diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelSCXJReportMapUtil.java b/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelSCXJReportMapUtil.java new file mode 100644 index 000000000..73713308e --- /dev/null +++ b/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelSCXJReportMapUtil.java @@ -0,0 +1,504 @@ +package com.op.common.core.utils.poi; + +import com.alibaba.fastjson2.JSONObject; +import com.op.common.core.domain.ExcelCol; +import org.apache.commons.compress.utils.IOUtils; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Excel导出报告相关处理 + * + * @author OP + */ +public class ExcelSCXJReportMapUtil { + //下载 + public static SXSSFWorkbook initWorkbook(String sheetName , String title, List excelCol , List data, Map detailMap,String shiftId) throws IOException { + SXSSFWorkbook workbook = new SXSSFWorkbook(); + int colSize = excelCol.size(); + + //创建Sheet(工作簿) + Sheet sheet = null; + if (!StringUtils.hasText(sheetName)){ + sheet = workbook.createSheet(); + }else{ + sheet = workbook.createSheet(sheetName); + } + + //单元格宽度 + for(int md=0;md<14;md++){ + if(md==1){ + sheet.setColumnWidth(md, 6000); + }else if(md>1){ + sheet.setColumnWidth(md, 4000); + } + } + + // 从resources目录获取图片字节数组 + byte[] imageBytes = getImageBytesFromResources("image/logo.png"); + /**logo**/ + int pictureIdx = workbook.addPicture(imageBytes, Workbook.PICTURE_TYPE_PNG); + CreationHelper helper = workbook.getCreationHelper(); + Drawing drawing = sheet.createDrawingPatriarch(); + ClientAnchor anchor = helper.createClientAnchor(); + anchor.setCol1(0); // B列 + anchor.setRow1(0); // 第2行(Excel的行和列都是从0开始计数的) + anchor.setCol2(1); // C列(图片宽度跨越的列数,这里设置为1列宽) + anchor.setRow2(2); // 第6行(图片高度跨越的行数,这里设置为4行高,可以根据图片大小调整) + Picture pict = drawing.createPicture(anchor, pictureIdx); + pict.resize(); // 根据图片的实际大小调整图片在Excel中的显示大小 + /**报告标题**/ + sheet.addMergedRegion(new CellRangeAddress(0, 1, 2, 13)); + // 获取合并后的单元格的第一个单元格(即C1),并设置值 + Row row1 = sheet.getRow(0); // 获取第1行(索引为0) + if (row1 == null) {row1 = sheet.createRow(0); // 如果第1行不存在,则创建它 + } + Cell cell = row1.getCell(2); // 获取C列(索引为2)的单元格 + if (cell == null) { + cell = row1.createCell(2); // 如果C列的单元格不存在,则创建它 + } + cell.setCellValue("中山榄菊日化实业有限公司"); // 设置单元格的值 + cell.setCellStyle(getTitelStyle(workbook)); // 应用样式到单元格 + /**报告二级标题、检验标准**/ + // 合并C3到I4的单元格,并设置样式 + mergeAndStyleCellsNoBorder(sheet, new CellRangeAddress(2, 3, 2, 9), detailMap.get("title")); + // 合并J3到L4的单元格,并设置样式 + mergeAndStyleCellsNoBorder(sheet, new CellRangeAddress(2, 3, 10, 12), "编码"+detailMap.get("standardNo")); + /**左右表格1**/ + //画边框 + for(int r5=4;r5<12;r5++){ + Row row05 = sheet.getRow(r5); + if (row05 == null) {row05 = sheet.createRow(r5);} + for (int col = 0; col < 14; col++) { + Cell cell1 = row05.createCell(col); + cell1.setCellStyle(getRowStyle(sheet)); + } + } + for(int d5=12;d5<(12+data.size());d5++){ + Row row05 = sheet.getRow(d5); + if (row05 == null) {row05 = sheet.createRow(d5);} + for (int col = 0; col < 14; col++) { + Cell cell1 = row05.createCell(col); + cell1.setCellStyle(getDataStyle(sheet)); + } + } + + Row row5 = sheet.getRow(4); + // 合并A5到B6的单元格,并设置样式和内容 + mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 0, 1), "生产车间/线体", true, true, IndexedColors.GREY_25_PERCENT); + // 合并C5到D6的单元格,并设置样式(无背景色,只有边框和内容居中) + mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 2, 3), detailMap.get("supplierName")+"/"+detailMap.get("checkLoc"), true, false, null); + // 合并J5到K6的单元格,并设置样式和内容 + mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 4, 4), "产品名称", true, true, IndexedColors.GREY_25_PERCENT); + // 合并L5到N6的单元格,并设置样式(无背景色,只有边框和内容居中) + mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 5, 8), detailMap.get("materialName"), true, false, null); + mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 9, 10), "生产类型", true, true, IndexedColors.GREY_25_PERCENT); + // 合并C5到D6的单元格,并设置样式(无背景色,只有边框和内容居中) + mergeAndStyleCells2(sheet,row5, new CellRangeAddress(4, 5, 11, 13), detailMap.get("productType"), true, false, null); + + Row row7 = sheet.getRow(6); + // 合并A7到B8的单元格,并设置样式和内容 + mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 0, 1), "检验时间", true, true, IndexedColors.GREY_25_PERCENT); + // 合并C5到D6的单元格,并设置样式(无背景色,只有边框和内容居中) + mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 2, 3), detailMap.get("incomeTime"), true, false, null); + // 合并E5到F6的单元格,并设置样式和内容 + mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 4, 4), "生产批次", true, true, IndexedColors.GREY_25_PERCENT); + // 合并G5到I6的单元格,并设置样式(无背景色,只有边框和内容居中) + mergeAndStyleCells2(sheet,row7, new CellRangeAddress(6, 7, 5, 13), detailMap.get("incomeBatchNo"), true, false, null); + /**上下表格2**///------------------------------------------------- + mergeAndStyleCells(sheet, new CellRangeAddress(8, 9, 0, 0), "序号"); + mergeAndStyleCells(sheet, new CellRangeAddress(8, 9, 1, 1), "项目名称"); + + //画时间区间 + if("5".equals(shiftId)){ + mergeAndStyleCells(sheet, new CellRangeAddress(8, 8, 2, 5), "上午"); + mergeAndStyleCells(sheet, new CellRangeAddress(8, 8, 6, 9), "下午"); + mergeAndStyleCells(sheet, new CellRangeAddress(8, 8, 10, 13), "加班"); + drawDatatimeDay(sheet); + }else{ + mergeAndStyleCells(sheet, new CellRangeAddress(8, 8, 2, 13), "时间"); + drawDatatimeNight(sheet); + } + + + //将data中的值填充到excel + int rowNum = 10; + if(!CollectionUtils.isEmpty(data)){ + Iterator iterator = data.iterator(); + //遍历数据 + for (;iterator.hasNext();){ + + T obj = iterator.next();//获取当前行对应的数据 + JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(obj)); + + Row dataRow = sheet.getRow(rowNum);//创建行 + // 假设使用了默认字体和字符宽度来计算行高(这是一个简化的示例) + int cellHeight = (int) (cell.getStringCellValue().length() * 6); // 每个字符大约15个单位高度 + dataRow.setHeightInPoints(Math.max(dataRow.getHeightInPoints(), cellHeight)); + + Cell cellData0 = dataRow.getCell(0); + cellData0.setCellValue(getValue(jsonObject.get(excelCol.get(0).getField()))); + cellData0.setCellStyle(getDataStyle(sheet)); + Cell cellData1 = dataRow.getCell(1); + cellData1.setCellValue(getValue(jsonObject.get(excelCol.get(1).getField()))); + cellData1.setCellStyle(getDataStyle(sheet)); + Cell cellData2 = dataRow.getCell(2); + cellData2.setCellValue(getValue(jsonObject.get(excelCol.get(2).getField()))); + cellData2.setCellStyle(getDataStyle(sheet)); + Cell cellData3 = dataRow.getCell(3); + cellData3.setCellValue(getValue(jsonObject.get(excelCol.get(3).getField()))); + cellData3.setCellStyle(getDataStyle(sheet)); + Cell cellData4 = dataRow.getCell(4); + cellData4.setCellValue(getValue(jsonObject.get(excelCol.get(4).getField()))); + cellData4.setCellStyle(getDataStyle(sheet)); + Cell cellData5 = dataRow.getCell(5); + cellData5.setCellValue(getValue(jsonObject.get(excelCol.get(5).getField()))); + cellData5.setCellStyle(getDataStyle(sheet)); + Cell cellData6 = dataRow.getCell(6); + cellData6.setCellValue(getValue(jsonObject.get(excelCol.get(6).getField()))); + cellData6.setCellStyle(getDataStyle(sheet)); + Cell cellData7 = dataRow.getCell(7); + cellData7.setCellValue(getValue(jsonObject.get(excelCol.get(7).getField()))); + cellData7.setCellStyle(getDataStyle(sheet)); + Cell cellData8 = dataRow.getCell(8); + cellData8.setCellValue(getValue(jsonObject.get(excelCol.get(8).getField()))); + cellData8.setCellStyle(getDataStyle(sheet)); + Cell cellData9 = dataRow.getCell(9); + cellData9.setCellValue(getValue(jsonObject.get(excelCol.get(9).getField()))); + cellData9.setCellStyle(getDataStyle(sheet)); + Cell cellData10 = dataRow.getCell(10); + cellData10.setCellValue(getValue(jsonObject.get(excelCol.get(10).getField()))); + cellData10.setCellStyle(getDataStyle(sheet)); + Cell cellData11 = dataRow.getCell(11); + cellData11.setCellValue(getValue(jsonObject.get(excelCol.get(11).getField()))); + cellData11.setCellStyle(getDataStyle(sheet)); + Cell cellData12 = dataRow.getCell(12); + cellData12.setCellValue(getValue(jsonObject.get(excelCol.get(12).getField()))); + cellData12.setCellStyle(getDataStyle(sheet)); + if("5".equals(shiftId)){ + Cell cellData13 = dataRow.getCell(13); + cellData13.setCellValue(getValue(jsonObject.get(excelCol.get(13).getField()))); + cellData13.setCellStyle(getDataStyle(sheet)); + } + + iterator.remove(); + rowNum++; + } + } + + //合并 + + Row rowEnd0 = sheet.createRow(rowNum); + mergeAndStyleCellsNoBorder(sheet,rowEnd0, new CellRangeAddress(rowNum, rowNum+1, 0, 3), "批量或致命性质量异常", true, true, IndexedColors.GREY_25_PERCENT); + mergeAndStyleCellsNoBorder(sheet,rowEnd0, new CellRangeAddress(rowNum, rowNum+1, 4, 13), detailMap.get("remark"), true, true,null); + + Row rowEnd1 = sheet.createRow(rowNum+2); + mergeAndStyleCellsNoBorder(sheet,rowEnd1, new CellRangeAddress(rowNum+2, rowNum+3, 0, 6), "备注:无异常的打√,有异常的描述异常及数量比例,有数据的需要填写数据", true, true, IndexedColors.GREY_25_PERCENT); + mergeAndStyleCells(sheet, new CellRangeAddress(rowNum+2, rowNum+3, 7, 7), "说明"); + mergeAndStyleCellsNoBorder(sheet,rowEnd1, new CellRangeAddress(rowNum+2, rowNum+3, 8, 13), "", true, true, null); + Row rowEnd2 = sheet.createRow(rowNum+5); + mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 0, 1), "检查人", true, true, IndexedColors.GREY_25_PERCENT); + mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 2, 3), detailMap.get("checkManName"), true, true,null); + mergeAndStyleCellsNoBorder(sheet,rowEnd2, new CellRangeAddress(rowNum+5, rowNum+5, 7, 8), "品质主管", true, true, IndexedColors.GREY_25_PERCENT); + + return workbook; + } + + //处理数据 + public static String getValue(Object object){ + if (object==null){ + return ""; + }else { + return object.toString(); + } + } +// //处理数据 +// public static Integer getValueNum(Object object){ +// if (object==null){ +// return 0; +// }else { +// return Integer.parseInt(object.toString()); +// } +// } + // 从resources目录获取图片的字节数组 + private static byte[] getImageBytesFromResources(String resourceName) { + try (InputStream inputStream = ExcelSCXJReportMapUtil.class.getClassLoader().getResourceAsStream(resourceName); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { + + if (inputStream == null) { + throw new RuntimeException("找不到资源: " + resourceName); + } + + IOUtils.copy(inputStream, byteArrayOutputStream); + return byteArrayOutputStream.toByteArray(); + + } catch (IOException e) { + throw new RuntimeException("读取资源时出错: " + resourceName, e); + } + } + //报告大标题样式-1 + public static CellStyle getTitelStyle(Workbook workbook){ + Font font = workbook.createFont(); + // 设置字体为加粗 + font.setBold(true); + // 设置字体大小(例如,设置为16) + font.setFontHeightInPoints((short) 24); + CellStyle cellStyle = workbook.createCellStyle(); + cellStyle.setFont(font); + cellStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);//设置水平居中 + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//设置垂直居中 + cellStyle.setWrapText(true);//设置单元格内容自动换行 + return cellStyle; + } + public static CellStyle getRowStyle(Sheet sheet){ + CellStyle style = sheet.getWorkbook().createCellStyle(); + // 设置边框线 + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); + style.setBorderTop(BorderStyle.THIN); + // 设置水平居中 + style.setAlignment(HorizontalAlignment.CENTER); + style.setWrapText(true);//设置单元格内容自动换行 + // 设置垂直居中 + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font font = sheet.getWorkbook().createFont(); + font.setBold(true); + // 设置字体大小(例如,设置为14) + font.setFontHeightInPoints((short) 14); + style.setFont(font); + return style; + } + public static CellStyle getDataStyle(Sheet sheet){ + CellStyle style = sheet.getWorkbook().createCellStyle(); + // 设置边框线 + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); + style.setBorderTop(BorderStyle.THIN); + Font font = sheet.getWorkbook().createFont(); + + // 设置字体大小(例如,设置为14) + font.setFontHeightInPoints((short) 14); + style.setFont(font); + style.setWrapText(true);//设置单元格内容自动换行 + // 设置水平居中 + style.setAlignment(HorizontalAlignment.LEFT); + // 设置垂直居中 + style.setVerticalAlignment(VerticalAlignment.CENTER); + return style; + } + private static void mergeAndStyleCells(Sheet sheet, CellRangeAddress cellRangeAddress, String cellValue) { + // 合并单元格 + sheet.addMergedRegion(cellRangeAddress); + + // 创建一个单元格样式 + CellStyle style = sheet.getWorkbook().createCellStyle(); + + // 设置字体为加粗 + Font font = sheet.getWorkbook().createFont(); + font.setBold(true); + // 设置字体大小(例如,设置为14) + font.setFontHeightInPoints((short) 14); + style.setFont(font); + // 设置边框线 + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); + style.setBorderTop(BorderStyle.THIN); + // 设置水平居中 + style.setAlignment(HorizontalAlignment.CENTER); + // 设置垂直居中 + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setWrapText(true);//设置单元格内容自动换行 + // 获取合并后的单元格的第一个单元格,并设置值 + Row row = sheet.getRow(cellRangeAddress.getFirstRow()); + if (row == null) { + row = sheet.createRow(cellRangeAddress.getFirstRow()); + } + Cell cell = row.getCell(cellRangeAddress.getFirstColumn()); + if (cell == null) { + cell = row.createCell(cellRangeAddress.getFirstColumn()); + } + cell.setCellValue(cellValue); // 设置单元格的值 + cell.setCellStyle(style); // 应用样式到单元格 + } + private static void mergeAndStyleCellsNoBorder(Sheet sheet, CellRangeAddress cellRangeAddress, String cellValue) { + // 合并单元格 + sheet.addMergedRegion(cellRangeAddress); + + // 创建一个单元格样式 + CellStyle style = sheet.getWorkbook().createCellStyle(); + + // 设置字体为加粗 + Font font = sheet.getWorkbook().createFont(); + font.setBold(true); + // 设置字体大小(例如,设置为14) + font.setFontHeightInPoints((short) 14); + style.setFont(font); + // 设置水平居中 + style.setAlignment(HorizontalAlignment.CENTER); + // 设置垂直居中 + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setWrapText(true);//设置单元格内容自动换行 + // 获取合并后的单元格的第一个单元格,并设置值 + Row row = sheet.getRow(cellRangeAddress.getFirstRow()); + if (row == null) { + row = sheet.createRow(cellRangeAddress.getFirstRow()); + } + Cell cell = row.getCell(cellRangeAddress.getFirstColumn()); + if (cell == null) { + cell = row.createCell(cellRangeAddress.getFirstColumn()); + } + cell.setCellValue(cellValue); // 设置单元格的值 + cell.setCellStyle(style); // 应用样式到单元格 + } + private static void mergeAndStyleCells2(Sheet sheet,Row row, CellRangeAddress cellRangeAddress, String cellValue, boolean centered, boolean hasBackground, IndexedColors backgroundColor) { + // 合并单元格 + sheet.addMergedRegion(cellRangeAddress); + + // 创建一个单元格样式 + CellStyle style = sheet.getWorkbook().createCellStyle(); + // 设置边框线 + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); + style.setBorderTop(BorderStyle.THIN); + // 设置字体居中 + if (centered) { + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + } + + // 设置背景颜色(如果有) + if (hasBackground && backgroundColor != null) { + style.setFillForegroundColor(backgroundColor.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + } + + // 获取合并后的单元格的第一个单元格,并设置值 + Cell cell = row.getCell(cellRangeAddress.getFirstColumn()); + if (cell == null) { + cell = row.createCell(cellRangeAddress.getFirstColumn()); + } + cell.setCellValue(cellValue); // 设置单元格的值 + cell.setCellStyle(style); // 应用样式到单元格 + } + private static void mergeAndStyleCellsNoBorder(Sheet sheet,Row row, CellRangeAddress cellRangeAddress, String cellValue, boolean centered, boolean hasBackground, IndexedColors backgroundColor) { + // 合并单元格 + sheet.addMergedRegion(cellRangeAddress); + + // 创建一个单元格样式 + CellStyle style = sheet.getWorkbook().createCellStyle(); + + // 设置字体居中 + if (centered) { + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + } + + // 设置背景颜色(如果有) + if (hasBackground && backgroundColor != null) { + style.setFillForegroundColor(backgroundColor.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + } + + // 获取合并后的单元格的第一个单元格,并设置值 + Cell cell = row.getCell(cellRangeAddress.getFirstColumn()); + if (cell == null) { + cell = row.createCell(cellRangeAddress.getFirstColumn()); + } + cell.setCellValue(cellValue); // 设置单元格的值 + cell.setCellStyle(style); // 应用样式到单元格 + } + //白班 + private static void drawDatatimeDay(Sheet sheet){ + Row dataTR1 = sheet.getRow(9); + if (dataTR1 == null) {dataTR1 = sheet.createRow(9);} + Cell dataTC1 = dataTR1.createCell(2); + dataTC1.setCellValue("8:00-9:00"); + dataTC1.setCellStyle(getRowStyle(sheet)); + Cell dataTC2 = dataTR1.createCell(3); + dataTC2.setCellValue("9:00-10:00"); + dataTC2.setCellStyle(getRowStyle(sheet)); + Cell dataTC3 = dataTR1.createCell(4); + dataTC3.setCellValue("10:00-11:00"); + dataTC3.setCellStyle(getRowStyle(sheet)); + Cell dataTC4 = dataTR1.createCell(5); + dataTC4.setCellValue("11:00-12:00"); + dataTC4.setCellStyle(getRowStyle(sheet)); + Cell dataTC5 = dataTR1.createCell(6); + dataTC5.setCellValue("13:30-14:30"); + dataTC5.setCellStyle(getRowStyle(sheet)); + Cell dataTC6 = dataTR1.createCell(7); + dataTC6.setCellValue("14:30-15:30"); + dataTC6.setCellStyle(getRowStyle(sheet)); + Cell dataTC7 = dataTR1.createCell(8); + dataTC7.setCellValue("15:30-16:30"); + dataTC7.setCellStyle(getRowStyle(sheet)); + Cell dataTC8 = dataTR1.createCell(9); + dataTC8.setCellValue("16:30-17:30"); + dataTC8.setCellStyle(getRowStyle(sheet)); + Cell dataTC9 = dataTR1.createCell(10); + dataTC9.setCellValue("12:30-13:30"); + dataTC9.setCellStyle(getRowStyle(sheet)); + Cell dataTC10 = dataTR1.createCell(11); + dataTC10.setCellValue("18:00-19:00"); + dataTC10.setCellStyle(getRowStyle(sheet)); + Cell dataTC11 = dataTR1.createCell(12); + dataTC11.setCellValue("19:00-20:00"); + dataTC11.setCellStyle(getRowStyle(sheet)); + Cell dataTC12 = dataTR1.createCell(13); + dataTC12.setCellValue("20:00-21:00"); + dataTC12.setCellStyle(getRowStyle(sheet)); + } + //白班 + private static void drawDatatimeNight(Sheet sheet){ + Row dataTR1 = sheet.getRow(9); + if (dataTR1 == null) {dataTR1 = sheet.createRow(9);} + Cell dataTC1 = dataTR1.createCell(2); + dataTC1.setCellValue("20:30-21:30"); + dataTC1.setCellStyle(getRowStyle(sheet)); + Cell dataTC2 = dataTR1.createCell(3); + dataTC2.setCellValue("21:30-22:30"); + dataTC2.setCellStyle(getRowStyle(sheet)); + Cell dataTC3 = dataTR1.createCell(4); + dataTC3.setCellValue("22:30-23:30"); + dataTC3.setCellStyle(getRowStyle(sheet)); + Cell dataTC4 = dataTR1.createCell(5); + dataTC4.setCellValue("23:30-1:30"); + dataTC4.setCellStyle(getRowStyle(sheet)); + Cell dataTC5 = dataTR1.createCell(6); + dataTC5.setCellValue("1:30-2:30"); + dataTC5.setCellStyle(getRowStyle(sheet)); + Cell dataTC6 = dataTR1.createCell(7); + dataTC6.setCellValue("2:30-3:30"); + dataTC6.setCellStyle(getRowStyle(sheet)); + Cell dataTC7 = dataTR1.createCell(8); + dataTC7.setCellValue("3:30-4:30"); + dataTC7.setCellStyle(getRowStyle(sheet)); + Cell dataTC8 = dataTR1.createCell(9); + dataTC8.setCellValue("4:30-5:30"); + dataTC8.setCellStyle(getRowStyle(sheet)); + Cell dataTC9 = dataTR1.createCell(10); + dataTC9.setCellValue("5:30-6:30"); + dataTC9.setCellStyle(getRowStyle(sheet)); + Cell dataTC10 = dataTR1.createCell(11); + dataTC10.setCellValue("6:30-7:30"); + dataTC10.setCellStyle(getRowStyle(sheet)); + Cell dataTC11 = dataTR1.createCell(12); + dataTC11.setCellValue("7:30-8:30"); + dataTC11.setCellStyle(getRowStyle(sheet)); + Cell dataTC12 = dataTR1.createCell(13); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorksController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorksController.java index 148940d0b..e036b21e0 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorksController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorksController.java @@ -88,6 +88,11 @@ public class MesReportWorksController extends BaseController { } /**烘房产量统计**/ + @GetMapping("/getHFProductionTitle") + public List getHFProductionTitle(HFProduction dto) { + List list = mesReportWorksService.getHFProductionTitle(dto); + return list; + } @GetMapping("/getHFProductionList") public List> getHFProductionList(HFProduction dto) { List equNames = this.getHFProductionTitle(dto); @@ -95,11 +100,6 @@ public class MesReportWorksController extends BaseController { List> list = mesReportWorksService.getHFProductionList(dto); return list; } - @GetMapping("/getHFProductionTitle") - public List getHFProductionTitle(HFProduction dto) { - List list = mesReportWorksService.getHFProductionTitle(dto); - return list; - } @PostMapping("/getHFProductionExport") public void getHFProductionExport(HttpServletResponse response,HFProduction dto) { List equNames = this.getHFProductionTitle(dto); @@ -116,6 +116,52 @@ public class MesReportWorksController extends BaseController { String titleName = "烘房产量统计报表"; SXSSFWorkbook workbook = null; + try { + //设置响应头 + response.setHeader("Content-disposition", + "attachment; filename="+ titleName); + response.setContentType("application/octet-stream;charset=UTF-8"); + ServletOutputStream outputStream = response.getOutputStream(); + //调用工具类 + workbook = ExcelMapUtil.initWorkbook(titleName, null, excelCols, list); + workbook.write(outputStream); + } catch (IOException e) { + e.printStackTrace(); + }finally { + if (workbook!=null){ + workbook.dispose(); + } + } + } + /**成型机产量统计**/ + @GetMapping("/getCXJProductionTitle") + public List getCXJProductionTitle(HFProduction dto) { + List list = mesReportWorksService.getCXJProductionTitle(dto); + return list; + } + @GetMapping("/getCXJProductionList") + public List> getCXJProductionList(HFProduction dto) { + List equNames = this.getCXJProductionTitle(dto); + dto.setEquNames(equNames); + List> list = mesReportWorksService.getCXJProductionList(dto); + return list; + } + @PostMapping("/getCXJProductionExport") + public void getCXJProductionExport(HttpServletResponse response,HFProduction dto) { + List equNames = this.getCXJProductionTitle(dto); + dto.setEquNames(equNames); + List> list = mesReportWorksService.getCXJProductionList(dto); + + ArrayList excelCols = new ArrayList<>(); + excelCols.add(new ExcelCol("日期","ymd",20)); + for (DynamicColumnVo column : equNames) { + excelCols.add(new ExcelCol(column.getLabel(), column.getCode(), 20)); + } + excelCols.add(new ExcelCol("总产量","totalQuantity",20)); + + String titleName = "成型机产量统计报表"; + SXSSFWorkbook workbook = null; + try { //设置响应头 response.setHeader("Content-disposition", diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/HFProduction.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/HFProduction.java index 790121799..396acb1b4 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/HFProduction.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/HFProduction.java @@ -23,8 +23,26 @@ public class HFProduction extends BaseEntity { private String quality; private String ymArrayStart; private String ymArrayEnd; + private String EquTypeCode; + private String shiftId; private List equNames; + public String getShiftId() { + return shiftId; + } + + public void setShiftId(String shiftId) { + this.shiftId = shiftId; + } + + public String getEquTypeCode() { + return EquTypeCode; + } + + public void setEquTypeCode(String equTypeCode) { + EquTypeCode = equTypeCode; + } + public List getEquNames() { return equNames; } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java index 1b4dcda8b..6758c9d49 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java @@ -219,4 +219,6 @@ public interface MesReportWorkMapper { List getHFProductionList(HFProduction dto); List getHFProductionTitle(HFProduction dto); + + List getCXJProductionList(HFProduction dto); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorksService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorksService.java index 46645ec72..dce875c56 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorksService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorksService.java @@ -20,4 +20,8 @@ public interface IMesReportWorksService { List> getHFProductionList(HFProduction dto); List getHFProductionTitle(HFProduction dto); + + List getCXJProductionTitle(HFProduction dto); + + List> getCXJProductionList(HFProduction dto); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 966059eb2..ff454e876 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -831,7 +831,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { } workOrder.setUploadTime(nowTime); mesReportWorkMapper.updateSyncSapStatus(workOrder); - + //mesReportWorkMapper.updateOrderWorkStatus(workOrder); return r; // return R.ok();//测试 } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorksServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorksServiceImpl.java index 9d324a7fb..560358616 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorksServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorksServiceImpl.java @@ -206,7 +206,6 @@ public class MesReportWorksServiceImpl implements IMesReportWorksService { @Override @DS("#header.poolName") public List> getHFProductionList(HFProduction dto) { - //return mesReportWorkMapper.getHFProductionList(dto); // 开始日期 String start = dto.getYmArrayStart(); String end = dto.getYmArrayEnd(); @@ -253,9 +252,65 @@ public class MesReportWorksServiceImpl implements IMesReportWorksService { @DS("#header.poolName") public List getHFProductionTitle(HFProduction dto) { //查询sql数据 + dto.setEquTypeCode("equ_type_hf"); List data = mesReportWorkMapper.getHFProductionTitle(dto); return data; } + + @Override + @DS("#header.poolName") + public List getCXJProductionTitle(HFProduction dto) { + //查询sql数据 + dto.setEquTypeCode("equ_type_cxj"); + List data = mesReportWorkMapper.getHFProductionTitle(dto); + return data; + } + + @Override + @DS("#header.poolName") + public List> getCXJProductionList(HFProduction dto) { + // 开始日期 + String start = dto.getYmArrayStart(); + String end = dto.getYmArrayEnd(); + // 查询出来时间区间 + List listDate = getDateInterval(start,end); + List allEquNames = dto.getEquNames(); + + List dbMProductList = mesReportWorkMapper.getCXJProductionList(dto); + + List> results = listDate.stream() + .map(date -> { + Map row = new HashMap<>(); + row.put("ymd", date); + + //对于每个日期,收集该日期下所有产品的产量数据 + Map dailyProductQuantities = dbMProductList.stream() + .filter(HFProduction -> HFProduction.getYmd().equals(date)) + .collect(Collectors.toMap( + HFProduction::getEquCode, + HFProduction::getQuality + )); + + // 遍历所有产品,如果dailyProduct不存在此产品,添加产品,产量设为空 + for (DynamicColumnVo equ : allEquNames) { + String equCode = equ.getCode(); + dailyProductQuantities.putIfAbsent(equCode, "0"); + } + + row.putAll(dailyProductQuantities); + + // 计算并添加当日总产量 + int totalQuantity = dailyProductQuantities.values().stream() + .mapToInt(Integer::parseInt) + .sum(); + row.put("totalQuantity", totalQuantity); + + return row; + }).collect(Collectors.toList()); + + return results; + } + private List getDateInterval(String start, String end) { start = start.substring(0,10); end = end.substring(0,10); diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index f78142445..08e7707cd 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -509,7 +509,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mrw.uploadTime, mrw.uploadMsg, pow.shift_id shiftId, - bst.Shift_Desc shiftName + bst.Shift_Desc shiftName, + pow.status from ( select workorder_code workorderCode, product_code productCode, @@ -1211,12 +1212,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select be.equipment_code code, be.equipment_name label from base_equipment be - where be.equipment_type_code ='equ_type_hf' and be.del_flag = '0' + where be.equipment_type_code = #{equTypeCode} and be.del_flag = '0' and be.equipment_name like concat('%', #{equName}, '%') order by be.equipment_name + insert into mes_report_work diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java index 35f2f893c..c16228318 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java @@ -311,6 +311,7 @@ public class ProOrderWorkorder extends TreeEntity { private String pworkorderCodeSap; /**SAP产线编码*/ + @Excel(name = "SAP产线编码") private String sapCode; /**SAP产线名称*/ private String sapName; diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml index d08347b60..1beb71a85 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProduceController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProduceController.java index 2a2ab5ad6..b5bbe5919 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProduceController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProduceController.java @@ -5,6 +5,7 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.poi.ExcelReportMapUtil; import com.op.common.core.utils.poi.ExcelSCReportMapUtil; +import com.op.common.core.utils.poi.ExcelSCXJReportMapUtil; import com.op.common.core.utils.poi.ExcelUtil; import com.op.common.core.web.controller.BaseController; import com.op.common.core.web.domain.AjaxResult; @@ -20,6 +21,7 @@ import com.op.system.api.domain.SysFile; import com.op.system.api.domain.SysUser; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import javax.servlet.ServletOutputStream; @@ -206,6 +208,107 @@ public class QcCheckReportProduceController extends BaseController { } } } + @RequiresPermissions("quality:produceReport:export") + @Log(title = "巡检报告导出", businessType = BusinessType.EXPORT) + @PostMapping("/SCXJReportExport") + public void SCXJReportExport(HttpServletResponse response, QcCheckTaskProduce qcCheckTaskProduce) { + Map detailMap = new HashMap<>(); + detailMap.put("title","产品巡检记录表"); + QcCheckTaskProduce detailInfo = qcCheckReportProduceService.getProduceReportXJ(qcCheckTaskProduce); + + List listVal = detailInfo.getCheckInfos(); + List list = getMapFromList(listVal); + + detailMap.put("checkManName",detailInfo.getCheckManName()); + detailMap.put("remark",detailInfo.getRemark()); + detailMap.put("standardNo",detailInfo.getFileNo()); + detailMap.put("supplierName",detailInfo.getSupplierName()); + detailMap.put("checkLoc",detailInfo.getLineName()); + detailMap.put("incomeBatchNo",detailInfo.getIncomeBatchNo()); + detailMap.put("materialCode",detailInfo.getMaterialCode()); + detailMap.put("materialName",detailInfo.getMaterialName()); + if("a".equals(detailInfo.getProductType())){ + detailMap.put("productType","正常"); + }else if("b".equals(detailInfo.getProductType())){ + detailMap.put("productType","返修"); + }else if("c".equals(detailInfo.getProductType())){ + detailMap.put("productType","试产"); + } + + detailMap.put("incomeTime",detailInfo.getCheckTimeStart()); + + //表格结构数据 + ArrayList excelCols = new ArrayList<>(); + excelCols.add(new ExcelCol("序号", "xh", 30)); + excelCols.add(new ExcelCol("项目名称", "ruleName", 30)); + if(qcCheckTaskProduce.getShiftId().equals("5")){ + excelCols.add(new ExcelCol("8:00-9:00", "column080090", 30)); + excelCols.add(new ExcelCol("9:00-10:00", "column090100", 30)); + excelCols.add(new ExcelCol("10:00-11:00", "column100110", 30)); + excelCols.add(new ExcelCol("11:00-12:00", "column110120", 30)); + excelCols.add(new ExcelCol("13:30-14:30", "column133143", 30)); + excelCols.add(new ExcelCol("14:30-15:30", "column143153", 30)); + excelCols.add(new ExcelCol("15:30-16:30", "column153163", 30)); + excelCols.add(new ExcelCol("16:30-17:30", "column163173", 30)); + excelCols.add(new ExcelCol("12:30-13:30", "column123133", 30)); + excelCols.add(new ExcelCol("18:00-19:00", "column180190", 30)); + excelCols.add(new ExcelCol("19:00-20:00", "column190200", 30)); + excelCols.add(new ExcelCol("20:00-21:00", "column200210", 30)); + }else if(qcCheckTaskProduce.getShiftId().equals("2")){ + excelCols.add(new ExcelCol("20:30-21:30", "column080090", 30)); + excelCols.add(new ExcelCol("21:30-22:30", "column090100", 30)); + excelCols.add(new ExcelCol("22:30-23:30", "column100110", 30)); + excelCols.add(new ExcelCol("23:30-1:30", "column110120", 30)); + excelCols.add(new ExcelCol("1:30-2:30", "column133143", 30)); + excelCols.add(new ExcelCol("2:30-3:30", "column143153", 30)); + excelCols.add(new ExcelCol("3:30-4:30", "column153163", 30)); + excelCols.add(new ExcelCol("4:30-5:30", "column163173", 30)); + excelCols.add(new ExcelCol("5:30-6:30", "column123133", 30)); + excelCols.add(new ExcelCol("6:30-7:30", "column180190", 30)); + excelCols.add(new ExcelCol("7:30-8:30", "column190200", 30)); + } + String sheetName = "巡检检验报告"; + SXSSFWorkbook workbook = null; + try { + //设置响应头 + response.setHeader("Content-disposition", + "attachment; filename=" + sheetName); + response.setContentType("application/octet-stream;charset=UTF-8"); + ServletOutputStream outputStream = response.getOutputStream(); + //调用工具类 + workbook = ExcelSCXJReportMapUtil.initWorkbook(sheetName, "-", excelCols, list, detailMap,qcCheckTaskProduce.getShiftId()); + workbook.write(outputStream); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (workbook != null) { + workbook.dispose(); + } + } + } + private List getMapFromList(List dtos){ + List maps = new ArrayList<>(); + int n = 1; + for(QcStaticTable dto:dtos){ + Map mapdto = new HashMap(); + mapdto.put("xh",n++); + mapdto.put("ruleName",dto.getRuleName()); + mapdto.put("column080090",dto.getColumn080090()); + mapdto.put("column090100",dto.getColumn090100()); + mapdto.put("column100110",dto.getColumn100110()); + mapdto.put("column110120",dto.getColumn110120()); + mapdto.put("column133143",dto.getColumn133143()); + mapdto.put("column143153",dto.getColumn143153()); + mapdto.put("column153163",dto.getColumn153163()); + mapdto.put("column163173",dto.getColumn163173()); + mapdto.put("column123133",dto.getColumn123133()); + mapdto.put("column180190",dto.getColumn180190()); + mapdto.put("column190200",dto.getColumn190200()); + mapdto.put("column200210",dto.getColumn200210()); + maps.add(mapdto); + } + return maps; + } /** * 获取来料检验详细信息 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java index 4e633d8c1..536eaca88 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java @@ -10,6 +10,7 @@ import com.op.common.core.domain.ExcelCol; import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.quality.domain.*; import com.op.quality.service.IQcMaterialGroupService; +import com.op.system.api.domain.SysDictData; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -205,4 +206,10 @@ public class QcCheckTypeProjectController extends BaseController { List orderList = util.importExcel(file.getInputStream()); return qcCheckTypeProjectService.importOrder(orderList); } + //获取自动采集字典 + @GetMapping("/getAutoDataOption") + public List getAutoDataOption(SysDictData sysDictData) { + List list = qcCheckTypeProjectService.getAutoDataOption(sysDictData); + return list; + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java index 40c3e5e17..d6c95c5b5 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java @@ -3,6 +3,7 @@ package com.op.quality.mapper; import java.util.List; import com.op.quality.domain.QcMaterialGroup; +import com.op.system.api.domain.SysDictData; import org.apache.ibatis.annotations.Mapper; /** @@ -70,4 +71,6 @@ public interface QcMaterialGroupMapper { String selectGroupIdByName(String groupName); void deleteGroupDetailById(String id); + + List getAutoDataOption(SysDictData sysDictData); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java index d846e7496..63d76b480 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java @@ -7,6 +7,7 @@ import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.QcMaterialGroupDetail; import com.op.quality.domain.QcProjectType; +import com.op.system.api.domain.SysDictData; /** * 物料检验项目维护Service接口 @@ -75,4 +76,6 @@ public interface IQcCheckTypeProjectService { List getProjectOptions(QcCheckProject qcCheckProject); AjaxResult importOrder(List orderList); + + List getAutoDataOption(SysDictData sysDictData); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java index 349931c3e..d2f85d600 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java @@ -303,10 +303,10 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer // 解析字符串为 Date 对象 Date date = sdf.parse(produce.getCheckTimeStart()); dto0.setIncomeTime(date); - System.out.println("解析后的日期: " + date); + //System.out.println("解析后的日期: " + date); } catch (ParseException e) { // 捕获解析异常并打印错误消息 - System.err.println("解析日期字符串时出错: " + e.getMessage()); + //System.err.println("解析日期字符串时出错: " + e.getMessage()); } dto0.setCheckType("checkTypeSCXJ"); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java index 16b45793c..595a68311 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java @@ -205,6 +205,13 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService return checkResult; } } + + @Override + @DS("#header.poolName") + public List getAutoDataOption(SysDictData sysDictData) { + return qcMaterialGroupMapper.getAutoDataOption(sysDictData); + } + /** * 校验导入订单信息 * diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcMaterialGroupMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcMaterialGroupMapper.xml index e327235dd..152dcd0ff 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcMaterialGroupMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcMaterialGroupMapper.xml @@ -140,4 +140,9 @@ +