aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsWeldSeamStandardController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,36 @@ package com.aps.core.controller.basicData; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.aps.core.domain.ApsWeldSeamStandard; import com.aps.core.service.IApsWeldSeamStandardService; import com.aps.common.core.web.controller.BaseController; import com.aps.common.core.web.page.TableDataInfo; /** * çç¼æ åController * * @author user * @date 2023-11-05 */ @RestController @RequestMapping("/weldSeamStandard") public class ApsWeldSeamStandardController extends BaseController { @Autowired private IApsWeldSeamStandardService apsWeldSeamStandardService; /** * æ¥è¯¢çç¼æ åå表 */ @GetMapping("/list") public TableDataInfo list(ApsWeldSeamStandard apsWeldSeamStandard) { startPage(); List<ApsWeldSeamStandard> list = apsWeldSeamStandardService.selectApsWeldSeamStandardList(apsWeldSeamStandard); return getDataTable(list); } } aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsPlate/ApsPlateProcessShopStatController.java
@@ -34,7 +34,7 @@ */ @Operation(summary = "é£é计å大表", description = "导åºåè½") @Log(title = "é£é车é´ç»è®¡", businessType = BusinessType.EXPORT) @RequiresPermissions("plateProcessShopStat:export") //@RequiresPermissions("plateProcessShopStat:export") @PostMapping("/export") public void export(HttpServletResponse response, ApsPlateProcessShopStat apsPlateProcessShopStat) { aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlanTask.java
@@ -8,6 +8,7 @@ import java.io.Serializable; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Data; @@ -34,6 +35,7 @@ @TableField(value = "id") @TableId(type = IdType.INPUT) @Schema(description = "主é®ID") @JsonFormat(shape = JsonFormat.Shape.STRING) private Long id; /** aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlate/ApsPlateProcessShopPlanStat.java
@@ -29,44 +29,24 @@ private String mainPartNumber; /** ä¸»ä»¶å®¢æ· */ @Schema(description = "主件客æ·ï¼æ¥èªERP", type = "String") @Schema(description = "主件客æ·", type = "String") @Excel(name = "主件客æ·") private String customer; /** 主件订å交æ */ @Schema(description = "主件订å交æï¼æ¥èªERP", type = "String") @Excel(name = "主件订å交æ") private BigInteger mainOrderDelivery; @Schema(description = "建æ è¡", type = "String") @Excel(name = "建æ è¡") private String requireTrackId;; /** ä¸å¡ç±»å */ @Schema(description = "ä¸å¡ç±»å", type = "String") @Excel(name = "ä¸å¡ç±»å") private String businessType; /** çªå· */ @Schema(description = "éæ±è¿½æº¯å·ï¼ç±APS产ç", type = "String") @Excel(name = "çªå·") private String designation; /** åæ®å· */ @Schema(description = "åæ®å·", type = "String") @Excel(name = "åæ®å·") private String documentNumber; /** éæ±åç±» */ @Schema(description = "éæ±åç±»", type = "String") @Excel(name = "éæ±åç±»") private String requirementType; /** åæ®ç¶æ */ @Schema(description = "åæ®ç¶æ", type = "String") @Excel(name = "åæ®ç¶æ") private String documentStatus; /** å½åå·¥åº */ @Schema(description = "å½åå·¥åº", type = "String") @Excel(name = "å½åå·¥åº") private String workCenter; /** æå· */ @@ -84,79 +64,114 @@ @Excel(name = "çæ¬å·") private String versionNumber; /** ä½é¶ç */ @Excel(name = "ä½é¶ç ") private String lowOrderCode; /** ç产æ°é */ @Schema(description = "ç产æ°é", type = "String") @Excel(name = "ç产æ°é") private BigDecimal productionQuantity; /** å·¥åå建æ¶é´ */ @Schema(description = "å·¥åå建æ¶é´ï¼æ¥èªERP", type = "String") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "å·¥åå建æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date orderCreateTime; /** éæ±åç±» */ @Schema(description = "éæ±åç±»", type = "String") @Excel(name = "éæ±åç±»") private String requirementType; /** åæ®ç¶æ */ @Schema(description = "åæ®ç¶æ", type = "String") @Excel(name = "åæ®ç¶æ") private String documentStatus; /** å·¥åå®¡æ ¸æ¶é´ */ @Schema(description = "å·¥åå®¡æ ¸æ¶é´ï¼æ¥èªERP", 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; /** å·¥åå¼å·¥æ¶é´ */ @Schema(description = "å·¥åå¼å·¥æ¶é´ï¼æ¥èªERP", type = "String") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "å·¥åå¼å·¥æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date startWorkDate; /** 忬¡ç¡®è®¤å®å·¥æ¶é´ */ @Schema(description = "忬¡ç¡®è®¤å®å·¥æ¶é´ï¼æ¥èªAPS", type = "String") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "忬¡ç¡®è®¤å®å·¥æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date workOrderConfirmTime; /** 计åå®å·¥æ¥ */ @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; /** çæ¬å· */ @Schema(description = "ç产工åï¼æ¥èªERP", type = "String") @Excel(name = "ç产工å") private String productionBase; /** çæ¬å· */ @Schema(description = "é½å¥ç¶åµï¼æ¥èªERP", type = "String") @Excel(name = "é½å¥ç¶åµ") private String kittingCondition; /** 计åé½å¥æ¶é´ */ @Schema(description = "计åé½å¥æ¶é´ï¼æ¥èªERP", type = "String") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "计åé½å¥æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date planKittingTime; /** å·¥åºå· */ @Excel(name = "å·¥åºå·") private String processNumber; /** æå±é¨é¨ */ @Excel(name = "æå±é¨é¨") /** å½åå·¥åº */ @Schema(description = "å½åå·¥åº", type = "String") @Excel(name = "å½åå·¥åº") private String workCenter; /** å½åå·¥åºè´£ä»»äºº */ @Excel(name = "å½åå·¥åºè´£ä»»äºº") private String department; /** ç¶æ */ @Excel(name = "ç¶æ") private String opStatus; /** ä¸ä¸éå·¥åº */ @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(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(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; @Schema(description = "å©ä½å·¥åº", type = "String") private String remainedProcess; /*--------*/ /** 忬¡ç¡®è®¤å®å·¥æ¶é´ */ @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 workOrderConfirmTime; /** ç产工å */ @Schema(description = "ç产工å", type = "String") @Excel(name = "ç产工å") private String productionBase; /** é½å¥ç¶åµ */ @Schema(description = "é½å¥ç¶åµ", type = "String") @Excel(name = "é½å¥ç¶åµ") private String kittingCondition; /** 计åé½å¥æ¶é´ */ @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 planKittingTime; /** 主件订å交æ */ @Schema(description = "主件订å交æ", type = "String") @Excel(name = "主件订å交æ") private BigInteger mainOrderDelivery; /** ä¸éå·¥åºæå±é¨é¨ */ @Excel(name = "ä¸éå·¥åºæå±é¨é¨") private String nextProcessDeparment; /** å½åå·¥åºç¶æ */ @Excel(name = "å½åå·¥åºç¶æ") private String opStatus; /** ä¸ä¸å·¥åºåç§° */ @Excel(name = "ä¸ä¸å·¥åºåç§°") private String nextOpName; /** ä½é¶ç */ @Excel(name = "ä½é¶ç ") private String lowOrderCode; /** 车é´å·¥åºä¿¡æ¯ */ private List<ApsPlateProcessShopStat> deptPlans=new ArrayList<>(); } aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlate/ApsPlateRequireDate.java
@@ -24,12 +24,14 @@ * 主é®ID */ @TableId(value = "id") @JsonFormat(shape = JsonFormat.Shape.STRING) private Long id; /** * å·¥åId */ @TableField(value = "plan_id") @JsonFormat(shape = JsonFormat.Shape.STRING) private Long planId; /** aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsWeldSeamStandard.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,55 @@ package com.aps.core.domain; import com.aps.common.core.annotation.Excel; import com.aps.common.core.web.domain.BaseEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.math.BigDecimal; /** * çç¼æ å对象 aps_weld_seam_standard * * @author user * @date 2023-11-05 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class ApsWeldSeamStandard extends BaseEntity { private static final long serialVersionUID = 1L; /** 主é®ID */ private Long id; /** æå· */ @Excel(name = "æå·") private String itemCode; /** å¾å· */ @Excel(name = "å¾å·") private String itemFigure; /** çæ¬å· */ @Excel(name = "çæ¬å·") private String itemFigureVersion; /** åä»¶çç¼æ°ï¼Hupï¼ */ @Excel(name = "åä»¶çç¼æ°ï¼Hupï¼") private BigDecimal hupQty; /** åä»¶çç¼æ°ï¼LODï¼ */ @Excel(name = "åä»¶çç¼æ°ï¼LODï¼") private BigDecimal lodQty; /** çæ¥å½¢å¼(hup\lod) */ @Excel(name = "çæ¥å½¢å¼") private String type; /** æ¯å¦å é¤(0å¦ï¼1æ¯) */ private Integer delFlag; } aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsPlateProcessShopStatMapper.java
@@ -1,6 +1,8 @@ package com.aps.core.mapper; import java.util.List; import com.aps.core.domain.ApsPlate.ApsPlateProcessShopPlanStat; import com.aps.core.domain.ApsPlate.ApsPlateProcessShopStat; import org.apache.ibatis.annotations.Mapper; @@ -64,4 +66,9 @@ int deleteAll(); void batchInsert(List<ApsPlateProcessShopStat> stats); /** * é£é计å大表 åºç¡ä¿¡æ¯æ¥è¯¢ * */ List<ApsPlateProcessShopPlanStat> selectPlatePlanBaseTable(); } aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsWeldSeamStandardMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,23 @@ package com.aps.core.mapper; import java.util.List; import com.aps.core.domain.ApsWeldSeamStandard; import org.apache.ibatis.annotations.Mapper; /** * çç¼æ åMapperæ¥å£ * * @author user * @date 2023-11-05 */ @Mapper public interface ApsWeldSeamStandardMapper { /** * æ¥è¯¢çç¼æ åå表 * * @param apsWeldSeamStandard çç¼æ å * @return çç¼æ åéå */ public List<ApsWeldSeamStandard> selectApsWeldSeamStandardList(ApsWeldSeamStandard apsWeldSeamStandard); } aps-modules/aps-core/src/main/java/com/aps/core/service/IApsWeldSeamStandardService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,21 @@ package com.aps.core.service; import java.util.List; import com.aps.core.domain.ApsWeldSeamStandard; /** * çç¼æ åServiceæ¥å£ * * @author user * @date 2023-11-05 */ public interface IApsWeldSeamStandardService { /** * æ¥è¯¢çç¼æ åå表 * * @param apsWeldSeamStandard çç¼æ å * @return çç¼æ åéå */ public List<ApsWeldSeamStandard> selectApsWeldSeamStandardList(ApsWeldSeamStandard apsWeldSeamStandard); } aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineMoServiceImpl.java
@@ -134,6 +134,7 @@ planEnd != null) { ApsGasPipelineMo apsGasPipelineMo = new ApsGasPipelineMo(); apsGasPipelineMo.setMo(mo); apsGasPipelineMo.setMaterialCode(materialNum); apsGasPipelineMo.setId(IdUtil.getSnowflakeNextId()); apsGasPipelineMo.setFactory(factory); apsGasPipelineMo.setCreateBy(SecurityUtils.getUsername()); aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialProductGroupManagementServiceImpl.java
@@ -68,6 +68,8 @@ @Override public int insertApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement) { apsMaterialProductGroupManagement.setId(IdUtil.getSnowflakeNextId()); apsMaterialProductGroupManagement.setCreateBy(SecurityUtils.getUsername()); apsMaterialProductGroupManagement.setCreateTime(DateUtils.getNowDate()); return apsMaterialProductGroupManagementMapper.insertApsMaterialProductGroupManagement(apsMaterialProductGroupManagement); } @@ -82,6 +84,7 @@ public int updateApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement) { apsMaterialProductGroupManagement.setUpdateTime(DateUtils.getNowDate()); apsMaterialProductGroupManagement.setUpdateBy(SecurityUtils.getUsername()); return apsMaterialProductGroupManagementMapper.updateApsMaterialProductGroupManagement(apsMaterialProductGroupManagement); } 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()) @@ -266,8 +272,7 @@ .toList(); // è·å计åå表åç¶æå表 List<ApsPlatePlan> planList = Optional.ofNullable(apsPlatePlanMapper.selectApsPlatePlanList(platePlan)) .orElse(Collections.emptyList()); List<ApsPlateProcessShopPlanStat> planList = apsPlateProcessShopStatMapper.selectPlatePlanBaseTable(); List<ApsPlateProcessShopStat> shopStates = Optional.ofNullable(apsPlateProcessShopStatMapper.selectApsPlateProcessShopStatList(new ApsPlateProcessShopStat())) .orElse(Collections.emptyList()); @@ -281,26 +286,22 @@ List<SysDictData> documentStatusDic = DictUtils.getDictCache("aps_document_status"); // æå»ºç»æå表 List<ApsPlateProcessShopPlanStat> shopPlanStats = planList.stream() .map(plan -> { ApsPlateProcessShopPlanStat shopPlanStat = new ApsPlateProcessShopPlanStat(); BeanUtils.copyProperties(plan, shopPlanStat); // ç¡®ä¿ç®æ 对象æ¯åæ³çå个对象å®ä¾ planList.forEach( plan -> { // æ ¹æ® docNo è·å对åºç shopStatList List<ApsPlateProcessShopStat> shopStatList = shopStatesByDocNo.getOrDefault(plan.getDocumentNumber(), Collections.emptyList()); shopPlanStat.setDeptPlans(shopStatList); plan.setDeptPlans(shopStatList); if (businessTypeDic != null) { businessTypeDic.stream().filter(x -> x.getDictValue().equals(plan.getBusinessType())).findFirst() .ifPresent(sysDictData -> shopPlanStat.setBusinessType(sysDictData.getDictLabel())); .ifPresent(sysDictData -> plan.setBusinessType(sysDictData.getDictLabel())); } if (documentStatusDic != null) { documentStatusDic.stream().filter(x->x.getDictValue().equals(plan.getDocumentStatus())) .findFirst().ifPresent(sysDictData -> shopPlanStat.setDocumentStatus(sysDictData.getDictLabel())); .findFirst().ifPresent(sysDictData -> plan.setDocumentStatus(sysDictData.getDictLabel())); } return shopPlanStat; }).toList(); }); // æå»ºè¿åç»æ AjaxResult success = AjaxResult.success(shopPlanStats); AjaxResult success = AjaxResult.success(planList); success.put("shopNames", shopList); return success; } @@ -314,7 +315,7 @@ response.setCharacterEncoding("utf-8"); Map<String, CellStyle> styles = createStyles(wb); CellStyle title = styles.get("title"); CellStyle titleStyle = styles.get("title"); try { @@ -324,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) @@ -552,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","å½åå·¥åºè´£ä»»äºº"); 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<>(); aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsWeldSeamStandardServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,33 @@ package com.aps.core.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.aps.core.mapper.ApsWeldSeamStandardMapper; import com.aps.core.domain.ApsWeldSeamStandard; import com.aps.core.service.IApsWeldSeamStandardService; /** * çç¼æ åServiceä¸å¡å±å¤ç * * @author user * @date 2023-11-05 */ @Service public class ApsWeldSeamStandardServiceImpl implements IApsWeldSeamStandardService { @Autowired private ApsWeldSeamStandardMapper apsWeldSeamStandardMapper; /** * æ¥è¯¢çç¼æ åå表 * * @param apsWeldSeamStandard çç¼æ å * @return çç¼æ å */ @Override public List<ApsWeldSeamStandard> selectApsWeldSeamStandardList(ApsWeldSeamStandard apsWeldSeamStandard) { return apsWeldSeamStandardMapper.selectApsWeldSeamStandardList(apsWeldSeamStandard); } } aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialProductGroupManagementMapper.xml
@@ -69,8 +69,6 @@ <if test="factory != null">factory = #{factory},</if> <if test="materialCode != null">material_code = #{materialCode},</if> <if test="domain != null">domain = #{domain},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="createTime != null">create_time = #{createTime},</if> <if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateTime != null">update_time = #{updateTime},</if> <if test="isMain != null">is_main = #{isMain},</if> aps-modules/aps-core/src/main/resources/mapper/core/ApsPlate/ApsPlateProcessShopStatMapper.xml
@@ -131,4 +131,43 @@ ) </foreach> </insert> <!--é£é计å大表 å·¥ååºç¡ä¿¡æ¯æ¥è¯¢--> <select id="selectPlatePlanBaseTable" resultType="com.aps.core.domain.ApsPlate.ApsPlateProcessShopPlanStat"> with a as( select ap.document_number, string_agg(pr.process_name,',') as remained_process from aps_plate_plan as ap left join aps_process_route as pr on ap.document_number=pr.work_order_no where cast(pr.process_number as numeric) > cast(ap.process_number as numeric) group by ap.document_number ) select app.id, app.main_part_number, app.customer, app.business_type, app.document_number, app.item_number, app.drawing_no, app.version_number, app.low_order_code, app.production_quantity, app.requirement_type, app.document_status, app.approve_on, app.process_number, app.work_center, app.department, app.op_status, app.next_op_name, 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 where app.del_flag='0'; </select> </mapper> aps-modules/aps-core/src/main/resources/mapper/core/ApsWeldSeamStandardMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.aps.core.mapper.ApsWeldSeamStandardMapper"> <resultMap type="com.aps.core.domain.ApsWeldSeamStandard" id="ApsWeldSeamStandardResult"> <result property="id" column="id" /> <result property="itemCode" column="item_code" /> <result property="itemFigure" column="item_figure" /> <result property="itemFigureVersion" column="item_figure_version" /> <result property="hupQty" column="hup_qty" /> <result property="lodQty" column="lod_qty" /> <result property="type" column="type" /> <result property="delFlag" column="del_flag" /> </resultMap> <sql id="selectApsWeldSeamStandardVo"> select id, item_code, item_figure, item_figure_version, hup_qty, lod_qty, type, del_flag from aps_weld_seam_standard </sql> <select id="selectApsWeldSeamStandardList" parameterType="com.aps.core.domain.ApsWeldSeamStandard" resultMap="ApsWeldSeamStandardResult"> <include refid="selectApsWeldSeamStandardVo"/> <where> <if test="itemCode != null and itemCode != ''"> and item_code LIKE '%' || #{itemCode} || '%'</if> <if test="itemFigure != null and itemFigure != ''"> and item_figure = #{itemFigure}</if> <if test="itemFigureVersion != null and itemFigureVersion != ''"> and item_figure_version = #{itemFigureVersion}</if> <if test="hupQty != null "> and hup_qty = #{hupQty}</if> <if test="lodQty != null "> and lod_qty = #{lodQty}</if> <if test="type != null and type != ''"> and type = #{type}</if> and del_flag = 0 </where> </select> </mapper>