From 27be79c80703ab38ad8343eeee3e49f33fd1851e Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Tue, 3 Dec 2024 19:37:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/utils/poi/ExcelReportMapUtil.java | 320 ++++++++++++++++++ .../src/main/resources/image/logo.png | Bin 0 -> 6607 bytes .../op/open/controller/OpenController.java | 3 +- .../main/resources/mapper/open/OpenMapper.xml | 5 +- .../QcCheckTaskIncomeController.java | 44 ++- .../QcProductCpkUpdownController.java | 27 +- .../domain/QcMaterialCheckStandarDTO.java | 88 +++++ .../mapper/QcCheckReportIncomeMapper.java | 1 + .../mapper/QcProductCpkUpdownMapper.java | 3 + .../service/IQcProductCpkUpdownService.java | 3 + .../impl/QcCheckReportProductServiceImpl.java | 6 + .../impl/QcProductCpkUpdownServiceImpl.java | 14 + .../impl/QcStaticTableServiceImpl.java | 6 +- .../quality/QcCheckReportIncomeMapper.xml | 7 +- .../quality/QcCheckTaskProduceMapper.xml | 2 +- .../quality/QcCheckTaskWarehousingMapper.xml | 2 +- .../quality/QcProductCpkUpdownMapper.xml | 30 ++ .../mapper/quality/QcStaticTableMapper.xml | 2 +- 18 files changed, 547 insertions(+), 16 deletions(-) create mode 100644 op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelReportMapUtil.java create mode 100644 op-common/op-common-core/src/main/resources/image/logo.png create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialCheckStandarDTO.java diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelReportMapUtil.java b/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelReportMapUtil.java new file mode 100644 index 00000000..8f11ae8b --- /dev/null +++ b/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelReportMapUtil.java @@ -0,0 +1,320 @@ +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.nio.file.Files; +import java.nio.file.Paths; +import java.util.Iterator; +import java.util.List; + +/** + * Excel导出报告相关处理 + * + * @author OP + */ +public class ExcelReportMapUtil { + //下载 + public static SXSSFWorkbook initWorkbook(String sheetName , String title , List excelCol , List data) 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); + } + if(title != null){ + + // 从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, 11)); + // 获取合并后的单元格的第一个单元格(即C1),并设置值 + Row row = sheet.getRow(0); // 获取第1行(索引为0) + if (row == null) {row = sheet.createRow(0); // 如果第1行不存在,则创建它 + } + Cell cell = row.getCell(2); // 获取C列(索引为2)的单元格 + if (cell == null) { + cell = row.createCell(2); // 如果C列的单元格不存在,则创建它 + } + cell.setCellValue("中山榄菊日化实业有限公司"); // 设置单元格的值 + cell.setCellStyle(getTitelStyle(workbook)); // 应用样式到单元格 + /**报告二级标题、检验标准**/ + // 合并C3到I4的单元格,并设置样式 + mergeAndStyleCells(sheet, new CellRangeAddress(2, 3, 2, 8), "包材检验报告"); + // 合并J3到L4的单元格,并设置样式 + mergeAndStyleCells(sheet, new CellRangeAddress(2, 3, 9, 12), "编码:07GL06C003-001A"); + /**左右表格1**/ + // 合并A5到B6的单元格,并设置样式和内容 + mergeAndStyleCells2(sheet, new CellRangeAddress(4, 5, 0, 1), "包材检验报告", true, true, IndexedColors.GREY_25_PERCENT); + // 合并C5到D6的单元格,并设置样式(无背景色,只有边框和内容居中) + mergeAndStyleCells2(sheet, new CellRangeAddress(4, 5, 2, 3), "", true, false, null); + // 合并E5到F6的单元格,并设置样式和内容 + mergeAndStyleCells2(sheet, new CellRangeAddress(4, 5, 4, 5), "生产批号", true, true, IndexedColors.GREY_25_PERCENT); + // 合并G5到I6的单元格,并设置样式(无背景色,只有边框和内容居中) + mergeAndStyleCells2(sheet, new CellRangeAddress(4, 5, 6, 8), "", true, false, null); + // 合并J5到K6的单元格,并设置样式和内容 + mergeAndStyleCells2(sheet, new CellRangeAddress(4, 5, 9, 10), "报告编号", true, true, IndexedColors.GREY_25_PERCENT); + // 合并L5到N6的单元格,并设置样式(无背景色,只有边框和内容居中) + mergeAndStyleCells2(sheet, new CellRangeAddress(4, 5, 11, 13), "", true, false, null); + +// // 将工作簿写入文件(或输出流) +// try (ByteArrayOutputStream fileOut = new ByteArrayOutputStream()) { +// workbook.write(fileOut); +// // 这里可以将fileOut.toByteArray()保存到文件或发送到其他地方 +// // 例如:Files.write(Paths.get("output.xlsx"), fileOut.toByteArray()); +// } catch (IOException e) { +// e.printStackTrace(); +// } finally { +// try { +// workbook.close(); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// } + +// String[] title1s = title.split(","); +// int rangeVal = colSize/title1s.length; +// //创建主标题行(第一行) +// Row sheetTitleRow = sheet.createRow(0); +// +// Cell titleCell0 = sheetTitleRow.createCell(0);//创建第一行第一个单元格 +// titleCell0.setCellValue("");//传值 +// titleCell0.setCellStyle(getHeaderFont(sheet.getWorkbook()));//设置样式 +// +// //遍历表头名称,创建表头单元格 +// for (int i = 0; i < title1s.length; i++) { +// Cell titleCell = sheetTitleRow.createCell(i*rangeVal+1);//创建第一行第一个单元格 +// titleCell.setCellValue(title1s[i]);//传值 +// titleCell.setCellStyle(getHeaderFont(sheet.getWorkbook()));//设置样式 +// if((i*rangeVal+1)!=(i+1)*rangeVal){ +// //主标题行合并单元格 +// CellRangeAddress cellAddresses = new CellRangeAddress(0, 0, i*rangeVal+1, (i+1)*rangeVal); +// sheet.addMergedRegion(cellAddresses); +// } +// } +// +// //创建表头行(第二行) +// Row sheetHeadRow = sheet.createRow(1);//1 +// //遍历表头名称,创建表头单元格 +// for (int i = 0; i < colSize; i++) { +// sheet.setColumnWidth(i, (excelCol.get(i).getWidth()) * 256);//宽度单位是字符的256分之一 +// Cell headCell = sheetHeadRow.createCell(i); +// headCell.setCellValue(excelCol.get(i).getTitle());//传值 +// headCell.setCellStyle(getHeaderFont(sheet.getWorkbook()));//设置样式 +// } +// }else { +// //创建表头行(第二行) +// Row sheetHeadRow = sheet.createRow(0);//1 +// //遍历表头名称,创建表头单元格 +// for (int i = 0; i < colSize; i++) { +// sheet.setColumnWidth(i, (excelCol.get(i).getWidth()) * 256);//宽度单位是字符的256分之一 +// Cell headCell = sheetHeadRow.createCell(i); +// headCell.setCellValue(excelCol.get(i).getTitle());//传值 +// headCell.setCellStyle(getHeaderFont(sheet.getWorkbook()));//设置样式 +// } +// } +// +// //将data中的值填充到excel +// int rowNum = sheet.getLastRowNum()+1; +// if(!CollectionUtils.isEmpty(data)){ +// Iterator iterator = data.iterator(); +// //遍历数据 +// for (;iterator.hasNext();){ +// Row dataRow = sheet.createRow(rowNum);//创建行 +// T obj = iterator.next();//获取当前行对应的数据 +// JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(obj)); +// for (int i = 0 ; i < colSize ; i++ ){ +// Cell dataCell = dataRow.createCell(i); +// dataCell.setCellStyle(getDataFont(workbook)); +// if(title!=null){//定量分析 +// dataCell.setCellValue(getValue(jsonObject.get(excelCol.get(i).getField()))); +// }else{ +// if(i>=2){ +// dataCell.setCellValue(getValueNum(jsonObject.get(excelCol.get(i).getField()))); +// }else{ +// dataCell.setCellValue(getValue(jsonObject.get(excelCol.get(i).getField()))); +// } +// } +// } +// iterator.remove(); +// rowNum++; +// } + } + + return workbook; + } + +// //标题样式 +// public static CellStyle getHeaderFont(Workbook workbook){ +// Font font = workbook.createFont(); +// font.setFontHeightInPoints((short) 15);//字体大小 +// font.setBold(true);//加粗 +// CellStyle cellStyle = workbook.createCellStyle(); +// cellStyle.setFont(font); +// cellStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);//设置水平居中 +// cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//设置垂直居中 +// // 设置上边框 +// cellStyle.setBorderTop(BorderStyle.THIN); +// // 设置下边框 +// cellStyle.setBorderBottom(BorderStyle.THIN); +// // 设置左边框 +// cellStyle.setBorderLeft(BorderStyle.THIN); +// // 设置右边框 +// cellStyle.setBorderRight(BorderStyle.THIN); +// cellStyle.setFillBackgroundColor(IndexedColors.AQUA.getIndex()); +// +// return cellStyle; +// } + +// //内容样式 +// public static CellStyle getDataFont(Workbook workbook){ +// Font font = workbook.createFont(); +// font.setFontHeightInPoints((short) 12);//字体大小 +// font.setBold(false);//不加粗 +// CellStyle cellStyle = workbook.createCellStyle(); +// cellStyle.setFont(font); +// cellStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);//设置水平居中 +// cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//设置垂直居中 +// cellStyle.setWrapText(true);//设置单元格内容自动换行 +// return cellStyle; +// } +// +// //处理数据 +// 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 = ExcelReportMapUtil.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; + } + 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.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, 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); + } + + // 设置边框线 + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); + style.setBorderTop(BorderStyle.THIN); + + // 获取合并后的单元格的第一个单元格,并设置值 + 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); // 应用样式到单元格 + } +} diff --git a/op-common/op-common-core/src/main/resources/image/logo.png b/op-common/op-common-core/src/main/resources/image/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d7e346848f5dffa3afc69365d44456cdba0df0dd GIT binary patch literal 6607 zcmV;=88GIFP)Py3iAh93RCr$PoM(JhRo2G;>zsRYQ%I#GKnRKo0-+2#j*g8%2#TXP3id*irr>~p zil_*PiUq+&2GButR1|xmiio45ua%J?7Fwtwz1`e$&VGM;-y|fE1ek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k} zts&}8rN|KLR#v<>4_DkPn$GTg^eHh zXDZikVBfeYgm>?4>XHV&Gc8?D?Vxn(fTo&I^p%H#AzT) zIUcM-*|*`i7vl8>ahw$gsk;>5x>q#N9GRe9cS2*$kxi{yC%Iaa3;n#+bOjyD(9Mww z^*jXc=|a_!3{)2+{W8HyTz3s(&8h~;#o=-+G-#QoGP`2MQnLCq2hSyl=p5&G6uF=t zFz+FVJGZ)}T1zpnAhOm-A!b;4RH*faBG-)G&!*vX=7Z=Ge2pDvvvPPO5k1_KR^l?u z^e<#Rdonn>BHTUVG3Gqn6;a)F0xXvK4D}qlc8zST&3KwZZWMi>Hav7{qcjCG%QOFq zIIbK+V}JG3dLE@jzO&uXwVkP`s~k6uvu;8uE1ijwTd?Fd9ODJEtJ|!81p7K{HPAGb zptM-3E1p-P)OjXf5jLP?38lrW@FgeWb6-L62a}j8W2^v3O}Tsn$k=*Ki&+c%nLa)- zC30=hT$Ft&tA|EZ=d4AU=G=>b5JbpEd8e`J`U-ll^WfV)1?5gdOzT*kVdNG+$oqty zyI4E&hejLr6HUdItLilDE5}195O0Y;$<8lHw+l7@Swx>$DiTlFD?+wSt7PxJr zDqYtOC~U`&km{b}`YUmTu;UX|m1Oz%b%|PE-Y#m!HA{BtUW20?I&8J;Z`y*TVkIi( z43vI&C1@G zXzn-Phm+U`aeCL6lbjNiy@Il4U-RkZrm?ZnS6}u)TmeZ_1T`iUC(%1jjS1)e-WSO2 z6&+uhV#hUhrPuF;(_^-sKz%`R#SgBiQhWAk|zyco}wDLdQ%j??7?sjm7U! zBpoG2y4ia(igm82mEr_HcznQ5jrVyU<)puspB*(wH3k{^#VKCz{>nC%Eg524=b-dk z=&Flu1Qb-PiYTWQC{-XLn_bk`IO=oPYi}uYt({BzZ~X1Q2sp;w_5c3=%%tyT&=8 literal 0 HcmV?d00001 diff --git a/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java b/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java index cd75c569..1c329cf0 100644 --- a/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java +++ b/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java @@ -255,7 +255,7 @@ public class OpenController extends BaseController { public AjaxResult getDeliveryNoteDetail(@RequestBody Map paramMap) { return openService.getDeliveryNoteDetail(paramMap); } - //给oa提供的物料建议标准更新 + //给oa提供的物料建议标准更新;物料英文名称编辑 @PostMapping("/sendProductCheckNo") public AjaxResult sendProductCheckNo(@RequestBody List dots) { return openService.sendProductCheckNo(dots); @@ -269,4 +269,5 @@ public class OpenController extends BaseController { } return openService.addEquSapInfo(dto); } + } diff --git a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml index afbe4d82..a5bc63db 100644 --- a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml +++ b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml @@ -33,6 +33,7 @@ set product_code = #{item.productCode}, product_desc_zh = #{item.productDescZh}, + product_desc_en = #{item.productDescEn}, product_group = #{item.productGroup}, product_group_name = #{item.productGroupName}, meins = #{item.meins}, @@ -408,14 +409,14 @@ insert into base_product( - product_code,product_desc_zh,product_group,product_group_name, + product_code,product_desc_zh,product_desc_en,product_group,product_group_name, meins,product_model,umrez,umren,mvgr5, gross_weight,volume ,create_by,create_time ) values ( - #{item.productCode},#{item.productDescZh},#{item.productGroup},#{item.productGroupName}, + #{item.productCode},#{item.productDescZh},#{item.productDescEn},#{item.productGroup},#{item.productGroupName}, #{item.meins},#{item.productModel},#{item.umrez},#{item.umren},#{item.mvgr5}, #{item.grossWeight},#{item.volume}, 'oa',GETDATE() diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java index 63572109..af1118f9 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java @@ -10,6 +10,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -19,9 +20,12 @@ import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.domain.ExcelCol; import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.bean.BeanUtils; +import com.op.common.core.utils.poi.ExcelMapUtil; +import com.op.common.core.utils.poi.ExcelReportMapUtil; import com.op.common.datasource.creator.DynamicDatasourceCreator; import com.op.common.security.utils.SecurityUtils; import com.op.quality.domain.*; @@ -31,6 +35,7 @@ import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO; import org.apache.commons.lang.StringUtils; +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.GetMapping; @@ -105,7 +110,7 @@ public class QcCheckTaskIncomeController extends BaseController { * 导出来料检验列表 */ @RequiresPermissions("quality:qcIncome:export") - @Log(title = "来料检验", businessType = BusinessType.EXPORT) + @Log(title = "来料检验导出", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, QcCheckTaskIncome qcCheckTaskIncome) { @@ -128,7 +133,42 @@ public class QcCheckTaskIncomeController extends BaseController { ExcelUtil util = new ExcelUtil(QcCheckTaskIncome.class); util.exportExcel(response, list, "来料检验数据"); } - + @RequiresPermissions("quality:qcIncome:export") + @Log(title = "来料检验报告导出", businessType = BusinessType.EXPORT) + @PostMapping("/reportExport") + public void reportExport(HttpServletResponse response, QcCheckTaskIncome qcCheckTaskIncome) { + List list = new ArrayList<>(); + List title2Cols = new ArrayList<>(); + String titleRow1 = "来料检验报告row"; + //表格结构数据 + ArrayList excelCols = new ArrayList<>(); + excelCols.add(new ExcelCol("CPK品类", "cpkTypeName", 30)); + excelCols.add(new ExcelCol("线体名称", "lineName", 30)); + excelCols.add(new ExcelCol("检验节点", "checkTypeName", 30)); + excelCols.add(new ExcelCol("检测项", "ruleName", 30)); + for (int n = 0; n < title2Cols.size(); n++) { + excelCols.add(new ExcelCol(title2Cols.get(n), "date" + (n+1), 20)); + } + excelCols.add(new ExcelCol("平均值", "cpkAvg", 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 = ExcelReportMapUtil.initWorkbook(sheetName, titleRow1, excelCols, list); + workbook.write(outputStream); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (workbook != null) { + workbook.dispose(); + } + } + } /** * 获取来料检验详细信息 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcProductCpkUpdownController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcProductCpkUpdownController.java index 0e8794c8..860d21d7 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcProductCpkUpdownController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcProductCpkUpdownController.java @@ -8,6 +8,7 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.poi.ExcelUtil; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.security.utils.SecurityUtils; +import com.op.quality.domain.QcMaterialCheckStandarDTO; import com.op.quality.domain.QcProductCpkUpdown; import com.op.quality.service.IQcProductCpkUpdownService; import org.apache.catalina.security.SecurityUtil; @@ -39,11 +40,10 @@ public class QcProductCpkUpdownController extends BaseController { @Autowired private IQcProductCpkUpdownService qcProductCpkUpdownService; -/** - * 查询CPK上下限维护列表 - */ - -@GetMapping("/list") + /** + * 查询CPK上下限维护列表 + */ + @GetMapping("/list") public TableDataInfo list(QcProductCpkUpdown qcProductCpkUpdown) { startPage(); List list = qcProductCpkUpdownService.selectQcProductCpkUpdownList(qcProductCpkUpdown); @@ -108,4 +108,21 @@ public class QcProductCpkUpdownController extends BaseController { public AjaxResult remove(@PathVariable String[] ids) { return toAjax(qcProductCpkUpdownService.deleteQcProductCpkUpdownByIds(ids)); } + + /** + * 物料检验标准列表 + */ + @GetMapping("/getMaterialCheckStandarList") + public TableDataInfo getMaterialCheckStandarList(QcMaterialCheckStandarDTO dto) { + startPage(); + List list = qcProductCpkUpdownService.getMaterialCheckStandarList(dto); + return getDataTable(list); + } + @Log(title = "物料检验标准列表导出", businessType = BusinessType.EXPORT) + @PostMapping("/getMaterialCheckStandarExport") + public void getMaterialCheckStandarExport(HttpServletResponse response, QcMaterialCheckStandarDTO dto) { + List list = qcProductCpkUpdownService.getMaterialCheckStandarList(dto); + ExcelUtil util = new ExcelUtil(QcMaterialCheckStandarDTO. class); + util.exportExcel(response, list, "物料检验标准"); + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialCheckStandarDTO.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialCheckStandarDTO.java new file mode 100644 index 00000000..822299a0 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcMaterialCheckStandarDTO.java @@ -0,0 +1,88 @@ +package com.op.quality.domain; + +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; + +/** + * + * @author Open Platform + * @date 2024-12-2 + */ +public class QcMaterialCheckStandarDTO extends BaseEntity { +private static final long serialVersionUID=1L; + + @Excel(name = "物料号") + private String materialCode; + @Excel(name = "物料名称") + private String materialName; + @Excel(name = "检验标准") + private String standNo; + @Excel(name = "检验物料组名称") + private String groupName; + @Excel(name = "物料组编码") + private String productGroup; + @Excel(name = "物料组名称") + private String productGroupName; + @Excel(name = "工厂") + private String siteCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getStandNo() { + return standNo; + } + + public void setStandNo(String standNo) { + this.standNo = standNo; + } + + public String getGroupName() { + return groupName; + } + + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public String getProductGroup() { + return productGroup; + } + + public void setProductGroup(String productGroup) { + this.productGroup = productGroup; + } + + public String getProductGroupName() { + return productGroupName; + } + + public void setProductGroupName(String productGroupName) { + this.productGroupName = productGroupName; + } + + public String getSiteCode() { + return siteCode; + } + + public void setSiteCode(String siteCode) { + this.siteCode = siteCode; + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java index e320a6e6..37aa8bc8 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java @@ -92,4 +92,5 @@ public interface QcCheckReportIncomeMapper { public List getPrintXJList(QcCheckReportIncome qcCheckReportIncome); + Long getActProductQty(String workOrderCode); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProductCpkUpdownMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProductCpkUpdownMapper.java index c56ad8bc..cd6ebed4 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProductCpkUpdownMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProductCpkUpdownMapper.java @@ -1,5 +1,6 @@ package com.op.quality.mapper; +import com.op.quality.domain.QcMaterialCheckStandarDTO; import com.op.quality.domain.QcProductCpkUpdown; import java.util.List; @@ -61,4 +62,6 @@ public interface QcProductCpkUpdownMapper { public int deleteQcProductCpkUpdownByIds(String[] ids); QcProductCpkUpdown checkCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown); + + List getMaterialCheckStandarList(QcMaterialCheckStandarDTO dto); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcProductCpkUpdownService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcProductCpkUpdownService.java index d352c347..3297751f 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcProductCpkUpdownService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcProductCpkUpdownService.java @@ -1,5 +1,6 @@ package com.op.quality.service; +import com.op.quality.domain.QcMaterialCheckStandarDTO; import com.op.quality.domain.QcProductCpkUpdown; import java.util.List; @@ -61,4 +62,6 @@ public interface IQcProductCpkUpdownService { public int deleteQcProductCpkUpdownById(String id); QcProductCpkUpdown checkCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown); + + List getMaterialCheckStandarList(QcMaterialCheckStandarDTO dto); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java index f4be899d..b052a69a 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -58,6 +59,11 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer //汇总批次号 List batchs = qcCheckReportIncomeMapper.getBatchsByTaskId(recordId); dto.setIncomeBatchNo(StringUtils.join(batchs, ";")); + //实际生产数量 + Long actVal = qcCheckReportIncomeMapper.getActProductQty(dto.getOrderNo()); + if(actVal != null){ + dto.setQuality(new BigDecimal(actVal)); + } return dto; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProductCpkUpdownServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProductCpkUpdownServiceImpl.java index 20233ec0..df524744 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProductCpkUpdownServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProductCpkUpdownServiceImpl.java @@ -4,11 +4,16 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; +import com.op.quality.domain.QcMaterialCheckStandarDTO; import com.op.quality.domain.QcProductCpkUpdown; import com.op.quality.mapper.QcProductCpkUpdownMapper; import com.op.quality.service.IQcProductCpkUpdownService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; /** @@ -101,4 +106,13 @@ public class QcProductCpkUpdownServiceImpl implements IQcProductCpkUpdownService public QcProductCpkUpdown checkCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown) { return qcProductCpkUpdownMapper.checkCpkUpdown(qcProductCpkUpdown); } + + @Override + @DS("#header.poolName") + public List getMaterialCheckStandarList(QcMaterialCheckStandarDTO dto) { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + dto.setSiteCode(request.getHeader(key.substring(8)).replace("ds_", "")); + return qcProductCpkUpdownMapper.getMaterialCheckStandarList(dto); + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java index f64c1a4f..07642e26 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java @@ -1313,7 +1313,11 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { if(act!=null){ String actArrayStr = act.getQuality().replace("[", "") .replace("]", "") - .replace("\"", ""); + .replace("\"", "") + .replace("/", "") + .replace("/", "") + .replace(",,", ",") + .replace("\\", ""); List actArray0 = Arrays.asList(actArrayStr.split(",")); List actArray = new ArrayList<>(); for(String avg:actArray0){ diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckReportIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckReportIncomeMapper.xml index be28b322..b38e4327 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckReportIncomeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckReportIncomeMapper.xml @@ -101,7 +101,7 @@ qct.check_status, qct.check_man_code, qct.check_man_name, qct.check_time, qct.check_result, qct.status, qct.check_type, qct.attr1, qct.attr2, qct.attr3, qct.attr4, qct.create_by, qct.create_time, qct.update_by, qct.update_time, - qct.factory_code, qct.del_flag,qct.reason,qct.product_type,qct.order_type,qct.jgy,qct.pgy,qct.cxzz, + qct.factory_code, qct.del_flag,qct.reason,qct.product_type,bp.product_group_name order_type,qct.jgy,qct.pgy,qct.cxzz, ISNULL(bp.mvgr5, '09JS08S-048B') standardNo from qc_check_task qct left join base_product bp on bp.product_code = qct.material_code @@ -169,7 +169,7 @@ qctp.down_diff downDiff, qctp.sample, td.sample_quality samplePlan, - qctp.item_type itemType, + qcp.item_type itemType, qctp.judge_rate judgeRate, qpt.standard_no standardNo, qctp.upper_diff upperDiff, @@ -316,6 +316,9 @@ and qct.type_code = #{typeCode} + insert into qc_check_task diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml index dc75e15a..53587308 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml @@ -131,7 +131,7 @@ #{supplierName}, '%') and qct.income_time = #{incomeTime} - and qct.check_loc = #{checkLoc} + and qct.check_loc like concat('%',#{checkLoc}, '%') and qct.check_status = #{checkStatus} and qct.check_man_code = #{checkManCode} and qct.check_man_name like concat('%', diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskWarehousingMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskWarehousingMapper.xml index 843a9b02..b776b236 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskWarehousingMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskWarehousingMapper.xml @@ -71,7 +71,7 @@ #{supplierName}, '%') and qct.income_time = #{incomeTime} - and qct.check_loc = #{checkLoc} + and qct.check_loc like concat('%',#{checkLoc}, '%') and qct.check_status = #{checkStatus} and qct.check_man_code = #{checkManCode} and qct.check_man_name like concat('%', diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcProductCpkUpdownMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcProductCpkUpdownMapper.xml index d38098f5..6a0f2657 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcProductCpkUpdownMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcProductCpkUpdownMapper.xml @@ -82,6 +82,36 @@ and material_code = #{materialCode} and rule_code = #{ruleCode} + insert into qc_product_cpk_updown diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml index e6392130..d67118ca 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml @@ -531,7 +531,7 @@ qcp.rule_name ruleName from qc_check_type_project qctp left join qc_check_project qcp on qctp.project_id = qcp.id - where qctp.type_id = #{checkType} and qctp.property_code = '1' + where qctp.type_id = #{checkType} and qctp.property_code = '1' and qctp.del_flag = '0' and qctp.material_code is null and qcp.rule_name is not null