From da8559d4b6abaefabf394d1d2174b3bf4a545a89 Mon Sep 17 00:00:00 2001 From: sfd <sun.sunshine@163.com> Date: 星期三, 21 五月 2025 11:10:54 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.50.149:8085/r/aps-backend into dev --- aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlate/ApsPlateProcessShopPlanStat.java | 28 ++- aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsPlate/ApsPlateProcessShopStatController.java | 2 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java | 311 ++++++++++++++++---------------------------- aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsStandardProcess.java | 32 ++-- aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateRequireDateServiceImpl.java | 6 aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsWeldSeamStandardController.java | 3 aps-modules/aps-core/src/main/resources/mapper/core/ApsPlate/ApsPlateProcessShopStatMapper.xml | 1 7 files changed, 153 insertions(+), 230 deletions(-) diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsWeldSeamStandardController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsWeldSeamStandardController.java index 2bbea33..79ff8fc 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsWeldSeamStandardController.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsWeldSeamStandardController.java @@ -1,6 +1,8 @@ package com.aps.core.controller.basicData; import java.util.List; + +import com.aps.common.security.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -26,6 +28,7 @@ /** * 鏌ヨ鐒婄紳鏍囧噯鍒楄〃 */ + @RequiresPermissions("weldSeamStandard:weldSeamStandard:list") @GetMapping("/list") public TableDataInfo list(ApsWeldSeamStandard apsWeldSeamStandard) { diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsPlate/ApsPlateProcessShopStatController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsPlate/ApsPlateProcessShopStatController.java index ef09bbc..ab26b2a 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsPlate/ApsPlateProcessShopStatController.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsPlate/ApsPlateProcessShopStatController.java @@ -34,7 +34,7 @@ */ @Operation(summary = "閽i噾璁″垝澶ц〃", description = "瀵煎嚭鍔熻兘") @Log(title = "閽i噾杞﹂棿缁熻", businessType = BusinessType.EXPORT) - @RequiresPermissions("plateProcessShopStat:export") + //@RequiresPermissions("plateProcessShopStat:export") @PostMapping("/export") public void export(HttpServletResponse response, ApsPlateProcessShopStat apsPlateProcessShopStat) { diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlate/ApsPlateProcessShopPlanStat.java b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlate/ApsPlateProcessShopPlanStat.java index 552aee3..598d689 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlate/ApsPlateProcessShopPlanStat.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlate/ApsPlateProcessShopPlanStat.java @@ -84,9 +84,9 @@ private String documentStatus; /** 宸ュ崟瀹℃牳鏃堕棿 */ - @Schema(description = "宸ュ崟瀹℃牳鏃堕棿", type = "String") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "宸ュ崟瀹℃牳鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "瀹℃牳鏃堕棿", type = "String") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "瀹℃牳鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date approveOn; /** 宸ュ簭鍙� */ @@ -102,7 +102,7 @@ @Excel(name = "褰撳墠宸ュ簭璐d换浜�") private String department; - /** 褰撳墠宸ュ簭鐘舵�� */ + /** 鐘舵�� */ @Excel(name = "鐘舵��") private String opStatus; @@ -110,16 +110,23 @@ @Excel(name = "涓嬩竴閬撳伐搴�") private String nextOpName; + /** 绯荤粺瀹屽伐鏃堕棿 */ + @Schema(description = "绯荤粺瀹屽伐鏃堕棿", type = "String") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "绯荤粺瀹屽伐鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date planEndDay; + + /** 宸ュ崟鍒涘缓鏃堕棿 */ @Schema(description = "宸ュ崟鍒涘缓鏃堕棿", type = "String") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @Excel(name = "宸ュ崟鍒涘缓鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date orderCreateTime; /** 宸ュ崟寮�宸ユ椂闂� */ @Schema(description = "宸ュ崟寮�宸ユ椂闂�", type = "String") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @Excel(name = "宸ュ崟寮�宸ユ椂闂�", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date startWorkDate; @@ -130,7 +137,7 @@ /** 鍐嶆纭瀹屽伐鏃堕棿 */ @Schema(description = "鍐嶆纭瀹屽伐鏃堕棿", type = "String") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @Excel(name = "鍐嶆纭瀹屽伐鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date workOrderConfirmTime; @@ -147,7 +154,7 @@ /** 璁″垝榻愬鏃堕棿 */ @Schema(description = "璁″垝榻愬鏃堕棿", type = "String") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @Excel(name = "璁″垝榻愬鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date planKittingTime; @@ -158,11 +165,6 @@ private BigInteger mainOrderDelivery; - /** 璁″垝瀹屽伐鏃� */ - @Schema(description = "璁″垝瀹屽伐鏃�", type = "String") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "璁″垝瀹屽伐鏃�", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private Date planEndDay; /** 涓嬮亾宸ュ簭鎵�灞為儴闂� */ diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsStandardProcess.java b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsStandardProcess.java index 6986fd7..e7d134b 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsStandardProcess.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsStandardProcess.java @@ -38,6 +38,10 @@ @Schema(description = "璧勬簮缁�", type = "String") @Excel(name = "璧勬簮缁�") private String resourceGroupName; + /** 涓撲笟 */ + @Schema(description = "涓撲笟", type = "String") + @Excel(name = "涓撲笟") + private String major; /** 浜ц兘妯″瀷: 鐙崰/鍚堟壒 */ @Schema(description = "浜ц兘妯″瀷", type = "String") @@ -55,8 +59,8 @@ private String plantId; /** 宸ュ巶 */ - @Schema(description = "宸ュ巶", type = "String") - @Excel(name = "宸ュ巶") + @Schema(description = "閫傜敤宸ュ巶", type = "String") + @Excel(name = "閫傜敤宸ュ巶") private String plant; /** 杞﹂棿Id */ @@ -65,8 +69,8 @@ private String workShopId; /** 杞﹂棿 */ - @Schema(description = "杞﹂棿", type = "String") - @Excel(name = "杞﹂棿") + @Schema(description = "閫傜敤杞﹂棿", type = "String") + @Excel(name = "閫傜敤杞﹂棿") private String workShop; /** 鏃ュ巻Id */ @@ -74,24 +78,22 @@ // @Excel(name = "鏃ュ巻Id") private Long workCalenderId; - /** 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� */ - @Schema(description = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�", type = "String") - private String delFlag; + /** 鏃ュ巻鎻忚堪 */ + @Schema(description = "鏃ュ巻鎻忚堪", type = "String") + @Excel(name = "鏃ュ巻鎻忚堪") + private String workCalender; /** 浜ц兘妯″瀷Id */ @Schema(description = "浜ц兘妯″瀷Id", type = "Long") // @Excel(name = "浜ц兘妯″瀷Id") private Long modelId; - /** 鏃ュ巻鎻忚堪 */ - @Schema(description = "鏃ュ巻鎻忚堪", type = "String") - @Excel(name = "鏃ュ巻鎻忚堪") - private String workCalender; - /** 涓撲笟 */ - @Schema(description = "涓撲笟", type = "String") - @Excel(name = "涓撲笟") - private String major; + /** 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� */ + @Schema(description = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�", type = "String") + private String delFlag; + + public String getMajor() { return major; diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java index 5bb509d..2315067 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java @@ -2,11 +2,13 @@ import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSON; +import com.alibaba.nacos.common.utils.JacksonUtils; import com.aps.common.core.utils.DateUtils; -import com.aps.common.core.utils.bean.BeanUtils; import com.aps.common.core.web.domain.AjaxResult; import com.aps.common.security.utils.DictUtils; import com.aps.common.security.utils.SecurityUtils; @@ -17,8 +19,12 @@ import com.aps.core.domain.ApsPlate.ApsPlateProcessStat; import com.aps.core.mapper.*; import com.aps.system.api.domain.SysDictData; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletResponse; +import lombok.AllArgsConstructor; +import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.*; import org.apache.poi.util.IOUtils; @@ -257,7 +263,7 @@ ApsShop apsShop = new ApsShop(); apsShop.setPlantCode(PLANT_CODE); - + apsShop.setStatus("1"); // 鑾峰彇杞﹂棿鍒楄〃骞跺鐞嗙┖鍊� List<String> shopList = Optional.ofNullable(shopMapper.selectApsShopList(apsShop)) .orElse(Collections.emptyList()) @@ -309,7 +315,7 @@ response.setCharacterEncoding("utf-8"); Map<String, CellStyle> styles = createStyles(wb); - CellStyle title = styles.get("title"); + CellStyle titleStyle = styles.get("title"); try { @@ -319,222 +325,58 @@ SXSSFSheet sheet = wb.getSheetAt(0); /*濉啓鏃ユ湡鍒� 鍜� 宸ユ椂鍒�*/ SXSSFRow rowTitle = sheet.createRow(0); - SXSSFCell mainPartNumberTitle = rowTitle.createCell(0); - mainPartNumberTitle.setCellValue("涓讳欢鏂欏彿"); - mainPartNumberTitle.setCellStyle(title); - SXSSFCell businessTypeTitle = rowTitle.createCell(1); - businessTypeTitle.setCellValue("涓氬姟绫诲瀷"); - businessTypeTitle.setCellStyle(title); - - SXSSFCell documentNumberTitle = rowTitle.createCell(2); - documentNumberTitle.setCellValue("鍗曟嵁鍙�"); - documentNumberTitle.setCellStyle(title); - - SXSSFCell requirementTypeTitle = rowTitle.createCell(3); - requirementTypeTitle.setCellValue("闇�姹傚垎绫�"); - requirementTypeTitle.setCellStyle(title); - - SXSSFCell documentStatusTitle = rowTitle.createCell(4); - documentStatusTitle.setCellValue("鍗曟嵁鐘舵��"); - documentStatusTitle.setCellStyle(title); - - SXSSFCell approveDateTitle = rowTitle.createCell(5); - approveDateTitle.setCellValue("瀹℃牳鏃堕棿"); - approveDateTitle.setCellStyle(title); - - SXSSFCell workCenterTitle = rowTitle.createCell(6); - workCenterTitle.setCellValue("褰撳墠宸ュ簭"); - workCenterTitle.setCellStyle(title); - - SXSSFCell departmentTitle = rowTitle.createCell(7); - departmentTitle.setCellValue("褰撳墠宸ュ簭璐熻矗浜�"); - departmentTitle.setCellStyle(title); - - SXSSFCell crtPcsStsTitle = rowTitle.createCell(8); - crtPcsStsTitle.setCellValue("褰撳墠宸ュ簭鐘舵��"); - crtPcsStsTitle.setCellStyle(title); - - SXSSFCell nextProcessTitle = rowTitle.createCell(9); - nextProcessTitle.setCellValue("涓嬩竴宸ュ簭"); - nextProcessTitle.setCellStyle(title); + Map<Integer, String> FrontTitleMap = initFrontTitle(shopNames); + FrontTitleMap.forEach((index, titleName) -> { + createCell(rowTitle, index, titleName, titleStyle); + }); - SXSSFCell nextProcessDeparmentTitle = rowTitle.createCell(10); - nextProcessDeparmentTitle.setCellValue("涓嬩竴宸ュ簭璐熻矗浜�"); - nextProcessDeparmentTitle.setCellStyle(title); - - SXSSFCell itemNumberTitle = rowTitle.createCell(11); - itemNumberTitle.setCellValue("鏂欏彿"); - itemNumberTitle.setCellStyle(title); - - SXSSFCell drawingNoTitle = rowTitle.createCell(12); - drawingNoTitle.setCellValue("鍥惧彿"); - drawingNoTitle.setCellStyle(title); - - SXSSFCell versionNumberTitle = rowTitle.createCell(13); - versionNumberTitle.setCellValue("鐗堟湰鍙�"); - versionNumberTitle.setCellStyle(title); - - SXSSFCell lowNumTitle = rowTitle.createCell(14); - lowNumTitle.setCellValue("浣庨樁鐮�"); - lowNumTitle.setCellStyle(title); - - - SXSSFCell productionQuantityTitle = rowTitle.createCell(15); - productionQuantityTitle.setCellValue("鐢熶骇鏁伴噺"); - productionQuantityTitle.setCellStyle(title); - - SXSSFCell planSendDateTitle = rowTitle.createCell(16); - planSendDateTitle.setCellValue("宸ュ崟璁″垝涓嬪彂鏃堕棿"); - planSendDateTitle.setCellStyle(title); - - - - SXSSFCell planEndDayTitle = rowTitle.createCell(17); - planEndDayTitle.setCellValue("绯荤粺瀹屽伐鏃堕棿"); - planEndDayTitle.setCellStyle(title); - - - - - - String firstShopName = shopNames.get(0); - SXSSFCell firstShopBeginDateTitle = rowTitle.createCell(18); - firstShopBeginDateTitle.setCellValue(firstShopName+"寮�宸ユ椂闂�"); - firstShopBeginDateTitle.setCellStyle(title); - SXSSFCell firstShopEndDateTitle = rowTitle.createCell(19); - firstShopEndDateTitle.setCellValue(firstShopName+"瀹屽伐鏃堕棿"); - firstShopEndDateTitle.setCellStyle(title); - - /*鐒婃帴浠堕綈濂�*/ - SXSSFCell hanJieQiTaoTitle= rowTitle.createCell(20); - hanJieQiTaoTitle.setCellValue("鐒婃帴浠堕綈濂楀紑濮嬫椂闂�"); - hanJieQiTaoTitle.setCellStyle(title); - - int i1 = 19; - - for (int i = 1; i < shopNames.size(); i++) { - String shopName = shopNames.get(i); - SXSSFCell beginDateCell = rowTitle.createCell(i * 2 + i1); - SXSSFCell endDateCell = rowTitle.createCell(i * 2 + i1+1); - beginDateCell.setCellValue(shopName+"寮�宸ユ椂闂�"); - endDateCell.setCellValue(shopName+"瀹屽伐鏃堕棿"); - 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); - + //JSONObject jsonObject = (JSONObject) JSONObject.toJSON(plan); + ObjectMapper mapper = new ObjectMapper(); + ObjectNode node = mapper.valueToTree(plan); SXSSFRow dataRow = sheet.createRow(i+1); - //涓讳欢鏂欏彿 - SXSSFCell mainPartNumberCell = dataRow.createCell(0); - mainPartNumberCell.setCellValue(plan.getMainPartNumber()); - //涓氬姟绫诲瀷; - SXSSFCell businessTypeCell= dataRow.createCell(1); - businessTypeCell.setCellValue(plan.getBusinessType()); + LinkedHashMap<String,String> frontTitles= frontTitleName(); + ArrayList<Map.Entry<String, String>> frontTitlesList = new ArrayList<Map.Entry<String, String>>( + frontTitles.entrySet()); - //鍗曟嵁鍙�; - SXSSFCell documentNumberCell = dataRow.createCell(2); - documentNumberCell.setCellValue(plan.getDocumentNumber()); + for (int i1 = 0; i1 < frontTitlesList.size(); i1++) { - //闇�姹傚垎绫�; - SXSSFCell requirementTypeCell = dataRow.createCell(3); - requirementTypeCell.setCellValue(plan.getRequirementType()); + Map.Entry<String, String> entry = frontTitlesList.get(i1); + String filedKey = entry.getKey(); + String fieldValue= node.get(filedKey).textValue(); + createCell(dataRow, i1,fieldValue , null); + } - // 鍗曟嵁鐘舵�� - SXSSFCell documentStatusCell = dataRow.createCell(4); - documentStatusCell.setCellValue(plan.getDocumentStatus()); - - - // 瀹℃牳鏃堕棿 - SXSSFCell approveDateCell = dataRow.createCell(5); - approveDateCell.setCellValue(""); - - //褰撳墠宸ュ簭 - SXSSFCell workCenterCell = dataRow.createCell(6); - workCenterCell.setCellValue(plan.getWorkCenter()); - - //褰撳墠宸ュ簭璐熻矗浜�; - SXSSFCell departmentCell = dataRow.createCell(7); - departmentCell.setCellValue(plan.getDepartment()); - - /*褰撳墠宸ュ簭鐘舵��*/ - SXSSFCell crtPcsStsCell = dataRow.createCell(8); - crtPcsStsCell.setCellValue(plan.getOpStatus()); - - - //涓嬩竴宸ュ簭 - SXSSFCell nextProcessCell = dataRow.createCell(9); - nextProcessCell.setCellValue(plan.getNextOpName()); - - //涓嬩竴宸ュ簭宸ュ簭璐熻矗浜� - SXSSFCell nextProcessDeparmentCell = dataRow.createCell(10); - nextProcessDeparmentCell.setCellValue(plan.getNextProcessDeparment()); - - //鏂欏彿 - SXSSFCell itemNumberCell = dataRow.createCell(11); - itemNumberCell.setCellValue(plan.getItemNumber()); - - // 鍥惧彿 - SXSSFCell drawingNoCell = dataRow.createCell(12); - drawingNoCell.setCellValue(plan.getDrawingNo()); - - //鐗堟湰鍙� - SXSSFCell versionNumberCell = dataRow.createCell(13); - versionNumberCell.setCellValue(plan.getVersionNumber()); - - //浣庨樁鐮� - SXSSFCell lowNumCell = dataRow.createCell(14); - lowNumCell.setCellValue(""); - - //鐢熶骇鏁伴噺 - SXSSFCell productionQuantityCell = dataRow.createCell(15); - productionQuantityCell.setCellValue(plan.getProductionQuantity().toString()); - - //宸ュ崟璁″垝涓嬪彂鏃堕棿 - SXSSFCell planSendDateCell = dataRow.createCell(16); - planSendDateCell.setCellValue(""); - - //绯荤粺瀹屽伐鏃堕棿 - SXSSFCell planEndDayCell = dataRow.createCell(17); - planEndDayCell.setCellValue(dateFormat.format(plan.getPlanEndDay())); - - - - - SXSSFCell firstShopBeginDateCell = dataRow.createCell(18); - SXSSFCell firstShopEndDateCell = dataRow.createCell(19); - - plan.getDeptPlans().stream().filter(x->x.getShopName().equals(firstShopName)).findFirst().ifPresent(x->{ - firstShopBeginDateCell.setCellValue(x.getPlanStartDate()); - firstShopEndDateCell.setCellValue(x.getPlanEndDate()); - }); - /*鐒婃帴浠堕綈濂�*/ - SXSSFCell hanJieQiTaoCell = dataRow.createCell(20); - hanJieQiTaoCell.setCellValue(""); - - - for (int j = 1; j< shopNames.size(); j++) { - String shopName = shopNames.get(j); - SXSSFCell beginDateCell = dataRow.createCell(j * 2 + i1); - SXSSFCell endDateCell = dataRow.createCell(j * 2 + i1+1); + int shopBeginIndex = frontTitlesList.size(); + for (int j = 0; j< shopNames.size(); j++) { + String shopName = shopNames.get(0); + SXSSFCell beginDateCell = dataRow.createCell(j * 2 + shopBeginIndex); + SXSSFCell endDateCell = dataRow.createCell(j * 2 + shopBeginIndex+1); plan.getDeptPlans().stream().filter(x->x.getShopName().equals(shopName)).findFirst().ifPresent(x->{ beginDateCell.setCellValue(x.getPlanStartDate()); endDateCell.setCellValue(x.getPlanEndDate()); }); } + LinkedHashMap<String,String> backTitles= backTitleName(); + ArrayList<Map.Entry<String, String>> backTitlesList = new ArrayList<Map.Entry<String, String>>( + backTitles.entrySet()); - + int backBeginIndex = shopBeginIndex+shopNames.size()*2; + for (int i1 = 0; i1 < backTitlesList.size(); i1++) { + Map.Entry<String, String> entry = backTitlesList.get(i1); + String filedKey = entry.getKey(); + String fieldValue= node.get(filedKey).textValue(); + createCell(dataRow, i1+backBeginIndex,fieldValue , null); + } } - for (int i = 0; i < rowTitle.getLastCellNum(); i++) { - sheet.setColumnWidth(i, 20 * 256); } - wb.write(response.getOutputStream()); } catch (Exception e) @@ -547,6 +389,79 @@ } } + + private LinkedHashMap<String,String> frontTitleName(){ + + LinkedHashMap<String,String> map = new LinkedHashMap<>(); + map.put("mainPartNumber","涓讳欢鏂欏彿"); + map.put("customer","涓讳欢瀹㈡埛"); + map.put("requireTrackId","寤烘爲琛�"); + map.put("businessType","涓氬姟绫诲瀷"); + map.put("documentNumber","鍗曟嵁鍙�"); + map.put("itemNumber","鏂欏彿"); + map.put("drawingNo","鍥惧彿"); + map.put("versionNumber","鐗堟湰鍙�"); + map.put("lowOrderCode","浣庨樁鐮�"); + map.put("productionQuantity","鐢熶骇鏁伴噺"); + map.put("requirementType","闇�姹傚垎绫�"); + map.put("documentStatus","鍗曟嵁鐘舵��"); + map.put("approveOn","瀹℃牳鏃堕棿"); + map.put("processNumber","宸ュ簭鍙�"); + map.put("workCenter","褰撳墠宸ュ簭"); + map.put("department","褰撳墠宸ュ簭璐d换浜�"); + map.put("opStatus","鐘舵��"); + map.put("nextOpName","涓嬩竴閬撳伐搴�"); + map.put("planEndDay","绯荤粺瀹屽伐鏃堕棿"); + + return map; + } + private LinkedHashMap<String,String> backTitleName(){ + LinkedHashMap<String,String> map = new LinkedHashMap<>(); + + map.put("orderCreateTime","宸ュ崟鍒涘缓鏃堕棿"); + map.put("startWorkDate","宸ュ崟寮�宸ユ椂闂�"); + map.put("remainedProcess","鍓╀綑宸ュ簭"); + + return map; + } + + private Map<Integer,String> initFrontTitle(List<String> shopNames) { + Map<Integer,String> map = new HashMap<>(); + Map<String,String> frontTitles= frontTitleName(); + AtomicInteger index= new AtomicInteger(); + + frontTitles.forEach((key,value)->{ + map.put(index.get(), value); + index.getAndIncrement(); + }); + + + for (int i = 0; i < shopNames.size(); i++) { + map.put(i * 2 + index.get(),shopNames.get(i) + "寮�濮嬫椂闂�"); + map.put(i * 2 + index.get()+1,shopNames.get(i) + "缁撴潫鏃堕棿"); + } + + Map<String,String> backTitles= backTitleName(); + + AtomicInteger begBackIndex= new AtomicInteger(frontTitles.size() + shopNames.size() * 2); + + backTitles.forEach((key,value)->{ + map.put(begBackIndex.get(),value); + begBackIndex.getAndIncrement(); + }); + + return map; + } + + + private static void createCell(SXSSFRow rowTitle, int column, String titleName, CellStyle cellStyle) { + SXSSFCell cell = rowTitle.createCell(column); + cell.setCellValue(titleName); + if(null!=cellStyle){ + cell.setCellStyle(cellStyle); + } + } + private Map<String,CellStyle> createStyles(SXSSFWorkbook wb) { Map<String,CellStyle> styles=new HashMap<>(); diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateRequireDateServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateRequireDateServiceImpl.java index a4aefe2..fb5ca8e 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateRequireDateServiceImpl.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateRequireDateServiceImpl.java @@ -17,8 +17,8 @@ /** * @author zhl - * @description 閽堝琛ㄣ�恆ps_plate_require_date(宸ュ崟璁″垝闇�姹傛棩鏈熻〃)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇 - * @createDate 2025-05-19 16:51:36 + * @description 閽堝琛ㄣ�恆ps_plate_require_date(宸ュ崟璁″垝闇�姹傛棩鏈熻〃)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇 + * @createDate 2025-05-19 16:51:36 */ @Service public class ApsPlateRequireDateServiceImpl extends ServiceImpl<ApsPlateRequireDateMapper, ApsPlateRequireDate> @@ -54,7 +54,7 @@ //TODO: 鏍规嵁idList鎵归噺鍒犻櫎 LambdaUpdateWrapper<ApsPlateRequireDate> queryWrapper = new LambdaUpdateWrapper<>(); queryWrapper.in(ApsPlateRequireDate::getId, idList); - queryWrapper.set(ApsPlateRequireDate::getDelFlag, 0); + queryWrapper.set(ApsPlateRequireDate::getDelFlag, 1); return apsPlateRequireDateMapper.update(queryWrapper); } diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlate/ApsPlateProcessShopStatMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlate/ApsPlateProcessShopStatMapper.xml index fe180ee..cf6ba64 100644 --- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlate/ApsPlateProcessShopStatMapper.xml +++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlate/ApsPlateProcessShopStatMapper.xml @@ -164,6 +164,7 @@ app.order_create_time, app.start_work_date, app.production_base, + app.plan_end_day, a.remained_process from aps_plate_plan as app left join a on app.document_number=a.document_number -- Gitblit v1.9.3