diff --git a/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/ErrorCodeConstants.java b/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/ErrorCodeConstants.java index b6e90df78..f9c1c737f 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/ErrorCodeConstants.java +++ b/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/ErrorCodeConstants.java @@ -27,10 +27,10 @@ public class ErrorCodeConstants { public static final ErrorCode BODY_PLATE_UPDATE_CONCURRENCY_ERROR = new ErrorCode(1_003_107_014, "更新柜体状态失败:柜体【{}】板件数量已发生改变,请刷新后重新操作"); - // ========== 订单商品 TODO 补充编号 ========== + // ========== 订单商品 1_003_108_000 ========== public static final ErrorCode GOODS_NOT_EXISTS = new ErrorCode(1_003_108_000, "订单商品不存在"); - // ========== 订单 TODO 补充编号 ========== + // ========== 订单 1_003_109_000 ========== public static final ErrorCode ORDER_NOT_EXISTS = new ErrorCode(1_003_109_000, "订单不存在"); public static final ErrorCode ORDER_NOT_CANCEL = new ErrorCode(1_003_109_001, "订单以进入生产状态,无法作废"); public static final ErrorCode PLATE_IS_PLAN = new ErrorCode(1_003_109_002, "删除对象中有已排单板件,请将该对象从排单中移除后再选择删除!"); @@ -39,16 +39,16 @@ public class ErrorCodeConstants { public static final ErrorCode ORDER_PLAN_ID_NOT_NULL = new ErrorCode(1_003_109_005, "订单或排单ID至少传入一个"); public static final ErrorCode ORDER_PLAN_ID_IS_ONE = new ErrorCode(1_003_109_006, "订单id与排单id与大板分类ID只能传一个"); - // ========== 订单 TODO 补充编号 ========== + // ========== 订单 1_003_110_000 ========== public static final ErrorCode MODULE_NOT_EXISTS = new ErrorCode(1_003_110_000, "模块不存在"); - // ========== 订单 TODO 补充编号 ========== + // ========== 订单 1_003_113_000 ========== public static final ErrorCode PLATE_NOT_EXISTS = new ErrorCode(1_003_113_000, "板材不存在"); - // ========== 订单 TODO 补充编号 ========== + // ========== 订单 1_003_115_000 ========== public static final ErrorCode ORDER_PARTS_NOT_EXISTS = new ErrorCode(1_003_115_000, "订单配件不存在"); - // ========== 订单 TODO 补充编号 ========== + // ========== 订单 1_003_116_000 ========== public static final ErrorCode PHONE_NOT_LAWFUL = new ErrorCode(1_003_116_000, "手机号不合法"); public static final ErrorCode CUSTOM_ORDER_EXISTS = new ErrorCode(1_003_117_000, "自定义订单号存在"); public static final ErrorCode ORDER_PROCESS_NOT_EXISTS = new ErrorCode(1_003_119_001, "工序组不存在"); @@ -122,6 +122,7 @@ public class ErrorCodeConstants { //=========== 包裹信息 1-003-006-000 ============ public static final ErrorCode THE_CURRENT_PACKAGE_TYPE_IS_INCORRECT = new ErrorCode(1_003_006_000, "当前包裹类型错误"); public static final ErrorCode NO_PRODUCTION_ORDER_INFORMATION_AVAILABLE = new ErrorCode(1_003_006_001, "已经是{}一条了"); + public static final ErrorCode ORDER_ALREADY_PACKAGED = new ErrorCode(1_003_006_002, "order.already.packaged"); //=========== 生产信息 1-003-007-000 ============ public static final ErrorCode ORDER_DATE_ERROR = new ErrorCode(1_003_007_000, "订单信息不存在,请重新进入或切换订单"); @@ -194,4 +195,10 @@ public class ErrorCodeConstants { public static final ErrorCode ORDER_COMPONENT_ASSEMBLY_CONFIG_QUERY_ERROR = new ErrorCode(1_003_010_005, "order.component.assembly.config.query.error"); public static final ErrorCode ORDER_COMPONENT_NOT_PROCESS = new ErrorCode(1_003_010_006, "order.component.not.process"); public static final ErrorCode ORDER_COMPONENT_RESTORE_REPEAT = new ErrorCode(1_003_010_007, "order.component.restore.repeat"); + + //=========== 部件管理 1-003-011-000 ============ + public static final ErrorCode HEAP_SPLIT_TASK_NOT_EXIST = new ErrorCode(1_003_011_000, "heap.split.task.not.exist"); + public static final ErrorCode HEAP_SPLIT_TASK_NAME_EXIST = new ErrorCode(1_003_011_001, "heap.split.task.name.exist"); + public static final ErrorCode HEAP_SPLIT_NO_NEED_RESTART = new ErrorCode(1_003_011_002, "heap.split.no.need.restart"); + public static final ErrorCode HEAP_SPLIT_NEED_RESTART = new ErrorCode(1_003_011_003, "heap.split.need.restart"); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/OrderItemTypeEnum.java b/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/OrderItemTypeEnum.java index 81ab25fae..713beb95e 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/OrderItemTypeEnum.java +++ b/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/OrderItemTypeEnum.java @@ -1,11 +1,14 @@ package com.cf.imes.module.executor.enums; +import com.cf.imes.framework.common.core.IntArrayValuable; import lombok.AllArgsConstructor; import lombok.Getter; +import java.util.Arrays; + @Getter @AllArgsConstructor -public enum OrderItemTypeEnum { +public enum OrderItemTypeEnum implements IntArrayValuable { PLATE_ITEM(1, "板材明细"), PARTS_ITEM(2, "配件明细"), @@ -14,11 +17,10 @@ public enum OrderItemTypeEnum { private final Integer status; private String description; - public boolean equals(Integer status) { - return this.status .equals(status) ; - } + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(OrderItemTypeEnum::getStatus).toArray(); - public boolean equals(OrderItemTypeEnum enableStatusEnum) { - return enableStatusEnum != null && enableStatusEnum.status .equals(this.getStatus()) ; + @Override + public int[] array() { + return ARRAYS; } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/assemblylist/AssemblyListController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/assemblylist/AssemblyListController.java index e78c00bb5..244c7b9cd 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/assemblylist/AssemblyListController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/assemblylist/AssemblyListController.java @@ -3,7 +3,9 @@ package com.cf.imes.module.executor.controller.admin.assemblylist; import com.cf.imes.framework.common.pojo.CommonResult; import com.cf.imes.framework.common.pojo.PageResult; import com.cf.imes.module.executor.controller.admin.assemblylist.vo.AssemblyListComponentPageReqVO; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO; +import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPartPageRespVO; import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPlatePageRespVO; import com.cf.imes.module.executor.service.assemblylist.AssemblyListService; import io.swagger.v3.oas.annotations.Operation; @@ -45,12 +47,18 @@ public class AssemblyListController { @PostMapping("/list/view/plate/page") @Operation(summary = "装配清单-获取订单部件下的板件视图分页列表数据") public CommonResult> getComponentViewPlatesPage(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) { - return success(assemblyListService.getViewComponentPage(pageReqVO)); + return success(assemblyListService.getViewComponentPlatePage(pageReqVO)); } - @PostMapping("/list/view/plate/cadinfo") - @Operation(summary = "装配清单-获取订单部件下的所有板件视图列表数据") - public CommonResult> getComponentViewPlates(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) { + @PostMapping("/list/view/part/page") + @Operation(summary = "装配清单-获取订单部件下的配件视图分页列表数据") + public CommonResult> getComponentViewPartsPage(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) { + return success(assemblyListService.getViewComponentPartPage(pageReqVO)); + } + + @PostMapping("/list/view/cadinfo") + @Operation(summary = "装配清单-获取订单部件下的所有板件+配件视图列表数据") + public CommonResult getComponentViewPlates(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) { return success(assemblyListService.getViewComponentPlatesCadInfo(pageReqVO)); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/assemblylist/vo/AssemblyListComponentPageReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/assemblylist/vo/AssemblyListComponentPageReqVO.java index 48c036c2f..3ddd08ef2 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/assemblylist/vo/AssemblyListComponentPageReqVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/assemblylist/vo/AssemblyListComponentPageReqVO.java @@ -1,8 +1,6 @@ package com.cf.imes.module.executor.controller.admin.assemblylist.vo; import com.cf.imes.framework.common.pojo.PageParam; -import com.cf.imes.framework.common.validation.InEnum; -import com.cf.imes.module.executor.enums.ordercomponent.OrderComponentProcessStatusEnum; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Size; import lombok.AllArgsConstructor; @@ -10,7 +8,6 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; -import org.hibernate.validator.constraints.Length; import java.util.List; import java.util.Set; @@ -35,12 +32,4 @@ public class AssemblyListComponentPageReqVO extends PageParam { @Schema(description = "部件编号", example = "[1,2]") @Size(max = 200, message = "{order.detail.component.list.query.componentIds.max}") private Set componentIds; - - @Schema(description = "部件名称", example = "部件") - @Length(max = 64, message = "{order.component.assemble.req.name.max}") - private String name; - - @Schema(description = "加工状态:0不加工、1未加工、2已加工", example = "1") - @InEnum(OrderComponentProcessStatusEnum.class) - private Integer processStatus; } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/HeapSplitController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/HeapSplitController.java new file mode 100644 index 000000000..6f3c18664 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/HeapSplitController.java @@ -0,0 +1,72 @@ +package com.cf.imes.module.executor.controller.admin.manage.pack; + +import com.cf.imes.framework.common.pojo.CommonResult; +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskListRespVO; +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskRespVO; +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskSaveReqVO; +import com.cf.imes.module.executor.service.heapsplit.HeapSplitTaskService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.validation.Valid; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +import static com.cf.imes.framework.common.pojo.CommonResult.success; + +/** + * + * + * @author Gqr + * @since 2026/3/13 14:05 + */ +@Tag(name = "管理后台 - 分堆管理 ") +@RestController +@RequestMapping("/manage/heapsplit") +@Validated +public class HeapSplitController { + + @Resource + private HeapSplitTaskService heapSplitTaskService; + + @PostMapping("/task") + @Operation(summary = "保存分堆任务") + public CommonResult saveHeapsplitTask(@Valid @RequestBody HeapSplitTaskSaveReqVO reqVO) { + heapSplitTaskService.saveHeapsplitTask(reqVO); + return success(true); + } + + @GetMapping("/task") + @Operation(summary = "查询分堆任务列表") + public CommonResult> getHeapsplitTask(@RequestParam(value = "name", required = false) String name, @RequestParam(value = "status", required = false) Integer status) { + return success(heapSplitTaskService.getHeapsplitTaskList(name, status)); + } + + @PostMapping("/task/remove") + @Operation(summary = "删除分堆任务") + public CommonResult deleteHeapsplitTask(@RequestBody List ids) { + heapSplitTaskService.deleteHeapsplitTask(ids); + return success(true); + } + + @GetMapping("/task/{id}") + @Operation(summary = "获取分堆任务") + public CommonResult getHeapsplitTaskById(@PathVariable("id") Long id) { + return success(heapSplitTaskService.getHeapsplitTask(id)); + } + + @PostMapping("/task/restart/{id}") + @Operation(summary = "重启分堆任务") + public CommonResult restartHeapsplitTask(@PathVariable("id") Long id) { + heapSplitTaskService.restartHeapsplitTask(id); + return success(true); + } +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/PackController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/PackController.java index 0cd1b609b..e92cd24e8 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/PackController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/PackController.java @@ -237,5 +237,9 @@ public class PackController { } - + @GetMapping("/scan/correlation") + @Operation(summary = "查询扫描类型相关的板件+配件id") + public CommonResult> getComponentCorrelation(@Valid @RequestBody PackScanComponentCorrelationReqVO reqVO) { + return success(packService.getComponentCorrelation(reqVO)); + } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskListRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskListRespVO.java new file mode 100644 index 000000000..358696d35 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskListRespVO.java @@ -0,0 +1,37 @@ +package com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * + * + * @author Gqr + * @since 2026/3/12 17:05 + */ +@Schema(description = "管理后台 - 分堆打包 - 任务列表分页 Request VO") +@Data +public class HeapSplitTaskListRespVO { + @Schema(description = "任务ID", example = "1024") + private Long id; + + @Schema(description = "任务名称", example = "分堆打包任务") + private String name; + + @Schema(description = "已分堆板件数", example = "100") + private int splittedPlateNum; + + @Schema(description = "未分堆板件数", example = "200") + private int unsplitPlateNum; + + @Schema(description = "总板件数", example = "300") + private int totalPlateNum; + + @Schema(description = "状态,0未完成、1已完成", example = "1") + private Integer status; + + @Schema(description = "修改时间") + private LocalDateTime updateTime; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskRespVO.java new file mode 100644 index 000000000..bf0757a4d --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskRespVO.java @@ -0,0 +1,30 @@ +package com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author Gqr + * @since 2026/3/12 17:05 + */ +@Schema(description = "管理后台 - 分堆打包 - 任务内容明细 Request VO") +@Data +@Builder +public class HeapSplitTaskRespVO { + @Schema(description = "任务ID", example = "1024") + private Long id; + + @Schema(description = "订单ID列表") + private List orderIds; + + @Schema(description = "板件ID列表") + private List plateIds; + + @Schema(description = "配件ID列表") + private List partIds; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskSaveReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskSaveReqVO.java new file mode 100644 index 000000000..bde283441 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/heapsplit/HeapSplitTaskSaveReqVO.java @@ -0,0 +1,49 @@ +package com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author Gqr + * @since 2026/3/10 17:36 + */ +@Schema(description = "管理后台 - 分堆打包 - 保存分堆任务 Request VO") +@Data +public class HeapSplitTaskSaveReqVO { + @Schema(description = "任务id") + private Long id; + + @Schema(description = "任务名称") + private String name; + + @Schema(description = "已分堆板件数") + private int splittedPlateNum; + + @Schema(description = "未分堆板件数") + private int unsplitPlateNum; + + @Schema(description = "总板件数") + private int totalPlateNum; + + @Schema(description = "已分堆配件数") + private int splittedPartNum; + + @Schema(description = "未分堆配件数") + private int unsplitPartNum; + + @Schema(description = "总配件数") + private int totalPartNum; + + @Schema(description = "板件id列表") + private List plateIds; + + @Schema(description = "配件id列表") + private List partIds; + + @Schema(description = "订单id列表") + private List orderIds; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/OrderPartsRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/OrderPartsRespVO.java index c121bd0d2..da2da02bb 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/OrderPartsRespVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/OrderPartsRespVO.java @@ -83,6 +83,7 @@ public class OrderPartsRespVO { @Schema(description = "加工组-用于计算-不显示") private List groupId; - + @Schema(description = "组件名称") + private String componentName; } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PackScanComponentCorrelationReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PackScanComponentCorrelationReqVO.java new file mode 100644 index 000000000..a505c0059 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PackScanComponentCorrelationReqVO.java @@ -0,0 +1,34 @@ +package com.cf.imes.module.executor.controller.admin.manage.pack.vo; + +import com.cf.imes.framework.common.validation.InEnum; +import com.cf.imes.module.executor.enums.OrderItemTypeEnum; +import com.cf.imes.module.executor.enums.pack.PackScanComponentCorrelationTypeEnum; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author Gqr + * @since 2026/3/18 11:13 + */ +@Schema(description = "管理后台 - 分堆打包扫描部件关联 Request VO") +@Data +public class PackScanComponentCorrelationReqVO { + + @InEnum(PackScanComponentCorrelationTypeEnum.class) + @Schema(description = "扫描类型,0部件父级、1部件顶级") + private Integer type; + + @Schema(description = "扫描本体编号") + private Long id; + + @InEnum(OrderItemTypeEnum.class) + @Schema(description = "扫描本体类型") + private Integer itemType; + + @Schema(description = "订单ID列表") + private List orderIds; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PlateDetailsRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PlateDetailsRespVO.java index 9a161ddcc..94f50d304 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PlateDetailsRespVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PlateDetailsRespVO.java @@ -3,15 +3,18 @@ package com.cf.imes.module.executor.controller.admin.manage.pack.vo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.math.BigDecimal; import java.util.List; @Schema(description = "管理后台 - 板材详情(导出板材表) Response VO") @Data @ExcelIgnoreUnannotated +@JsonInclude(JsonInclude.Include.NON_NULL) public class PlateDetailsRespVO { @Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED) @@ -133,4 +136,30 @@ public class PlateDetailsRespVO { @Schema(description = "加工组名称集合") private List processGroupNameList; + @Schema(description = "开料长") + private BigDecimal splitHeight; + + @Schema(description = "开料宽") + private BigDecimal splitWidth; + + @Schema(description = "品牌") + private String brand; + + @Schema(description = "左封边厚度") + private BigDecimal sealLeft; + + + @Schema(description = "右封边厚度") + private BigDecimal sealRight; + + + @Schema(description = "上封边厚度") + private BigDecimal sealUp; + + + @Schema(description = "下封边厚度") + private BigDecimal sealDown; + + @Schema(description = "部件名称") + private String componentName; } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderCadViewPlatePageReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderCadViewPlatePageReqVO.java index fbd62a53d..0eb6e0864 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderCadViewPlatePageReqVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderCadViewPlatePageReqVO.java @@ -24,7 +24,7 @@ public class OrderCadViewPlatePageReqVO extends PageParam { @NotNull(message = "{order.cadview.plate.page.orderid.not.null}",groups = {OrderCadViewPageGroup.class}) private Long orderId; - @Schema(description = "柜体编号", example = "1024") + @Schema(description = "柜体编号", example = "[1,2,3]") private Set bodyIds; @Schema(description = "加工组编号", example = "1024") @@ -32,4 +32,7 @@ public class OrderCadViewPlatePageReqVO extends PageParam { @Schema(description = "部件编号", example = "1024") private Long componentId; + + @Schema(description = "名称") + private String name; } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrdersViewCadViewInfoRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrdersViewCadViewInfoRespVO.java new file mode 100644 index 000000000..bed03c730 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrdersViewCadViewInfoRespVO.java @@ -0,0 +1,34 @@ +package com.cf.imes.module.executor.controller.admin.order.vo.order; + +import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPartPageRespVO; +import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPlatePageRespVO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * + * @author Gqr + * @since 2026/3/16 17:34 + */ +@Schema(description = "管理后台 - 装配清单 - 订单部件板件+配件cad视图信息查询 Request VO") +@Data +@ToString(callSuper = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class OrdersViewCadViewInfoRespVO { + + @Schema(description = "板件列表") + List plates = new ArrayList<>(); + + @Schema(description = "配件列表") + List parts = new ArrayList<>(); +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/ordercomponent/OrderComponentController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/ordercomponent/OrderComponentController.java index e7aeab5f3..f3ed6a8fe 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/ordercomponent/OrderComponentController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/ordercomponent/OrderComponentController.java @@ -2,10 +2,12 @@ package com.cf.imes.module.executor.controller.admin.ordercomponent; import com.cf.imes.framework.common.pojo.CommonResult; import com.cf.imes.framework.common.pojo.PageResult; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentPageReqVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrdersTopComponentListReqVO; +import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPartPageRespVO; import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPlatePageRespVO; import com.cf.imes.module.executor.service.assemblylist.AssemblyListService; import com.cf.imes.module.executor.service.ordercomponent.OrderComponentService; @@ -73,13 +75,19 @@ public class OrderComponentController { @PostMapping("/view/plate/page") @Operation(summary = "获取部件下的板件视图分页列表数据") public CommonResult> getComponentViewPlatesPage(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) { - return success(orderComponentService.getViewComponentPage(pageReqVO)); + return success(orderComponentService.getViewComponentPlatesPage(pageReqVO)); } - @PostMapping("/view/plate/cadinfo") - @Operation(summary = "获取部件下的所有板件视图列表数据") - public CommonResult> getComponentViewPlates(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) { - return success(orderComponentService.getViewComponentPlatesCadInfo(pageReqVO)); + @PostMapping("/view/part/page") + @Operation(summary = "获取部件下的配件视图分页列表数据") + public CommonResult> getComponentViewPartsPage(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) { + return success(orderComponentService.getViewComponentPartsPage(pageReqVO)); + } + + @PostMapping("/view/cadinfo") + @Operation(summary = "获取部件下的所有板件+配件视图列表数据") + public CommonResult getComponentViewPlates(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) { + return success(orderComponentService.getViewComponentCadInfo(pageReqVO)); } @DeleteMapping("/{orderId}/{id}") diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/PlateController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/PlateController.java index 8171a4bd4..9234be0e1 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/PlateController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/PlateController.java @@ -7,6 +7,7 @@ import com.cf.imes.framework.common.util.object.BeanUtils; import com.cf.imes.framework.excel.core.util.ExcelUtils; import com.cf.imes.framework.operatelog.core.annotations.OperateLog; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList; import com.cf.imes.module.executor.controller.admin.plate.vo.*; import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO; @@ -136,15 +137,27 @@ public class PlateController { return success(plateService.createNewPlate(reqVO)); } - @PostMapping("/body/view/page") + @PostMapping("/body/view/plate/page") @Operation(summary = "获取柜体下的板件视图分页列表数据") public CommonResult> getBodyViewPlatesPage(@Validated(OrderCadViewPageGroup.class) @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) { return success(plateService.getBodyViewPlatesPage(orderCadViewPlatePageReqVO)); } + @PostMapping("/body/view/part/page") + @Operation(summary = "获取柜体下的配件视图分页列表数据") + public CommonResult> getBodyViewPartsPage(@Validated(OrderCadViewPageGroup.class) @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) { + return success(plateService.getBodyViewPartsPage(orderCadViewPlatePageReqVO)); + } + @PostMapping("/body/view/cadinfo") - @Operation(summary = "获取板件对应柜体下的所有板件视图列表数据") - public CommonResult> getBodyViewPlatesCadInfo(@Validated @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) { - return success(plateService.getBodyViewPlatesCadInfo(orderCadViewPlatePageReqVO)); + @Operation(summary = "获取板件对应柜体下的所有板件+配件视图列表数据") + public CommonResult getBodyViewCadInfo(@Validated @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) { + return success(plateService.getBodyViewCadInfo(orderCadViewPlatePageReqVO)); + } + + @PostMapping("/body/view/part/cadinfo") + @Operation(summary = "获取板件对应柜体下的所有配件视图列表数据") + public CommonResult getBodyViewPartCadInfo(@Validated @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) { + return success(plateService.getBodyViewPartCadInfo(orderCadViewPlatePageReqVO)); } } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/OrderViewPartPageRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/OrderViewPartPageRespVO.java new file mode 100644 index 000000000..eafa9dcfb --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/OrderViewPartPageRespVO.java @@ -0,0 +1,78 @@ +package com.cf.imes.module.executor.controller.admin.plate.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * + * + * @author Gqr + * @since 2025/12/23 13:40 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Schema(description = "管理后台 - 配件视图信息") +@JsonInclude(JsonInclude.Include.NON_NULL) +public class OrderViewPartPageRespVO { + @Schema(description = "配件编号") + private Long id; + + @Schema(description = "配件类型") + private String type; + + @Schema(description = "配件名称") + private String name; + + @Schema(description = "颜色") + private String color; + + @Schema(description = "材质") + private String material; + + @Schema(description = "型号") + private String model; + + @Schema(description = "规格") + private String spec; + + @Schema(description = "数量") + private BigDecimal num; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "品牌") + private String brand; + + @Schema(description = "厂家") + private String factory; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "宽") + private Double width; + + @Schema(description = "长") + private Double length; + + @Schema(description = "厚") + private Double thickness; + + @Schema(description = "部件id") + private Long compId; + + @Schema(description = "板件CAD图纸ID") + private Integer cadViewId; + + @Schema(description = "CAD图纸文件ID") + private Long cadViewFileId; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/heapsplit/HeapSplitTaskDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/heapsplit/HeapSplitTaskDO.java new file mode 100644 index 000000000..86b9a61c4 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/heapsplit/HeapSplitTaskDO.java @@ -0,0 +1,89 @@ +package com.cf.imes.module.executor.dal.dataobject.heapsplit; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.cf.imes.framework.mybatis.core.dataobject.BaseDO; +import com.cf.imes.framework.mybatis.core.type.CompressObjectListTypeHandler; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.ToString; + +import java.util.List; + +/** + * 分堆任务 heap_split_task_{N} DO + * + * @author Gqr + * @since 2026/3/10 17:15 + */ +@TableName(value = "heap_split_task", autoResultMap = true) +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class HeapSplitTaskDO extends BaseDO { + /** + * 主键 + */ + @TableId + private Long id; + + /** + * 组织ID + */ + @TableField(fill = FieldFill.INSERT) + private Long organId; + + /** + * 任务名称 + */ + private String name; + + /** + * 已分堆板件数 + */ + private int splittedPlateNum; + + /** + * 未分堆板件数 + */ + private int unsplitPlateNum; + + /** + * 总板件数 + */ + private int totalPlateNum; + + /** + * 已分堆配件数 + */ + private int splittedPartNum; + + /** + * 未分堆配件数 + */ + private int unsplitPartNum; + + /** + * 总配件数 + */ + private int totalPartNum; + + /** + * 状态 + */ + private Integer status; + + /** + * 订单ID列表 + */ + @TableField(typeHandler = CompressObjectListTypeHandler.class) + private List orderIds; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/heapsplit/HeapSplitTaskDetailDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/heapsplit/HeapSplitTaskDetailDO.java new file mode 100644 index 000000000..1a8c15340 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/heapsplit/HeapSplitTaskDetailDO.java @@ -0,0 +1,51 @@ +package com.cf.imes.module.executor.dal.dataobject.heapsplit; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 分堆任务明细 heap_split_task_detail_{N} DO + * + * @author Gqr + * @since 2026/3/10 17:15 + */ +@TableName("heap_split_task_detail") +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class HeapSplitTaskDetailDO { + /** + * 主键 + */ + @TableId + private Long id; + + /** + * 组织ID + */ + @TableField(fill = FieldFill.INSERT) + private Long organId; + + /** + * 任务ID + */ + private Long taskId; + + /** + * 明细ID + */ + private Long detailId; + + + /** + * 明细类型 + */ + private Integer type; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderItemDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderItemDO.java index 60b34ef97..839d2fa18 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderItemDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderItemDO.java @@ -71,4 +71,9 @@ public class OrderItemDO { * 部件id */ private Long compId; + + /** + * cad视图id + */ + private Integer cadViewId; } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrdersViewPartsPageDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrdersViewPartsPageDO.java new file mode 100644 index 000000000..8bfbc3e94 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrdersViewPartsPageDO.java @@ -0,0 +1,109 @@ +package com.cf.imes.module.executor.dal.dataobject.orderItem; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 柜体板件视图数据DO + * + * @author Gqr + * @since 2025/12/23 11:54 + */ +@Data +public class OrdersViewPartsPageDO { + /** + * 主键 + */ + private Long id; + + /** + * 板编号 + */ + private String type; + + /** + * 板件名称 + */ + private String name; + + /** + * 颜色 + */ + private String color; + + /** + * 板件宽度 + */ + private String material; + + /** + * 型号 + */ + private String model; + + /** + * 规格 + */ + private String spec; + + /** + * 数量 + */ + private BigDecimal num; + + /** + * 单位 + */ + private String unit; + + /** + * 品牌 + */ + private String brand; + + /** + * 厂家 + */ + private String factory; + + /** + * 备注 + */ + private String remark; + + /** + * 宽 + */ + private Double width; + + /** + * 长 + */ + private Double length; + + /** + * 厚 + */ + private Double thickness; + + /** + * 部件id + */ + private Long compId; + + /** + * 柜体id + */ + private Long bodyId; + + /** + * cad视图id + */ + private Integer cadViewId; + + /** + * cad视图文件id + */ + private Long cadViewFileId; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderBodyViewPlatesPageDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrdersViewPlatesPageDO.java similarity index 97% rename from cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderBodyViewPlatesPageDO.java rename to cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrdersViewPlatesPageDO.java index 26e0e4ed4..5b91f9acb 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderBodyViewPlatesPageDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrdersViewPlatesPageDO.java @@ -11,7 +11,7 @@ import java.math.BigDecimal; * @since 2025/12/23 11:54 */ @Data -public class OrderBodyViewPlatesPageDO { +public class OrdersViewPlatesPageDO { /** * 主键 */ diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderParts/OrderPartsDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderParts/OrderPartsDO.java index 8b9d09047..8636889fe 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderParts/OrderPartsDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderParts/OrderPartsDO.java @@ -106,5 +106,4 @@ public class OrderPartsDO extends BaseDO { * 是否删除 */ private Boolean deleted; - } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/plate/PlateDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/plate/PlateDO.java index 84901971d..e4b84c111 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/plate/PlateDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/plate/PlateDO.java @@ -212,12 +212,6 @@ public class PlateDO extends BaseDO { */ private Long planId; - - /** - * cad图纸id - */ - private Integer cadViewId; - /** * cad图纸数据 */ diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/heapsplit/HeapSplitTaskDetailMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/heapsplit/HeapSplitTaskDetailMapper.java new file mode 100644 index 000000000..54edd3701 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/heapsplit/HeapSplitTaskDetailMapper.java @@ -0,0 +1,19 @@ +package com.cf.imes.module.executor.dal.mysql.heapsplit; + +import com.cf.imes.framework.mybatis.core.injector.BaseBatchMapper; +import com.cf.imes.module.executor.dal.dataobject.heapsplit.HeapSplitTaskDetailDO; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 分堆任务明细 HeapSplitTaskDetail Mapper + * + * @author Gqr + * @since 2026/3/10 17:28 + */ +@Mapper +public interface HeapSplitTaskDetailMapper extends BaseBatchMapper { + @Delete("DELETE FROM heap_split_task_detail WHERE task_id = #{taskId} LIMIT #{limit}") + Integer deleteByLimit(@Param("taskId") Long taskId, @Param("limit") Integer limit); +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/heapsplit/HeapSplitTaskMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/heapsplit/HeapSplitTaskMapper.java new file mode 100644 index 000000000..f02fec230 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/heapsplit/HeapSplitTaskMapper.java @@ -0,0 +1,15 @@ +package com.cf.imes.module.executor.dal.mysql.heapsplit; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.cf.imes.module.executor.dal.dataobject.heapsplit.HeapSplitTaskDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 分堆任务 HeapSplitTask Mapper + * + * @author Gqr + * @since 2026/3/10 17:28 + */ +@Mapper +public interface HeapSplitTaskMapper extends BaseMapper { +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderItem/OrderItemMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderItem/OrderItemMapper.java index ed822840b..78759177d 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderItem/OrderItemMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderItem/OrderItemMapper.java @@ -10,8 +10,9 @@ import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsRes import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlatesDetailRespVO; import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO; import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO; -import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderBodyViewPlatesPageDO; import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPartsPageDO; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPlatesPageDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -188,7 +189,25 @@ public interface OrderItemMapper extends BaseMapperX { List selectOrderPackPlateIds(@Param("orderId") Long orderId,@Param("organId") Long organId); /** - * 分页查询柜体板件视图数据 + * 分页查询订单板件视图数据 + * + * @param page 分页参数 + * @param orderIds 订单ID + * @param bodyIds 柜体ID列表 + * @param groupId 加工组ID + * @param componentIds 部件ID列表 + * @param cadView 是否需要cad图纸内信息:cad_view_id、seal_left、seal_down、seal_right、seal_up + * @return + */ + IPage selectOrdersViewPlatesPage(@Param("page") IPage page, + @Param("orderIds") List orderIds, + @Param("bodyIds") Set bodyIds, + @Param("groupId") Long groupId, + @Param("componentIds") Set componentIds, + @Param("cadView") boolean cadView); + + /** + * 分页查询订单板件视图数据 * * @param page 分页参数 * @param orderId 订单ID @@ -198,24 +217,29 @@ public interface OrderItemMapper extends BaseMapperX { * @param cadView 是否需要cad图纸内信息:cad_view_id、seal_left、seal_down、seal_right、seal_up * @return */ - IPage selectBodyViewPlatesPage(@Param("page") IPage page, - @Param("orderId") Long orderId, - @Param("bodyIds") Set bodyIds, - @Param("groupId") Long groupId, - @Param("componentIds") Set componentIds, - @Param("cadView") boolean cadView); + IPage selectOrdersViewPartsPage(@Param("page") IPage page, + @Param("orderIds") List orderId, + @Param("bodyIds") Set bodyIds, + @Param("groupId") Long groupId, + @Param("componentIds") Set componentIds, + @Param("name") String name, + @Param("cadView") boolean cadView); /** - * 分页查询订单板件视图数据 + * 查询部件关联的板件ID列表 * - * @param page 分页参数 - * @param orderId 订单ID - * @param componentIds 部件ID列表 - * @param cadView 是否需要cad图纸内信息:cad_view_id、seal_left、seal_down、seal_right、seal_up + * @param componentIds + * @param orderIds * @return */ - IPage selectOrdersViewPlatesPage(@Param("page") IPage page, - @Param("orderIds") List orderId, - @Param("componentIds") Set componentIds, - @Param("cadView") boolean cadView); + List selectComponentCorrelationPlateIds(@Param("orderIds") List orderIds, @Param("componentIds") List componentIds); + + /** + * 查询部件关联的部件ID列表 + * + * @param componentIds + * @param orderIds + * @return + */ + List selectComponentCorrelationPartsIds(@Param("orderIds") List orderIds, @Param("componentIds") List componentIds); } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/enums/heapsplit/HeapSplitTaskStatusEnum.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/enums/heapsplit/HeapSplitTaskStatusEnum.java new file mode 100644 index 000000000..13d5b5e21 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/enums/heapsplit/HeapSplitTaskStatusEnum.java @@ -0,0 +1,26 @@ +package com.cf.imes.module.executor.enums.heapsplit; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * 分堆任务状态枚举 + * + * @author Gqr + * @since 2026/3/11 10:35 + */ +@RequiredArgsConstructor +@Getter +public enum HeapSplitTaskStatusEnum { + /** + * 未完成 + */ + UNFINISHED(0), + + /** + * 已完成 + */ + FINISHED(1); + + private final int status; +} \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/enums/pack/PackScanComponentCorrelationTypeEnum.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/enums/pack/PackScanComponentCorrelationTypeEnum.java new file mode 100644 index 000000000..cc9913ae6 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/enums/pack/PackScanComponentCorrelationTypeEnum.java @@ -0,0 +1,37 @@ +package com.cf.imes.module.executor.enums.pack; + +import com.cf.imes.framework.common.core.IntArrayValuable; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import java.util.Arrays; + +/** + * 分堆打包扫描部件关联类型 + * + * @author Gqr + * @since 2026/3/18 11:08 + */ +@RequiredArgsConstructor +@Getter +public enum PackScanComponentCorrelationTypeEnum implements IntArrayValuable { + /** + * 部件父级 + */ + PARENT(0), + + /** + * 部件顶级 + */ + TOP(1); + + private final Integer type; + + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PackScanComponentCorrelationTypeEnum::getType).toArray(); + + + @Override + public int[] array() { + return ARRAYS; + } +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListService.java index 0f2d95c4f..da59758ad 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListService.java @@ -2,8 +2,10 @@ package com.cf.imes.module.executor.service.assemblylist; import com.cf.imes.framework.common.pojo.PageResult; import com.cf.imes.module.executor.controller.admin.assemblylist.vo.AssemblyListComponentPageReqVO; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrdersTopComponentListReqVO; +import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPartPageRespVO; import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPlatePageRespVO; import java.util.List; @@ -28,14 +30,22 @@ public interface AssemblyListService { * @param reqVO * @return */ - PageResult getViewComponentPage(AssemblyListComponentPageReqVO reqVO); + PageResult getViewComponentPlatePage(AssemblyListComponentPageReqVO reqVO); + + /** + * 获取订单下配件视图分页列表 + * + * @param reqVO + * @return + */ + PageResult getViewComponentPartPage(AssemblyListComponentPageReqVO reqVO); /** * 获取部件和下级所有的板件视图列表 * @param reqVO * @return */ - List getViewComponentPlatesCadInfo(AssemblyListComponentPageReqVO reqVO); + OrdersViewCadViewInfoRespVO getViewComponentPlatesCadInfo(AssemblyListComponentPageReqVO reqVO); /** * 加工部件 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListServiceImpl.java index 054fe96f3..48652df27 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListServiceImpl.java @@ -18,13 +18,15 @@ import com.cf.imes.framework.common.pojo.PageResult; import com.cf.imes.framework.common.util.Assert.AssertUtils; import com.cf.imes.framework.common.util.json.JsonUtils; import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils; import com.cf.imes.module.executor.controller.admin.assemblylist.vo.AssemblyListComponentPageReqVO; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentTreeCompareVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrdersTopComponentListReqVO; +import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPartPageRespVO; import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPlatePageRespVO; -import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderBodyViewPlatesPageDO; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPartsPageDO; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPlatesPageDO; import com.cf.imes.module.executor.dal.dataobject.ordercomponent.OrderComponentDO; import com.cf.imes.module.executor.dal.mysql.order.OrderMapper; import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper; @@ -421,6 +423,16 @@ public class AssemblyListServiceImpl implements AssemblyListService { .eq(OrderComponentDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus()) .set(OrderComponentDO::getProcessStatus, targetProcessStatus) ); + } else { + // 结构不同说明不在不加工配置,更新加工状态 + orderComponentMapper.update(new LambdaUpdateWrapper() + .eq(OrderComponentDO::getId, id) + .eq(OrderComponentDO::getOrderId, orderId) + .eq(OrderComponentDO::getOrganId, organId) + .eq(OrderComponentDO::getProcessStatus, sourceProcessStatus) + .eq(OrderComponentDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus()) + .set(OrderComponentDO::getProcessStatus, targetProcessStatus) + ); } } else { @@ -435,6 +447,8 @@ public class AssemblyListServiceImpl implements AssemblyListService { } } + + /** * 点击加工入口方法 */ @@ -539,7 +553,7 @@ public class AssemblyListServiceImpl implements AssemblyListService { } @Override - public PageResult getViewComponentPage(AssemblyListComponentPageReqVO pageReqVO) { + public PageResult getViewComponentPlatePage(AssemblyListComponentPageReqVO pageReqVO) { Set componentIds = pageReqVO.getComponentIds(); if (CollUtil.isEmpty(componentIds)) { return new PageResult<>(Collections.emptyList(), 0L); @@ -581,10 +595,10 @@ public class AssemblyListServiceImpl implements AssemblyListService { .collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId)); // 分页查询板件 - PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - IPage pageRes = orderItemMapper.selectOrdersViewPlatesPage(page, orderIds, queryComponentIds, false); + PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + IPage pageRes = orderItemMapper.selectOrdersViewPlatesPage(page, orderIds, null, null, queryComponentIds, false); long total = pageRes.getTotal(); - List records = pageRes.getRecords(); + List records = pageRes.getRecords(); List resultList = new ArrayList<>(); if (total > 0) { @@ -600,11 +614,72 @@ public class AssemblyListServiceImpl implements AssemblyListService { } @Override - public List getViewComponentPlatesCadInfo(AssemblyListComponentPageReqVO pageReqVO) { - List emptyList = Collections.emptyList(); + public PageResult getViewComponentPartPage(AssemblyListComponentPageReqVO pageReqVO) { Set componentIds = pageReqVO.getComponentIds(); if (CollUtil.isEmpty(componentIds)) { - return emptyList; + return new PageResult<>(Collections.emptyList(), 0L); + } + + // 1、查询顶级 + List componentDOS = orderComponentMapper.selectByIds(componentIds); + if (CollUtil.isEmpty(componentDOS) || componentDOS.size() != componentIds.size()) { + throw new ServiceException(ORDER_COMPONENT_NOT_EXIST); + } + // 整理所在订单id列表 + List orderIds = componentDOS.stream() + .map(OrderComponentDO::getOrderId) + .distinct() + .toList(); + // 整理所在顶级配件id列表 + List topIds = componentDOS.stream() + .map(OrderComponentDO::getTopId) + .toList(); + + // 2、把下级部件id作为查询条件 + List orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX() + .in(OrderComponentDO::getTopId, topIds) + .in(OrderComponentDO::getOrderId, orderIds) + .eq(OrderComponentDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus()) + .select(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId, OrderComponentDO::getPid)); + + Set queryComponentIds = new HashSet<>(); + if (CollUtil.isNotEmpty(orderComponentDOS)) { + for (OrderComponentDO co : componentDOS) { + queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS)); + } + } else { + return new PageResult<>(); + } + // 整理出id和cadViewFileId的对应关系 + Map cadViewFileIdMap = orderComponentDOS.stream() + .filter(item -> item.getCadViewFileId() != null) + .collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId)); + + // 分页查询板件 + PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + IPage pageRes = orderItemMapper.selectOrdersViewPartsPage(page, orderIds, null, null, queryComponentIds, null, false); + long total = pageRes.getTotal(); + List records = pageRes.getRecords(); + + List resultList = new ArrayList<>(); + if (total > 0) { + resultList = records.stream().map(item -> { + OrderViewPartPageRespVO vo = new OrderViewPartPageRespVO(); + BeanUtil.copyProperties(item, vo); + + vo.setCadViewFileId(cadViewFileIdMap.get(item.getCompId())); + return vo; + }).toList(); + } + return new PageResult<>(resultList, total); + } + + @Override + public OrdersViewCadViewInfoRespVO getViewComponentPlatesCadInfo(AssemblyListComponentPageReqVO pageReqVO) { + OrdersViewCadViewInfoRespVO assemblyListComponentCadViewInfoRespVO = new OrdersViewCadViewInfoRespVO(); + Set componentIds = pageReqVO.getComponentIds(); + if (CollUtil.isEmpty(componentIds)) { + return assemblyListComponentCadViewInfoRespVO; } // 1、查询顶级 @@ -634,7 +709,7 @@ public class AssemblyListServiceImpl implements AssemblyListService { queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS)); } } else { - return emptyList; + return assemblyListComponentCadViewInfoRespVO; } // 整理出id和cadViewFileId的对应关系 @@ -643,13 +718,13 @@ public class AssemblyListServiceImpl implements AssemblyListService { .collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId)); // 查询所有板件的视图所需信息 - PageDTO page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); - IPage viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page, orderIds, queryComponentIds, true); - List records = viewPlatesPage.getRecords(); + PageDTO page1 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); + IPage viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page1, orderIds, null, null, queryComponentIds, true); + List plateRecords = viewPlatesPage.getRecords(); - List resultList = new ArrayList<>(); - if (CollUtil.isNotEmpty(records)) { - resultList = records.stream().map(item -> { + List plateResultList = new ArrayList<>(); + if (CollUtil.isNotEmpty(plateRecords)) { + plateResultList = plateRecords.stream().map(item -> { OrderViewPlatePageRespVO vo = new OrderViewPlatePageRespVO(); BeanUtil.copyProperties(item, vo); @@ -657,7 +732,26 @@ public class AssemblyListServiceImpl implements AssemblyListService { return vo; }).toList(); } - return resultList; + + // 查询所有配件的视图所需信息 + PageDTO page2 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); + IPage viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page2, orderIds, null, null, queryComponentIds, null, true); + List partRecords = viewPartsPage.getRecords(); + + List partResultList = new ArrayList<>(); + if (CollUtil.isNotEmpty(partRecords)) { + partResultList = partRecords.stream().map(item -> { + OrderViewPartPageRespVO vo = new OrderViewPartPageRespVO(); + BeanUtil.copyProperties(item, vo); + + vo.setCadViewFileId(cadViewFileIdMap.get(item.getCompId())); + return vo; + }).toList(); + } + + assemblyListComponentCadViewInfoRespVO.setPlates(plateResultList); + assemblyListComponentCadViewInfoRespVO.setParts(partResultList); + return assemblyListComponentCadViewInfoRespVO; } /** diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/heapsplit/HeapSplitTaskService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/heapsplit/HeapSplitTaskService.java new file mode 100644 index 000000000..563607ffa --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/heapsplit/HeapSplitTaskService.java @@ -0,0 +1,51 @@ +package com.cf.imes.module.executor.service.heapsplit; + +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskListRespVO; +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskRespVO; +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskSaveReqVO; + +import java.util.List; + +/** + * 分堆任务 Service 接口 + * + * @author Gqr + * @since 2026/3/10 17:52 + */ +public interface HeapSplitTaskService { + /** + * 保存分堆任务 + * + * @param reqVO + */ + void saveHeapsplitTask(HeapSplitTaskSaveReqVO reqVO); + + /** + * 获取分堆任务列表 + * + * @return + */ + List getHeapsplitTaskList(String name, Integer status); + + /** + * 删除分堆任务 + * + * @param ids + */ + void deleteHeapsplitTask(List ids); + + /** + * 获取分堆任务内容 + * + * @param id + * @return + */ + HeapSplitTaskRespVO getHeapsplitTask(Long id); + + /** + * 重启分堆任务 + * + * @param id + */ + void restartHeapsplitTask(Long id); +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/heapsplit/HeapSplitTaskServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/heapsplit/HeapSplitTaskServiceImpl.java new file mode 100644 index 000000000..ff66ea9b0 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/heapsplit/HeapSplitTaskServiceImpl.java @@ -0,0 +1,275 @@ +package com.cf.imes.module.executor.service.heapsplit; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.cf.imes.framework.common.enums.DeletedCodeEnum; +import com.cf.imes.framework.common.enums.OrderItemTypeEnum; +import com.cf.imes.framework.common.exception.ServiceException; +import com.cf.imes.framework.common.util.Assert.AssertUtils; +import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils; +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskListRespVO; +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskRespVO; +import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitTaskSaveReqVO; +import com.cf.imes.module.executor.dal.dataobject.heapsplit.HeapSplitTaskDO; +import com.cf.imes.module.executor.dal.dataobject.heapsplit.HeapSplitTaskDetailDO; +import com.cf.imes.module.executor.dal.mysql.heapsplit.HeapSplitTaskDetailMapper; +import com.cf.imes.module.executor.dal.mysql.heapsplit.HeapSplitTaskMapper; +import com.cf.imes.module.executor.enums.heapsplit.HeapSplitTaskStatusEnum; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +import static com.cf.imes.module.executor.enums.ErrorCodeConstants.HEAP_SPLIT_NEED_RESTART; +import static com.cf.imes.module.executor.enums.ErrorCodeConstants.HEAP_SPLIT_NO_NEED_RESTART; +import static com.cf.imes.module.executor.enums.ErrorCodeConstants.HEAP_SPLIT_TASK_NAME_EXIST; +import static com.cf.imes.module.executor.enums.ErrorCodeConstants.HEAP_SPLIT_TASK_NOT_EXIST; + +/** + * 分堆任务 ServiceImpl 接口实现类 + * + * @author Gqr + * @since 2026/3/10 17:53 + */ +@Service +public class HeapSplitTaskServiceImpl implements HeapSplitTaskService { + @Resource + private HeapSplitTaskMapper heapSplitTaskMapper; + + @Resource + private HeapSplitTaskDetailMapper heapSplitTaskDetailMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveHeapsplitTask(HeapSplitTaskSaveReqVO reqVO) { + Long taskId = reqVO.getId(); + if (ObjectUtil.isNull(taskId)) { + createHeapSplitTask(reqVO); + } else { + updateHeapSplitTask(reqVO); + } + } + + /** + * 创建分堆任务 + * + * @param reqVO + */ + public void createHeapSplitTask(HeapSplitTaskSaveReqVO reqVO) { + String taskName = reqVO.getName(); + // 1、校验任务名称 + validTaskName(taskName, null); + + // 2、创建任务 + int splittedPlateNum = reqVO.getSplittedPlateNum(); + int totalPlateNum = reqVO.getTotalPlateNum(); + int splittedPartNum = reqVO.getSplittedPartNum(); + int totalPartNum = reqVO.getTotalPartNum(); + // 所有板件&配件都分堆了就认为完成了 + boolean finish = (splittedPlateNum == totalPlateNum) && (splittedPartNum == totalPartNum); + + HeapSplitTaskDO heapSplitTaskDO = HeapSplitTaskDO.builder() + .name(taskName) + .splittedPlateNum(splittedPlateNum) + .unsplitPlateNum(reqVO.getUnsplitPlateNum()) + .totalPlateNum(totalPlateNum) + .splittedPartNum(splittedPartNum) + .unsplitPartNum(reqVO.getUnsplitPartNum()) + .totalPartNum(totalPartNum) + .status(finish ? HeapSplitTaskStatusEnum.FINISHED.getStatus() : HeapSplitTaskStatusEnum.UNFINISHED.getStatus()) + .orderIds(reqVO.getOrderIds()) + .build(); + heapSplitTaskMapper.insert(heapSplitTaskDO); + + // 3、插入任务明细,拆分每一千条插入一次 + batchInsertPlateDetail(heapSplitTaskDO.getId(), reqVO.getPlateIds()); + batchInsertPartDetail(heapSplitTaskDO.getId(), reqVO.getPartIds()); + + } + + /** + * 更新分堆任务 + * + * @param reqVO + */ + public void updateHeapSplitTask(HeapSplitTaskSaveReqVO reqVO) { + Long id = reqVO.getId(); + // 1、校验任务 + HeapSplitTaskDO heapSplitTaskDO = getById(id); + + // 2、校验任务名称 + validTaskName(reqVO.getName(), heapSplitTaskDO.getId()); + + // 3、更新完成状态 + int finishedStatus = HeapSplitTaskStatusEnum.FINISHED.getStatus(); + int unfinishedStatus = HeapSplitTaskStatusEnum.UNFINISHED.getStatus(); + if (ObjectUtil.equals(finishedStatus, heapSplitTaskDO.getStatus())) { + throw new ServiceException(HEAP_SPLIT_NEED_RESTART); + } + int splittedPlateNum = reqVO.getSplittedPlateNum(); + int totalPlateNum = reqVO.getTotalPlateNum(); + int splittedPartNum = reqVO.getSplittedPartNum(); + int totalPartNum = reqVO.getTotalPartNum(); + // 所有板件&配件都分堆了就认为完成了 + boolean finish = (splittedPlateNum == totalPlateNum) && (splittedPartNum == totalPartNum); + // 状态有所变化更新任务状态 + if(finish) { + heapSplitTaskMapper.update(new LambdaUpdateWrapper() + .eq(HeapSplitTaskDO::getId, id) + .eq(HeapSplitTaskDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus()) + .eq(HeapSplitTaskDO::getStatus, unfinishedStatus) + .set(HeapSplitTaskDO::getStatus, finishedStatus) + ); + } + + // 4、删除旧任务关联的明细 + // 循环删除,直到没有满足条件的数据 + for (int i = 0; i < Short.MAX_VALUE; i++) { + int deleteCount = heapSplitTaskDetailMapper.deleteByLimit(id, 1000); + // 达到删除预期条数,说明到底了 + if (deleteCount < 1000) { + break; + } + } + + // 5、插入任务明细 + batchInsertPlateDetail(heapSplitTaskDO.getId(), reqVO.getPlateIds()); + batchInsertPartDetail(heapSplitTaskDO.getId(), reqVO.getPartIds()); + } + + /** + * 查询 + * + * @param id + * @return + */ + private HeapSplitTaskDO getById(Long id) { + HeapSplitTaskDO heapSplitTaskDO = heapSplitTaskMapper.selectById(id); + if (ObjectUtil.isNull(heapSplitTaskDO)) { + throw new ServiceException(HEAP_SPLIT_TASK_NOT_EXIST); + } + return heapSplitTaskDO; + } + + /** + * 校验任务名是否唯一 + * + * @param name + * @param id + */ + private void validTaskName(String name, Long id) { + List heapSplitTaskDOList = heapSplitTaskMapper.selectList(new LambdaQueryWrapperX() + .eq(HeapSplitTaskDO::getName, name) + .eq(HeapSplitTaskDO::getOrganId, SecurityFrameworkUtils.getUserOrganId()) + .neIfPresent(HeapSplitTaskDO::getId, id)); + + if (CollUtil.isNotEmpty(heapSplitTaskDOList)) { + throw new ServiceException(HEAP_SPLIT_TASK_NAME_EXIST); + } + } + + /** + * 批量插入板件任务明细 + * + * @param taskId + * @param plateIds + */ + public void batchInsertPlateDetail(Long taskId, List plateIds) { + List> platePartitions = CollUtil.split(plateIds, 1000); + + for (List batch : platePartitions) { + List list = new ArrayList<>(batch.size()); + for (Long plateId : batch) { + HeapSplitTaskDetailDO heapSplitTaskPlateDetailDO = HeapSplitTaskDetailDO + .builder() + .taskId(taskId) + .detailId(plateId) + .type(OrderItemTypeEnum.PLATE.getType()) + .build(); + list.add(heapSplitTaskPlateDetailDO); + } + heapSplitTaskDetailMapper.insertBatchSomeColumn(list); + } + } + + /** + * 批量插入配件任务明细 + * + * @param taskId + * @param partIds + */ + public void batchInsertPartDetail(Long taskId, List partIds) { + List> partPartitions = CollUtil.split(partIds, 1000); + + for (List batch : partPartitions) { + List list = new ArrayList<>(batch.size()); + for (Long partId : batch) { + HeapSplitTaskDetailDO heapSplitTaskPartDetailDO = HeapSplitTaskDetailDO + .builder() + .taskId(taskId) + .detailId(partId) + .type(OrderItemTypeEnum.PARTS.getType()) + .build(); + list.add(heapSplitTaskPartDetailDO); + } + heapSplitTaskDetailMapper.insertBatchSomeColumn(list); + } + } + + @Override + public List getHeapsplitTaskList(String name, Integer status) { + return BeanUtil.copyToList(heapSplitTaskMapper.selectList(new LambdaQueryWrapperX() + .likeIfPresent(HeapSplitTaskDO::getName, name) + .eqIfPresent(HeapSplitTaskDO::getStatus, status)), HeapSplitTaskListRespVO.class); + } + + @Override + public void deleteHeapsplitTask(List ids) { + List idsToDelete = ids.stream().distinct().toList(); + + Long idsCount = heapSplitTaskMapper.selectCount(new LambdaQueryWrapper() + .in(HeapSplitTaskDO::getId, idsToDelete)); + if (idsToDelete.size() != idsCount) { + throw new ServiceException(HEAP_SPLIT_TASK_NOT_EXIST); + } + + heapSplitTaskMapper.deleteByIds(ids); + } + + @Override + public HeapSplitTaskRespVO getHeapsplitTask(Long id) { + HeapSplitTaskDO heapSplitTaskDO = getById(id); + + AssertUtils.equals(HeapSplitTaskStatusEnum.FINISHED.getStatus(), heapSplitTaskDO.getStatus(), HEAP_SPLIT_NEED_RESTART); + + // 查询任务关联的任务明细 + List heapSplitTaskDetailDOS = heapSplitTaskDetailMapper.selectList(new LambdaQueryWrapper() + .eq(HeapSplitTaskDetailDO::getTaskId, id)); + + return HeapSplitTaskRespVO.builder() + .id(id) + .orderIds(heapSplitTaskDO.getOrderIds()) + .plateIds(heapSplitTaskDetailDOS.stream().filter(detail -> detail.getType().equals(OrderItemTypeEnum.PLATE.getType())).map(HeapSplitTaskDetailDO::getDetailId).toList()) + .partIds(heapSplitTaskDetailDOS.stream().filter(detail -> detail.getType().equals(OrderItemTypeEnum.PARTS.getType())).map(HeapSplitTaskDetailDO::getDetailId).toList()) + .build(); + } + + @Override + public void restartHeapsplitTask(Long id) { + HeapSplitTaskDO heapSplitTaskDO = getById(id); + + AssertUtils.equals(HeapSplitTaskStatusEnum.UNFINISHED.getStatus(), heapSplitTaskDO.getStatus(), HEAP_SPLIT_NO_NEED_RESTART); + + heapSplitTaskMapper.update(new LambdaUpdateWrapper() + .eq(HeapSplitTaskDO::getId, id) + .eq(HeapSplitTaskDO::getStatus, HeapSplitTaskStatusEnum.FINISHED.getStatus()) + .set(HeapSplitTaskDO::getStatus, HeapSplitTaskStatusEnum.UNFINISHED.getStatus()) + ); + } +} \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackService.java index 76aac7946..807fd2dec 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackService.java @@ -79,4 +79,17 @@ public interface PackService { // 保存优化后的预打包信息 void saveOptimizeInfo(PrePackReqVO reqVO); + /** + * 校验打包状态:已打包的不允许扫描关联 + * @param orderId + */ + void validOrderPackageStatus(Long orderId); + + /** + * 获取部件关联板件和配件id + * + * @param reqVO + * @return + */ + List getComponentCorrelation(PackScanComponentCorrelationReqVO reqVO); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java index b06d4f2ad..12425325b 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java @@ -1,7 +1,7 @@ package com.cf.imes.module.executor.service.manage.pack; - import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; import com.cf.imes.framework.common.enums.*; @@ -30,6 +30,12 @@ import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper; import com.cf.imes.module.executor.dal.mysql.pack.OrderPackageMapper; import com.cf.imes.module.executor.dal.mysql.pack.OrderPrepackagedMapper; import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper; +import com.cf.imes.module.executor.enums.pack.PackScanComponentCorrelationTypeEnum; +import com.cf.imes.module.executor.service.order.OrderService; +import com.cf.imes.module.executor.service.orderParts.OrderPartsService; +import com.cf.imes.module.executor.service.ordercomponent.OrderComponentService; +import com.cf.imes.module.executor.service.orderitem.OrderItemService; +import com.cf.imes.module.executor.service.plate.PlateService; import com.cf.imes.module.system.api.setting.SettingApi; import com.cf.imes.module.system.api.setting.dto.PackageConfigDTO; import com.fasterxml.jackson.core.type.TypeReference; @@ -53,12 +59,16 @@ import java.util.Objects; import static com.cf.imes.framework.common.util.string.SearchUtil.insertSeparator; import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.NO_PRODUCTION_ORDER_INFORMATION_AVAILABLE; +import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_ALREADY_PACKAGED; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_DATE_ERROR; +import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_NOT_EXISTS; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_NO_DATA_ERROR; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_PACK_DATA_ERROR; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_PACK_DATA_NULL_ERROR; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_PACK_ERROR; +import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_PARTS_NOT_EXISTS; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.PART_PACK_DATA_ERROR; +import static com.cf.imes.module.executor.enums.ErrorCodeConstants.PLATE_NOT_EXISTS; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.THE_CURRENT_PACKAGE_TYPE_IS_INCORRECT; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_PLATE_ERROR; import static com.cf.imes.module.system.enums.ErrorCodeConstants.CURRENTLY_NO_CONFIGURATION_AVAILABLE; @@ -97,6 +107,20 @@ public class PackServiceImpl implements PackService { @Resource private OrderPlanApi orderPlanApi; + @Resource + private OrderService orderService; + + @Resource + private PlateService plateService; + + @Resource + private OrderPartsService orderPartsService; + + @Resource + private OrderItemService orderItemService; + + @Resource + private OrderComponentService orderComponentService; // 打包分页查询 @Override @@ -1021,5 +1045,64 @@ public class PackServiceImpl implements PackService { } + @Override + public void validOrderPackageStatus(Long orderId) { + OrderDO order = orderService.getOrder(orderId); + AssertUtils.notEmpty(order, ORDER_NOT_EXISTS); + // 已经打包的提示 + Integer packaged = order.getPackaged(); + AssertUtils.equals(OrderPackageStatusEnum.PACKAGED.getStatus(), packaged, ORDER_ALREADY_PACKAGED); + } + + @Override + public List getComponentCorrelation(PackScanComponentCorrelationReqVO reqVO) { + Long id = reqVO.getId(); + Integer itemType = reqVO.getItemType(); + Integer type = reqVO.getType(); + List orderIds = reqVO.getOrderIds(); + // 没有归属部件返回自己本身 + List self = List.of(id); + + Long compId; + if (com.cf.imes.module.executor.enums.OrderItemTypeEnum.PLATE_ITEM.getStatus().equals(itemType)) { + // 板件 + PlateDO plate = plateService.getPlate(id); + AssertUtils.notEmpty(plate, PLATE_NOT_EXISTS); + // 查询关联部件id + compId = orderItemService.getPlateItemCompId(id); + } else { + // 配件 + OrderPartsDO part = orderPartsService.getPart(id); + AssertUtils.notEmpty(part, ORDER_PARTS_NOT_EXISTS); + // 查询关联部件id + compId = orderItemService.getPartItemCompId(id); + } + + if (ObjectUtil.isNull(compId)) { + // 没有归属部件返回自己本身 + return self; + } + + List componentIdList; + if (PackScanComponentCorrelationTypeEnum.PARENT.getType().equals(type)) { + // 部件父级 + componentIdList = orderComponentService.getChildComponentIdsOnMyParent(compId); + } else { + // 部件顶级 + componentIdList = orderComponentService.getChildComponentIdsOnTopId(compId); + } + + if (CollUtil.isEmpty(componentIdList)) { + // 没有归属部件返回自己本身 + return self; + } + + List componentIdsCorrelationItemIds = orderItemService.getComponentIdsCorrelationItemIds(orderIds, componentIdList); + if (CollUtil.isEmpty(componentIdsCorrelationItemIds)) { + return self; + } + + return componentIdsCorrelationItemIds; + } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderParts/OrderPartsService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderParts/OrderPartsService.java index 5e646f76d..66f0a5570 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderParts/OrderPartsService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderParts/OrderPartsService.java @@ -3,11 +3,9 @@ package com.cf.imes.module.executor.service.orderParts; import java.util.*; import jakarta.validation.*; import com.cf.imes.module.executor.controller.admin.orderParts.vo.*; -import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO; import com.cf.imes.module.executor.controller.admin.plate.vo.PlateTermsPageReqVO; import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO; import com.cf.imes.framework.common.pojo.PageResult; -import com.cf.imes.framework.common.pojo.PageParam; /** * 订单配件表 order_parts_{N} Service 接口 @@ -16,6 +14,14 @@ import com.cf.imes.framework.common.pojo.PageParam; */ public interface OrderPartsService { + /** + * 查询配件 + * + * @param id + * @return + */ + OrderPartsDO getPart(Long id); + /** * 创建订单配件表 order_parts_{N} * diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderParts/OrderPartsServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderParts/OrderPartsServiceImpl.java index 572eac448..b44d44c8e 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderParts/OrderPartsServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderParts/OrderPartsServiceImpl.java @@ -39,6 +39,11 @@ public class OrderPartsServiceImpl implements OrderPartsService { @Resource private OrderPartsMapper orderPartsMapper; + @Override + public OrderPartsDO getPart(Long id) { + return orderPartsMapper.selectById(id); + } + @Override public Long createOrderParts(OrderPartsSaveReqVO createReqVO) { // 插入 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentService.java index ad0f5d668..9569ad8eb 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentService.java @@ -1,10 +1,11 @@ package com.cf.imes.module.executor.service.ordercomponent; import com.cf.imes.framework.common.pojo.PageResult; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentPageReqVO; -import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrdersTopComponentListReqVO; +import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPartPageRespVO; import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPlatePageRespVO; import java.util.List; @@ -24,14 +25,6 @@ public interface OrderComponentService { */ List getOrderComponentList(OrderDetailComponentListReqVO reqVO); - /** - * 查询订单顶级部件列表 - * - * @param reqVO - * @return - */ - List getOrderTopComponentList(OrdersTopComponentListReqVO reqVO); - /** * 获取节点的顶级节点下所有节点 * @@ -42,17 +35,27 @@ public interface OrderComponentService { /** * 获取部件下板件视图分页列表 + * * @param reqVO * @return */ - PageResult getViewComponentPage(OrderDetailComponentPageReqVO reqVO); + PageResult getViewComponentPlatesPage(OrderDetailComponentPageReqVO reqVO); + + /** + * 获取部件下配件分页列表 + * + * @param reqVO + * @return + */ + PageResult getViewComponentPartsPage(OrderDetailComponentPageReqVO reqVO); /** * 获取部件和下级所有的板件视图列表 + * * @param reqVO * @return */ - List getViewComponentPlatesCadInfo(OrderDetailComponentPageReqVO reqVO); + OrdersViewCadViewInfoRespVO getViewComponentCadInfo(OrderDetailComponentPageReqVO reqVO); /** * 删除部件 @@ -84,4 +87,20 @@ public interface OrderComponentService { * @return */ List getChildComponentListOnTopId(Long id); + + /** + * 查询部件归属的顶级部件的所有子部件id列表 + * + * @param id + * @return + */ + List getChildComponentIdsOnTopId(Long id); + + /** + * 查询部件归属的父部件的所有子部件id列表 + * + * @param id + * @return + */ + List getChildComponentIdsOnMyParent(Long id); } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentServiceImpl.java index c6f7c0c7f..dd34645c8 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentServiceImpl.java @@ -2,6 +2,7 @@ package com.cf.imes.module.executor.service.ordercomponent; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -14,19 +15,21 @@ import com.cf.imes.framework.common.pojo.PageResult; import com.cf.imes.framework.common.util.Assert.AssertUtils; import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO; import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentPageReqVO; -import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrdersTopComponentListReqVO; +import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPartPageRespVO; import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPlatePageRespVO; import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO; import com.cf.imes.module.executor.dal.dataobject.goods.OrderGoodsPlateNumAndAreaDO; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPartsPageDO; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPlatesPageDO; import com.cf.imes.module.executor.dal.dataobject.ordercomponent.OrderComponentDO; import com.cf.imes.module.executor.dal.dataobject.order.OrderDO; import com.cf.imes.module.executor.dal.dataobject.order.OrderPlateNumAndAreaDO; import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO; import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyPlateNumAndAreaDO; -import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderBodyViewPlatesPageDO; import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper; import com.cf.imes.module.executor.dal.mysql.order.OrderMapper; import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper; @@ -126,20 +129,6 @@ public class OrderComponentServiceImpl implements OrderComponentService { return BeanUtil.copyToList(uniqueList, OrderComponentRespVO.class); } - @Override - public List getOrderTopComponentList(OrdersTopComponentListReqVO reqVO) { - List orderIds = reqVO.getOrderIds(); - if (CollUtil.isEmpty(orderIds)) { - return Collections.emptyList(); - } - List orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX() - .in(OrderComponentDO::getOrderId, orderIds) - .eq(OrderComponentDO::getPid, OrderComponentDO.PARENT_ID_ROOT) - .likeIfPresent(OrderComponentDO::getName, reqVO.getName()) - ); - return BeanUtil.copyToList(orderComponentDOS, OrderComponentRespVO.class); - } - @Override public List getComponentListOnTopId(OrderDetailComponentListReqVO reqVO) { Set componentIds = reqVO.getComponentIds(); @@ -185,7 +174,7 @@ public class OrderComponentServiceImpl implements OrderComponentService { } @Override - public PageResult getViewComponentPage(OrderDetailComponentPageReqVO pageReqVO) { + public PageResult getViewComponentPlatesPage(OrderDetailComponentPageReqVO pageReqVO) { Set componentIds = pageReqVO.getComponentIds(); if (CollUtil.isEmpty(componentIds)) { return new PageResult<>(Collections.emptyList(), 0L); @@ -225,11 +214,11 @@ public class OrderComponentServiceImpl implements OrderComponentService { .collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId)); // 分页查询板件 - PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - IPage pageRes = orderItemMapper.selectBodyViewPlatesPage(page, orderId, null, + PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + IPage pageRes = orderItemMapper.selectOrdersViewPlatesPage(page, List.of(orderId), null, null, queryComponentIds, false); long total = pageRes.getTotal(); - List records = pageRes.getRecords(); + List records = pageRes.getRecords(); List resultList = new ArrayList<>(); if(total > 0) { @@ -245,7 +234,68 @@ public class OrderComponentServiceImpl implements OrderComponentService { } @Override - public List getViewComponentPlatesCadInfo(OrderDetailComponentPageReqVO pageReqVO) { + public PageResult getViewComponentPartsPage(OrderDetailComponentPageReqVO pageReqVO) { + Set componentIds = pageReqVO.getComponentIds(); + if (CollUtil.isEmpty(componentIds)) { + return new PageResult<>(Collections.emptyList(), 0L); + } + // 校验订单 + Long orderId = pageReqVO.getOrderId(); + OrderDO orderDO = orderMapper.selectById(orderId); + AssertUtils.notEmpty(orderDO, ORDER_NOT_EXISTS); + + // 1、查询顶级 + List componentDOS = orderComponentMapper.selectByIds(componentIds); + if (CollUtil.isEmpty(componentDOS) || componentDOS.size() != componentIds.size()) { + throw new ServiceException(ORDER_COMPONENT_NOT_EXIST); + } + List topIds = componentDOS.stream() + .map(OrderComponentDO::getTopId) + .toList(); + + // 2、把下级部件id作为查询条件 + List orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX() + .in(OrderComponentDO::getTopId, topIds) + .eq(OrderComponentDO::getOrderId, orderId) + .eqIfPresent(OrderComponentDO::getDeleted, pageReqVO.isDeleted()) + .select(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId, OrderComponentDO::getPid)); + + Set queryComponentIds = new HashSet<>(); + if (CollUtil.isNotEmpty(orderComponentDOS)) { + for (OrderComponentDO co : componentDOS) { + queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS)); + } + } else { + return new PageResult<>(); + } + // 整理出id和cadViewFileId的对应关系 + Map cadViewFileIdMap = orderComponentDOS.stream() + .filter(item -> item.getCadViewFileId() != null) + .collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId)); + + // 分页查询板件 + PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + IPage pageRes = orderItemMapper.selectOrdersViewPartsPage(page, List.of(orderId), null, + null, queryComponentIds, null, false); + long total = pageRes.getTotal(); + List records = pageRes.getRecords(); + + List resultList = new ArrayList<>(); + if (total > 0) { + resultList = records.stream().map(item -> { + OrderViewPartPageRespVO vo = new OrderViewPartPageRespVO(); + BeanUtil.copyProperties(item, vo); + + vo.setCadViewFileId(cadViewFileIdMap.get(item.getCompId())); + return vo; + }).toList(); + } + return new PageResult<>(resultList, total); + } + + @Override + public OrdersViewCadViewInfoRespVO getViewComponentCadInfo(OrderDetailComponentPageReqVO pageReqVO) { + OrdersViewCadViewInfoRespVO ordersViewCadViewInfoRespVO = new OrdersViewCadViewInfoRespVO(); Set componentIds = pageReqVO.getComponentIds(); Long orderId = pageReqVO.getOrderId(); @@ -270,7 +320,7 @@ public class OrderComponentServiceImpl implements OrderComponentService { queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS)); } } else { - return Collections.emptyList(); + return ordersViewCadViewInfoRespVO; } // 整理出id和cadViewFileId的对应关系 @@ -279,14 +329,14 @@ public class OrderComponentServiceImpl implements OrderComponentService { .collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId)); // 查询所有板件的视图所需信息 - PageDTO page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); - IPage viewPlatesPage = orderItemMapper.selectBodyViewPlatesPage(page, orderId, null, + PageDTO page1 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); + IPage viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page1, List.of(orderId), null, null, queryComponentIds, true); - List records = viewPlatesPage.getRecords(); + List plateRecords = viewPlatesPage.getRecords(); - List resultList = new ArrayList<>(); - if(CollUtil.isNotEmpty(records)) { - resultList = records.stream().map(item -> { + List plateResult = new ArrayList<>(); + if(CollUtil.isNotEmpty(plateRecords)) { + plateResult = plateRecords.stream().map(item -> { OrderViewPlatePageRespVO vo = new OrderViewPlatePageRespVO(); BeanUtil.copyProperties(item, vo); @@ -294,7 +344,27 @@ public class OrderComponentServiceImpl implements OrderComponentService { return vo; }).toList(); } - return resultList; + + // 查询所有配件的视图所需信息 + PageDTO page2 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); + IPage viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page2, List.of(orderId), null, + null, queryComponentIds, null, true); + List partRecords = viewPartsPage.getRecords(); + + List partResult = new ArrayList<>(); + if (CollUtil.isNotEmpty(plateRecords)) { + partResult = partRecords.stream().map(item -> { + OrderViewPartPageRespVO vo = new OrderViewPartPageRespVO(); + BeanUtil.copyProperties(item, vo); + + vo.setCadViewFileId(cadViewFileIdMap.get(item.getCompId())); + return vo; + }).toList(); + } + + ordersViewCadViewInfoRespVO.setPlates(plateResult); + ordersViewCadViewInfoRespVO.setParts(partResult); + return ordersViewCadViewInfoRespVO; } @Override @@ -604,4 +674,36 @@ public class OrderComponentServiceImpl implements OrderComponentService { ); return BeanUtil.copyToList(orderComponentDOS, OrderComponentRespVO.class); } + + @Override + public List getChildComponentIdsOnTopId(Long id) { + List result = new ArrayList<>(); + OrderComponentDO componentDO = orderComponentMapper.selectById(id); + if (ObjectUtil.isNotNull(componentDO)) { + // 查询顶级下所有部件 + result = orderComponentMapper.selectList(new LambdaQueryWrapperX() + .eq(OrderComponentDO::getTopId, componentDO.getTopId()) + .eq(OrderComponentDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus()) + .select(OrderComponentDO::getId) + ).stream().map(OrderComponentDO::getId).toList(); + } + return result; + } + + @Override + public List getChildComponentIdsOnMyParent(Long id) { + List result = new ArrayList<>(); + OrderComponentDO componentDO = orderComponentMapper.selectById(id); + if (ObjectUtil.isNotNull(componentDO)) { + // 查询顶级下所有部件 + List componentListOnTop = orderComponentMapper.selectList(new LambdaQueryWrapperX() + .eq(OrderComponentDO::getTopId, componentDO.getTopId()) + .eq(OrderComponentDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus()) + .select(OrderComponentDO::getId, OrderComponentDO::getPid) + ); + + return getChildrenIds(componentDO, componentListOnTop).stream().toList(); + } + return result; + } } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemService.java new file mode 100644 index 000000000..f932950bd --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemService.java @@ -0,0 +1,36 @@ +package com.cf.imes.module.executor.service.orderitem; + +import java.util.List; + +/** + * + * 订单明细 Service + * + * @author Gqr + * @since 2026/3/18 11:29 + */ +public interface OrderItemService { + /** + * 查询板件订单明细关联的部件id + * + * @param plateId + * @return + */ + Long getPlateItemCompId(Long plateId); + + /** + * 查询配件订单明细关联的部件id + * + * @param partId + * @return + */ + Long getPartItemCompId(Long partId); + + /** + * + * @param componentIds + * @param orderIds + * @return + */ + List getComponentIdsCorrelationItemIds(List orderIds, List componentIds); +} \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemServiceImpl.java new file mode 100644 index 000000000..d674fba3d --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemServiceImpl.java @@ -0,0 +1,56 @@ +package com.cf.imes.module.executor.service.orderitem; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO; +import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 订单明细服务实现类 ServiceImpl + * + * @author Gqr + * @since 2026/3/18 11:29 + */ +@Service +public class OrderItemServiceImpl implements OrderItemService { + @Resource + private OrderItemMapper orderItemMapper; + + @Override + public Long getPlateItemCompId(Long id) { + List plateItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper() + .eq(OrderItemDO::getPlateId, id) + .select(OrderItemDO::getCompId)); + if (CollUtil.isNotEmpty(plateItemDOS)) { + return plateItemDOS.get(0).getCompId(); + } + return null; + } + + @Override + public Long getPartItemCompId(Long partId) { + List partItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper() + .eq(OrderItemDO::getPartsId, partId)); + if (CollUtil.isNotEmpty(partItemDOS)) { + return partItemDOS.get(0).getCompId(); + } + return null; + } + + @Override + public List getComponentIdsCorrelationItemIds(List orderIds, List componentIds) { + List resultList = new ArrayList<>(); + if (CollUtil.isEmpty(componentIds)) { + return resultList; + } + // 查询关联的板件和配件id + resultList.addAll(orderItemMapper.selectComponentCorrelationPlateIds(orderIds, componentIds)); + resultList.addAll(orderItemMapper.selectComponentCorrelationPartsIds(orderIds, componentIds)); + return resultList; + } +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateService.java index 650502ddc..13b27d0de 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateService.java @@ -3,6 +3,7 @@ package com.cf.imes.module.executor.service.plate; import com.cf.imes.framework.common.pojo.PageResult; import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList; import com.cf.imes.module.executor.controller.admin.plate.vo.*; import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO; @@ -19,6 +20,14 @@ import java.util.Set; */ public interface PlateService { + /** + * 查询板件 + * + * @param plateId + * @return + */ + PlateDO getPlate(Long plateId); + /** * 创建订单板件 * @@ -103,11 +112,29 @@ public interface PlateService { */ PageResult getBodyViewPlatesPage(OrderCadViewPlatePageReqVO orderBodyPageRespVO); + /** - * 根据板件id获取柜体下所有板件cad视图所需信息 + * 获取柜体配件视图分页列表 * * @param orderBodyPageRespVO * @return */ - List getBodyViewPlatesCadInfo(OrderCadViewPlatePageReqVO orderBodyPageRespVO); + PageResult getBodyViewPartsPage(OrderCadViewPlatePageReqVO orderBodyPageRespVO); + + + /** + * 根据板件id获取柜体下所有板件+配件cad视图所需信息 + * + * @param orderBodyPageRespVO + * @return + */ + OrdersViewCadViewInfoRespVO getBodyViewCadInfo(OrderCadViewPlatePageReqVO orderBodyPageRespVO); + + /** + * 根据板件id获取柜体下所有配件cad视图所需信息 + * + * @param orderBodyPageRespVO + * @return + */ + OrdersViewCadViewInfoRespVO getBodyViewPartCadInfo(OrderCadViewPlatePageReqVO orderBodyPageRespVO); } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java index 665a38da8..08b7e7ce2 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java @@ -25,14 +25,16 @@ import com.cf.imes.framework.mybatis.core.query.QueryWrapperX; import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlanPlateNumAndAreaRespVO; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO; import com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp; import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList; import com.cf.imes.module.executor.controller.admin.plate.vo.*; import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO; import com.cf.imes.module.executor.dal.dataobject.order.OrderDO; import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO; -import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderBodyViewPlatesPageDO; import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPartsPageDO; +import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPlatesPageDO; import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO; import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO; import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO; @@ -118,6 +120,11 @@ public class PlateServiceImpl implements PlateService { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + @Override + public PlateDO getPlate(Long plateId) { + return plateMapper.selectById(plateId); + } + @Override public Long createPlate(PlateSaveReqVO createReqVO) { // 插入 @@ -824,11 +831,11 @@ public class PlateServiceImpl implements PlateService { .filter(item -> item.getCadViewFileId() != null) .collect(Collectors.toMap(OrderBodyDO::getId, OrderBodyDO::getCadViewFileId)); - PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - IPage pageRes = orderItemMapper.selectBodyViewPlatesPage(page, pageReqVO.getOrderId(), + PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + IPage pageRes = orderItemMapper.selectOrdersViewPlatesPage(page, List.of(pageReqVO.getOrderId()), bodyIds, pageReqVO.getGroupId(), null, false); - List records = pageRes.getRecords(); + List records = pageRes.getRecords(); // cad图纸id赋到每块板上 if(CollUtil.isNotEmpty(records)) { records.forEach(item -> item.setCadViewFileId(bodyIdAndCadViewFileIdMap.get(item.getBodyId()))); @@ -837,7 +844,36 @@ public class PlateServiceImpl implements PlateService { } @Override - public List getBodyViewPlatesCadInfo(OrderCadViewPlatePageReqVO reqVO) { + public PageResult getBodyViewPartsPage(OrderCadViewPlatePageReqVO pageReqVO) { + Set bodyIds = pageReqVO.getBodyIds(); + if (CollUtil.isEmpty(bodyIds)) { + return new PageResult<>(Collections.emptyList(), 0L); + } + List orderBodyDOList = orderBodyMapper.selectByIds(bodyIds); + if (CollUtil.isEmpty(orderBodyDOList)) { + throw new ServiceException(ORDER_BODY_NOT_EXISTS); + } + + // 整理出body_id和cad图纸id的关系 + Map bodyIdAndCadViewFileIdMap = orderBodyDOList.stream() + .filter(item -> item.getCadViewFileId() != null) + .collect(Collectors.toMap(OrderBodyDO::getId, OrderBodyDO::getCadViewFileId)); + + PageDTO page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + IPage pageRes = orderItemMapper.selectOrdersViewPartsPage(page, List.of(pageReqVO.getOrderId()), + bodyIds, pageReqVO.getGroupId(), null, pageReqVO.getName(), false); + + List records = pageRes.getRecords(); + // cad图纸id赋到每个配件上 + if (CollUtil.isNotEmpty(records)) { + records.forEach(item -> item.setCadViewFileId(bodyIdAndCadViewFileIdMap.get(item.getBodyId()))); + } + return new PageResult<>(BeanUtil.copyToList(records, OrderViewPartPageRespVO.class), pageRes.getTotal()); + } + + @Override + public OrdersViewCadViewInfoRespVO getBodyViewCadInfo(OrderCadViewPlatePageReqVO reqVO) { + OrdersViewCadViewInfoRespVO ordersViewCadViewInfoRespVO = new OrdersViewCadViewInfoRespVO(); Long orderId = reqVO.getOrderId(); OrderDO orderDO = orderMapper.selectById(orderId); AssertUtils.notEmpty(orderDO, ORDER_NOT_EXISTS); @@ -846,7 +882,7 @@ public class PlateServiceImpl implements PlateService { // 匹配柜体 if(CollUtil.isEmpty(bodyIds)) { - return Collections.emptyList(); + return ordersViewCadViewInfoRespVO; } List orderBodyDOList = orderBodyMapper.selectByIds(bodyIds); if (CollUtil.isEmpty(orderBodyDOList)) { @@ -859,15 +895,67 @@ public class PlateServiceImpl implements PlateService { .collect(Collectors.toMap(OrderBodyDO::getId, OrderBodyDO::getCadViewFileId)); // 查询所有板件的视图所需信息 - PageDTO page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); - IPage viewPlatesPage = orderItemMapper.selectBodyViewPlatesPage(page, orderId, bodyIds, reqVO.getGroupId(), null, true); + PageDTO page1 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); + IPage viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page1, List.of(orderId), bodyIds, reqVO.getGroupId(), null, true); - List records = viewPlatesPage.getRecords(); + List plateRecords = viewPlatesPage.getRecords(); // cad图纸id赋到每块板上 - if(CollUtil.isNotEmpty(records)) { - records.forEach(item -> item.setCadViewFileId(bodyIdAndCadViewFileIdMap.get(item.getBodyId()))); + if(CollUtil.isNotEmpty(plateRecords)) { + plateRecords.forEach(item -> item.setCadViewFileId(bodyIdAndCadViewFileIdMap.get(item.getBodyId()))); } - return BeanUtil.copyToList(records, OrderViewPlatePageRespVO.class); + + // 查询所有配件的视图所需信息 + PageDTO page2 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); + IPage viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page2, List.of(orderId), bodyIds, reqVO.getGroupId(), null, null, true); + + List partRecords = viewPartsPage.getRecords(); + + // cad图纸id赋到每个配件上 + if (CollUtil.isNotEmpty(partRecords)) { + partRecords.forEach(item -> item.setCadViewFileId(bodyIdAndCadViewFileIdMap.get(item.getBodyId()))); + } + + ordersViewCadViewInfoRespVO.setPlates(BeanUtil.copyToList(plateRecords, OrderViewPlatePageRespVO.class)); + ordersViewCadViewInfoRespVO.setParts(BeanUtil.copyToList(partRecords, OrderViewPartPageRespVO.class)); + return ordersViewCadViewInfoRespVO; + } + + @Override + public OrdersViewCadViewInfoRespVO getBodyViewPartCadInfo(OrderCadViewPlatePageReqVO reqVO) { + OrdersViewCadViewInfoRespVO ordersViewCadViewInfoRespVO = new OrdersViewCadViewInfoRespVO(); + Long orderId = reqVO.getOrderId(); + OrderDO orderDO = orderMapper.selectById(orderId); + AssertUtils.notEmpty(orderDO, ORDER_NOT_EXISTS); + + Set bodyIds = reqVO.getBodyIds(); + + // 匹配柜体 + if(CollUtil.isEmpty(bodyIds)) { + return ordersViewCadViewInfoRespVO; + } + List orderBodyDOList = orderBodyMapper.selectByIds(bodyIds); + if (CollUtil.isEmpty(orderBodyDOList)) { + throw new ServiceException(ORDER_BODY_NOT_EXISTS); + } + + // 整理出body_id和cad图纸id的关系 + Map bodyIdAndCadViewFileIdMap = orderBodyDOList.stream() + .filter(item -> item.getCadViewFileId() != null) + .collect(Collectors.toMap(OrderBodyDO::getId, OrderBodyDO::getCadViewFileId)); + + // 查询所有配件的视图所需信息 + PageDTO page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE); + IPage viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page, List.of(orderId), bodyIds, reqVO.getGroupId(), null, reqVO.getName(), true); + + List partRecords = viewPartsPage.getRecords(); + + // cad图纸id赋到每个配件上 + if (CollUtil.isNotEmpty(partRecords)) { + partRecords.forEach(item -> item.setCadViewFileId(bodyIdAndCadViewFileIdMap.get(item.getBodyId()))); + } + + ordersViewCadViewInfoRespVO.setParts(BeanUtil.copyToList(partRecords, OrderViewPartPageRespVO.class)); + return ordersViewCadViewInfoRespVO; } } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml index 0b9df8f54..8f85b931b 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml @@ -534,68 +534,187 @@ - - - + SELECT + p.plate_no, + p.name, + p.width, + p.height, + p.thickness, + g.material, + g.color, + p.custom_plate_no, + p.cad_plate_no AS customNumber, + p.id, + i.body_id, + i.cad_view_id , p.seal_left, p.seal_down, p.seal_right, p.seal_up - , p.seal_left, p.seal_down, p.seal_right, p.seal_up, p.area, p.texture, p.is_special_shaped, p.is_sculpt, p.is_row_hole, p.remark + , p.seal_left, p.seal_down, p.seal_right, p.seal_up, + p.area, p.texture, p.is_special_shaped, p.is_sculpt, + p.is_row_hole, p.remark , i.comp_id - FROM order_item i - LEFT JOIN `order_plate` p ON i.plate_id = p.id - LEFT JOIN `order_goods` g ON g.id = p.goods_id - WHERE p.deleted = false and i.plate_id != 0 + FROM ( + SELECT + plate_id, + cad_view_id, + MIN(body_id) AS body_id + + , MIN(comp_id) AS comp_id + + FROM order_item + WHERE plate_id != 0 + + AND body_id IN + + #{bodyId} + + + + AND group_id = #{groupId} + - AND i.order_id in + AND order_id IN #{orderId} - AND i.comp_id in + AND comp_id IN #{componentId} + GROUP BY plate_id, cad_view_id + ) i + INNER JOIN order_plate p ON p.id = i.plate_id + INNER JOIN order_goods g ON g.id = p.goods_id + WHERE p.deleted = false + + + + + + + \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml index 6c2c54f24..63dd46e6f 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml @@ -346,6 +346,7 @@ + @@ -377,10 +378,12 @@ op.thickness as partsThickness, op.category as category, op.subparts as subparts, - op.type + op.type, + oc.name as componentName from order_parts op - left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.parts_id + left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.parts_id + left join order_component oc on op.organ_id = oc.organ_id and op.order_id = oc.order_id and oc.id = oi.comp_id where op.organ_id = #{organId} and op.order_id = #{orderId} and op.deleted = false and op.type != '封边条' and oi.package_id = 0 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml index db909d171..d954e3056 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml @@ -778,6 +778,14 @@ + + + + + + + + @@ -845,6 +853,7 @@ op.name as plateName, ogs.material as plateMaterial, ogs.color as plateColor, + ogs.brand as brand, op.order_id as orderId, op.height as plateHeight, op.width as plateWidth, @@ -860,13 +869,21 @@ op.open_door_type as openDoorType, op.is_side_sculpt as isSideSculpt, op.is_2v as is2v, - op.is_side_2v as isSide2v + op.is_side_2v as isSide2v, + op.split_width as splitWidth, + op.split_height as splitHeight, + op.seal_left as sealLeft, + op.seal_right as sealRight, + op.seal_up as sealUp, + op.seal_down as sealDown, + oc.name as componentName from order_plate op left join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id left join order_group og on oi.organ_id = og.organ_id and oi.order_id = og.order_id and oi.group_id = og.id left join order_body ob on oi.organ_id = ob.organ_id and oi.order_id = ob.order_id and oi.body_id = ob.id + left join order_component oc on op.organ_id = oc.organ_id and op.order_id = oc.order_id and oc.id = oi.comp_id where op.organ_id = #{organId} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode.properties b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode.properties index b84db99da..d34da1e70 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode.properties +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode.properties @@ -33,4 +33,11 @@ order.component.no.need.to.restore=该部件未删除,无需恢复 order.component.processed.repeat=该部件已加工勿重复操作,请刷新列表后检查状态 order.component.assembly.config.query.error=装配设置查询失败,请检查服务状态 order.component.not.process=当前部件无需加工,请刷新列表后检查状态 -order.component.restore.repeat=该部件已恢复勿重复操作,请刷新列表后检查状态 \ No newline at end of file +order.component.restore.repeat=该部件已恢复勿重复操作,请刷新列表后检查状态 + +heap.split.task.not.exist=分堆任务不存在 +heap.split.task.name.exist=分堆任务名已存在,请重新命名 +heap.split.no.need.restart=该分堆任务无需重启,请刷新列表后检查状态 +heap.split.need.restart=该分堆任务已完成,请重启该任务后再次查看 + +order.already.packaged=该订单已打包完成,无法操作 \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode_cht.properties b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode_cht.properties index 69126ae0d..cac2bd935 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode_cht.properties +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode_cht.properties @@ -33,4 +33,11 @@ order.component.no.need.to.restore=該部件未删除,無需恢復 order.component.processed.repeat=該部件已加工勿重複操作,請重繪清單後檢查狀態 order.component.assembly.config.query.error=裝配設定査詢失敗,請檢查服務狀態 order.component.not.process=當前部件無需加工,請重繪清單後檢查狀態 -order.component.restore.repeat=該部件已恢復勿重複操作,請重繪清單後檢查狀態 \ No newline at end of file +order.component.restore.repeat=該部件已恢復勿重複操作,請重繪清單後檢查狀態 + +heap.split.task.not.exist=分堆任務不存在 +heap.split.task.name.exist=分堆任務名已存在,請重新命名 +heap.split.no.need.restart=該分堆任務無需重啓,請重繪清單後檢查狀態 +heap.split.need.restart=該分堆任務已完成,請重啓該任務後再次查看 + +order.already.packaged=該訂單已打包完成,無法操作 \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode_en.properties b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode_en.properties index dd6da7a99..7e117a1bf 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode_en.properties +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/message_errorcode_en.properties @@ -33,4 +33,11 @@ order.component.no.need.to.restore=This component has not been deleted and does order.component.processed.repeat=This component has been processed and should not be operated repeatedly. Please refresh the list and check the status order.component.assembly.config.query.error=Assembly settings query failed, please check service status order.component.not.process=The current component does not require processing. Please refresh the list and check the status -order.component.restore.repeat=The component has been restored. Do not repeat the operation. Please refresh the list and check the status \ No newline at end of file +order.component.restore.repeat=The component has been restored. Do not repeat the operation. Please refresh the list and check the status + +heap.split.task.not.exist=The heap split task does not exist +heap.split.task.name.exist=The task name for heap splitting already exists, please rename it +heap.split.no.need.restart=This heap splitting task does not require a restart. Please refresh the list and check the status +heap.split.need.restart=The heap splitting task has been completed. Please restart the task and check again + +order.already.packaged=The order has been packaged and cannot be processed \ No newline at end of file diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/controller/admin/orderimport/webcad/vo/WebCadDataPartsReqVO.java b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/controller/admin/orderimport/webcad/vo/WebCadDataPartsReqVO.java index be51d7f1b..93945caa4 100644 --- a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/controller/admin/orderimport/webcad/vo/WebCadDataPartsReqVO.java +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/controller/admin/orderimport/webcad/vo/WebCadDataPartsReqVO.java @@ -73,7 +73,7 @@ public class WebCadDataPartsReqVO { private GroupDataDTO groupData; // 组件id - private List componentIds; + private List componentIds = new ArrayList<>(); @NoArgsConstructor @Data diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/orderItem/OrderItemDO.java b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/orderItem/OrderItemDO.java index 0bdb54335..0794b3502 100644 --- a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/orderItem/OrderItemDO.java +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/orderItem/OrderItemDO.java @@ -79,4 +79,8 @@ public class OrderItemDO { */ private Long compId; + /** + * cad视图id + */ + private Integer cadViewId; } \ No newline at end of file diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/orderParts/OrderPartsDO.java b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/orderParts/OrderPartsDO.java index 9c6e6a8f2..30da62b1b 100644 --- a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/orderParts/OrderPartsDO.java +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/orderParts/OrderPartsDO.java @@ -26,35 +26,6 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class OrderPartsDO extends BaseDO { - public OrderPartsDO(OrderPartsDO parts) { - this.id = parts.getId(); - this.organId = parts.getOrganId(); - this.orderId = parts.getOrderId(); - this.goodsId = parts.getGoodsId(); - this.name = parts.getName(); - this.color = parts.getColor(); - this.material = parts.getMaterial(); - this.category = parts.getCategory(); - this.type = parts.getType(); - this.width = parts.getWidth(); - this.length = parts.getLength(); - this.thickness = parts.getThickness(); - this.model = parts.getModel(); - this.spec = parts.getSpec(); - this.brand = parts.getBrand(); - this.factory = parts.getFactory(); - this.unit = parts.getUnit(); - this.price = parts.getPrice(); - this.isComposite = parts.getIsComposite(); - this.subparts = parts.getSubparts(); - this.remark = parts.getRemark(); - this.deleted = parts.getDeleted(); - this.setCreateTime(parts.getCreateTime()); - this.setUpdateTime(parts.getUpdateTime()); - this.setCreator(parts.getCreator()); - this.setUpdater(parts.getUpdater()); - } - /** * 配件 ID */ diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/plate/PlateDO.java b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/plate/PlateDO.java index 65cdc7bb7..1495e1e42 100644 --- a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/plate/PlateDO.java +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/dal/dataobject/plate/PlateDO.java @@ -30,60 +30,6 @@ import java.math.BigDecimal; @AllArgsConstructor public class PlateDO extends BaseDO { - public PlateDO(PlateDO plateDO) { - this.id = plateDO.getId(); - this.organId = plateDO.getOrganId(); - this.orderId = plateDO.getOrderId(); - this.name = plateDO.getName(); - this.plateNo = plateDO.getPlateNo(); - this.type = plateDO.getType(); - this.goodsId = plateDO.getGoodsId(); - this.width = plateDO.getWidth(); - this.height = plateDO.getHeight(); - this.thickness = plateDO.getThickness(); - this.splitWidth = plateDO.getSplitWidth(); - this.splitHeight = plateDO.getSplitHeight(); - this.splitThickness = plateDO.getSplitThickness(); - this.sealLeft = plateDO.getSealLeft(); - this.sealRight = plateDO.getSealRight(); - this.sealUp = plateDO.getSealUp(); - this.sealDown = plateDO.getSealDown(); - this.area = plateDO.getArea(); - this.texture = plateDO.getTexture(); - this.holeFace = plateDO.getHoleFace(); - this.holeArrange = plateDO.getHoleArrange(); - this.unregularPointCount = plateDO.getUnregularPointCount(); - this.frontHoleCount = plateDO.getFrontHoleCount(); - this.backHoleCount = plateDO.getBackHoleCount(); - this.sideHoleCount = plateDO.getSideHoleCount(); - this.frontModelCount = plateDO.getFrontModelCount(); - this.backModelCount = plateDO.getBackModelCount(); - this.isDoor = plateDO.getIsDoor(); - this.openDoorType = plateDO.getOpenDoorType(); - this.offsetX = plateDO.getOffsetX(); - this.offsetY = plateDO.getOffsetY(); - this.isArcAcross = plateDO.getIsArcAcross(); - this.moduleTypeId = plateDO.getModuleTypeId(); - this.isSpecialShaped = plateDO.getIsSpecialShaped(); - this.isSculpt = plateDO.getIsSculpt(); - this.isRowHole = plateDO.getIsRowHole(); - this.isOptimized = plateDO.getIsOptimized(); - this.isCutted = plateDO.getIsCutted(); - this.filterType = plateDO.getFilterType(); - this.remark = plateDO.getRemark(); - this.isCancel = plateDO.getIsCancel(); - this.deleted = plateDO.getDeleted(); - this.customPlateNo = plateDO.getCustomPlateNo(); - this.roomName = plateDO.getRoomName(); - this.bodyName = plateDO.getBodyName(); - this.customPlateNoBuilder = plateDO.getCustomPlateNoBuilder(); - this.setCreateTime(plateDO.getCreateTime()); - this.setUpdateTime(plateDO.getUpdateTime()); - this.setCreator(plateDO.getCreator()); - this.setUpdater(plateDO.getUpdater()); - this.setDeleted(plateDO.getDeleted()); - } - /** * 板件 ID */ @@ -292,11 +238,6 @@ public class PlateDO extends BaseDO { */ private Long planId; - /** - * cad图纸id - */ - private Integer cadViewId; - /** * cad图纸数据 */ diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/service/orderImport/factory/WebCadOrderImportAsyncFactory.java b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/service/orderImport/factory/WebCadOrderImportAsyncFactory.java index ccf8ebdde..9efd8d1ee 100644 --- a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/service/orderImport/factory/WebCadOrderImportAsyncFactory.java +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/service/orderImport/factory/WebCadOrderImportAsyncFactory.java @@ -858,7 +858,6 @@ public class WebCadOrderImportAsyncFactory { .deleted(false) .organId(organId) .planId(0L) - .cadViewId(block.getID()) .build(); plateDO.setCreator(operatorName); plateDO.setUpdater(operatorName); @@ -902,6 +901,7 @@ public class WebCadOrderImportAsyncFactory { private void analyzeBlockProcessGroup(OrderBodyDO orderBodyDO, WebCadDataBlockReqVO block, Long plateId) { Long bodyId = orderBodyDO.getId(); Long roomId = orderBodyDO.getRoomId(); + Integer cadViewId = block.getID(); // 获取缓存的部件id Integer cadGroupId = block.getComponentId(); @@ -965,8 +965,9 @@ public class WebCadOrderImportAsyncFactory { .packageId(0L) .partsId(0L) .num(1.0) - .organId(organId) .compId(plateComponentId) + .cadViewId(cadViewId) + .organId(organId) .build(); orderItemDOS.add(orderItemDO); orderItemBatchInsertWithinThreshold(orderItemDOS, false); @@ -984,8 +985,9 @@ public class WebCadOrderImportAsyncFactory { .packageId(0L) .partsId(0L) .num(1.0) - .organId(organId) .compId(plateComponentId) + .cadViewId(cadViewId) + .organId(organId) .build(); orderItemDOS.add(orderItemDO); orderItemBatchInsertWithinThreshold(orderItemDOS, false); @@ -1547,6 +1549,7 @@ public class WebCadOrderImportAsyncFactory { private void analyzePartProcessGroup(OrderBodyDO orderBodyDO, WebCadDataPartsReqVO.BlockObjectListDTO part) { Long bodyId = orderBodyDO.getId(); Long roomId = orderBodyDO.getRoomId(); + Integer cadViewId = part.getObjectId(); // 获取orderPart analyzeOrderPart(part); @@ -1615,6 +1618,7 @@ public class WebCadOrderImportAsyncFactory { .plateId(0L) .num(part.getNum()) .compId(partComponentId) + .cadViewId(cadViewId) .organId(organId) .build(); orderItemDOS.add(orderItemDO); @@ -1633,6 +1637,7 @@ public class WebCadOrderImportAsyncFactory { .packageId(0L) .plateId(0L) .num(part.getNum()) + .cadViewId(cadViewId) .organId(organId) .build(); orderItemDOS.add(orderItemDO); @@ -1669,6 +1674,7 @@ public class WebCadOrderImportAsyncFactory { .plateId(0L) .num(part.getNum()) .compId(partComponentId) + .cadViewId(cadViewId) .organId(organId) .build(); orderItemDOS.add(orderItemDO); @@ -1686,6 +1692,7 @@ public class WebCadOrderImportAsyncFactory { .packageId(0L) .plateId(0L) .num(part.getNum()) + .cadViewId(cadViewId) .organId(organId) .build(); orderItemDOS.add(orderItemDO); @@ -2036,7 +2043,7 @@ public class WebCadOrderImportAsyncFactory { private void orderPlateBatchInsertWithinThreshold(List list, boolean isLast) { // 达到批量的阈值就做一次插入 if (CollUtil.isNotEmpty(list) && (list.size() >= BATCH_THRESHOLD_NUMBER || isLast)) { - String sql = "INSERT INTO order_plate (id,organ_id,order_id,name,plate_no,type,goods_id,width,height,thickness,split_width,split_height,split_thickness,seal_left,seal_right,seal_up,seal_down,area,texture,hole_face,hole_arrange,unregular_point_count,front_hole_count,back_hole_count,side_hole_count,front_model_count,back_model_count,is_door,open_door_type,offset_x,offset_y,is_arc_across,module_type_id,is_special_shaped,is_sculpt,is_side_sculpt,is_2v,is_side_2v,is_row_hole,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater, cad_view_id, cad_plate_no) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + String sql = "INSERT INTO order_plate (id,organ_id,order_id,name,plate_no,type,goods_id,width,height,thickness,split_width,split_height,split_thickness,seal_left,seal_right,seal_up,seal_down,area,texture,hole_face,hole_arrange,unregular_point_count,front_hole_count,back_hole_count,side_hole_count,front_model_count,back_model_count,is_door,open_door_type,offset_x,offset_y,is_arc_across,module_type_id,is_special_shaped,is_sculpt,is_side_sculpt,is_2v,is_side_2v,is_row_hole,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater, cad_plate_no) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { @Override public void setValues(PreparedStatement ps, int index) throws SQLException { @@ -2091,8 +2098,7 @@ public class WebCadOrderImportAsyncFactory { ps.setTimestamp(48, Timestamp.valueOf(item.getUpdateTime())); ps.setString(49, item.getCreator()); ps.setString(50, item.getUpdater()); - ps.setInt(51, item.getCadViewId()); - ps.setString(52, item.getCadPlateNo()); + ps.setString(51, item.getCadPlateNo()); } @Override @@ -2117,7 +2123,7 @@ public class WebCadOrderImportAsyncFactory { // 达到批量的阈值就做一次插入 if (CollUtil.isNotEmpty(list) && (list.size() >= BATCH_THRESHOLD_NUMBER || isLast)) { - String sql = "INSERT INTO order_item (id,order_id,type,room_id,body_id,package_id,group_id,plate_id,parts_id,num,organ_id,comp_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; + String sql = "INSERT INTO order_item (id,order_id,type,room_id,body_id,package_id,group_id,plate_id,parts_id,num,organ_id,comp_id,cad_view_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"; jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { @Override public void setValues(PreparedStatement ps, int index) throws SQLException { @@ -2142,6 +2148,11 @@ public class WebCadOrderImportAsyncFactory { } else { ps.setNull(12, Types.BIGINT); } + if (item.getCadViewId() != null) { + ps.setLong(13, item.getCadViewId()); + } else { + ps.setNull(13, Types.INTEGER); + } } @Override diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/service/orderImport/factory/WebCadOrderImportFactory.java b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/service/orderImport/factory/WebCadOrderImportFactory.java index e245eab60..578bbf7c4 100644 --- a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/service/orderImport/factory/WebCadOrderImportFactory.java +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/java/com/cf/imes/module/plan/service/orderImport/factory/WebCadOrderImportFactory.java @@ -791,7 +791,6 @@ public class WebCadOrderImportFactory { .deleted(false) .organId(organId) .planId(0L) - .cadViewId(block.getID()) .build(); plateDO.setCreator(operatorName); plateDO.setUpdater(operatorName); @@ -1258,6 +1257,7 @@ public class WebCadOrderImportFactory { private void analyzeBlockProcessGroup(OrderBodyDO orderBodyDO, WebCadDataBlockReqVO block, Long plateId) { Long bodyId = orderBodyDO.getId(); Long roomId = orderBodyDO.getRoomId(); + Integer cadViewId = block.getID(); // 获取缓存的部件id Integer cadGroupId = block.getComponentId(); @@ -1321,8 +1321,9 @@ public class WebCadOrderImportFactory { .packageId(0L) .partsId(0L) .num(1.0) - .organId(organId) .compId(plateComponentId) + .cadViewId(cadViewId) + .organId(organId) .build(); orderItemDOS.add(orderItemDO); orderItemBatchInsertWithinThreshold(orderItemDOS, false); @@ -1340,8 +1341,9 @@ public class WebCadOrderImportFactory { .packageId(0L) .partsId(0L) .num(1.0) - .organId(organId) .compId(plateComponentId) + .cadViewId(cadViewId) + .organId(organId) .build(); orderItemDOS.add(orderItemDO); orderItemBatchInsertWithinThreshold(orderItemDOS, false); @@ -1475,6 +1477,7 @@ public class WebCadOrderImportFactory { private void analyzePartProcessGroup(OrderBodyDO orderBodyDO, WebCadDataPartsReqVO.BlockObjectListDTO part) { Long bodyId = orderBodyDO.getId(); Long roomId = orderBodyDO.getRoomId(); + Integer cadViewId = part.getObjectId(); // 获取orderPart analyzeOrderPart(part); @@ -1544,6 +1547,7 @@ public class WebCadOrderImportFactory { .plateId(0L) .num(part.getNum()) .compId(partComponentId) + .cadViewId(cadViewId) .organId(organId) .build(); orderItemDOS.add(orderItemDO); @@ -1562,6 +1566,7 @@ public class WebCadOrderImportFactory { .packageId(0L) .plateId(0L) .num(part.getNum()) + .cadViewId(cadViewId) .organId(organId) .build(); orderItemDOS.add(orderItemDO); @@ -1598,6 +1603,7 @@ public class WebCadOrderImportFactory { .plateId(0L) .num(part.getNum()) .compId(partComponentId) + .cadViewId(cadViewId) .organId(organId) .build(); orderItemDOS.add(orderItemDO); @@ -1615,6 +1621,7 @@ public class WebCadOrderImportFactory { .packageId(0L) .plateId(0L) .num(part.getNum()) + .cadViewId(cadViewId) .organId(organId) .build(); orderItemDOS.add(orderItemDO); @@ -1861,7 +1868,7 @@ public class WebCadOrderImportFactory { private void orderPlateBatchInsertWithinThreshold(List list, boolean isLast) { // 达到批量的阈值就做一次插入 if (CollUtil.isNotEmpty(list) && (list.size() >= BATCH_THRESHOLD_NUMBER || isLast)) { - String sql = "INSERT INTO order_plate (id,organ_id,order_id,name,plate_no,type,goods_id,width,height,thickness,split_width,split_height,split_thickness,seal_left,seal_right,seal_up,seal_down,area,texture,hole_face,hole_arrange,unregular_point_count,front_hole_count,back_hole_count,side_hole_count,front_model_count,back_model_count,is_door,open_door_type,offset_x,offset_y,is_arc_across,module_type_id,is_special_shaped,is_sculpt,is_side_sculpt,is_2v,is_side_2v,is_row_hole,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater, cad_view_id, cad_plate_no) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + String sql = "INSERT INTO order_plate (id,organ_id,order_id,name,plate_no,type,goods_id,width,height,thickness,split_width,split_height,split_thickness,seal_left,seal_right,seal_up,seal_down,area,texture,hole_face,hole_arrange,unregular_point_count,front_hole_count,back_hole_count,side_hole_count,front_model_count,back_model_count,is_door,open_door_type,offset_x,offset_y,is_arc_across,module_type_id,is_special_shaped,is_sculpt,is_side_sculpt,is_2v,is_side_2v,is_row_hole,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater, cad_plate_no) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { @Override public void setValues(PreparedStatement ps, int index) throws SQLException { @@ -1916,8 +1923,7 @@ public class WebCadOrderImportFactory { ps.setTimestamp(48, Timestamp.valueOf(item.getUpdateTime())); ps.setString(49, item.getCreator()); ps.setString(50, item.getUpdater()); - ps.setInt(51, item.getCadViewId()); - ps.setString(52, item.getCadPlateNo()); + ps.setString(51, item.getCadPlateNo()); } @Override @@ -1942,7 +1948,7 @@ public class WebCadOrderImportFactory { // 达到批量的阈值就做一次插入 if (CollUtil.isNotEmpty(list) && (list.size() >= BATCH_THRESHOLD_NUMBER || isLast)) { - String sql = "INSERT INTO order_item (id,order_id,type,room_id,body_id,package_id,group_id,plate_id,parts_id,num,organ_id,comp_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; + String sql = "INSERT INTO order_item (id,order_id,type,room_id,body_id,package_id,group_id,plate_id,parts_id,num,organ_id,comp_id,cad_view_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"; jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { @Override public void setValues(PreparedStatement ps, int index) throws SQLException { @@ -1967,6 +1973,11 @@ public class WebCadOrderImportFactory { } else { ps.setNull(12, Types.BIGINT); } + if (item.getCadViewId() != null) { + ps.setLong(13, item.getCadViewId()); + } else { + ps.setNull(13, Types.INTEGER); + } } @Override