mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、新增分堆任务管理接口;2、新增扫描获取关联明细接口;3、新增订单详情、部件、装配清单配件用接口;4、cad拆单兼容新结构:cadviewid存到order_item;
This commit is contained in:
+13
-6
@@ -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");
|
||||
}
|
||||
|
||||
+8
-6
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+12
-4
@@ -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<PageResult<OrderViewPlatePageRespVO>> getComponentViewPlatesPage(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) {
|
||||
return success(assemblyListService.getViewComponentPage(pageReqVO));
|
||||
return success(assemblyListService.getViewComponentPlatePage(pageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/list/view/plate/cadinfo")
|
||||
@Operation(summary = "装配清单-获取订单部件下的所有板件视图列表数据")
|
||||
public CommonResult<List<OrderViewPlatePageRespVO>> getComponentViewPlates(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) {
|
||||
@PostMapping("/list/view/part/page")
|
||||
@Operation(summary = "装配清单-获取订单部件下的配件视图分页列表数据")
|
||||
public CommonResult<PageResult<OrderViewPartPageRespVO>> getComponentViewPartsPage(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) {
|
||||
return success(assemblyListService.getViewComponentPartPage(pageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/list/view/cadinfo")
|
||||
@Operation(summary = "装配清单-获取订单部件下的所有板件+配件视图列表数据")
|
||||
public CommonResult<OrdersViewCadViewInfoRespVO> getComponentViewPlates(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) {
|
||||
return success(assemblyListService.getViewComponentPlatesCadInfo(pageReqVO));
|
||||
}
|
||||
|
||||
|
||||
-11
@@ -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<Long> 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;
|
||||
}
|
||||
|
||||
+72
@@ -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<Boolean> saveHeapsplitTask(@Valid @RequestBody HeapSplitTaskSaveReqVO reqVO) {
|
||||
heapSplitTaskService.saveHeapsplitTask(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/task")
|
||||
@Operation(summary = "查询分堆任务列表")
|
||||
public CommonResult<List<HeapSplitTaskListRespVO>> 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<Boolean> deleteHeapsplitTask(@RequestBody List<Long> ids) {
|
||||
heapSplitTaskService.deleteHeapsplitTask(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/task/{id}")
|
||||
@Operation(summary = "获取分堆任务")
|
||||
public CommonResult<HeapSplitTaskRespVO> getHeapsplitTaskById(@PathVariable("id") Long id) {
|
||||
return success(heapSplitTaskService.getHeapsplitTask(id));
|
||||
}
|
||||
|
||||
@PostMapping("/task/restart/{id}")
|
||||
@Operation(summary = "重启分堆任务")
|
||||
public CommonResult<Boolean> restartHeapsplitTask(@PathVariable("id") Long id) {
|
||||
heapSplitTaskService.restartHeapsplitTask(id);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -237,5 +237,9 @@ public class PackController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/scan/correlation")
|
||||
@Operation(summary = "查询扫描类型相关的板件+配件id")
|
||||
public CommonResult<List<Long>> getComponentCorrelation(@Valid @RequestBody PackScanComponentCorrelationReqVO reqVO) {
|
||||
return success(packService.getComponentCorrelation(reqVO));
|
||||
}
|
||||
}
|
||||
|
||||
+37
@@ -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;
|
||||
}
|
||||
+30
@@ -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<Long> orderIds;
|
||||
|
||||
@Schema(description = "板件ID列表")
|
||||
private List<Long> plateIds;
|
||||
|
||||
@Schema(description = "配件ID列表")
|
||||
private List<Long> partIds;
|
||||
}
|
||||
+49
@@ -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<Long> plateIds;
|
||||
|
||||
@Schema(description = "配件id列表")
|
||||
private List<Long> partIds;
|
||||
|
||||
@Schema(description = "订单id列表")
|
||||
private List<Long> orderIds;
|
||||
}
|
||||
+2
-1
@@ -83,6 +83,7 @@ public class OrderPartsRespVO {
|
||||
@Schema(description = "加工组-用于计算-不显示")
|
||||
private List<Long> groupId;
|
||||
|
||||
|
||||
@Schema(description = "组件名称")
|
||||
private String componentName;
|
||||
|
||||
}
|
||||
|
||||
+34
@@ -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<Long> orderIds;
|
||||
}
|
||||
+29
@@ -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<GroupNameList> 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;
|
||||
}
|
||||
|
||||
+4
-1
@@ -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<Long> 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;
|
||||
}
|
||||
|
||||
+34
@@ -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<OrderViewPlatePageRespVO> plates = new ArrayList<>();
|
||||
|
||||
@Schema(description = "配件列表")
|
||||
List<OrderViewPartPageRespVO> parts = new ArrayList<>();
|
||||
}
|
||||
+13
-5
@@ -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<PageResult<OrderViewPlatePageRespVO>> getComponentViewPlatesPage(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) {
|
||||
return success(orderComponentService.getViewComponentPage(pageReqVO));
|
||||
return success(orderComponentService.getViewComponentPlatesPage(pageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/view/plate/cadinfo")
|
||||
@Operation(summary = "获取部件下的所有板件视图列表数据")
|
||||
public CommonResult<List<OrderViewPlatePageRespVO>> getComponentViewPlates(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) {
|
||||
return success(orderComponentService.getViewComponentPlatesCadInfo(pageReqVO));
|
||||
@PostMapping("/view/part/page")
|
||||
@Operation(summary = "获取部件下的配件视图分页列表数据")
|
||||
public CommonResult<PageResult<OrderViewPartPageRespVO>> getComponentViewPartsPage(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) {
|
||||
return success(orderComponentService.getViewComponentPartsPage(pageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/view/cadinfo")
|
||||
@Operation(summary = "获取部件下的所有板件+配件视图列表数据")
|
||||
public CommonResult<OrdersViewCadViewInfoRespVO> getComponentViewPlates(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) {
|
||||
return success(orderComponentService.getViewComponentCadInfo(pageReqVO));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{orderId}/{id}")
|
||||
|
||||
+17
-4
@@ -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<PageResult<OrderViewPlatePageRespVO>> getBodyViewPlatesPage(@Validated(OrderCadViewPageGroup.class) @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
|
||||
return success(plateService.getBodyViewPlatesPage(orderCadViewPlatePageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/body/view/part/page")
|
||||
@Operation(summary = "获取柜体下的配件视图分页列表数据")
|
||||
public CommonResult<PageResult<OrderViewPartPageRespVO>> getBodyViewPartsPage(@Validated(OrderCadViewPageGroup.class) @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
|
||||
return success(plateService.getBodyViewPartsPage(orderCadViewPlatePageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/body/view/cadinfo")
|
||||
@Operation(summary = "获取板件对应柜体下的所有板件视图列表数据")
|
||||
public CommonResult<List<OrderViewPlatePageRespVO>> getBodyViewPlatesCadInfo(@Validated @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
|
||||
return success(plateService.getBodyViewPlatesCadInfo(orderCadViewPlatePageReqVO));
|
||||
@Operation(summary = "获取板件对应柜体下的所有板件+配件视图列表数据")
|
||||
public CommonResult<OrdersViewCadViewInfoRespVO> getBodyViewCadInfo(@Validated @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
|
||||
return success(plateService.getBodyViewCadInfo(orderCadViewPlatePageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/body/view/part/cadinfo")
|
||||
@Operation(summary = "获取板件对应柜体下的所有配件视图列表数据")
|
||||
public CommonResult<OrdersViewCadViewInfoRespVO> getBodyViewPartCadInfo(@Validated @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
|
||||
return success(plateService.getBodyViewPartCadInfo(orderCadViewPlatePageReqVO));
|
||||
}
|
||||
}
|
||||
+78
@@ -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;
|
||||
}
|
||||
+89
@@ -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<Long> orderIds;
|
||||
}
|
||||
+51
@@ -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;
|
||||
}
|
||||
+5
@@ -71,4 +71,9 @@ public class OrderItemDO {
|
||||
* 部件id
|
||||
*/
|
||||
private Long compId;
|
||||
|
||||
/**
|
||||
* cad视图id
|
||||
*/
|
||||
private Integer cadViewId;
|
||||
}
|
||||
+109
@@ -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;
|
||||
}
|
||||
+1
-1
@@ -11,7 +11,7 @@ import java.math.BigDecimal;
|
||||
* @since 2025/12/23 11:54
|
||||
*/
|
||||
@Data
|
||||
public class OrderBodyViewPlatesPageDO {
|
||||
public class OrdersViewPlatesPageDO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
-1
@@ -106,5 +106,4 @@ public class OrderPartsDO extends BaseDO {
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
-6
@@ -212,12 +212,6 @@ public class PlateDO extends BaseDO {
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
|
||||
/**
|
||||
* cad图纸id
|
||||
*/
|
||||
private Integer cadViewId;
|
||||
|
||||
/**
|
||||
* cad图纸数据
|
||||
*/
|
||||
|
||||
+19
@@ -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<HeapSplitTaskDetailDO> {
|
||||
@Delete("DELETE FROM heap_split_task_detail WHERE task_id = #{taskId} LIMIT #{limit}")
|
||||
Integer deleteByLimit(@Param("taskId") Long taskId, @Param("limit") Integer limit);
|
||||
}
|
||||
+15
@@ -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<HeapSplitTaskDO> {
|
||||
}
|
||||
+41
-17
@@ -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<OrderItemDO> {
|
||||
List<PlateAndPartIdList> 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<OrdersViewPlatesPageDO> selectOrdersViewPlatesPage(@Param("page") IPage<OrdersViewPlatesPageDO> page,
|
||||
@Param("orderIds") List<Long> orderIds,
|
||||
@Param("bodyIds") Set<Long> bodyIds,
|
||||
@Param("groupId") Long groupId,
|
||||
@Param("componentIds") Set<Long> componentIds,
|
||||
@Param("cadView") boolean cadView);
|
||||
|
||||
/**
|
||||
* 分页查询订单板件视图数据
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param orderId 订单ID
|
||||
@@ -198,24 +217,29 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
* @param cadView 是否需要cad图纸内信息:cad_view_id、seal_left、seal_down、seal_right、seal_up
|
||||
* @return
|
||||
*/
|
||||
IPage<OrderBodyViewPlatesPageDO> selectBodyViewPlatesPage(@Param("page") IPage<OrderBodyViewPlatesPageDO> page,
|
||||
@Param("orderId") Long orderId,
|
||||
@Param("bodyIds") Set<Long> bodyIds,
|
||||
@Param("groupId") Long groupId,
|
||||
@Param("componentIds") Set<Long> componentIds,
|
||||
@Param("cadView") boolean cadView);
|
||||
IPage<OrdersViewPartsPageDO> selectOrdersViewPartsPage(@Param("page") IPage<OrdersViewPartsPageDO> page,
|
||||
@Param("orderIds") List<Long> orderId,
|
||||
@Param("bodyIds") Set<Long> bodyIds,
|
||||
@Param("groupId") Long groupId,
|
||||
@Param("componentIds") Set<Long> 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<OrderBodyViewPlatesPageDO> selectOrdersViewPlatesPage(@Param("page") IPage<OrderBodyViewPlatesPageDO> page,
|
||||
@Param("orderIds") List<Long> orderId,
|
||||
@Param("componentIds") Set<Long> componentIds,
|
||||
@Param("cadView") boolean cadView);
|
||||
List<Long> selectComponentCorrelationPlateIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds);
|
||||
|
||||
/**
|
||||
* 查询部件关联的部件ID列表
|
||||
*
|
||||
* @param componentIds
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectComponentCorrelationPartsIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds);
|
||||
}
|
||||
+26
@@ -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;
|
||||
}
|
||||
+37
@@ -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;
|
||||
}
|
||||
}
|
||||
+12
-2
@@ -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<OrderViewPlatePageRespVO> getViewComponentPage(AssemblyListComponentPageReqVO reqVO);
|
||||
PageResult<OrderViewPlatePageRespVO> getViewComponentPlatePage(AssemblyListComponentPageReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 获取订单下配件视图分页列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
PageResult<OrderViewPartPageRespVO> getViewComponentPartPage(AssemblyListComponentPageReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 获取部件和下级所有的板件视图列表
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderViewPlatePageRespVO> getViewComponentPlatesCadInfo(AssemblyListComponentPageReqVO reqVO);
|
||||
OrdersViewCadViewInfoRespVO getViewComponentPlatesCadInfo(AssemblyListComponentPageReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 加工部件
|
||||
|
||||
+111
-17
@@ -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<OrderComponentDO>()
|
||||
.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<OrderViewPlatePageRespVO> getViewComponentPage(AssemblyListComponentPageReqVO pageReqVO) {
|
||||
public PageResult<OrderViewPlatePageRespVO> getViewComponentPlatePage(AssemblyListComponentPageReqVO pageReqVO) {
|
||||
Set<Long> 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<OrderBodyViewPlatesPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrderBodyViewPlatesPageDO> pageRes = orderItemMapper.selectOrdersViewPlatesPage(page, orderIds, queryComponentIds, false);
|
||||
PageDTO<OrdersViewPlatesPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrdersViewPlatesPageDO> pageRes = orderItemMapper.selectOrdersViewPlatesPage(page, orderIds, null, null, queryComponentIds, false);
|
||||
long total = pageRes.getTotal();
|
||||
List<OrderBodyViewPlatesPageDO> records = pageRes.getRecords();
|
||||
List<OrdersViewPlatesPageDO> records = pageRes.getRecords();
|
||||
|
||||
List<OrderViewPlatePageRespVO> resultList = new ArrayList<>();
|
||||
if (total > 0) {
|
||||
@@ -600,11 +614,72 @@ public class AssemblyListServiceImpl implements AssemblyListService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderViewPlatePageRespVO> getViewComponentPlatesCadInfo(AssemblyListComponentPageReqVO pageReqVO) {
|
||||
List<OrderViewPlatePageRespVO> emptyList = Collections.emptyList();
|
||||
public PageResult<OrderViewPartPageRespVO> getViewComponentPartPage(AssemblyListComponentPageReqVO pageReqVO) {
|
||||
Set<Long> componentIds = pageReqVO.getComponentIds();
|
||||
if (CollUtil.isEmpty(componentIds)) {
|
||||
return emptyList;
|
||||
return new PageResult<>(Collections.emptyList(), 0L);
|
||||
}
|
||||
|
||||
// 1、查询顶级
|
||||
List<OrderComponentDO> componentDOS = orderComponentMapper.selectByIds(componentIds);
|
||||
if (CollUtil.isEmpty(componentDOS) || componentDOS.size() != componentIds.size()) {
|
||||
throw new ServiceException(ORDER_COMPONENT_NOT_EXIST);
|
||||
}
|
||||
// 整理所在订单id列表
|
||||
List<Long> orderIds = componentDOS.stream()
|
||||
.map(OrderComponentDO::getOrderId)
|
||||
.distinct()
|
||||
.toList();
|
||||
// 整理所在顶级配件id列表
|
||||
List<Long> topIds = componentDOS.stream()
|
||||
.map(OrderComponentDO::getTopId)
|
||||
.toList();
|
||||
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.in(OrderComponentDO::getTopId, topIds)
|
||||
.in(OrderComponentDO::getOrderId, orderIds)
|
||||
.eq(OrderComponentDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus())
|
||||
.select(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId, OrderComponentDO::getPid));
|
||||
|
||||
Set<Long> queryComponentIds = new HashSet<>();
|
||||
if (CollUtil.isNotEmpty(orderComponentDOS)) {
|
||||
for (OrderComponentDO co : componentDOS) {
|
||||
queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS));
|
||||
}
|
||||
} else {
|
||||
return new PageResult<>();
|
||||
}
|
||||
// 整理出id和cadViewFileId的对应关系
|
||||
Map<Long, Long> cadViewFileIdMap = orderComponentDOS.stream()
|
||||
.filter(item -> item.getCadViewFileId() != null)
|
||||
.collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId));
|
||||
|
||||
// 分页查询板件
|
||||
PageDTO<OrdersViewPartsPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrdersViewPartsPageDO> pageRes = orderItemMapper.selectOrdersViewPartsPage(page, orderIds, null, null, queryComponentIds, null, false);
|
||||
long total = pageRes.getTotal();
|
||||
List<OrdersViewPartsPageDO> records = pageRes.getRecords();
|
||||
|
||||
List<OrderViewPartPageRespVO> 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<Long> 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<OrderBodyViewPlatesPageDO> page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrderBodyViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page, orderIds, queryComponentIds, true);
|
||||
List<OrderBodyViewPlatesPageDO> records = viewPlatesPage.getRecords();
|
||||
PageDTO<OrdersViewPlatesPageDO> page1 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page1, orderIds, null, null, queryComponentIds, true);
|
||||
List<OrdersViewPlatesPageDO> plateRecords = viewPlatesPage.getRecords();
|
||||
|
||||
List<OrderViewPlatePageRespVO> resultList = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
resultList = records.stream().map(item -> {
|
||||
List<OrderViewPlatePageRespVO> 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<OrdersViewPartsPageDO> page2 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPartsPageDO> viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page2, orderIds, null, null, queryComponentIds, null, true);
|
||||
List<OrdersViewPartsPageDO> partRecords = viewPartsPage.getRecords();
|
||||
|
||||
List<OrderViewPartPageRespVO> 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+51
@@ -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<HeapSplitTaskListRespVO> getHeapsplitTaskList(String name, Integer status);
|
||||
|
||||
/**
|
||||
* 删除分堆任务
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void deleteHeapsplitTask(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取分堆任务内容
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HeapSplitTaskRespVO getHeapsplitTask(Long id);
|
||||
|
||||
/**
|
||||
* 重启分堆任务
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void restartHeapsplitTask(Long id);
|
||||
}
|
||||
+275
@@ -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<HeapSplitTaskDO>()
|
||||
.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<HeapSplitTaskDO> heapSplitTaskDOList = heapSplitTaskMapper.selectList(new LambdaQueryWrapperX<HeapSplitTaskDO>()
|
||||
.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<Long> plateIds) {
|
||||
List<List<Long>> platePartitions = CollUtil.split(plateIds, 1000);
|
||||
|
||||
for (List<Long> batch : platePartitions) {
|
||||
List<HeapSplitTaskDetailDO> 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<Long> partIds) {
|
||||
List<List<Long>> partPartitions = CollUtil.split(partIds, 1000);
|
||||
|
||||
for (List<Long> batch : partPartitions) {
|
||||
List<HeapSplitTaskDetailDO> 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<HeapSplitTaskListRespVO> getHeapsplitTaskList(String name, Integer status) {
|
||||
return BeanUtil.copyToList(heapSplitTaskMapper.selectList(new LambdaQueryWrapperX<HeapSplitTaskDO>()
|
||||
.likeIfPresent(HeapSplitTaskDO::getName, name)
|
||||
.eqIfPresent(HeapSplitTaskDO::getStatus, status)), HeapSplitTaskListRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteHeapsplitTask(List<Long> ids) {
|
||||
List<Long> idsToDelete = ids.stream().distinct().toList();
|
||||
|
||||
Long idsCount = heapSplitTaskMapper.selectCount(new LambdaQueryWrapper<HeapSplitTaskDO>()
|
||||
.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<HeapSplitTaskDetailDO> heapSplitTaskDetailDOS = heapSplitTaskDetailMapper.selectList(new LambdaQueryWrapper<HeapSplitTaskDetailDO>()
|
||||
.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<HeapSplitTaskDO>()
|
||||
.eq(HeapSplitTaskDO::getId, id)
|
||||
.eq(HeapSplitTaskDO::getStatus, HeapSplitTaskStatusEnum.FINISHED.getStatus())
|
||||
.set(HeapSplitTaskDO::getStatus, HeapSplitTaskStatusEnum.UNFINISHED.getStatus())
|
||||
);
|
||||
}
|
||||
}
|
||||
+13
@@ -79,4 +79,17 @@ public interface PackService {
|
||||
// 保存优化后的预打包信息
|
||||
void saveOptimizeInfo(PrePackReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 校验打包状态:已打包的不允许扫描关联
|
||||
* @param orderId
|
||||
*/
|
||||
void validOrderPackageStatus(Long orderId);
|
||||
|
||||
/**
|
||||
* 获取部件关联板件和配件id
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<Long> getComponentCorrelation(PackScanComponentCorrelationReqVO reqVO);
|
||||
}
|
||||
|
||||
+84
-1
@@ -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<Long> getComponentCorrelation(PackScanComponentCorrelationReqVO reqVO) {
|
||||
Long id = reqVO.getId();
|
||||
Integer itemType = reqVO.getItemType();
|
||||
Integer type = reqVO.getType();
|
||||
List<Long> orderIds = reqVO.getOrderIds();
|
||||
// 没有归属部件返回自己本身
|
||||
List<Long> 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<Long> componentIdList;
|
||||
if (PackScanComponentCorrelationTypeEnum.PARENT.getType().equals(type)) {
|
||||
// 部件父级
|
||||
componentIdList = orderComponentService.getChildComponentIdsOnMyParent(compId);
|
||||
} else {
|
||||
// 部件顶级
|
||||
componentIdList = orderComponentService.getChildComponentIdsOnTopId(compId);
|
||||
}
|
||||
|
||||
if (CollUtil.isEmpty(componentIdList)) {
|
||||
// 没有归属部件返回自己本身
|
||||
return self;
|
||||
}
|
||||
|
||||
List<Long> componentIdsCorrelationItemIds = orderItemService.getComponentIdsCorrelationItemIds(orderIds, componentIdList);
|
||||
if (CollUtil.isEmpty(componentIdsCorrelationItemIds)) {
|
||||
return self;
|
||||
}
|
||||
|
||||
return componentIdsCorrelationItemIds;
|
||||
}
|
||||
}
|
||||
|
||||
+8
-2
@@ -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}
|
||||
*
|
||||
|
||||
+5
@@ -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) {
|
||||
// 插入
|
||||
|
||||
+30
-11
@@ -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<OrderComponentRespVO> getOrderComponentList(OrderDetailComponentListReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 查询订单顶级部件列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderComponentRespVO> getOrderTopComponentList(OrdersTopComponentListReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 获取节点的顶级节点下所有节点
|
||||
*
|
||||
@@ -42,17 +35,27 @@ public interface OrderComponentService {
|
||||
|
||||
/**
|
||||
* 获取部件下板件视图分页列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
PageResult<OrderViewPlatePageRespVO> getViewComponentPage(OrderDetailComponentPageReqVO reqVO);
|
||||
PageResult<OrderViewPlatePageRespVO> getViewComponentPlatesPage(OrderDetailComponentPageReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 获取部件下配件分页列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
PageResult<OrderViewPartPageRespVO> getViewComponentPartsPage(OrderDetailComponentPageReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 获取部件和下级所有的板件视图列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderViewPlatePageRespVO> getViewComponentPlatesCadInfo(OrderDetailComponentPageReqVO reqVO);
|
||||
OrdersViewCadViewInfoRespVO getViewComponentCadInfo(OrderDetailComponentPageReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 删除部件
|
||||
@@ -84,4 +87,20 @@ public interface OrderComponentService {
|
||||
* @return
|
||||
*/
|
||||
List<OrderComponentRespVO> getChildComponentListOnTopId(Long id);
|
||||
|
||||
/**
|
||||
* 查询部件归属的顶级部件的所有子部件id列表
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<Long> getChildComponentIdsOnTopId(Long id);
|
||||
|
||||
/**
|
||||
* 查询部件归属的父部件的所有子部件id列表
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<Long> getChildComponentIdsOnMyParent(Long id);
|
||||
}
|
||||
+131
-29
@@ -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<OrderComponentRespVO> getOrderTopComponentList(OrdersTopComponentListReqVO reqVO) {
|
||||
List<Long> orderIds = reqVO.getOrderIds();
|
||||
if (CollUtil.isEmpty(orderIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.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<OrderComponentRespVO> getComponentListOnTopId(OrderDetailComponentListReqVO reqVO) {
|
||||
Set<Long> componentIds = reqVO.getComponentIds();
|
||||
@@ -185,7 +174,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderViewPlatePageRespVO> getViewComponentPage(OrderDetailComponentPageReqVO pageReqVO) {
|
||||
public PageResult<OrderViewPlatePageRespVO> getViewComponentPlatesPage(OrderDetailComponentPageReqVO pageReqVO) {
|
||||
Set<Long> 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<OrderBodyViewPlatesPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrderBodyViewPlatesPageDO> pageRes = orderItemMapper.selectBodyViewPlatesPage(page, orderId, null,
|
||||
PageDTO<OrdersViewPlatesPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrdersViewPlatesPageDO> pageRes = orderItemMapper.selectOrdersViewPlatesPage(page, List.of(orderId), null,
|
||||
null, queryComponentIds, false);
|
||||
long total = pageRes.getTotal();
|
||||
List<OrderBodyViewPlatesPageDO> records = pageRes.getRecords();
|
||||
List<OrdersViewPlatesPageDO> records = pageRes.getRecords();
|
||||
|
||||
List<OrderViewPlatePageRespVO> resultList = new ArrayList<>();
|
||||
if(total > 0) {
|
||||
@@ -245,7 +234,68 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderViewPlatePageRespVO> getViewComponentPlatesCadInfo(OrderDetailComponentPageReqVO pageReqVO) {
|
||||
public PageResult<OrderViewPartPageRespVO> getViewComponentPartsPage(OrderDetailComponentPageReqVO pageReqVO) {
|
||||
Set<Long> 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<OrderComponentDO> componentDOS = orderComponentMapper.selectByIds(componentIds);
|
||||
if (CollUtil.isEmpty(componentDOS) || componentDOS.size() != componentIds.size()) {
|
||||
throw new ServiceException(ORDER_COMPONENT_NOT_EXIST);
|
||||
}
|
||||
List<Long> topIds = componentDOS.stream()
|
||||
.map(OrderComponentDO::getTopId)
|
||||
.toList();
|
||||
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.in(OrderComponentDO::getTopId, topIds)
|
||||
.eq(OrderComponentDO::getOrderId, orderId)
|
||||
.eqIfPresent(OrderComponentDO::getDeleted, pageReqVO.isDeleted())
|
||||
.select(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId, OrderComponentDO::getPid));
|
||||
|
||||
Set<Long> queryComponentIds = new HashSet<>();
|
||||
if (CollUtil.isNotEmpty(orderComponentDOS)) {
|
||||
for (OrderComponentDO co : componentDOS) {
|
||||
queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS));
|
||||
}
|
||||
} else {
|
||||
return new PageResult<>();
|
||||
}
|
||||
// 整理出id和cadViewFileId的对应关系
|
||||
Map<Long, Long> cadViewFileIdMap = orderComponentDOS.stream()
|
||||
.filter(item -> item.getCadViewFileId() != null)
|
||||
.collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId));
|
||||
|
||||
// 分页查询板件
|
||||
PageDTO<OrdersViewPartsPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrdersViewPartsPageDO> pageRes = orderItemMapper.selectOrdersViewPartsPage(page, List.of(orderId), null,
|
||||
null, queryComponentIds, null, false);
|
||||
long total = pageRes.getTotal();
|
||||
List<OrdersViewPartsPageDO> records = pageRes.getRecords();
|
||||
|
||||
List<OrderViewPartPageRespVO> 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<Long> 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<OrderBodyViewPlatesPageDO> page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrderBodyViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectBodyViewPlatesPage(page, orderId, null,
|
||||
PageDTO<OrdersViewPlatesPageDO> page1 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page1, List.of(orderId), null,
|
||||
null, queryComponentIds, true);
|
||||
List<OrderBodyViewPlatesPageDO> records = viewPlatesPage.getRecords();
|
||||
List<OrdersViewPlatesPageDO> plateRecords = viewPlatesPage.getRecords();
|
||||
|
||||
List<OrderViewPlatePageRespVO> resultList = new ArrayList<>();
|
||||
if(CollUtil.isNotEmpty(records)) {
|
||||
resultList = records.stream().map(item -> {
|
||||
List<OrderViewPlatePageRespVO> 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<OrdersViewPartsPageDO> page2 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPartsPageDO> viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page2, List.of(orderId), null,
|
||||
null, queryComponentIds, null, true);
|
||||
List<OrdersViewPartsPageDO> partRecords = viewPartsPage.getRecords();
|
||||
|
||||
List<OrderViewPartPageRespVO> 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<Long> getChildComponentIdsOnTopId(Long id) {
|
||||
List<Long> result = new ArrayList<>();
|
||||
OrderComponentDO componentDO = orderComponentMapper.selectById(id);
|
||||
if (ObjectUtil.isNotNull(componentDO)) {
|
||||
// 查询顶级下所有部件
|
||||
result = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.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<Long> getChildComponentIdsOnMyParent(Long id) {
|
||||
List<Long> result = new ArrayList<>();
|
||||
OrderComponentDO componentDO = orderComponentMapper.selectById(id);
|
||||
if (ObjectUtil.isNotNull(componentDO)) {
|
||||
// 查询顶级下所有部件
|
||||
List<OrderComponentDO> componentListOnTop = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.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;
|
||||
}
|
||||
}
|
||||
+36
@@ -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<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds);
|
||||
}
|
||||
+56
@@ -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<OrderItemDO> plateItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||
.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<OrderItemDO> partItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||
.eq(OrderItemDO::getPartsId, partId));
|
||||
if (CollUtil.isNotEmpty(partItemDOS)) {
|
||||
return partItemDOS.get(0).getCompId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds) {
|
||||
List<Long> resultList = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(componentIds)) {
|
||||
return resultList;
|
||||
}
|
||||
// 查询关联的板件和配件id
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPlateIds(orderIds, componentIds));
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPartsIds(orderIds, componentIds));
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
+29
-2
@@ -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<OrderViewPlatePageRespVO> getBodyViewPlatesPage(OrderCadViewPlatePageReqVO orderBodyPageRespVO);
|
||||
|
||||
|
||||
/**
|
||||
* 根据板件id获取柜体下所有板件cad视图所需信息
|
||||
* 获取柜体配件视图分页列表
|
||||
*
|
||||
* @param orderBodyPageRespVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderViewPlatePageRespVO> getBodyViewPlatesCadInfo(OrderCadViewPlatePageReqVO orderBodyPageRespVO);
|
||||
PageResult<OrderViewPartPageRespVO> getBodyViewPartsPage(OrderCadViewPlatePageReqVO orderBodyPageRespVO);
|
||||
|
||||
|
||||
/**
|
||||
* 根据板件id获取柜体下所有板件+配件cad视图所需信息
|
||||
*
|
||||
* @param orderBodyPageRespVO
|
||||
* @return
|
||||
*/
|
||||
OrdersViewCadViewInfoRespVO getBodyViewCadInfo(OrderCadViewPlatePageReqVO orderBodyPageRespVO);
|
||||
|
||||
/**
|
||||
* 根据板件id获取柜体下所有配件cad视图所需信息
|
||||
*
|
||||
* @param orderBodyPageRespVO
|
||||
* @return
|
||||
*/
|
||||
OrdersViewCadViewInfoRespVO getBodyViewPartCadInfo(OrderCadViewPlatePageReqVO orderBodyPageRespVO);
|
||||
}
|
||||
+100
-12
@@ -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<OrderBodyViewPlatesPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrderBodyViewPlatesPageDO> pageRes = orderItemMapper.selectBodyViewPlatesPage(page, pageReqVO.getOrderId(),
|
||||
PageDTO<OrdersViewPlatesPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrdersViewPlatesPageDO> pageRes = orderItemMapper.selectOrdersViewPlatesPage(page, List.of(pageReqVO.getOrderId()),
|
||||
bodyIds, pageReqVO.getGroupId(), null, false);
|
||||
|
||||
List<OrderBodyViewPlatesPageDO> records = pageRes.getRecords();
|
||||
List<OrdersViewPlatesPageDO> 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<OrderViewPlatePageRespVO> getBodyViewPlatesCadInfo(OrderCadViewPlatePageReqVO reqVO) {
|
||||
public PageResult<OrderViewPartPageRespVO> getBodyViewPartsPage(OrderCadViewPlatePageReqVO pageReqVO) {
|
||||
Set<Long> bodyIds = pageReqVO.getBodyIds();
|
||||
if (CollUtil.isEmpty(bodyIds)) {
|
||||
return new PageResult<>(Collections.emptyList(), 0L);
|
||||
}
|
||||
List<OrderBodyDO> orderBodyDOList = orderBodyMapper.selectByIds(bodyIds);
|
||||
if (CollUtil.isEmpty(orderBodyDOList)) {
|
||||
throw new ServiceException(ORDER_BODY_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 整理出body_id和cad图纸id的关系
|
||||
Map<Long, Long> bodyIdAndCadViewFileIdMap = orderBodyDOList.stream()
|
||||
.filter(item -> item.getCadViewFileId() != null)
|
||||
.collect(Collectors.toMap(OrderBodyDO::getId, OrderBodyDO::getCadViewFileId));
|
||||
|
||||
PageDTO<OrdersViewPartsPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrdersViewPartsPageDO> pageRes = orderItemMapper.selectOrdersViewPartsPage(page, List.of(pageReqVO.getOrderId()),
|
||||
bodyIds, pageReqVO.getGroupId(), null, pageReqVO.getName(), false);
|
||||
|
||||
List<OrdersViewPartsPageDO> 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<OrderBodyDO> 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<OrderBodyViewPlatesPageDO> page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrderBodyViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectBodyViewPlatesPage(page, orderId, bodyIds, reqVO.getGroupId(), null, true);
|
||||
PageDTO<OrdersViewPlatesPageDO> page1 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page1, List.of(orderId), bodyIds, reqVO.getGroupId(), null, true);
|
||||
|
||||
List<OrderBodyViewPlatesPageDO> records = viewPlatesPage.getRecords();
|
||||
List<OrdersViewPlatesPageDO> 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<OrdersViewPartsPageDO> page2 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPartsPageDO> viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page2, List.of(orderId), bodyIds, reqVO.getGroupId(), null, null, true);
|
||||
|
||||
List<OrdersViewPartsPageDO> 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<Long> bodyIds = reqVO.getBodyIds();
|
||||
|
||||
// 匹配柜体
|
||||
if(CollUtil.isEmpty(bodyIds)) {
|
||||
return ordersViewCadViewInfoRespVO;
|
||||
}
|
||||
List<OrderBodyDO> orderBodyDOList = orderBodyMapper.selectByIds(bodyIds);
|
||||
if (CollUtil.isEmpty(orderBodyDOList)) {
|
||||
throw new ServiceException(ORDER_BODY_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 整理出body_id和cad图纸id的关系
|
||||
Map<Long, Long> bodyIdAndCadViewFileIdMap = orderBodyDOList.stream()
|
||||
.filter(item -> item.getCadViewFileId() != null)
|
||||
.collect(Collectors.toMap(OrderBodyDO::getId, OrderBodyDO::getCadViewFileId));
|
||||
|
||||
// 查询所有配件的视图所需信息
|
||||
PageDTO<OrdersViewPartsPageDO> page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPartsPageDO> viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page, List.of(orderId), bodyIds, reqVO.getGroupId(), null, reqVO.getName(), true);
|
||||
|
||||
List<OrdersViewPartsPageDO> 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;
|
||||
}
|
||||
}
|
||||
+162
-43
@@ -534,68 +534,187 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectBodyViewPlatesPage" resultType="com.cf.imes.module.executor.dal.dataobject.orderItem.OrderBodyViewPlatesPageDO">
|
||||
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, p.cad_view_id
|
||||
<choose>
|
||||
<when test="cadView">
|
||||
, p.seal_left, p.seal_down, p.seal_right, p.seal_up
|
||||
</when>
|
||||
<otherwise>
|
||||
, 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
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
, i.comp_id
|
||||
</if>
|
||||
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 i.order_id = #{orderId} AND p.deleted = false and i.plate_id != 0
|
||||
<if test="bodyIds != null and bodyIds.size() > 0">
|
||||
AND i.body_id in
|
||||
<foreach item="bodyId" collection="bodyIds" open="(" separator="," close=")">
|
||||
#{bodyId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND i.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
AND i.comp_id in
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectOrdersViewPlatesPage" resultType="com.cf.imes.module.executor.dal.dataobject.orderItem.OrderBodyViewPlatesPageDO">
|
||||
SELECT p.order_id, 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, p.cad_view_id
|
||||
<select id="selectOrdersViewPlatesPage" resultType="com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPlatesPageDO">
|
||||
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
|
||||
<choose>
|
||||
<when test="cadView">
|
||||
, p.seal_left, p.seal_down, p.seal_right, p.seal_up
|
||||
</when>
|
||||
<otherwise>
|
||||
, 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
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
, i.comp_id
|
||||
</if>
|
||||
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
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
, MIN(comp_id) AS comp_id
|
||||
</if>
|
||||
FROM order_item
|
||||
WHERE plate_id != 0
|
||||
<if test="bodyIds != null and bodyIds.size() > 0">
|
||||
AND body_id IN
|
||||
<foreach item="bodyId" collection="bodyIds" open="(" separator="," close=")">
|
||||
#{bodyId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND group_id = #{groupId}
|
||||
</if>
|
||||
<if test="orderIds != null and orderIds.size() > 0">
|
||||
AND i.order_id in
|
||||
AND order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
AND i.comp_id in
|
||||
AND comp_id IN
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
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
|
||||
</select>
|
||||
|
||||
<select id="selectOrdersViewPartsPage" resultType="com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPartsPageDO">
|
||||
SELECT
|
||||
op.id,
|
||||
op.type,
|
||||
op.name,
|
||||
op.material,
|
||||
op.color,
|
||||
op.model,
|
||||
op.spec,
|
||||
i.num,
|
||||
op.unit,
|
||||
op.factory,
|
||||
i.body_id,
|
||||
i.cad_view_id,
|
||||
op.remark,
|
||||
op.width,
|
||||
op.length,
|
||||
op.thickness
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
, i.comp_id
|
||||
</if>
|
||||
FROM (
|
||||
SELECT
|
||||
parts_id,
|
||||
cad_view_id,
|
||||
MIN(body_id) AS body_id,
|
||||
SUM(num) AS num
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
, MIN(comp_id) AS comp_id
|
||||
</if>
|
||||
FROM order_item
|
||||
WHERE plate_id = 0
|
||||
<if test="orderIds != null and orderIds.size() > 0">
|
||||
AND order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="bodyIds != null and bodyIds.size() > 0">
|
||||
AND body_id IN
|
||||
<foreach item="bodyId" collection="bodyIds" open="(" separator="," close=")">
|
||||
#{bodyId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND group_id = #{groupId}
|
||||
</if>
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
AND comp_id IN
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY parts_id, cad_view_id
|
||||
) i
|
||||
INNER JOIN order_parts op
|
||||
ON op.id = i.parts_id
|
||||
WHERE op.deleted = false
|
||||
<if test="cadView">
|
||||
AND op.name != '封边条' AND op.name != '三合一'
|
||||
</if>
|
||||
<if test="name != null">
|
||||
AND op.name = #{name}
|
||||
</if>
|
||||
ORDER BY op.id, op.type
|
||||
</select>
|
||||
|
||||
<select id="selectComponentCorrelationPlateIds" resultType="java.lang.Long">
|
||||
select oi.plate_id
|
||||
from order_item oi
|
||||
where oi.plate_id != 0
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
and oi.comp_id in
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="orderIds != null and orderIds.size() > 0">
|
||||
AND oi.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM order_plate op
|
||||
WHERE op.id = oi.plate_id
|
||||
AND op.order_id = oi.order_id
|
||||
AND op.deleted = false
|
||||
)
|
||||
GROUP BY oi.plate_id;
|
||||
</select>
|
||||
|
||||
<select id="selectComponentCorrelationPartsIds" resultType="java.lang.Long">
|
||||
SELECT oi.parts_id
|
||||
FROM order_item oi
|
||||
WHERE oi.parts_id != 0
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
AND oi.comp_id IN
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="orderIds != null and orderIds.size() > 0">
|
||||
AND oi.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM order_parts op
|
||||
WHERE op.id = oi.parts_id
|
||||
AND op.order_id = oi.order_id
|
||||
AND op.deleted = false
|
||||
)
|
||||
GROUP BY oi.parts_id
|
||||
</select>
|
||||
</mapper>
|
||||
+5
-2
@@ -346,6 +346,7 @@
|
||||
<result property="partsThickness" column="partsThickness"/>
|
||||
<result property="category" column="category"/>
|
||||
<result property="subparts" column="subparts"/>
|
||||
<result property="componentName" column="componentName"/>
|
||||
|
||||
<collection property="count" ofType="java.math.BigDecimal" column="count"/>
|
||||
<collection property="roomId" ofType="java.lang.Long" column="roomId"/>
|
||||
@@ -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
|
||||
|
||||
|
||||
+18
-1
@@ -778,6 +778,14 @@
|
||||
<result property="isSideSculpt" column="isSideSculpt"/>
|
||||
<result property="is2v" column="is2v"/>
|
||||
<result property="isSide2v" column="isSide2v"/>
|
||||
<result property="componentName" column="componentName"/>
|
||||
<result property="brand" column="brand"/>
|
||||
<result property="splitWidth" column="splitWidth"/>
|
||||
<result property="splitHeight" column="splitHeight"/>
|
||||
<result property="sealLeft" column="sealLeft"/>
|
||||
<result property="sealRight" column="sealRight"/>
|
||||
<result property="sealUp" column="sealUp"/>
|
||||
<result property="sealDown" column="sealDown"/>
|
||||
|
||||
<collection property="processGroupNameList" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.manage.pack.vo.GroupNameList">
|
||||
<result property="name" column="name"/>
|
||||
@@ -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}
|
||||
|
||||
|
||||
+8
-1
@@ -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=该部件已恢复勿重复操作,请刷新列表后检查状态
|
||||
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=该订单已打包完成,无法操作
|
||||
+8
-1
@@ -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=該部件已恢復勿重複操作,請重繪清單後檢查狀態
|
||||
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=該訂單已打包完成,無法操作
|
||||
+8
-1
@@ -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
|
||||
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
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class WebCadDataPartsReqVO {
|
||||
private GroupDataDTO groupData;
|
||||
|
||||
// 组件id
|
||||
private List<Integer> componentIds;
|
||||
private List<Integer> componentIds = new ArrayList<>();
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
|
||||
+4
@@ -79,4 +79,8 @@ public class OrderItemDO {
|
||||
*/
|
||||
private Long compId;
|
||||
|
||||
/**
|
||||
* cad视图id
|
||||
*/
|
||||
private Integer cadViewId;
|
||||
}
|
||||
-29
@@ -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
|
||||
*/
|
||||
|
||||
-59
@@ -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图纸数据
|
||||
*/
|
||||
|
||||
+18
-7
@@ -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<PlateDO> 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
|
||||
|
||||
+18
-7
@@ -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<PlateDO> 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
|
||||
|
||||
Reference in New Issue
Block a user