mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
新版分堆打包开发
This commit is contained in:
+16
-37
@@ -1,21 +1,19 @@
|
||||
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 com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.OrdersHeapSplitDetailRespVO;
|
||||
import com.cf.imes.module.executor.service.heapsplit.HeapSplitService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
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;
|
||||
@@ -35,38 +33,19 @@ import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
public class HeapSplitController {
|
||||
|
||||
@Resource
|
||||
private HeapSplitTaskService heapSplitTaskService;
|
||||
private HeapSplitService heapSplitService;
|
||||
|
||||
@PostMapping("/task")
|
||||
@Operation(summary = "保存分堆任务")
|
||||
public CommonResult<Boolean> saveHeapsplitTask(@Valid @RequestBody HeapSplitTaskSaveReqVO reqVO) {
|
||||
heapSplitTaskService.saveHeapsplitTask(reqVO);
|
||||
@PostMapping("")
|
||||
@Operation(summary = "保存分堆")
|
||||
public CommonResult<Boolean> saveHeapsplit(@Valid @RequestBody HeapSplitSaveReqVO reqVO) {
|
||||
heapSplitService.saveHeapsplit(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("/details")
|
||||
@Operation(summary = "查询分堆详情")
|
||||
@Parameter(name = "orderIds", description = "订单ID列表", required = true)
|
||||
public CommonResult<OrdersHeapSplitDetailRespVO> getOrdersHeapSplitDetail(@RequestBody @NotEmpty(message = "订单ID不能为空") List<Long> orderIds) {
|
||||
return success(heapSplitService.getOrdersHeapSplitedDetail(orderIds));
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
-58
@@ -11,6 +11,7 @@ import com.cf.imes.module.executor.service.manage.query.ProductionStatusService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -55,34 +56,26 @@ public class PackController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getOrderPlateList")
|
||||
@Operation(summary = "查询多个订单对应的板材信息")
|
||||
@Parameter(name = "orderIds", description = "订单ID", required = true)
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:pack:create','manage:pack:pre-pack','manage:pack:pack')")
|
||||
public CommonResult<List<PlateDetailsRespVO>> getOrdersPlateList(@Valid @RequestParam("orderIds") List<Long> orderIds) {
|
||||
|
||||
return success(packService.getOrdersPlateList(orderIds));
|
||||
|
||||
@PostMapping("/unpack/details")
|
||||
@Operation(summary = "获取订单列表下未打包明细")
|
||||
@Parameter(name = "orderIds", description = "订单ID列表", required = true)
|
||||
public CommonResult<OrdersUnpackDetailRespVO> getOrdersUnpackDetail(@RequestBody @NotEmpty(message = "订单ID不能为空") List<Long> orderIds) {
|
||||
return success(packService.getOrdersUnpackDetails(orderIds));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getOrderPack")
|
||||
@PostMapping("/getOrderPack")
|
||||
@Operation(summary = "查看生产订单对应的包裹信息-未分页")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:pack:export-pack-num','manage:pack:pack')")
|
||||
public CommonResult<List<OrderPackageVO>> getOrderPack(@Valid PackageDetailsReqVO reqVO) {
|
||||
|
||||
public CommonResult<List<OrderPackageVO>> getOrderPack(@Valid @RequestBody PackageDetailsReqVO reqVO) {
|
||||
return success(packService.getOrderPack(reqVO));
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/queryPackageDetails")
|
||||
@GetMapping("/packageDetails/{packageNo}")
|
||||
@Operation(summary = "查询包裹的详细信息")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:pack:pack-details','manage:pack:query')")
|
||||
public CommonResult<PageResult<PackageDetailsRespVO>> queryPackageDetails(@Valid PackDetailsReqVO reqVO){
|
||||
|
||||
return CommonResult.success(productionStatusService.queryPackageDetails(reqVO));
|
||||
|
||||
public CommonResult<List<PackageDetailsRespVO>> queryPackageDetails(@PathVariable String packageNo){
|
||||
return success(packService.getPackageDetails(packageNo));
|
||||
}
|
||||
|
||||
|
||||
@@ -95,50 +88,13 @@ public class PackController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getParts")
|
||||
@Operation(summary = "查看配件列表")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack-parts:query')")
|
||||
public CommonResult<List<OrderPartsRespVO>> getParts(@Valid OrderPartsReqVO reqVO) {
|
||||
|
||||
return success(packService.getPartsList(reqVO));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PutMapping("/updatePack")
|
||||
@Operation(summary = "板材包裹更新-即封包")
|
||||
@Operation(summary = "封包")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:update')")
|
||||
public CommonResult<OrderPackRespVO> updatePack(@Valid @RequestBody OrderPackReqVO packageVO) {
|
||||
|
||||
return success(packService.updatePack(packageVO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PutMapping("/updateParts")
|
||||
@Operation(summary = "配件包裹更新-即封包")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:update')")
|
||||
public CommonResult<OrderPackRespVO> updateParts(@Valid @RequestBody OrderPartsReqVO reqVO) {
|
||||
|
||||
return success(packService.updateParts(reqVO));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/selectPack")
|
||||
@Operation(summary = "查询包裹")
|
||||
@Parameter(name = "orderId", description = "订单Id", required = true)
|
||||
@@ -169,7 +125,7 @@ public class PackController {
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:unpacking')")
|
||||
public CommonResult<OrderPackRespVO> unpacking(@Valid @RequestBody PackingReqVO reqVO) {
|
||||
|
||||
OrderPackRespVO unpacking = packService.unpacking(reqVO.getPackageId());
|
||||
OrderPackRespVO unpacking = packService.unpacking(reqVO.getPackageNo());
|
||||
|
||||
return success(unpacking);
|
||||
}
|
||||
@@ -223,7 +179,7 @@ public class PackController {
|
||||
|
||||
|
||||
|
||||
@GetMapping("/scan/correlation")
|
||||
@PostMapping("/scan/correlation")
|
||||
@Operation(summary = "查询扫描类型相关的板件+配件id")
|
||||
public CommonResult<List<Long>> getComponentCorrelation(@Valid @RequestBody PackScanComponentCorrelationReqVO reqVO) {
|
||||
return success(packService.getComponentCorrelation(reqVO));
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackagePartsSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/3/10 17:36
|
||||
*/
|
||||
@Schema(description = "管理后台 - 分堆打包 - 保存分堆 Request VO")
|
||||
@Data
|
||||
public class HeapSplitSaveReqVO {
|
||||
@Schema(description = "板件id列表")
|
||||
private List<Long> plateIds = new ArrayList<>();
|
||||
|
||||
@Schema(description = "删除的板件id列表")
|
||||
private List<Long> delPlateIds = new ArrayList<>();
|
||||
|
||||
@Schema(description = "配件id列表")
|
||||
private List<PackagePartsSaveReqVO> parts = new ArrayList<>();
|
||||
|
||||
@Schema(description = "删除的配件id列表")
|
||||
private List<PackagePartsSaveReqVO> delParts = new ArrayList<>();
|
||||
|
||||
@Schema(description = "订单id列表")
|
||||
private List<Long> orderIds = new ArrayList<>();
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
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
@@ -1,49 +0,0 @@
|
||||
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;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.OrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PlateDetailsRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/3/12 17:05
|
||||
*/
|
||||
@Schema(description = "管理后台 - 分堆打包 - 分堆明细 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class OrdersHeapSplitDetailRespVO {
|
||||
|
||||
@Schema(description = "板件列表")
|
||||
private List<PlateDetailsRespVO> plates;
|
||||
|
||||
@Schema(description = "配件列表")
|
||||
private List<OrderPartsRespVO> parts;
|
||||
}
|
||||
+12
-28
@@ -1,12 +1,12 @@
|
||||
package com.cf.imes.module.executor.controller.admin.manage.pack.vo;
|
||||
|
||||
|
||||
import com.cf.imes.module.executor.validation.manage.pack.PackTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 包裹新增 Request VO")
|
||||
@@ -14,44 +14,28 @@ import java.util.List;
|
||||
@ToString(callSuper = true)
|
||||
public class OrderPackReqVO {
|
||||
|
||||
|
||||
@Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long packId;
|
||||
|
||||
|
||||
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "订单号为空")
|
||||
private Long orderId;
|
||||
|
||||
private List<Long> orderIds;
|
||||
|
||||
@Schema(description = "包裹编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String packNo;
|
||||
|
||||
|
||||
@Schema(description = "包裹类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@PackTypeValid
|
||||
private Integer packageType;
|
||||
|
||||
|
||||
// @Schema(description = "包裹状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// private Long packStatus;
|
||||
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "新增的板件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> addPlateIdList;
|
||||
|
||||
private List<Long> addPlateIdList = new ArrayList<>();
|
||||
|
||||
@Schema(description = "移除的板件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> deletePlateIdList;
|
||||
|
||||
|
||||
@Schema(description = "新增的配件包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> addPartsIdList;
|
||||
private List<Long> deletePlateIdList = new ArrayList<>();
|
||||
|
||||
@Schema(description = "打包方式:0柜名、1房名、2订单")
|
||||
private Integer packMethod = 1;
|
||||
|
||||
@Schema(description = "新增打包的配件列表")
|
||||
private List<PackagePartsSaveReqVO> addPartsList = new ArrayList<>();
|
||||
|
||||
@Schema(description = "移除包裹的配件列表")
|
||||
private List<PackagePartsSaveReqVO> delPartsList = new ArrayList<>();
|
||||
}
|
||||
|
||||
+5
@@ -5,6 +5,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 订单包裹表 Response VO")
|
||||
@Data
|
||||
@@ -17,6 +19,9 @@ public class OrderPackRespVO {
|
||||
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "订单号列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> orderIds;
|
||||
|
||||
@Schema(description = "包裹编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String packageNo;
|
||||
|
||||
|
||||
+4
-1
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.executor.controller.admin.manage.pack.vo;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
@@ -16,9 +17,11 @@ public class OrderPartsReqVO /*extends PageParam*/ {
|
||||
|
||||
|
||||
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "订单号为空")
|
||||
// @NotNull(message = "订单号为空")
|
||||
private Long orderId;
|
||||
|
||||
private List<Long> orderIds;
|
||||
|
||||
|
||||
@Schema(description = "更新配件时传-包裹ID")
|
||||
private Long packId;
|
||||
|
||||
+36
-13
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.executor.controller.admin.manage.pack.vo;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -11,6 +12,28 @@ import java.util.List;
|
||||
@Data
|
||||
public class OrderPartsRespVO {
|
||||
|
||||
@Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long packageId;
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "包裹号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String packageNo;
|
||||
|
||||
@Schema(description = "房间名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("房间名称")
|
||||
private String roomName;
|
||||
|
||||
@Schema(description = "柜体名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("柜体名称")
|
||||
private String cabinetName;
|
||||
|
||||
@Schema(description = "房间ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String roomId;
|
||||
|
||||
@Schema(description = "柜体ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String bodyId;
|
||||
|
||||
@Schema(description = "配件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long partsId;
|
||||
@@ -67,23 +90,23 @@ public class OrderPartsRespVO {
|
||||
@Schema(description = "子配件ID列表,复合部件时记录子配件ID,半角逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String subparts;
|
||||
|
||||
|
||||
@Schema(description = "数量-用于计算,不显示")
|
||||
private List<BigDecimal> count;
|
||||
|
||||
|
||||
@Schema(description = "房间-用于计算-不显示")
|
||||
private List<Long> roomId;
|
||||
|
||||
|
||||
@Schema(description = "柜体-用于计算-不显示")
|
||||
private List<Long> bodyId;
|
||||
|
||||
|
||||
@Schema(description = "加工组-用于计算-不显示")
|
||||
private List<Long> groupId;
|
||||
|
||||
@Schema(description = "组件名称")
|
||||
private String componentName;
|
||||
|
||||
private List<GroupNameList> processGroupNameList;
|
||||
|
||||
@Schema(description = "加工组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String processGroup;
|
||||
|
||||
@Schema(description = "分堆状态,true:已分堆")
|
||||
private Boolean heapSplitStatus;
|
||||
|
||||
@Schema(description = "分堆数量")
|
||||
private BigDecimal heapNum;
|
||||
|
||||
@Schema(description = "打包数量")
|
||||
private BigDecimal packNum;
|
||||
}
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.cf.imes.module.executor.controller.admin.manage.pack.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/3/12 17:05
|
||||
*/
|
||||
@Schema(description = "管理后台 - 分堆打包 - 订单未打包明细 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class OrdersUnpackDetailRespVO {
|
||||
|
||||
@Schema(description = "未打包板件列表")
|
||||
private List<PlateDetailsRespVO> plates;
|
||||
|
||||
@Schema(description = "未打包配件列表")
|
||||
private List<OrderPartsRespVO> parts;
|
||||
}
|
||||
+2
-17
@@ -5,30 +5,15 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 删除订单包裹 Request VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class PackReqVO {
|
||||
|
||||
@Schema(description = "订单ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "订单号为空,请重新删除配件")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "包裹信息为空,请重新删除配件")
|
||||
private Long packageId;
|
||||
|
||||
private List<Long> orderIds;
|
||||
|
||||
@Schema(description = "包裹编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long packageNo;
|
||||
|
||||
|
||||
@Schema(description = "是否是其他类型的包裹", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "包裹类型为空,请重新删除配件")
|
||||
private Boolean isOther;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
-1
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
public class PackScanComponentCorrelationReqVO {
|
||||
|
||||
@InEnum(PackScanComponentCorrelationTypeEnum.class)
|
||||
@Schema(description = "扫描类型,0部件父级、1部件顶级")
|
||||
@Schema(description = "扫描类型,0本身、1部件父级、2部件顶级")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "扫描本体编号")
|
||||
@@ -31,4 +31,7 @@ public class PackScanComponentCorrelationReqVO {
|
||||
|
||||
@Schema(description = "订单ID列表")
|
||||
private List<Long> orderIds;
|
||||
|
||||
@Schema(description = "是否关联加工组")
|
||||
private boolean relateGroup;
|
||||
}
|
||||
|
||||
+4
@@ -9,6 +9,8 @@ import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 查看订单下对应的包裹信息")
|
||||
@Data
|
||||
@@ -21,6 +23,8 @@ public class PackageDetailsReqVO extends PageParam {
|
||||
@Length(max = 19,message = "订单号长度不能超过 19 位")
|
||||
private String orderId;
|
||||
|
||||
private List<Long> orderIds;
|
||||
|
||||
|
||||
@Schema(description = "板编号")
|
||||
@Pattern(regexp = "^[0-9]*$",message = "板编号必须为数字")
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.executor.controller.admin.manage.pack.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/3/26 17:11
|
||||
*/
|
||||
@Schema(description = "管理后台 - 分堆打包 - 分堆打包配件提交 Request VO")
|
||||
@Data
|
||||
public class PackagePartsSaveReqVO {
|
||||
@Schema(description = "配件ID")
|
||||
private Long partsId;
|
||||
|
||||
@Schema(description = "处理配件数量")
|
||||
private Integer num;
|
||||
|
||||
@Schema(description = "柜体ID")
|
||||
private Long bodyId;
|
||||
|
||||
@Schema(description = "房间ID")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
private Long orderId;
|
||||
}
|
||||
+2
-2
@@ -13,9 +13,9 @@ import jakarta.validation.constraints.NotNull;
|
||||
public class PackingReqVO {
|
||||
|
||||
|
||||
@Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "包裹编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "包裹异常,请查看是否封包")
|
||||
private Long packageId;
|
||||
private Long packageNo;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -162,4 +162,7 @@ public class PlateDetailsRespVO {
|
||||
|
||||
@Schema(description = "部件名称")
|
||||
private String componentName;
|
||||
|
||||
@Schema(description = "分堆状态,true:已分堆")
|
||||
private Boolean heapSplitStatus;
|
||||
}
|
||||
|
||||
+52
-14
@@ -1,7 +1,7 @@
|
||||
package com.cf.imes.module.executor.controller.admin.manage.query.vo.pack;
|
||||
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.GroupNameList;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -10,11 +10,14 @@ import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 包裹详情 Response VO")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class PackageDetailsRespVO {
|
||||
|
||||
@Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long packageNo;
|
||||
|
||||
@Schema(description = "订单ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String orderId;
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "房间名称-板材类型显示", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String roomName;
|
||||
@@ -70,17 +73,11 @@ public class PackageDetailsRespVO {
|
||||
@Schema(description = "备注(板材和配件都要传递)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "加工组名称集合")
|
||||
private List<GroupNameList> processGroupNameList;
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description = "配件名称-配件类型显示", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
private String partsName;
|
||||
|
||||
@Schema(description = "配件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long partsId;
|
||||
private Long partsId;
|
||||
|
||||
@Schema(description = "型号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String model;
|
||||
@@ -130,15 +127,56 @@ public class PackageDetailsRespVO {
|
||||
private List<BigDecimal> count;
|
||||
|
||||
|
||||
@Schema(description = "房间-用于计算-不显示")
|
||||
private List<Long> roomId;
|
||||
@Schema(description = "房间ID")
|
||||
private Long roomId;
|
||||
|
||||
|
||||
@Schema(description = "柜体-用于计算-不显示")
|
||||
private List<Long> bodyId;
|
||||
@Schema(description = "柜体ID")
|
||||
private Long bodyId;
|
||||
|
||||
|
||||
@Schema(description = "加工组-用于计算-不显示")
|
||||
private List<Long> groupId;
|
||||
|
||||
@Schema(description = "排版面")
|
||||
private String holeFace;
|
||||
|
||||
@Schema(description = "排孔类型")
|
||||
private String holeArrange;
|
||||
|
||||
@Schema(description = "开门类型")
|
||||
private String openDoorType;
|
||||
|
||||
@Schema(description = "是否侧面造型")
|
||||
private Boolean isSideSculpt;
|
||||
|
||||
@Schema(description = "是否二维刀路")
|
||||
private Boolean is2v;
|
||||
|
||||
@Schema(description = "是否侧面二维刀路")
|
||||
private Boolean isSide2v;
|
||||
|
||||
@Schema(description = "部件名称")
|
||||
private String componentName;
|
||||
|
||||
@Schema(description = "开料长")
|
||||
private BigDecimal splitHeight;
|
||||
|
||||
@Schema(description = "开料宽")
|
||||
private BigDecimal splitWidth;
|
||||
|
||||
@Schema(description = "左封边厚度")
|
||||
private BigDecimal sealLeft;
|
||||
|
||||
|
||||
@Schema(description = "右封边厚度")
|
||||
private BigDecimal sealRight;
|
||||
|
||||
|
||||
@Schema(description = "上封边厚度")
|
||||
private BigDecimal sealUp;
|
||||
|
||||
|
||||
@Schema(description = "下封边厚度")
|
||||
private BigDecimal sealDown;
|
||||
}
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ import java.time.LocalDateTime;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderDO extends BaseDO {
|
||||
public static final Long PARENT_ID_ROOT = 0L;
|
||||
|
||||
/**
|
||||
* 订单号,主键
|
||||
|
||||
+20
@@ -63,6 +63,17 @@ public class OrderItemDO {
|
||||
* 部件数量
|
||||
*/
|
||||
private Double num;
|
||||
|
||||
/**
|
||||
* 已打包数量
|
||||
*/
|
||||
private Double packNum;
|
||||
|
||||
/**
|
||||
* 已分堆数量
|
||||
*/
|
||||
private Double heapNum;
|
||||
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
@@ -76,4 +87,13 @@ public class OrderItemDO {
|
||||
* cad视图id
|
||||
*/
|
||||
private Integer cadViewId;
|
||||
|
||||
/**
|
||||
* 分堆状态
|
||||
*/
|
||||
private Integer heapSplitStatus;
|
||||
|
||||
private Boolean source;
|
||||
|
||||
private Long sourceId;
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.pack;
|
||||
|
||||
|
||||
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 lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@TableName("order_package_new")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderPackagDONew extends BaseDO {
|
||||
|
||||
// 组织 ID
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long organId;
|
||||
|
||||
// 订单号
|
||||
private Long orderId;
|
||||
|
||||
// 包裹编号
|
||||
private String packageNo;
|
||||
|
||||
// 包裹名
|
||||
private String name;
|
||||
|
||||
// 包裹状态,0未封包,1已封包,2已入库,3已出库
|
||||
private Integer status;
|
||||
|
||||
|
||||
// 备注
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -320,4 +320,11 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
* @return
|
||||
*/
|
||||
OrderPlateNumAndAreaDO selectPlateNumAndArea(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 更新订单打包状态
|
||||
*
|
||||
* @param orderIds
|
||||
*/
|
||||
void updateOrdersPackageStatus(@Param("orderIds") List<Long> orderIds);
|
||||
}
|
||||
|
||||
+37
-11
@@ -139,22 +139,46 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
|
||||
void deleteOtherParts(@Param("partsId") Long partsId,@Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
|
||||
/**
|
||||
* 更新板件item的包裹id
|
||||
*
|
||||
* @param plateIdList
|
||||
* @param packageNo
|
||||
* @param orderIds
|
||||
*/
|
||||
void updatePlatesItemPackageId(@Param("plateIdList") List<Long> plateIdList, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 更新配件item的包裹id
|
||||
*
|
||||
* @param addPartsList
|
||||
* @param packageNo
|
||||
* @param orderIds
|
||||
*/
|
||||
void updatePartsItemPackageId(@Param("addPartsList") List<Long> addPartsList, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
|
||||
|
||||
void insertPackId(@Param("plateIdList") List<Long> plateIdList, @Param("packId") Long packId,@Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
|
||||
|
||||
void deletePackId(@Param("deletePlateIdList") List<Long> deletePlateIdList,@Param("packId") Long packId,@Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
/**
|
||||
* 更新板件item解包package_id = 0
|
||||
*
|
||||
* @param deletePlateIdList
|
||||
* @param packageNo
|
||||
* @param orderIds
|
||||
*/
|
||||
void updatePlatesItemUnPackageId(@Param("deletePlateIdList") List<Long> deletePlateIdList, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 更新配件item解包package_id = 0
|
||||
*
|
||||
* @param deletePartsList
|
||||
* @param packageNo
|
||||
* @param orderIds
|
||||
*/
|
||||
void updatePartsItemUnPackageId(@Param("deletePartsList") List<Long> deletePartsList, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
|
||||
void insertPartsId(@Param("packId") Long packId, @Param("addPartsIdList") List<Long> addPartsIdList,@Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
|
||||
|
||||
void insertParts(@Param("addPartsList") List<Long> addPartsList, @Param("packId")Long packId, @Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
|
||||
void deletePartsList(@Param("deletePartsList")List<Long> deletePartsList,@Param("packId") Long packId,@Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
|
||||
|
||||
default List<OrderItemDO> selectPackList(Long packId, Long orderId , Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<OrderItemDO>()
|
||||
.eq(OrderItemDO::getOrganId, organId)
|
||||
@@ -230,16 +254,18 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
*
|
||||
* @param componentIds
|
||||
* @param orderIds
|
||||
* @param groupId
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectComponentCorrelationPlateIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds);
|
||||
List<Long> selectComponentCorrelationPlateIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds, @Param("groupId") Long groupId);
|
||||
|
||||
/**
|
||||
* 查询部件关联的部件ID列表
|
||||
*
|
||||
* @param componentIds
|
||||
* @param orderIds
|
||||
* @param groupId
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectComponentCorrelationPartsIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds);
|
||||
List<Long> selectComponentCorrelationPartsIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds, @Param("groupId") Long groupId);
|
||||
}
|
||||
+23
-2
@@ -18,6 +18,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
|
||||
@@ -115,10 +116,30 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsDO> {
|
||||
@Param("roomId")Long roomId,
|
||||
@Param("bodyId")Long bodyId);
|
||||
|
||||
IPage<PackageDetailsRespVO> selectParts(@Param("page") IPage page, @Param("packageId") Long packageId, @Param("organId") Long organId);
|
||||
/**
|
||||
* 查询包裹配件列表
|
||||
*
|
||||
* @param orderIds
|
||||
* @param packageId
|
||||
* @return
|
||||
*/
|
||||
List<PackageDetailsRespVO> selectPackedParts(@Param("orderIds") Set<Long> orderIds, @Param("packageNo") String packageId);
|
||||
|
||||
/**
|
||||
* 查询订单列表未打包配件
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<OrderPartsRespVO> selectOrdersPartsList(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
List<OrderPartsRespVO> selectPartsList(@Param("orderId") Long orderId , @Param("organId") Long organId);
|
||||
/**
|
||||
* 查询订单列表未打包配件
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<OrderPartsRespVO> selectOrdersHeapSplitPartsList(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
|
||||
|
||||
|
||||
+7
@@ -113,4 +113,11 @@ public interface OrderPackageMapper extends BaseMapperX<OrderPackageDO> {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表下的所有包裹编号
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<OrderPackageVO> getPackageNoInOrderIds(@Param("orderIds") List<Long> orderIds);
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.pack;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.dal.dataobject.pack.OrderPackagDONew;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/3/25 13:55
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderPackageNewMapper extends BaseMapperX<OrderPackagDONew> {
|
||||
}
|
||||
+23
-2
@@ -294,9 +294,30 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
|
||||
List<PlateDetailsRespVO> selectOrderNoPackPlateList(@Param("orderId") Long orderId, @Param("organId") Long organId);
|
||||
|
||||
List<PlateDetailsRespVO> selectOrderPackPlateList(@Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
||||
/**
|
||||
* 查询订单列表下未打包的板件
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<PlateDetailsRespVO> selectOrdersPackPlateList(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
IPage<PackageDetailsRespVO> selectPackPlateList(@Param("page") IPage<PackageDetailsRespVO> page, @Param("packageId") Long packageId, @Param("organId") Long organId);
|
||||
/**
|
||||
* 查询包裹板件列表
|
||||
*
|
||||
* @param orderIds
|
||||
* @param packageNo
|
||||
* @return
|
||||
*/
|
||||
List<PackageDetailsRespVO> selectPackedPlateList(@Param("orderIds") Set<Long> orderIds, @Param("packageNo") String packageNo);
|
||||
|
||||
/**
|
||||
* 查询订单列表下分堆列表
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<PlateDetailsRespVO> selectOrdersHeapSplitPlateList(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
List<LabelOrderPlateData> selectLabelOrderPlateDataByOrderId(@Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
|
||||
|
||||
+6
-2
@@ -15,15 +15,19 @@ import java.util.Arrays;
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum PackScanComponentCorrelationTypeEnum implements IntArrayValuable {
|
||||
/**
|
||||
* 本身
|
||||
*/
|
||||
SELF(0),
|
||||
/**
|
||||
* 部件父级
|
||||
*/
|
||||
PARENT(0),
|
||||
PARENT(1),
|
||||
|
||||
/**
|
||||
* 部件顶级
|
||||
*/
|
||||
TOP(1);
|
||||
TOP(2);
|
||||
|
||||
private final Integer type;
|
||||
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.executor.service.heapsplit;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.OrdersHeapSplitDetailRespVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 分堆任务 Service 接口
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/3/10 17:52
|
||||
*/
|
||||
public interface HeapSplitService {
|
||||
/**
|
||||
* 保存分堆
|
||||
*
|
||||
* @param reqVO
|
||||
*/
|
||||
void saveHeapsplit(HeapSplitSaveReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 获取订单列表分堆详情
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
OrdersHeapSplitDetailRespVO getOrdersHeapSplitedDetail(List<Long> orderIds);
|
||||
}
|
||||
+289
@@ -0,0 +1,289 @@
|
||||
package com.cf.imes.module.executor.service.heapsplit;
|
||||
|
||||
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.exception.ErrorCode;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.HeapSplitSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.heapsplit.OrdersHeapSplitDetailRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackagePartsSaveReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 分堆 ServiceImpl 接口实现类
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/3/10 17:53
|
||||
*/
|
||||
@Service
|
||||
public class HeapSplitServiceImpl implements HeapSplitService {
|
||||
|
||||
@Resource
|
||||
private OrderItemMapper orderItemMapper;
|
||||
|
||||
@Resource
|
||||
private PlateMapper plateMapper;
|
||||
|
||||
@Resource
|
||||
private OrderPartsMapper orderPartsMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveHeapsplit(HeapSplitSaveReqVO reqVO) {
|
||||
// 更新板件分堆状态
|
||||
List<Long> plateIds = reqVO.getPlateIds();
|
||||
if (CollUtil.isNotEmpty(plateIds)) {
|
||||
List<List<Long>> platePartitions = CollUtil.split(plateIds, 1000);
|
||||
for (List<Long> batch : platePartitions) {
|
||||
orderItemMapper.update(new LambdaUpdateWrapper<OrderItemDO>()
|
||||
.in(OrderItemDO::getOrderId, reqVO.getOrderIds())
|
||||
.in(OrderItemDO::getPlateId, batch)
|
||||
.eq(OrderItemDO::getHeapSplitStatus, 0)
|
||||
.set(OrderItemDO::getHeapSplitStatus, 1));
|
||||
}
|
||||
}
|
||||
|
||||
// 删除板件分堆状态
|
||||
List<Long> delPlateIds = reqVO.getDelPlateIds();
|
||||
if (CollUtil.isNotEmpty(delPlateIds)) {
|
||||
List<List<Long>> delPlatePartitions = CollUtil.split(delPlateIds, 1000);
|
||||
for (List<Long> batch : delPlatePartitions) {
|
||||
orderItemMapper.update(new LambdaUpdateWrapper<OrderItemDO>()
|
||||
.in(OrderItemDO::getOrderId, reqVO.getOrderIds())
|
||||
.in(OrderItemDO::getPlateId, batch)
|
||||
.eq(OrderItemDO::getHeapSplitStatus, 1)
|
||||
.set(OrderItemDO::getHeapSplitStatus, 0));
|
||||
}
|
||||
}
|
||||
|
||||
// 更新配件分堆状态
|
||||
List<PackagePartsSaveReqVO> parts = reqVO.getParts();
|
||||
Map<Long, List<PackagePartsSaveReqVO>> groupMap =
|
||||
parts.stream().collect(Collectors.groupingBy(PackagePartsSaveReqVO::getBodyId));
|
||||
|
||||
for (Map.Entry<Long, List<PackagePartsSaveReqVO>> entry : groupMap.entrySet()) {
|
||||
Long bodyId = entry.getKey();
|
||||
List<PackagePartsSaveReqVO> partsList = entry.getValue();
|
||||
|
||||
for (PackagePartsSaveReqVO partsSaveReqVO : partsList) {
|
||||
Long partsId = partsSaveReqVO.getPartsId();
|
||||
Integer num = partsSaveReqVO.getNum();
|
||||
// partsId下的所有明细,基于num正序,优先分堆数量小的
|
||||
List<OrderItemDO> orderItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||
.eq(OrderItemDO::getPartsId, partsId)
|
||||
.in(OrderItemDO::getOrderId, reqVO.getOrderIds())
|
||||
.eq(OrderItemDO::getBodyId, bodyId)
|
||||
.eq(OrderItemDO::getHeapSplitStatus, false)
|
||||
.orderByAsc(OrderItemDO::getNum));
|
||||
|
||||
allocateSingleGroup(orderItemDOS, num);
|
||||
}
|
||||
}
|
||||
|
||||
// 删除配件分堆状态
|
||||
List<PackagePartsSaveReqVO> delParts = reqVO.getDelParts();
|
||||
Map<Long, List<PackagePartsSaveReqVO>> delGroupMap =
|
||||
delParts.stream().collect(Collectors.groupingBy(PackagePartsSaveReqVO::getBodyId));
|
||||
for (Map.Entry<Long, List<PackagePartsSaveReqVO>> entry : delGroupMap.entrySet()) {
|
||||
Long bodyId = entry.getKey();
|
||||
List<PackagePartsSaveReqVO> partsList = entry.getValue();
|
||||
|
||||
for (PackagePartsSaveReqVO partsSaveReqVO : partsList) {
|
||||
Long partsId = partsSaveReqVO.getPartsId();
|
||||
Integer num = partsSaveReqVO.getNum();
|
||||
// partsId下的所有明细,基于num正序,优先分堆数量小的
|
||||
List<OrderItemDO> orderItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||
.eq(OrderItemDO::getPartsId, partsId)
|
||||
.in(OrderItemDO::getOrderId, reqVO.getOrderIds())
|
||||
.eq(OrderItemDO::getBodyId, bodyId)
|
||||
.orderByAsc(OrderItemDO::getNum));
|
||||
|
||||
restoreGroup(orderItemDOS, num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrdersHeapSplitDetailRespVO getOrdersHeapSplitedDetail(List<Long> orderIds) {
|
||||
OrdersHeapSplitDetailRespVO respVO = new OrdersHeapSplitDetailRespVO();
|
||||
respVO.setParts(orderPartsMapper.selectOrdersHeapSplitPartsList(orderIds));
|
||||
respVO.setPlates(plateMapper.selectOrdersHeapSplitPlateList(orderIds));
|
||||
return respVO;
|
||||
}
|
||||
|
||||
private void allocateSingleGroup(List<OrderItemDO> list, int targetNum) {
|
||||
|
||||
int remain = targetNum;
|
||||
|
||||
for (OrderItemDO item : list) {
|
||||
|
||||
if (remain <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
double current = Optional.ofNullable(item.getNum()).orElse(0.0);
|
||||
if (current <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 情况1:<= 直接吃掉(不拆分!)
|
||||
if (current <= remain) {
|
||||
|
||||
// 标记分堆
|
||||
item.setHeapSplitStatus(1);
|
||||
|
||||
// 更新分堆数量
|
||||
item.setHeapNum(current);
|
||||
|
||||
orderItemMapper.updateById(item);
|
||||
|
||||
remain -= current;
|
||||
}
|
||||
|
||||
// 情况2:> 需要拆分
|
||||
else {
|
||||
|
||||
// 1️⃣ 原记录扣减
|
||||
item.setHeapNum(current - remain);
|
||||
orderItemMapper.updateById(item);
|
||||
|
||||
// 2️⃣ 新建分堆记录
|
||||
OrderItemDO newItem = buildHeapItem(item, remain);
|
||||
orderItemMapper.insert(newItem);
|
||||
|
||||
remain = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (remain > 0) {
|
||||
throw new ServiceException(new ErrorCode(10001, "数量不足,剩余未分配:" + remain));
|
||||
}
|
||||
}
|
||||
|
||||
private OrderItemDO buildHeapItem(OrderItemDO source, double heapNum) {
|
||||
OrderItemDO newItem = new OrderItemDO();
|
||||
|
||||
// 基础字段复制(建议用BeanUtils)
|
||||
BeanUtils.copyProperties(source, newItem);
|
||||
|
||||
newItem.setId(null); // 新ID
|
||||
newItem.setHeapNum(heapNum);
|
||||
|
||||
// 标记为“已分堆”
|
||||
newItem.setHeapSplitStatus(1);
|
||||
newItem.setSourceId(source.getId());
|
||||
|
||||
return newItem;
|
||||
}
|
||||
|
||||
private void restoreGroup(List<OrderItemDO> list, int targetNum) {
|
||||
int remain = targetNum;
|
||||
|
||||
Map<Long, OrderItemDO> originMap = list.stream()
|
||||
.filter(i -> ObjectUtil.equals(0L, i.getSourceId()))
|
||||
.collect(Collectors.toMap(OrderItemDO::getId, Function.identity()));
|
||||
|
||||
List<Long> deleteIds = new ArrayList<>();
|
||||
List<OrderItemDO> updateList = new ArrayList<>();
|
||||
|
||||
// 1️⃣ 先处理子 item(sourceId != 0)
|
||||
List<OrderItemDO> subItems = list.stream()
|
||||
.filter(i -> ObjectUtil.notEqual(0L, i.getSourceId())
|
||||
&& i.getHeapSplitStatus() == 1)
|
||||
.toList();
|
||||
for (OrderItemDO item : subItems) {
|
||||
|
||||
if (remain <= 0) break;
|
||||
|
||||
double heap = Optional.ofNullable(item.getHeapNum()).orElse(0.0);
|
||||
if (heap <= 0) continue;
|
||||
|
||||
double toRestore = Math.min(heap, remain);
|
||||
|
||||
OrderItemDO origin = originMap.get(item.getSourceId());
|
||||
if (origin == null) {
|
||||
throw new ServiceException(new ErrorCode(10002, "找不到来源原 item"));
|
||||
}
|
||||
|
||||
// 🔥 从 origin.heapNum 扣减
|
||||
double originHeap = Optional.ofNullable(origin.getHeapNum()).orElse(0.0);
|
||||
origin.setHeapNum(originHeap - toRestore);
|
||||
|
||||
if (origin.getHeapNum() <= 0) {
|
||||
origin.setHeapNum(0.0);
|
||||
origin.setHeapSplitStatus(0);
|
||||
}
|
||||
|
||||
updateList.add(origin);
|
||||
|
||||
// 子 item处理
|
||||
if (toRestore == heap) {
|
||||
// 全扣 → 删除
|
||||
deleteIds.add(item.getId());
|
||||
} else {
|
||||
// 部分扣 → 更新剩余
|
||||
item.setHeapNum(heap - toRestore);
|
||||
updateList.add(item);
|
||||
}
|
||||
|
||||
remain -= toRestore;
|
||||
}
|
||||
|
||||
// 2️⃣ 再处理原 item(剩余的 heapNum)
|
||||
List<OrderItemDO> originItems = originMap.values().stream()
|
||||
.filter(i -> i.getHeapSplitStatus() == 1)
|
||||
.toList();
|
||||
|
||||
for (OrderItemDO item : originItems) {
|
||||
|
||||
if (remain <= 0) break;
|
||||
|
||||
double heap = Optional.ofNullable(item.getHeapNum()).orElse(0.0);
|
||||
if (heap <= 0) continue;
|
||||
|
||||
double toRestore = Math.min(heap, remain);
|
||||
|
||||
item.setHeapNum(heap - toRestore);
|
||||
|
||||
if (item.getHeapNum() <= 0) {
|
||||
item.setHeapNum(0.0);
|
||||
item.setHeapSplitStatus(0);
|
||||
}
|
||||
|
||||
updateList.add(item);
|
||||
|
||||
remain -= toRestore;
|
||||
}
|
||||
|
||||
// 3️⃣ 校验
|
||||
if (remain > 0) {
|
||||
throw new ServiceException(new ErrorCode(10003, "还原失败,数量不足,剩余:" + remain));
|
||||
}
|
||||
|
||||
// 4️⃣ 批量执行
|
||||
if (!updateList.isEmpty()) {
|
||||
orderItemMapper.updateBatch(updateList);
|
||||
}
|
||||
|
||||
if (!deleteIds.isEmpty()) {
|
||||
orderItemMapper.deleteByIds(deleteIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
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
@@ -1,275 +0,0 @@
|
||||
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())
|
||||
);
|
||||
}
|
||||
}
|
||||
+49
-13
@@ -4,6 +4,7 @@ package com.cf.imes.module.executor.service.manage.pack;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.OrderPackageVO;
|
||||
import com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.PackageDetailsRespVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,7 +15,12 @@ public interface PackService {
|
||||
PageResult<PackRespVO> getPackPage(PackPageReqVO pageReqVO);
|
||||
|
||||
|
||||
// 查看生产订单对应的包裹信息
|
||||
/**
|
||||
* 查询生产单对应的包裹列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderPackageVO> getOrderPack(PackageDetailsReqVO reqVO);
|
||||
|
||||
|
||||
@@ -25,24 +31,38 @@ public interface PackService {
|
||||
List<PlateDetailsRespVO> getOrderPlateList(Long orderId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询订单列表中未打包的板件
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<PlateDetailsRespVO> getOrdersPackPlateList(List<Long> orderIds);
|
||||
|
||||
// 查询多个订单对应的板材信息
|
||||
List<PlateDetailsRespVO> getOrdersPlateList(List<Long> orderIds);
|
||||
/**
|
||||
* 查询订单列表中未打包的配件
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<OrderPartsRespVO> getOrdersPackPartsList(List<Long> orderIds);
|
||||
|
||||
|
||||
|
||||
// 查看配件列表分页
|
||||
List<OrderPartsRespVO> getPartsList(OrderPartsReqVO reqVO);
|
||||
|
||||
OrderPackRespVO updateParts(OrderPartsReqVO reqVO);
|
||||
|
||||
|
||||
// 拆包
|
||||
/**
|
||||
* 拆包
|
||||
*
|
||||
* @param packageId
|
||||
* @return
|
||||
*/
|
||||
OrderPackRespVO unpacking(Long packageId);
|
||||
|
||||
|
||||
|
||||
// 更新包裹
|
||||
/**
|
||||
* 封包
|
||||
*
|
||||
* @param packageVO
|
||||
* @return
|
||||
*/
|
||||
OrderPackRespVO updatePack(OrderPackReqVO packageVO);
|
||||
|
||||
|
||||
@@ -87,4 +107,20 @@ public interface PackService {
|
||||
* @return
|
||||
*/
|
||||
List<Long> getComponentCorrelation(PackScanComponentCorrelationReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 获取订单列表下未打包的明细
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
OrdersUnpackDetailRespVO getOrdersUnpackDetails(List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 获取包裹板件、配件详情
|
||||
*
|
||||
* @param packageNo
|
||||
* @return
|
||||
*/
|
||||
List<PackageDetailsRespVO> getPackageDetails(String packageNo);
|
||||
}
|
||||
|
||||
+634
-310
File diff suppressed because it is too large
Load Diff
+48
-48
@@ -33,55 +33,55 @@ public class ProductionStatusServiceImpl implements ProductionStatusService {
|
||||
@Override
|
||||
public PageResult<PackageDetailsRespVO> queryPackageDetails(PackDetailsReqVO reqVO) {
|
||||
|
||||
PageDTO<PackageDetailsRespVO> page = new PageDTO<>(reqVO.getPageNo(), reqVO.getPageSize());
|
||||
|
||||
// 查看配件包裹
|
||||
if(reqVO.getType().equals(OrderPackageTypeEnum.PARTS.getType()) || reqVO.getType().equals(OrderPackageTypeEnum.OTHER_ACCESSORIES.getType())){
|
||||
// PageDTO<PackageDetailsRespVO> page = new PageDTO<>(reqVO.getPageNo(), reqVO.getPageSize());
|
||||
//
|
||||
// // 查看配件包裹
|
||||
// if(reqVO.getType().equals(OrderPackageTypeEnum.PARTS.getType()) || reqVO.getType().equals(OrderPackageTypeEnum.OTHER_ACCESSORIES.getType())){
|
||||
//
|
||||
//
|
||||
// // 查看配件包裹
|
||||
// IPage<PackageDetailsRespVO> packageDetailsRespVOS = orderPartsMapper.selectParts(page,reqVO.getPackageId(),getUserOrganId());
|
||||
// if (CollUtil.isEmpty(packageDetailsRespVOS.getRecords())) {
|
||||
// return new PageResult<>();
|
||||
// }
|
||||
//
|
||||
// packageDetailsRespVOS.getRecords().forEach(f->{
|
||||
// f.setNum(f.getCount().stream().reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
//
|
||||
// f.setCount(null);
|
||||
// f.setBodyId(null);
|
||||
// f.setRoomId(null);
|
||||
// f.setGroupId(null);
|
||||
// });
|
||||
//
|
||||
// return new PageResult<>(packageDetailsRespVOS.getRecords(), packageDetailsRespVOS.getTotal());
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
// 查看配件包裹
|
||||
IPage<PackageDetailsRespVO> packageDetailsRespVOS = orderPartsMapper.selectParts(page,reqVO.getPackageId(),getUserOrganId());
|
||||
if (CollUtil.isEmpty(packageDetailsRespVOS.getRecords())) {
|
||||
return new PageResult<>();
|
||||
}
|
||||
|
||||
packageDetailsRespVOS.getRecords().forEach(f->{
|
||||
f.setNum(f.getCount().stream().reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
|
||||
f.setCount(null);
|
||||
f.setBodyId(null);
|
||||
f.setRoomId(null);
|
||||
f.setGroupId(null);
|
||||
});
|
||||
|
||||
return new PageResult<>(packageDetailsRespVOS.getRecords(), packageDetailsRespVOS.getTotal());
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 查看板材包裹
|
||||
IPage<PackageDetailsRespVO> packageDetailsRespVOS = orderPlateMapper.selectPackPlateList(page,reqVO.getPackageId(),getUserOrganId());
|
||||
|
||||
if (CollUtil.isEmpty(packageDetailsRespVOS.getRecords())) {
|
||||
return new PageResult<>();
|
||||
}
|
||||
|
||||
for (PackageDetailsRespVO plateDetailsRespVO : packageDetailsRespVOS.getRecords()) {
|
||||
String name = "";
|
||||
|
||||
if(!plateDetailsRespVO.getProcessGroupNameList().isEmpty()) {
|
||||
for (GroupNameList groupNameList : plateDetailsRespVO.getProcessGroupNameList()) {
|
||||
// 去除最后的逗号
|
||||
name += groupNameList.getName() + ",";
|
||||
}
|
||||
name = name.substring(0, name.length() - 1);
|
||||
}
|
||||
|
||||
plateDetailsRespVO.setProcessGroup(name);
|
||||
}
|
||||
|
||||
|
||||
return new PageResult<>(packageDetailsRespVOS.getRecords(), packageDetailsRespVOS.getTotal());
|
||||
|
||||
// // 查看板材包裹
|
||||
// IPage<PackageDetailsRespVO> packageDetailsRespVOS = orderPlateMapper.selectPackPlateList(page,reqVO.getPackageId(),getUserOrganId());
|
||||
//
|
||||
// if (CollUtil.isEmpty(packageDetailsRespVOS.getRecords())) {
|
||||
// return new PageResult<>();
|
||||
// }
|
||||
//
|
||||
// for (PackageDetailsRespVO plateDetailsRespVO : packageDetailsRespVOS.getRecords()) {
|
||||
// String name = "";
|
||||
//
|
||||
// if(!plateDetailsRespVO.getProcessGroupNameList().isEmpty()) {
|
||||
// for (GroupNameList groupNameList : plateDetailsRespVO.getProcessGroupNameList()) {
|
||||
// // 去除最后的逗号
|
||||
// name += groupNameList.getName() + ",";
|
||||
// }
|
||||
// name = name.substring(0, name.length() - 1);
|
||||
// }
|
||||
//
|
||||
// plateDetailsRespVO.setProcessGroup(name);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// return new PageResult<>(packageDetailsRespVOS.getRecords(), packageDetailsRespVOS.getTotal());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -182,4 +182,18 @@ public interface OrderService {
|
||||
|
||||
OrderAllData getOrderAllData(Long orderId, Long planId);
|
||||
|
||||
/**
|
||||
* 检查item是否有未打包的并更新订单打包状态
|
||||
*
|
||||
* @param orderIds
|
||||
*/
|
||||
void updateOrdersPackageStatus(List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 获取订单id对应的所有父子订单id
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> getFatherAndSonOrderIds(List<Long> orderIds);
|
||||
}
|
||||
+41
@@ -1683,5 +1683,46 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrdersPackageStatus(List<Long> orderIds) {
|
||||
orderMapper.updateOrdersPackageStatus(orderIds);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getFatherAndSonOrderIds(List<Long> orderIds) {
|
||||
if (CollUtil.isEmpty(orderIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 查数据库(过滤掉不存在/已删除)
|
||||
List<OrderDO> orders = orderMapper.selectByIds(orderIds);
|
||||
if (CollUtil.isEmpty(orders)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 用 Set 去重
|
||||
Set<Long> allIds = orders.stream()
|
||||
.map(OrderDO::getId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 收集父ID
|
||||
Set<Long> parentIds = orders.stream()
|
||||
.map(OrderDO::getParentNo)
|
||||
.filter(id -> ObjectUtil.notEqual(id, OrderDO.PARENT_ID_ROOT))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (CollUtil.isNotEmpty(parentIds)) {
|
||||
// 再查一遍父订单(避免父也被删除)
|
||||
List<OrderDO> parentOrders = orderMapper.selectByIds(parentIds);
|
||||
|
||||
if (CollUtil.isNotEmpty(parentOrders)) {
|
||||
parentOrders.stream()
|
||||
.map(OrderDO::getId)
|
||||
.forEach(allIds::add);
|
||||
}
|
||||
}
|
||||
|
||||
return new ArrayList<>(allIds);
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -1,5 +1,7 @@
|
||||
package com.cf.imes.module.executor.service.orderitem;
|
||||
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -16,7 +18,7 @@ public interface OrderItemService {
|
||||
* @param plateId
|
||||
* @return
|
||||
*/
|
||||
Long getPlateItemCompId(Long plateId);
|
||||
OrderItemDO getPlateItemCompId(Long plateId);
|
||||
|
||||
/**
|
||||
* 查询配件订单明细关联的部件id
|
||||
@@ -24,7 +26,7 @@ public interface OrderItemService {
|
||||
* @param partId
|
||||
* @return
|
||||
*/
|
||||
Long getPartItemCompId(Long partId);
|
||||
OrderItemDO getPartItemCompId(Long partId);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -32,5 +34,5 @@ public interface OrderItemService {
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds);
|
||||
List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds, Long groupId);
|
||||
}
|
||||
+10
-9
@@ -22,35 +22,36 @@ public class OrderItemServiceImpl implements OrderItemService {
|
||||
private OrderItemMapper orderItemMapper;
|
||||
|
||||
@Override
|
||||
public Long getPlateItemCompId(Long id) {
|
||||
public OrderItemDO getPlateItemCompId(Long id) {
|
||||
List<OrderItemDO> plateItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||
.eq(OrderItemDO::getPlateId, id)
|
||||
.select(OrderItemDO::getCompId));
|
||||
.select(OrderItemDO::getCompId, OrderItemDO::getGroupId));
|
||||
if (CollUtil.isNotEmpty(plateItemDOS)) {
|
||||
return plateItemDOS.get(0).getCompId();
|
||||
return plateItemDOS.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getPartItemCompId(Long partId) {
|
||||
public OrderItemDO getPartItemCompId(Long partId) {
|
||||
List<OrderItemDO> partItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||
.eq(OrderItemDO::getPartsId, partId));
|
||||
.eq(OrderItemDO::getPartsId, partId)
|
||||
.select(OrderItemDO::getCompId, OrderItemDO::getGroupId));
|
||||
if (CollUtil.isNotEmpty(partItemDOS)) {
|
||||
return partItemDOS.get(0).getCompId();
|
||||
return partItemDOS.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds) {
|
||||
public List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds, Long groupId) {
|
||||
List<Long> resultList = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(componentIds)) {
|
||||
return resultList;
|
||||
}
|
||||
// 查询关联的板件和配件id
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPlateIds(orderIds, componentIds));
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPartsIds(orderIds, componentIds));
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPlateIds(orderIds, componentIds, groupId));
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPartsIds(orderIds, componentIds, groupId));
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
||||
+32
@@ -643,4 +643,36 @@
|
||||
and op.deleted = false
|
||||
and o.deleted = false
|
||||
</select>
|
||||
|
||||
<update id="updateOrdersPackageStatus">
|
||||
UPDATE orders o
|
||||
SET o.packaged =
|
||||
CASE
|
||||
WHEN
|
||||
EXISTS (SELECT 1 FROM order_item oi
|
||||
WHERE oi.order_id = o.id
|
||||
AND oi.package_id = 0 and oi.plate_id != 0
|
||||
AND oi.order_id IN
|
||||
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
)
|
||||
OR EXISTS (SELECT 1 FROM order_item oi
|
||||
JOIN order_parts op on oi.organ_id = op.organ_id and oi.order_id = op.order_id and oi.parts_id = op.id
|
||||
WHERE oi.order_id = o.id
|
||||
AND oi.package_id = 0 and oi.parts_id != 0 and op.type != '封边条'
|
||||
AND oi.order_id IN
|
||||
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
)
|
||||
THEN '${@com.cf.imes.framework.common.enums.OrderPackageStatusEnum@UNPACKED.status}'
|
||||
ELSE '${@com.cf.imes.framework.common.enums.OrderPackageStatusEnum@PACKAGED.status}'
|
||||
END
|
||||
WHERE o.id in
|
||||
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
+44
-49
@@ -389,38 +389,61 @@
|
||||
|
||||
|
||||
|
||||
<update id="insertPackId" parameterType="java.lang.Long">
|
||||
|
||||
<update id="updatePlatesItemPackageId" parameterType="java.lang.Long">
|
||||
update order_item
|
||||
|
||||
set package_id = #{packId}
|
||||
|
||||
where organ_id = #{organId}
|
||||
and order_id = #{orderId}
|
||||
set package_id = #{packageNo}
|
||||
where order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
and plate_id in
|
||||
<foreach item="id" collection="plateIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updatePartsItemPackageId" parameterType="java.lang.Long">
|
||||
update order_item oi
|
||||
set package_id = #{packageNo}
|
||||
where order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
and parts_id in
|
||||
<foreach item="id" collection="addPartsList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="deletePackId" parameterType="java.lang.Long">
|
||||
|
||||
<update id="updatePlatesItemUnPackageId" parameterType="java.lang.Long">
|
||||
update order_item oi
|
||||
|
||||
set package_id = 0
|
||||
|
||||
where
|
||||
organ_id = #{organId}
|
||||
and order_id = #{orderId}
|
||||
and package_id = #{packId}
|
||||
where order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
and package_id = #{packageNo}
|
||||
and plate_id in
|
||||
<foreach item="id" collection="deletePlateIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updatePartsItemUnPackageId" parameterType="java.lang.Long">
|
||||
update order_item oi
|
||||
set package_id = 0
|
||||
where order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
and package_id = #{packageNo}
|
||||
and parts_id in
|
||||
<foreach item="id" collection="deletePartsList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</update>
|
||||
|
||||
@@ -442,40 +465,6 @@
|
||||
</update>
|
||||
|
||||
|
||||
<update id="insertParts" parameterType="java.lang.Long">
|
||||
|
||||
update order_item oi
|
||||
|
||||
set package_id = #{packId}
|
||||
|
||||
where organ_id = #{organId}
|
||||
and order_id = #{orderId}
|
||||
and parts_id in
|
||||
<foreach item="id" collection="addPartsList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deletePartsList">
|
||||
|
||||
update order_item oi
|
||||
|
||||
set package_id = 0
|
||||
|
||||
where
|
||||
organ_id = #{organId}
|
||||
and order_id = #{orderId}
|
||||
and package_id = #{packId}
|
||||
and parts_id in
|
||||
<foreach item="id" collection="deletePartsList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="updateParts">
|
||||
|
||||
@@ -688,6 +677,9 @@
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND oi.group_id = #{groupId}
|
||||
</if>
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM order_plate op
|
||||
@@ -714,6 +706,9 @@
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND oi.group_id = #{groupId}
|
||||
</if>
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM order_parts op
|
||||
|
||||
+205
-75
@@ -264,13 +264,17 @@
|
||||
</select>
|
||||
|
||||
<resultMap id="partsMap" type="com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.PackageDetailsRespVO">
|
||||
|
||||
<result property="packageNo" column="packageId"/>
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="roomName" column="roomName"/>
|
||||
<result property="cabinetName" column="bodyName"/>
|
||||
<result property="roomId" column="roomId"/>
|
||||
<result property="bodyId" column="bodyId"/>
|
||||
<result property="processGroup" column="processGroup"/>
|
||||
<result property="partsId" column="partsId"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isComposite" column="isComposite"/>
|
||||
<result property="partsName" column="name"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="spec" column="spec"/>
|
||||
<result property="unit" column="unit"/>
|
||||
@@ -283,53 +287,84 @@
|
||||
<result property="partsThickness" column="partsThickness"/>
|
||||
<result property="category" column="category"/>
|
||||
<result property="subparts" column="subparts"/>
|
||||
|
||||
<collection property="count" ofType="java.math.BigDecimal" column="count"/>
|
||||
<collection property="roomId" ofType="java.lang.Long" column="roomId"/>
|
||||
<collection property="bodyId" ofType="java.lang.Long" column="bodyId"/>
|
||||
<collection property="groupId" ofType="java.lang.Long" column="groupId"/>
|
||||
<result property="componentName" column="componentName"/>
|
||||
<result property="num" column="num"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectParts"
|
||||
<select id="selectPackedParts"
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="partsMap">
|
||||
|
||||
|
||||
select distinct
|
||||
oi.num as `count`,
|
||||
op.order_id as orderId,
|
||||
op.id as partsId,
|
||||
op.name as name,
|
||||
op.model as model,
|
||||
op.spec as spec,
|
||||
op.unit as unit,
|
||||
op.brand as brand,
|
||||
op.material as material,
|
||||
op.factory as factory,
|
||||
op.type as type,
|
||||
op.remark as remark,
|
||||
op.is_composite as isComposite,
|
||||
op.color as partsColor,
|
||||
op.width as partsWidth,
|
||||
op.length as partsLength,
|
||||
op.thickness as partsThickness,
|
||||
op.category as category,
|
||||
op.subparts as subparts
|
||||
|
||||
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
|
||||
|
||||
where op.organ_id =#{organId} and op.deleted = false and oi.package_id = #{packageId}
|
||||
|
||||
|
||||
SELECT
|
||||
t.room_name AS roomName,
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
t.group_names AS groupName,
|
||||
t.component_names AS componentName,
|
||||
t.num AS num,
|
||||
t.package_id AS packageId,
|
||||
op.id AS partsId,
|
||||
op.order_id AS orderId,
|
||||
op.name,
|
||||
op.model,
|
||||
op.spec,
|
||||
op.unit,
|
||||
op.brand,
|
||||
op.factory,
|
||||
op.remark,
|
||||
op.color AS partsColor,
|
||||
op.width AS partsWidth,
|
||||
op.length AS partsLength,
|
||||
op.thickness AS partsThickness,
|
||||
op.category,
|
||||
op.subparts,
|
||||
op.type
|
||||
FROM order_parts op
|
||||
JOIN (
|
||||
SELECT
|
||||
oi.parts_id,
|
||||
oi.package_id,
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name,
|
||||
SUM(oi.pack_num) AS num
|
||||
FROM order_item oi
|
||||
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 oi.organ_id = oc.organ_id
|
||||
AND oi.order_id = oc.order_id
|
||||
AND oc.id = oi.comp_id
|
||||
WHERE oi.package_id = #{packageNo}
|
||||
AND oi.parts_id != 0
|
||||
GROUP BY oi.room_id, oi.body_id, oi.parts_id, oi.package_id
|
||||
) t ON t.parts_id = op.id
|
||||
WHERE op.deleted = false
|
||||
AND op.type != '封边条'
|
||||
AND op.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<resultMap id="PartsListMap" type="com.cf.imes.module.executor.controller.admin.manage.pack.vo.OrderPartsRespVO">
|
||||
|
||||
<result property="packageId" column="packageId"/>
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="roomName" column="roomName"/>
|
||||
<result property="cabinetName" column="bodyName"/>
|
||||
<result property="roomId" column="roomId"/>
|
||||
<result property="bodyId" column="bodyId"/>
|
||||
<result property="partsId" column="partsId"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="isComposite" column="isComposite"/>
|
||||
@@ -348,48 +383,143 @@
|
||||
<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"/>
|
||||
<collection property="bodyId" ofType="java.lang.Long" column="bodyId"/>
|
||||
<collection property="groupId" ofType="java.lang.Long" column="groupId"/>
|
||||
<result property="heapSplitStatus" column="heapSplitStatus"/>
|
||||
<result property="heapNum" column="heapNum"/>
|
||||
|
||||
</resultMap>
|
||||
<select id="selectPartsList"
|
||||
<select id="selectOrdersPartsList"
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="PartsListMap">
|
||||
|
||||
|
||||
select distinct
|
||||
oi.num as `count`,
|
||||
oi.room_id as roomId,
|
||||
oi.body_id as bodyId,
|
||||
oi.group_id as groupId,
|
||||
op.id as partsId,
|
||||
op.name,
|
||||
op.model,
|
||||
op.spec,
|
||||
op.unit,
|
||||
op.brand,
|
||||
op.factory,
|
||||
op.remark,
|
||||
op.color as partsColor,
|
||||
op.width as partsWidth,
|
||||
op.length as partsLength,
|
||||
op.thickness as partsThickness,
|
||||
op.category as category,
|
||||
op.subparts as subparts,
|
||||
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_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
|
||||
SELECT
|
||||
t.room_name AS roomName,
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
t.group_names AS groupName,
|
||||
t.component_names AS componentName,
|
||||
t.num AS num,
|
||||
t.pack_num AS packNum,
|
||||
op.id AS partsId,
|
||||
op.order_id AS orderId,
|
||||
op.name,
|
||||
op.model,
|
||||
op.spec,
|
||||
op.unit,
|
||||
op.brand,
|
||||
op.factory,
|
||||
op.remark,
|
||||
op.color AS partsColor,
|
||||
op.width AS partsWidth,
|
||||
op.length AS partsLength,
|
||||
op.thickness AS partsThickness,
|
||||
op.category,
|
||||
op.subparts,
|
||||
op.type
|
||||
FROM order_parts op
|
||||
JOIN (
|
||||
SELECT
|
||||
oi.parts_id,
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name,
|
||||
SUM(oi.num) AS num,
|
||||
SUM(oi.pack_num) AS pack_num
|
||||
FROM order_item oi
|
||||
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 oi.organ_id = oc.organ_id
|
||||
AND oi.order_id = oc.order_id
|
||||
AND oc.id = oi.comp_id
|
||||
WHERE
|
||||
oi.parts_id != 0
|
||||
AND oi.package_id = 0
|
||||
GROUP BY oi.room_id, oi.body_id, oi.parts_id
|
||||
) t ON t.parts_id = op.id
|
||||
WHERE op.deleted = false
|
||||
AND op.type != '封边条'
|
||||
AND op.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectOrdersHeapSplitPartsList"
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="PartsListMap">
|
||||
SELECT
|
||||
t.room_name AS roomName,
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
t.heap_split_status AS heapSplitStatus,
|
||||
t.group_names AS groupName,
|
||||
t.component_names AS componentName,
|
||||
t.num AS num,
|
||||
t.heap_num AS heapNum,
|
||||
op.id AS partsId,
|
||||
op.name,
|
||||
op.model,
|
||||
op.spec,
|
||||
op.unit,
|
||||
op.brand,
|
||||
op.factory,
|
||||
op.remark,
|
||||
op.color AS partsColor,
|
||||
op.width AS partsWidth,
|
||||
op.length AS partsLength,
|
||||
op.thickness AS partsThickness,
|
||||
op.category,
|
||||
op.subparts,
|
||||
op.type
|
||||
FROM order_parts op
|
||||
JOIN (
|
||||
SELECT
|
||||
oi.parts_id,
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
oi.heap_split_status,
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name,
|
||||
SUM(oi.num) AS num,
|
||||
SUM(oi.heap_num) AS heap_num
|
||||
FROM order_item oi
|
||||
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 oi.organ_id = oc.organ_id
|
||||
AND oi.order_id = oc.order_id
|
||||
AND oc.id = oi.comp_id
|
||||
WHERE
|
||||
oi.parts_id != 0
|
||||
GROUP BY oi.room_id, oi.body_id, oi.parts_id, oi.heap_split_status
|
||||
) t ON t.parts_id = op.id
|
||||
WHERE op.deleted = false
|
||||
AND op.type != '封边条'
|
||||
AND op.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
<resultMap id="LabelPartsMap" type="com.cf.imes.module.executor.controller.admin.order.vo.order.LabelOrderPartsData">
|
||||
|
||||
|
||||
+9
@@ -219,4 +219,13 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getPackageNoInOrderIds" resultType="com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.OrderPackageVO">
|
||||
SELECT DISTINCT package_no,status
|
||||
FROM order_package_new
|
||||
WHERE deleted = false
|
||||
AND order_id IN
|
||||
<foreach collection="orderIds" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
+250
-96
@@ -754,6 +754,8 @@
|
||||
<resultMap id="PlateDetailsMap" type="com.cf.imes.module.executor.controller.admin.manage.pack.vo.PlateDetailsRespVO">
|
||||
<result property="packageId" column="packageId"/>
|
||||
<result property="roomName" column="roomName"/>
|
||||
<result property="roomId" column="roomId"/>
|
||||
<result property="bodyId" column="bodyId"/>
|
||||
<result property="cabinetName" column="bodyName"/>
|
||||
<result property="plateId" column="plateId"/>
|
||||
<result property="plateNo" column="plateNo"/>
|
||||
@@ -787,9 +789,7 @@
|
||||
<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"/>
|
||||
</collection>
|
||||
<result property="heapSplitStatus" column="heapSplitStatus"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
@@ -837,103 +837,240 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectOrderPackPlateList"
|
||||
<select id="selectOrdersPackPlateList"
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="PlateDetailsMap">
|
||||
|
||||
|
||||
select distinct
|
||||
oi.package_id as packageId,
|
||||
og.name as name,
|
||||
ob.room_name as roomName,
|
||||
ob.name as bodyName,
|
||||
op.id as plateId,
|
||||
op.plate_no as plateNo,
|
||||
op.custom_plate_no as customPlateNo,
|
||||
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,
|
||||
op.thickness as plateThickness,
|
||||
op.area as plateArea,
|
||||
op.texture as texture ,
|
||||
op.remark as remark,
|
||||
op.is_special_shaped as specialShaped,
|
||||
op.is_sculpt as profiling,
|
||||
op.is_row_hole as rowHole,
|
||||
op.hole_face as holeFace,
|
||||
op.hole_arrange as holeArrange,
|
||||
op.open_door_type as openDoorType,
|
||||
op.is_side_sculpt as isSideSculpt,
|
||||
op.is_2v as is2v,
|
||||
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}
|
||||
|
||||
and op.deleted = false
|
||||
and op.order_id in
|
||||
<foreach item="orderIds" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderIds}
|
||||
SELECT
|
||||
t.group_names AS processGroup,
|
||||
t.component_names AS componentName,
|
||||
t.room_name AS roomName,
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
op.id AS plateId,
|
||||
op.plate_no AS plateNo,
|
||||
op.custom_plate_no AS customPlateNo,
|
||||
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,
|
||||
op.thickness AS plateThickness,
|
||||
op.area AS plateArea,
|
||||
op.texture,
|
||||
op.remark,
|
||||
op.is_special_shaped AS specialShaped,
|
||||
op.is_sculpt AS profiling,
|
||||
op.is_row_hole AS rowHole,
|
||||
op.hole_face AS holeFace,
|
||||
op.hole_arrange AS holeArrange,
|
||||
op.open_door_type AS openDoorType,
|
||||
op.is_side_sculpt AS isSideSculpt,
|
||||
op.is_2v AS is2v,
|
||||
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
|
||||
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
|
||||
JOIN (
|
||||
SELECT
|
||||
oi.plate_id,
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,-- 聚合加工组
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name
|
||||
FROM order_item oi
|
||||
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 oi.organ_id = oc.organ_id
|
||||
AND oi.order_id = oc.order_id
|
||||
AND oc.id = oi.comp_id
|
||||
WHERE oi.plate_id != 0
|
||||
AND oi.package_id = 0
|
||||
GROUP BY oi.plate_id, room_id, body_id
|
||||
) t ON t.plate_id = op.id
|
||||
WHERE op.deleted = false
|
||||
AND op.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectPackPlateList"
|
||||
<select id="selectPackedPlateList"
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="orderItemMap">
|
||||
|
||||
|
||||
select distinct
|
||||
op.order_id as orderId,
|
||||
og.name as name,
|
||||
ob.room_name as roomName,
|
||||
ob.name as bodyName,
|
||||
op.plate_no as plateNo,
|
||||
op.custom_plate_no as customPlateNo,
|
||||
op.id as plateId,
|
||||
op.name as plateName,
|
||||
ogs.material as plateMaterial,
|
||||
ogs.color as palteColor,
|
||||
op.height as plateHeight,
|
||||
op.width as plateWidth,
|
||||
op.thickness as plateThickness,
|
||||
op.area as plateArea,
|
||||
op.texture as texture ,
|
||||
op.remark as remark,
|
||||
op.is_special_shaped as specialShaped,
|
||||
op.is_sculpt as profiling,
|
||||
op.is_row_hole as rowHole
|
||||
|
||||
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
|
||||
|
||||
where
|
||||
oi.organ_id = #{organId} and oi.package_id =#{packageId} and op.deleted = false
|
||||
|
||||
|
||||
|
||||
SELECT
|
||||
t.package_id AS packageId,
|
||||
t.group_names AS processGroup,
|
||||
t.component_names AS componentName,
|
||||
t.room_name AS roomName,
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
op.id AS plateId,
|
||||
op.plate_no AS plateNo,
|
||||
op.custom_plate_no AS customPlateNo,
|
||||
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,
|
||||
op.thickness AS plateThickness,
|
||||
op.area AS plateArea,
|
||||
op.texture,
|
||||
op.remark,
|
||||
op.is_special_shaped AS specialShaped,
|
||||
op.is_sculpt AS profiling,
|
||||
op.is_row_hole AS rowHole,
|
||||
op.hole_face AS holeFace,
|
||||
op.hole_arrange AS holeArrange,
|
||||
op.open_door_type AS openDoorType,
|
||||
op.is_side_sculpt AS isSideSculpt,
|
||||
op.is_2v AS is2v,
|
||||
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
|
||||
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
|
||||
JOIN (
|
||||
SELECT
|
||||
oi.plate_id,
|
||||
oi.package_id,
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,-- 聚合加工组
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name
|
||||
FROM order_item oi
|
||||
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 oi.organ_id = oc.organ_id
|
||||
AND oi.order_id = oc.order_id
|
||||
AND oc.id = oi.comp_id
|
||||
WHERE oi.package_id = #{packageNo}
|
||||
AND oi.plate_id != 0
|
||||
GROUP BY oi.room_id, oi.body_id, oi.plate_id, oi.package_id
|
||||
) t ON t.plate_id = op.id
|
||||
WHERE op.deleted = false
|
||||
AND op.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectOrdersHeapSplitPlateList"
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="PlateDetailsMap">
|
||||
SELECT
|
||||
t.group_names AS processGroup,
|
||||
t.component_names AS componentName,
|
||||
t.room_name AS roomName,
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
t.heap_split_status AS heapSplitStatus,
|
||||
op.id AS plateId,
|
||||
op.plate_no AS plateNo,
|
||||
op.custom_plate_no AS customPlateNo,
|
||||
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,
|
||||
op.thickness AS plateThickness,
|
||||
op.area AS plateArea,
|
||||
op.texture,
|
||||
op.remark,
|
||||
op.is_special_shaped AS specialShaped,
|
||||
op.is_sculpt AS profiling,
|
||||
op.is_row_hole AS rowHole,
|
||||
op.hole_face AS holeFace,
|
||||
op.hole_arrange AS holeArrange,
|
||||
op.open_door_type AS openDoorType,
|
||||
op.is_side_sculpt AS isSideSculpt,
|
||||
op.is_2v AS is2v,
|
||||
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
|
||||
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
|
||||
JOIN (
|
||||
SELECT
|
||||
oi.plate_id,
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
oi.heap_split_status,
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name
|
||||
FROM order_item oi
|
||||
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 oi.organ_id = oc.organ_id
|
||||
AND oi.order_id = oc.order_id
|
||||
AND oc.id = oi.comp_id
|
||||
WHERE oi.plate_id != 0
|
||||
GROUP BY room_id, body_id, oi.plate_id, oi.heap_split_status
|
||||
) t ON t.plate_id = op.id
|
||||
WHERE op.deleted = false
|
||||
AND op.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectLabelOrderPlateDataByOrderId"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.LabelOrderPlateData">
|
||||
@@ -1046,15 +1183,19 @@
|
||||
</select>
|
||||
|
||||
<resultMap id="orderItemMap" type="com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.PackageDetailsRespVO">
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="packageNo" column="packageId"/>
|
||||
<result property="roomName" column="roomName"/>
|
||||
<result property="cabinetName" column="bodyName"/>
|
||||
<result property="roomId" column="roomId"/>
|
||||
<result property="bodyId" column="bodyId"/>
|
||||
<result property="processGroup" column="processGroup"/>
|
||||
<result property="plateId" column="plateId"/>
|
||||
<result property="plateNo" column="plateNo"/>
|
||||
<result property="customPlateNo" column="customPlateNo"/>
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="plateName" column="plateName"/>
|
||||
<result property="customPlateNo" column="customPlateNo"/>
|
||||
<result property="material" column="plateMaterial"/>
|
||||
<result property="color" column="palteColor"/>
|
||||
<result property="color" column="plateColor"/>
|
||||
<result property="width" column="plateWidth"/>
|
||||
<result property="height" column="plateHeight"/>
|
||||
<result property="thickness" column="plateThickness"/>
|
||||
@@ -1064,9 +1205,22 @@
|
||||
<result property="profiling" column="profiling"/>
|
||||
<result property="rowHole" column="rowHole"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="holeFace" column="holeFace"/>
|
||||
<result property="holeArrange" column="holeArrange"/>
|
||||
<result property="openDoorType" column="openDoorType"/>
|
||||
|
||||
<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"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user