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,34 +64,99 @@ @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") @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 approveOn; /** 工序号 */ @Excel(name = "工序号") private String processNumber; /** 当前工序 */ @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(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "工单创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date orderCreateTime; /** 工单开工时间 */ @Schema(description = "工单开工时间,来自ERP", type = "String") @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 startWorkDate; @Schema(description = "剩余工序", type = "String") private String remainedProcess; /*--------*/ /** 再次确认完工时间 */ @Schema(description = "再次确认完工时间,来自APS", type = "String") @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 workOrderConfirmTime; /** 生产工厂 */ @Schema(description = "生产工厂", type = "String") @Excel(name = "生产工厂") private String productionBase; /** 齐套状况 */ @Schema(description = "齐套状况", type = "String") @Excel(name = "齐套状况") private String kittingCondition; /** 计划齐套时间 */ @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 planKittingTime; /** 主件订单交期 */ @Schema(description = "主件订单交期", type = "String") @Excel(name = "主件订单交期") private BigInteger mainOrderDelivery; /** 计划完工日 */ @Schema(description = "计划完工日", type = "String") @@ -119,44 +164,12 @@ @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 = "所属部门") private String department; /** 下道工序所属部门 */ @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/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/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java
@@ -266,8 +266,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 +280,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; } aps-modules/aps-core/src/main/resources/mapper/core/ApsPlate/ApsPlateProcessShopStatMapper.xml
@@ -131,4 +131,42 @@ ) </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, 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>