| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | planEndDayTitle.setCellValue("计划完工日"); |
| | | planEndDayTitle.setCellStyle(title); |
| | | |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < shopNames.size(); i++) { |
| | | String shopName = shopNames.get(i); |
| | | SXSSFCell beginDateCell = rowTitle.createCell(i * 2 + 11); |
| | |
| | | beginDateCell.setCellStyle(title); |
| | | endDateCell.setCellStyle(title); |
| | | } |
| | | |
| | | |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | for (int i = 0; i < table.size(); i++) { |
| | | ApsPlateProcessShopPlanStat plan = table.get(i); |
| | | /*创建数据行*/ |
| | | |
| | | SXSSFRow dataRow = sheet.createRow(i+1); |
| | | |
| | | SXSSFCell mainPartNumberCell = dataRow.createCell(0); |
| | | mainPartNumberTitle.setCellValue(plan.getMainPartNumber()); |
| | | //mainPartNumberTitle.setCellStyle(title); |
| | | mainPartNumberCell.setCellValue(plan.getMainPartNumber()); |
| | | |
| | | //mainPartNumberCell.setCellStyle(title); |
| | | |
| | | SXSSFCell businessTypeCell= dataRow.createCell(1); |
| | | businessTypeCell.setCellValue(plan.getBusinessType()); |
| | |
| | | // productionQuantityCell.setCellStyle(title); |
| | | |
| | | SXSSFCell planEndDayCell = dataRow.createCell(10); |
| | | planEndDayCell.setCellValue(plan.getPlanEndDay()); |
| | | planEndDayCell.setCellValue(dateFormat.format(plan.getPlanEndDay())); |
| | | // planEndDayCell.setCellStyle(title); |
| | | |
| | | for (int j = 0; j< shopNames.size(); j++) { |
| | | String shopName = shopNames.get(j); |
| | | SXSSFCell beginDateCell = dataRow.createCell(j * 2 + 11); |
| | | SXSSFCell endDateCell = dataRow.createCell(j * 2 + 12); |
| | | plan.getDeptPlans().stream().filter(x->x.getShopName().equals(shopName)).findFirst().ifPresent(x->{ |
| | | beginDateCell.setCellValue(x.getPlanStartDate()); |
| | | endDateCell.setCellValue(x.getPlanEndDate()); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | for (int i = 0; i < 24; i++) { |
| | | |
| | | sheet.setColumnWidth(i, 20 * 256); |
| | | } |
| | | |
| | | wb.write(response.getOutputStream()); |
| | | } |
| | | catch (Exception e) |
| | |
| | | style.setFont(titleFont); |
| | | DataFormat dataFormat = wb.createDataFormat(); |
| | | style.setDataFormat(dataFormat.getFormat("@")); |
| | | |
| | | |
| | | |
| | | |
| | | styles.put("title", style); |
| | | return styles; |
| | | } |