mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、订单/排单未排小板查询接口重构;2、未排/已排板件和造型查询优化;
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ public class PackController {
|
|||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "打包分页查询")
|
@Operation(summary = "打包分页查询")
|
||||||
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
|
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
|
||||||
public CommonResult<PageResult<PackRespVO>> getPlatePage(@Valid PackPageReqVO pageReqVO) {
|
public CommonResult<PageResult<PackRespVO>> getPackPlatePage(@Valid PackPageReqVO pageReqVO) {
|
||||||
|
|
||||||
return CommonResult.success(packService.getPackPage(pageReqVO));
|
return CommonResult.success(packService.getPackPage(pageReqVO));
|
||||||
|
|
||||||
|
|||||||
-3
@@ -219,7 +219,4 @@ public class PlateDetailRespVO {
|
|||||||
// 加工组ID和名称
|
// 加工组ID和名称
|
||||||
@Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private List<ProcessGroupList> processGroupLists;
|
private List<ProcessGroupList> processGroupLists;
|
||||||
|
|
||||||
@Schema(description = "造型数据")
|
|
||||||
private String modelData;
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-6
@@ -8,7 +8,7 @@ import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
|||||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||||
@@ -78,13 +78,11 @@ public class PlateController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/getPlatePage")
|
@PostMapping("/orders/noplan")
|
||||||
@Operation(summary = "获取未排单的订单板件")
|
@Operation(summary = "获取未排单的订单板件")
|
||||||
@PreAuthorize("@ss.hasAnyPermissions('manage:un-order-plan:insert-plate','manage:order-plan:insert-plate')")
|
@PreAuthorize("@ss.hasAnyPermissions('manage:un-order-plan:insert-plate','manage:order-plan:insert-plate')")
|
||||||
public CommonResult<PageResult<PlateResList>> getPlatePage(@Valid NoPlanPlatePageReqVO reqVO) {
|
public CommonResult<List<PlateDetailRespVO>> getOrdersNoPlanPlate(@Valid @RequestBody NoPlanPlatePageReqVO reqVO) {
|
||||||
|
return success(plateService.getOrdersNoPlanPlate(reqVO));
|
||||||
return success(plateService.getOrderPlatePage(reqVO));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+12
-5
@@ -4,12 +4,11 @@ package com.cf.imes.module.executor.controller.admin.plate.vo;
|
|||||||
import com.cf.imes.framework.common.pojo.PageParam;
|
import com.cf.imes.framework.common.pojo.PageParam;
|
||||||
import com.cf.imes.framework.common.validation.NumberValid;
|
import com.cf.imes.framework.common.validation.NumberValid;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.validator.constraints.Length;
|
|
||||||
|
|
||||||
import jakarta.validation.constraints.Pattern;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -21,9 +20,8 @@ public class NoPlanPlatePageReqVO extends PageParam {
|
|||||||
|
|
||||||
|
|
||||||
@Schema(description = "订单id")
|
@Schema(description = "订单id")
|
||||||
@Pattern(regexp = "^[0-9]*$",message = "订单号必须为数字")
|
@Size(min = 1, max = 100, message = "订单id列表不能为空且数量不能超过100个")
|
||||||
@Length(max = 19,message = "订单号长度不能超过19位")
|
private List<Long> orderIds;
|
||||||
private String orderId;
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "排单ID")
|
@Schema(description = "排单ID")
|
||||||
@@ -57,18 +55,25 @@ public class NoPlanPlatePageReqVO extends PageParam {
|
|||||||
@Schema(description = "材质-在排单界面添加板材时为必传的")
|
@Schema(description = "材质-在排单界面添加板材时为必传的")
|
||||||
private String material;
|
private String material;
|
||||||
|
|
||||||
|
private List<String> materialList;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "颜色-在排单界面添加板材时为必传的")
|
@Schema(description = "颜色-在排单界面添加板材时为必传的")
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
|
private List<String> colorList;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "厚度-在排单界面添加板材时为必传的")
|
@Schema(description = "厚度-在排单界面添加板材时为必传的")
|
||||||
private Integer thickness;
|
private Integer thickness;
|
||||||
|
|
||||||
|
private List<BigDecimal> thicknessList;
|
||||||
|
|
||||||
@Schema(description = "品牌-在排单界面添加板材时为必传的")
|
@Schema(description = "品牌-在排单界面添加板材时为必传的")
|
||||||
private String brand;
|
private String brand;
|
||||||
|
|
||||||
|
private List<String> brandList;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "板名称")
|
@Schema(description = "板名称")
|
||||||
private String plateName;
|
private String plateName;
|
||||||
@@ -107,6 +112,8 @@ public class NoPlanPlatePageReqVO extends PageParam {
|
|||||||
@Schema(description = "纹路")
|
@Schema(description = "纹路")
|
||||||
private Integer texture;
|
private Integer texture;
|
||||||
|
|
||||||
|
private List<Boolean> textureList;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "异形")
|
@Schema(description = "异形")
|
||||||
private Boolean isSpecialShaped;
|
private Boolean isSpecialShaped;
|
||||||
|
|||||||
+287
@@ -0,0 +1,287 @@
|
|||||||
|
package com.cf.imes.module.executor.dal.dataobject.plate;
|
||||||
|
|
||||||
|
import com.cf.imes.module.executor.controller.admin.plan.bo.ProcessGroupList;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板件明细
|
||||||
|
*
|
||||||
|
* @author Gqr
|
||||||
|
* @since 2026/5/12 10:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PlateDetailDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板件ID
|
||||||
|
*/
|
||||||
|
private Long plateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间ID
|
||||||
|
*/
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间名称
|
||||||
|
*/
|
||||||
|
private String roomName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 柜体ID
|
||||||
|
*/
|
||||||
|
private Long bodyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 柜体名称
|
||||||
|
*/
|
||||||
|
private String bodyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品ID-大板分类ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大板实际ID
|
||||||
|
*/
|
||||||
|
private String goodsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板编号
|
||||||
|
*/
|
||||||
|
private String plateNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义板编号
|
||||||
|
*/
|
||||||
|
private String customPlateNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板颜色
|
||||||
|
*/
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌
|
||||||
|
*/
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板材质
|
||||||
|
*/
|
||||||
|
private String material;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板长
|
||||||
|
*/
|
||||||
|
private Double height;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板宽
|
||||||
|
*/
|
||||||
|
private Double width;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板厚
|
||||||
|
*/
|
||||||
|
private Double thickness;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拆单宽度
|
||||||
|
*/
|
||||||
|
private BigDecimal splitWidth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拆单高度
|
||||||
|
*/
|
||||||
|
private BigDecimal splitHeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拆单厚度
|
||||||
|
*/
|
||||||
|
private BigDecimal splitThickness;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否异性-是否弧形地脚,不处理异形
|
||||||
|
*/
|
||||||
|
private Boolean isSpecialShaped;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 左封边厚度
|
||||||
|
*/
|
||||||
|
private BigDecimal sealLeft;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 右封边厚度
|
||||||
|
*/
|
||||||
|
private BigDecimal sealRight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上封边厚度
|
||||||
|
*/
|
||||||
|
private BigDecimal sealUp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下封边厚度
|
||||||
|
*/
|
||||||
|
private BigDecimal sealDown;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面积
|
||||||
|
*/
|
||||||
|
private BigDecimal area;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纹路类型,0 正纹 1 可翻转 2 反纹
|
||||||
|
*/
|
||||||
|
private Integer texture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 孔面类型,0 正面 1 反面 2 侧面
|
||||||
|
*/
|
||||||
|
private Integer holeFace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排孔类型,0 正纹 1 反面 2 随意面
|
||||||
|
*/
|
||||||
|
private Integer holeArrange;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异型孔数量
|
||||||
|
*/
|
||||||
|
private Integer unregularPointCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正面孔数量
|
||||||
|
*/
|
||||||
|
private Integer frontHoleCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 背面孔数量
|
||||||
|
*/
|
||||||
|
private Integer backHoleCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 侧面孔数量
|
||||||
|
*/
|
||||||
|
private Integer sideHoleCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正面造型量
|
||||||
|
*/
|
||||||
|
private Integer frontModelCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 背面造型量
|
||||||
|
*/
|
||||||
|
private Integer backModelCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否门板
|
||||||
|
*/
|
||||||
|
private Boolean isDoor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否孤形对角
|
||||||
|
*/
|
||||||
|
private Boolean isArcAcross;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模块类型 ID
|
||||||
|
*/
|
||||||
|
private Long moduleTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排单过滤类型,1 有挖穿造型 2 有挖穿孔 4 有二维刀路 8 可叠
|
||||||
|
*/
|
||||||
|
private String filterType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异型偏移 x
|
||||||
|
*/
|
||||||
|
private Double offsetX;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异型偏移 y
|
||||||
|
*/
|
||||||
|
private Double offsetY;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否作废
|
||||||
|
*/
|
||||||
|
private Boolean isCancel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板类型,0 层板 1 立板 2 背板
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加工组名称
|
||||||
|
*/
|
||||||
|
private String processGroupName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开门类型,0 无 1 左 2 右 3 上 4 下
|
||||||
|
*/
|
||||||
|
private Integer openDoorType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有孔
|
||||||
|
*/
|
||||||
|
private Boolean hasHole;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否造型
|
||||||
|
*/
|
||||||
|
private Boolean isSculpt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否侧面造型
|
||||||
|
*/
|
||||||
|
private Boolean isSideSculpt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否二维刀路
|
||||||
|
*/
|
||||||
|
private Boolean is2v;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否侧面二维刀路
|
||||||
|
*/
|
||||||
|
private Boolean isSide2v;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加工组名称
|
||||||
|
*/
|
||||||
|
private List<ProcessGroupList> processGroupLists;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 造型数据
|
||||||
|
*/
|
||||||
|
private String modelData;
|
||||||
|
}
|
||||||
+9
-1
@@ -8,6 +8,7 @@ import com.cf.imes.module.executor.controller.admin.order.vo.order.LabelOrderPla
|
|||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
|
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
|
||||||
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDetailDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -37,7 +38,14 @@ public interface PlanItemMapper extends BaseMapperX<PlanItemDO> {
|
|||||||
@Param("orderGoodsIds") List<Long> orderGoodsIds,
|
@Param("orderGoodsIds") List<Long> orderGoodsIds,
|
||||||
@Param("orderIds") Long... orderIds);
|
@Param("orderIds") Long... orderIds);
|
||||||
|
|
||||||
List<PlateDetailRespVO> selectPlanPlateDetailList(@Param("planId") Long planId, @Param("organId") Long organId);
|
/**
|
||||||
|
* 查询排单小板
|
||||||
|
*
|
||||||
|
* @param planId
|
||||||
|
* @param organId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PlateDetailDO> selectPlanPlateDetailList(@Param("planId") Long planId, @Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
||||||
|
|
||||||
|
|
||||||
List<PlateInfoVO> selectOrderPlanPlateList(@Param("planIds") List<Long> planIds, @Param("organId") Long organId);
|
List<PlateInfoVO> selectOrderPlanPlateList(@Param("planIds") List<Long> planIds, @Param("organId") Long organId);
|
||||||
|
|||||||
+19
-4
@@ -7,18 +7,18 @@ import com.cf.imes.framework.common.enums.OrderPlateTypeEnum;
|
|||||||
import com.cf.imes.framework.common.pojo.PageResult;
|
import com.cf.imes.framework.common.pojo.PageResult;
|
||||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackRespVO;
|
|
||||||
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PlateDetailsRespVO;
|
import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PlateDetailsRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.manage.process.vo.PlateDetails;
|
import com.cf.imes.module.executor.controller.admin.manage.process.vo.PlateDetails;
|
||||||
import com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.PackageDetailsRespVO;
|
import com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.PackageDetailsRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.LabelOrderPlateData;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.LabelOrderPlateData;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.PrintOrderPackReqVO;
|
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.PrintOrderPackReqVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.NoPlanPlatePageReqVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsIdVO;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsIdVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlatePageReqVO;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.PlatePageReqVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||||
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDetailDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
@@ -193,9 +193,24 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<PlateDetailRespVO> selectPlateListByGoodsIds(@Param("orderId") Long orderId, @Param("organId") Long organId);
|
List<PlateDetailDO> selectPlateListByGoodsIds(@Param("orderId") Long orderId, @Param("organId") Long organId);
|
||||||
|
|
||||||
List<PlateDetailRespVO> selectNoPlanPlate(@Param("orderIds") List<Long> orderIds, @Param("ids") List<Long> ids, @Param("organId") Long organId);
|
/**
|
||||||
|
* 查询未排单板件
|
||||||
|
*
|
||||||
|
* @param orderIds
|
||||||
|
* @param ids
|
||||||
|
* @param organId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PlateDetailDO> selectNoPlanPlate(@Param("orderIds") List<Long> orderIds, @Param("ids") List<Long> ids, @Param("organId") Long organId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询未排单板件(带添加小板筛选)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PlateDetailDO> selectNoPlanPlateWithFilter(@Param("reqVO") NoPlanPlatePageReqVO reqVO, @Param("organId") Long organId);
|
||||||
|
|
||||||
|
|
||||||
// 批量删除
|
// 批量删除
|
||||||
|
|||||||
+70
-34
@@ -1,5 +1,6 @@
|
|||||||
package com.cf.imes.module.executor.service.optimizeplan;
|
package com.cf.imes.module.executor.service.optimizeplan;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@@ -53,6 +54,7 @@ import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
|||||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderPlateModel;
|
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderPlateModel;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||||
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDetailDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.remainplaten.RemainPlateDO;
|
import com.cf.imes.module.executor.dal.dataobject.remainplaten.RemainPlateDO;
|
||||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||||
@@ -283,7 +285,6 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
OrderSource orderSource;
|
OrderSource orderSource;
|
||||||
if (ObjectUtil.isNotNull(orderId)) {
|
if (ObjectUtil.isNotNull(orderId)) {
|
||||||
orderSource = getOrderSourceByOrderId(orderId);
|
orderSource = getOrderSourceByOrderId(orderId);
|
||||||
// orderSource.setMachineDTO(machineApi.getMachineDetail(machineId).getCheckedData());
|
|
||||||
return orderSource;
|
return orderSource;
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotNull(planId)) {
|
if (ObjectUtil.isNotNull(planId)) {
|
||||||
@@ -305,13 +306,13 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
|
|
||||||
AssertUtils.notEmpty(goodsDOS, ORDER_PLATE_EMPTY);
|
AssertUtils.notEmpty(goodsDOS, ORDER_PLATE_EMPTY);
|
||||||
|
|
||||||
List<PlateDetailRespVO> plateDOS = plateMapper.selectPlateListByGoodsIds(orderId,getUserOrganId());
|
List<PlateDetailDO> plateDOS = plateMapper.selectPlateListByGoodsIds(orderId, getUserOrganId());
|
||||||
|
|
||||||
AssertUtils.notEmpty(plateDOS, ORDER_PLATE_EMPTY);
|
AssertUtils.notEmpty(plateDOS, ORDER_PLATE_EMPTY);
|
||||||
|
|
||||||
List<OrderModelDO> models =
|
List<OrderModelDO> models =
|
||||||
plateDOS.stream()
|
plateDOS.stream()
|
||||||
.map(PlateDetailRespVO::getModelData)
|
.map(PlateDetailDO::getModelData)
|
||||||
.filter(StringUtils::isNotBlank)
|
.filter(StringUtils::isNotBlank)
|
||||||
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
||||||
.toList();
|
.toList();
|
||||||
@@ -322,10 +323,6 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(Collections.singletonList(orderId), getUserOrganId());
|
List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(Collections.singletonList(orderId), getUserOrganId());
|
||||||
|
|
||||||
|
|
||||||
// 查询订单对应的配件的ES信息
|
|
||||||
List<OrderPartsRemark> orderPartsRemarks = esUtils.getEsDocument(FIELD_ORDER_ID, orderId, printOrderPartsRespVOS.size(), ORDER_PARTS_REMARK_MODEL.getIndex(), OrderPartsRemark.class);
|
|
||||||
|
|
||||||
|
|
||||||
// 查询订单对应的包裹信息
|
// 查询订单对应的包裹信息
|
||||||
List<PrintOrderPackReqVO> printOrderPackReqVOS = plateMapper.selectOrderPackList(orderId,getUserOrganId());
|
List<PrintOrderPackReqVO> printOrderPackReqVOS = plateMapper.selectOrderPackList(orderId,getUserOrganId());
|
||||||
|
|
||||||
@@ -342,10 +339,10 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
return OrderSource.builder()
|
return OrderSource.builder()
|
||||||
.orderList(Collections.singletonList(orderDO))
|
.orderList(Collections.singletonList(orderDO))
|
||||||
.goodsList(goodsDOS)
|
.goodsList(goodsDOS)
|
||||||
.plateList(plateDOS)
|
.plateList(BeanUtil.copyToList(plateDOS, PlateDetailRespVO.class))
|
||||||
.plateModels(models)
|
.plateModels(models)
|
||||||
.orderPartsRespVOS(printOrderPartsRespVOS)
|
.orderPartsRespVOS(printOrderPartsRespVOS)
|
||||||
.orderPartsRemarks(orderPartsRemarks)
|
.orderPartsRemarks(null)
|
||||||
.orderPackReqVOS(printOrderPackReqVOS)
|
.orderPackReqVOS(printOrderPackReqVOS)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -372,31 +369,19 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
List<Long> ids = goodsDOS.stream().map(GoodsReqVO::getId).toList();
|
List<Long> ids = goodsDOS.stream().map(GoodsReqVO::getId).toList();
|
||||||
|
|
||||||
// 查询排单对应的小板信息
|
// 查询排单对应的小板信息
|
||||||
List<PlateDetailRespVO> plateDetailRespVOS = planItemMapper.selectPlanPlateDetailList(planId,getUserOrganId());
|
List<PlateDetailDO> plateDetailRespVOS = planItemMapper.selectPlanPlateDetailList(planId, orderIds, getUserOrganId());
|
||||||
|
|
||||||
AssertUtils.notEmpty(plateDetailRespVOS, ORDER_PLAN_PLATE_ERROR);
|
AssertUtils.notEmpty(plateDetailRespVOS, ORDER_PLAN_PLATE_ERROR);
|
||||||
|
|
||||||
for (PlateDetailRespVO plateDetailsRespVO : plateDetailRespVOS) {
|
List<PlateDetailDO> resultPlateList = mergeGroupName(plateDetailRespVOS);
|
||||||
StringBuilder name = new StringBuilder();
|
|
||||||
if(!plateDetailsRespVO.getProcessGroupLists().isEmpty()) {
|
|
||||||
for (ProcessGroupList groupNameList : plateDetailsRespVO.getProcessGroupLists()) {
|
|
||||||
// 去除最后的逗号
|
|
||||||
name.append(groupNameList.getGroupName()).append(",");
|
|
||||||
|
|
||||||
}
|
|
||||||
name = new StringBuilder(name.substring(0, name.length() - 1));
|
|
||||||
}
|
|
||||||
plateDetailsRespVO.setProcessGroupName(name.toString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
List<OrderDO> orderDOS = orderMapper.selectBatchIds(orderIds);
|
List<OrderDO> orderDOS = orderMapper.selectBatchIds(orderIds);
|
||||||
|
|
||||||
AssertUtils.notEmpty(orderDOS, ORDER_PLAN_ORDERS_EMPTY);
|
AssertUtils.notEmpty(orderDOS, ORDER_PLAN_ORDERS_EMPTY);
|
||||||
|
|
||||||
List<OrderModelDO> models =
|
List<OrderModelDO> models =
|
||||||
plateDetailRespVOS.stream()
|
resultPlateList.stream()
|
||||||
.map(PlateDetailRespVO::getModelData)
|
.map(PlateDetailDO::getModelData)
|
||||||
.filter(StringUtils::isNotBlank)
|
.filter(StringUtils::isNotBlank)
|
||||||
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
||||||
.toList();
|
.toList();
|
||||||
@@ -422,9 +407,6 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
// 查询订单对应的配件信息
|
// 查询订单对应的配件信息
|
||||||
List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(orderIds, getUserOrganId());
|
List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(orderIds, getUserOrganId());
|
||||||
|
|
||||||
// 查询订单对应的配件的ES信息
|
|
||||||
List<OrderPartsRemark> orderPartsRemarks = esUtils.getEsDocument(FIELD_ORDER_ID, orderIds, printOrderPartsRespVOS.size(), ORDER_PARTS_REMARK_MODEL.getIndex(), OrderPartsRemark.class);
|
|
||||||
|
|
||||||
// 查询订单对应的包裹信息
|
// 查询订单对应的包裹信息
|
||||||
List<PrintOrderPackReqVO> printOrderPackReqVOS = plateMapper.selectPlanPackList(ids,getUserOrganId());
|
List<PrintOrderPackReqVO> printOrderPackReqVOS = plateMapper.selectPlanPackList(ids,getUserOrganId());
|
||||||
|
|
||||||
@@ -446,12 +428,12 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
.orderList(orderDOS)
|
.orderList(orderDOS)
|
||||||
.plan(planDO)
|
.plan(planDO)
|
||||||
.goodsList(goodsDOS)
|
.goodsList(goodsDOS)
|
||||||
.plateList(plateDetailRespVOS)
|
.plateList(BeanUtil.copyToList(resultPlateList, PlateDetailRespVO.class))
|
||||||
.plateModels(models)
|
.plateModels(models)
|
||||||
.planActualGoodsModelDO(planActualGoodsModelDO)
|
.planActualGoodsModelDO(planActualGoodsModelDO)
|
||||||
.optimizeRemainPlates(optimizeRemainPlates)
|
.optimizeRemainPlates(optimizeRemainPlates)
|
||||||
.orderPartsRespVOS(printOrderPartsRespVOS)
|
.orderPartsRespVOS(printOrderPartsRespVOS)
|
||||||
.orderPartsRemarks(orderPartsRemarks)
|
.orderPartsRemarks(null)
|
||||||
.orderPackReqVOS(printOrderPackReqVOS)
|
.orderPackReqVOS(printOrderPackReqVOS)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
@@ -788,13 +770,16 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
throw new ServiceException(ORDER_PLAN_CREATE_PLATE_NUM_REACH_THRESHOLD_ERROR, planCreatePlateThreshold);
|
throw new ServiceException(ORDER_PLAN_CREATE_PLATE_NUM_REACH_THRESHOLD_ERROR, planCreatePlateThreshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PlateDetailRespVO> plateDetailRespVOS = plateMapper.selectNoPlanPlate(orderIds, orderGoodsIds, getUserOrganId());
|
// 查询未排单小板
|
||||||
|
List<PlateDetailDO> plateDetailRespVOS = plateMapper.selectNoPlanPlate(orderIds, orderGoodsIds, getUserOrganId());
|
||||||
|
|
||||||
AssertUtils.notEmpty(plateDetailRespVOS, ORDER_PLATE_EMPTY);
|
AssertUtils.notEmpty(plateDetailRespVOS, ORDER_PLATE_EMPTY);
|
||||||
|
|
||||||
|
List<PlateDetailDO> resultPlateList = mergeGroupName(plateDetailRespVOS);
|
||||||
|
|
||||||
List<OrderModelDO> models =
|
List<OrderModelDO> models =
|
||||||
plateDetailRespVOS.stream()
|
resultPlateList.stream()
|
||||||
.map(PlateDetailRespVO::getModelData)
|
.map(PlateDetailDO::getModelData)
|
||||||
.filter(StringUtils::isNotBlank)
|
.filter(StringUtils::isNotBlank)
|
||||||
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
||||||
.toList();
|
.toList();
|
||||||
@@ -804,12 +789,63 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
return OrderSource.builder()
|
return OrderSource.builder()
|
||||||
.orderList(buildTree(orderDOS))
|
.orderList(buildTree(orderDOS))
|
||||||
.goodsList(goodsReqVOS)
|
.goodsList(goodsReqVOS)
|
||||||
.plateList(plateDetailRespVOS)
|
.plateList(BeanUtil.copyToList(resultPlateList, PlateDetailRespVO.class))
|
||||||
.plateModels(models)
|
.plateModels(models)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合并加工组名称
|
||||||
|
*
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
public List<PlateDetailDO> mergeGroupName(List<PlateDetailDO> list) {
|
||||||
|
|
||||||
|
if (list == null || list.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// plateId -> (groupName + 代表对象)
|
||||||
|
Map<Long, PlateDetailDO> resultMap = new LinkedHashMap<>();
|
||||||
|
Map<Long, Set<String>> groupNameMap = new HashMap<>();
|
||||||
|
|
||||||
|
for (PlateDetailDO item : list) {
|
||||||
|
|
||||||
|
Long plateId = item.getPlateId();
|
||||||
|
if (plateId == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保留第一条作为代表对象(或你也可以自定义取最新)
|
||||||
|
resultMap.putIfAbsent(plateId, item);
|
||||||
|
|
||||||
|
if (item.getProcessGroupName() != null) {
|
||||||
|
groupNameMap
|
||||||
|
.computeIfAbsent(plateId, k -> new LinkedHashSet<>())
|
||||||
|
.add(item.getProcessGroupName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组装最终结果
|
||||||
|
List<PlateDetailDO> result = new ArrayList<>(resultMap.size());
|
||||||
|
|
||||||
|
for (Map.Entry<Long, PlateDetailDO> entry : resultMap.entrySet()) {
|
||||||
|
|
||||||
|
Long plateId = entry.getKey();
|
||||||
|
PlateDetailDO item = entry.getValue();
|
||||||
|
|
||||||
|
Set<String> groupNames = groupNameMap.get(plateId);
|
||||||
|
if (groupNames != null && !groupNames.isEmpty()) {
|
||||||
|
item.setProcessGroupName(String.join(",", groupNames));
|
||||||
|
}
|
||||||
|
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将订单列表整理成父子结构
|
* 将订单列表整理成父子结构
|
||||||
* 规则:
|
* 规则:
|
||||||
|
|||||||
+8
-2
@@ -4,7 +4,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
|||||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||||
@@ -70,7 +70,13 @@ public interface PlateService {
|
|||||||
|
|
||||||
PageResult<PlateGoodDO> getGoodsPlate(GoodsPlateFilterPageReqVO pageReqVO);
|
PageResult<PlateGoodDO> getGoodsPlate(GoodsPlateFilterPageReqVO pageReqVO);
|
||||||
|
|
||||||
PageResult<PlateResList> getOrderPlatePage(NoPlanPlatePageReqVO reqVO);
|
/**
|
||||||
|
* 查询订单未排单小板
|
||||||
|
*
|
||||||
|
* @param reqVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PlateDetailRespVO> getOrdersNoPlanPlate(NoPlanPlatePageReqVO reqVO);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+69
-85
@@ -22,7 +22,6 @@ import com.cf.imes.framework.common.util.object.BeanUtils;
|
|||||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
|
||||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO;
|
||||||
@@ -31,7 +30,7 @@ import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO;
|
|||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentPageReqVO;
|
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentPageReqVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||||
@@ -42,6 +41,7 @@ import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPlatesPage
|
|||||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||||
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDetailDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||||
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||||
@@ -334,24 +334,16 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<PlateResList> getOrderPlatePage(NoPlanPlatePageReqVO pageReqVO) {
|
public List<PlateDetailRespVO> getOrdersNoPlanPlate(NoPlanPlatePageReqVO pageReqVO) {
|
||||||
|
// 置空内部条件
|
||||||
List<Integer> statusList = new ArrayList<>();
|
pageReqVO.setMaterialList(null);
|
||||||
statusList.add(OrderStatusEnum.NEW_ORDER.getStatus());
|
pageReqVO.setColorList(null);
|
||||||
statusList.add(OrderStatusEnum.IN_PRODUCTION.getStatus());
|
pageReqVO.setBrandList(null);
|
||||||
statusList.add(OrderStatusEnum.SORTED.getStatus());
|
pageReqVO.setThicknessList(null);
|
||||||
|
pageReqVO.setTextureList(null);
|
||||||
|
|
||||||
Long organId = getUserOrganId();
|
Long organId = getUserOrganId();
|
||||||
|
|
||||||
QueryWrapperX<OrderDO> queryWrapperX = new QueryWrapperX<>();
|
|
||||||
queryWrapperX
|
|
||||||
.eq("o.organ_id", organId)
|
|
||||||
.eq("o.deleted", false)
|
|
||||||
.in("o.status", statusList)
|
|
||||||
.isNotNull("op.id")
|
|
||||||
.eq("op.deleted", false);
|
|
||||||
|
|
||||||
|
|
||||||
if (pageReqVO.getPlanId() != null) {
|
if (pageReqVO.getPlanId() != null) {
|
||||||
|
|
||||||
Long planId = pageReqVO.getPlanId();
|
Long planId = pageReqVO.getPlanId();
|
||||||
@@ -379,67 +371,75 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
if (planDO.getType().equals(PlanTypeEnum.MIXEDORDERPLAN.getType())) {
|
if (planDO.getType().equals(PlanTypeEnum.MIXEDORDERPLAN.getType())) {
|
||||||
|
|
||||||
// 混单添加查询条件
|
// 混单添加查询条件
|
||||||
mixedInsertQuery(pageReqVO, planDO, material, thickness, queryWrapperX);
|
mixedInsertQuery(pageReqVO, planDO, material, thickness);
|
||||||
|
|
||||||
}
|
}
|
||||||
// 非混单
|
// 非混单
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// 非混单条件查询条件
|
// 非混单条件查询条件
|
||||||
noMixedInsertQuery(pageReqVO, planDO, material, brand, color, thickness, texture, queryWrapperX);
|
noMixedInsertQuery(pageReqVO, planDO, material, brand, color, thickness, texture);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 无排单ID时
|
// 查询订单未排单小板
|
||||||
else {
|
List<PlateDetailDO> plateDetailDOS = plateMapper.selectNoPlanPlateWithFilter(pageReqVO, organId);
|
||||||
|
// 合并加工组
|
||||||
|
List<PlateDetailDO> resultPlateList = mergeGroupName(plateDetailDOS);
|
||||||
|
|
||||||
queryWrapperX
|
return BeanUtil.copyToList(resultPlateList, PlateDetailRespVO.class);
|
||||||
.likeIfPresent(FIELD_OG_MATERIAL, pageReqVO.getMaterial())
|
}
|
||||||
.likeIfPresent(FIELD_OG_BRAND, pageReqVO.getBrand())
|
|
||||||
.likeIfPresent(FIELD_OG_COLOR, pageReqVO.getColor())
|
/**
|
||||||
.eqIfPresent(FIELD_OP_THICKNESS, pageReqVO.getThickness());
|
* 合并加工组名称
|
||||||
|
*
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
public List<PlateDetailDO> mergeGroupName(List<PlateDetailDO> list) {
|
||||||
|
|
||||||
|
if (list == null || list.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// plateId -> (groupName + 代表对象)
|
||||||
|
Map<Long, PlateDetailDO> resultMap = new LinkedHashMap<>();
|
||||||
|
Map<Long, Set<String>> groupNameMap = new HashMap<>();
|
||||||
|
|
||||||
queryWrapperX
|
for (PlateDetailDO item : list) {
|
||||||
.inIfPresent("op.goods_id", pageReqVO.getGoodsIdList())
|
|
||||||
.likeIfPresent("o.id", pageReqVO.getOrderId() != null ? pageReqVO.getOrderId() : null)
|
|
||||||
.likeIfPresent("op.id", pageReqVO.getPlateId())
|
|
||||||
.likeIfPresent("op.name", pageReqVO.getPlateName())
|
|
||||||
.likeIfPresent("op.plate_no", pageReqVO.getPlateNo())
|
|
||||||
.likeIfPresent("op.custom_plate_no", pageReqVO.getCustomPlateNo())
|
|
||||||
.betweenIfPresent("op.height", new BigDecimal[]{pageReqVO.getLongMinRang(), pageReqVO.getLongMaxRang()})
|
|
||||||
.betweenIfPresent("op.width", new BigDecimal[]{pageReqVO.getWidthMinRang(), pageReqVO.getWidthMaxRang()})
|
|
||||||
.betweenIfPresent(FIELD_OP_THICKNESS, new BigDecimal[]{pageReqVO.getThicknessMinRang(), pageReqVO.getThicknessMaxRang()})
|
|
||||||
.eqIfPresent("op.texture", pageReqVO.getTexture())
|
|
||||||
.eqIfPresent("op.is_special_shaped", pageReqVO.getIsSpecialShaped())
|
|
||||||
.eqIfPresent("op.is_sculpt", pageReqVO.getIsSculpt())
|
|
||||||
.eqIfPresent("op.is_row_hole", pageReqVO.getIsRowHole())
|
|
||||||
.likeIfPresent("op.remark", pageReqVO.getRemark())
|
|
||||||
.orderByDesc("o.id, op.id");
|
|
||||||
|
|
||||||
|
Long plateId = item.getPlateId();
|
||||||
|
if (plateId == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Integer pageNo = (pageReqVO.getPageNo() - 1) * pageReqVO.getPageSize();
|
// 保留第一条作为代表对象(或你也可以自定义取最新)
|
||||||
|
resultMap.putIfAbsent(plateId, item);
|
||||||
|
|
||||||
List<PlateResList> plateResLists = orderMapper.selectNoPlanOrderPlateList(queryWrapperX, pageNo, pageReqVO.getPageSize(), organId);
|
|
||||||
|
|
||||||
if (CollUtil.isEmpty(plateResLists)) {
|
|
||||||
|
|
||||||
return new PageResult<>();
|
|
||||||
|
|
||||||
|
if (item.getProcessGroupName() != null) {
|
||||||
|
groupNameMap
|
||||||
|
.computeIfAbsent(plateId, k -> new LinkedHashSet<>())
|
||||||
|
.add(item.getProcessGroupName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
queryWrapperX
|
// 组装最终结果
|
||||||
.groupBy("o.id");
|
List<PlateDetailDO> result = new ArrayList<>(resultMap.size());
|
||||||
|
|
||||||
List<Long> plateCount = orderMapper.selectNoPlanOrderPlateCount(queryWrapperX, organId);
|
for (Map.Entry<Long, PlateDetailDO> entry : resultMap.entrySet()) {
|
||||||
|
|
||||||
long sum = plateCount.stream().mapToLong(Long::longValue).sum();
|
Long plateId = entry.getKey();
|
||||||
|
PlateDetailDO item = entry.getValue();
|
||||||
|
|
||||||
return new PageResult<>(plateResLists, sum);
|
Set<String> groupNames = groupNameMap.get(plateId);
|
||||||
|
if (groupNames != null && !groupNames.isEmpty()) {
|
||||||
|
item.setProcessGroupName(String.join(",", groupNames));
|
||||||
|
}
|
||||||
|
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -768,8 +768,7 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
private void mixedInsertQuery(NoPlanPlatePageReqVO pageReqVO,
|
private void mixedInsertQuery(NoPlanPlatePageReqVO pageReqVO,
|
||||||
PlanDO planDO,
|
PlanDO planDO,
|
||||||
List<String> material,
|
List<String> material,
|
||||||
List<BigDecimal> thickness,
|
List<BigDecimal> thickness) {
|
||||||
QueryWrapperX<OrderDO> queryWrapperX) {
|
|
||||||
|
|
||||||
|
|
||||||
if (Boolean.TRUE.equals(pageReqVO.getIsMixed())) {
|
if (Boolean.TRUE.equals(pageReqVO.getIsMixed())) {
|
||||||
@@ -779,21 +778,14 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
// 相同材质和厚度
|
// 相同材质和厚度
|
||||||
if (planDO.getFilter().equals(MixConfigTypeEnum.SAMEMATERIALANDTHICKNESS.getType())) {
|
if (planDO.getFilter().equals(MixConfigTypeEnum.SAMEMATERIALANDTHICKNESS.getType())) {
|
||||||
|
|
||||||
queryWrapperX
|
pageReqVO.setMaterialList(material);
|
||||||
.inIfPresent(FIELD_OG_MATERIAL, material)
|
pageReqVO.setThicknessList(thickness);
|
||||||
.likeIfPresent(FIELD_OG_BRAND, pageReqVO.getBrand())
|
|
||||||
.likeIfPresent(FIELD_OG_COLOR, pageReqVO.getColor())
|
|
||||||
.inIfPresent(FIELD_OP_THICKNESS, thickness);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 相同厚度
|
// 相同厚度
|
||||||
else {
|
else {
|
||||||
|
|
||||||
queryWrapperX
|
pageReqVO.setThicknessList(thickness);
|
||||||
.likeIfPresent(FIELD_OG_MATERIAL, pageReqVO.getMaterial())
|
|
||||||
.likeIfPresent(FIELD_OG_BRAND, pageReqVO.getBrand())
|
|
||||||
.likeIfPresent(FIELD_OG_COLOR, pageReqVO.getColor())
|
|
||||||
.inIfPresent(FIELD_OP_THICKNESS, thickness);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -807,8 +799,7 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
List<String> brand,
|
List<String> brand,
|
||||||
List<String> color,
|
List<String> color,
|
||||||
List<BigDecimal> thickness,
|
List<BigDecimal> thickness,
|
||||||
List<Boolean> texture,
|
List<Boolean> texture) {
|
||||||
QueryWrapperX<OrderDO> queryWrapperX) {
|
|
||||||
|
|
||||||
// 是否开启混单
|
// 是否开启混单
|
||||||
if (Boolean.TRUE.equals(pageReqVO.getIsMixed())) {
|
if (Boolean.TRUE.equals(pageReqVO.getIsMixed())) {
|
||||||
@@ -819,29 +810,22 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
|
|
||||||
// 相同材质和厚度 混单
|
// 相同材质和厚度 混单
|
||||||
if (pageReqVO.getMixedType().equals(MixConfigTypeEnum.SAMEMATERIALANDTHICKNESS.getType())) {
|
if (pageReqVO.getMixedType().equals(MixConfigTypeEnum.SAMEMATERIALANDTHICKNESS.getType())) {
|
||||||
queryWrapperX
|
pageReqVO.setMaterialList(material);
|
||||||
.inIfPresent(FIELD_OG_MATERIAL, material)
|
pageReqVO.setThicknessList(thickness);
|
||||||
.likeIfPresent(FIELD_OG_BRAND, pageReqVO.getBrand())
|
|
||||||
.likeIfPresent(FIELD_OG_COLOR, pageReqVO.getColor())
|
|
||||||
.inIfPresent(FIELD_OP_THICKNESS, thickness);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 相同厚度 混单
|
// 相同厚度 混单
|
||||||
else {
|
else {
|
||||||
queryWrapperX
|
pageReqVO.setThicknessList(thickness);
|
||||||
.likeIfPresent(FIELD_OG_MATERIAL, pageReqVO.getMaterial())
|
|
||||||
.likeIfPresent(FIELD_OG_BRAND, pageReqVO.getBrand())
|
|
||||||
.likeIfPresent(FIELD_OG_COLOR, pageReqVO.getColor())
|
|
||||||
.inIfPresent(FIELD_OP_THICKNESS, thickness);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
queryWrapperX
|
// 非混单
|
||||||
.inIfPresent(FIELD_OG_MATERIAL, material)
|
pageReqVO.setMaterialList(material);
|
||||||
.inIfPresent(FIELD_OG_BRAND, brand)
|
pageReqVO.setBrandList(brand);
|
||||||
.inIfPresent(FIELD_OG_COLOR, color)
|
pageReqVO.setColorList(color);
|
||||||
.inIfPresent(FIELD_OP_THICKNESS, thickness)
|
pageReqVO.setThicknessList(thickness);
|
||||||
.inIfPresent(FIELD_OG_TEXTURE, texture);
|
pageReqVO.setTextureList(texture);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+64
-42
@@ -349,7 +349,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<resultMap id="PlateDetailMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO">
|
<resultMap id="PlateDetailMap" type="com.cf.imes.module.executor.dal.dataobject.plate.PlateDetailDO">
|
||||||
|
|
||||||
<result property="plateId" column="plateId"/>
|
<result property="plateId" column="plateId"/>
|
||||||
<result property="orderId" column="orderId"/>
|
<result property="orderId" column="orderId"/>
|
||||||
@@ -418,54 +418,76 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectPlanPlateDetailList" resultMap="PlateDetailMap">
|
<select id="selectPlanPlateDetailList" resultMap="PlateDetailMap">
|
||||||
|
SELECT
|
||||||
|
og.name AS processGroupName,
|
||||||
|
|
||||||
|
ogs.goods_id as plateGoodsId,
|
||||||
|
ogs.goods_name as goodsName,
|
||||||
|
ogs.color as color,
|
||||||
|
ogs.material as material,
|
||||||
|
|
||||||
|
op.id as plateId,
|
||||||
|
op.order_id as orderId,
|
||||||
|
op.name as name,
|
||||||
|
op.plate_no as plateNo,
|
||||||
|
op.custom_plate_no as customPlateNo,
|
||||||
|
op.type as type,
|
||||||
|
op.goods_id as goodsId,
|
||||||
|
op.width,
|
||||||
|
op.height,
|
||||||
|
op.thickness,
|
||||||
|
op.split_width as splitWidth,
|
||||||
|
op.split_height as splitHeight,
|
||||||
|
op.split_thickness as splitThickness,
|
||||||
|
op.seal_left as sealLeft,
|
||||||
|
op.seal_right as sealRight,
|
||||||
|
op.seal_up as sealUp,
|
||||||
|
op.seal_down as sealDown,
|
||||||
|
op.area as area,
|
||||||
|
op.texture as texture,
|
||||||
|
op.hole_face as holeFace,
|
||||||
|
op.hole_arrange as holeArrange,
|
||||||
|
op.is_door as isDoor,
|
||||||
|
op.open_door_type as openDoorType,
|
||||||
|
op.offset_x as offsetX,
|
||||||
|
op.offset_y as offsetY,
|
||||||
|
op.is_special_shaped as isSpecialShaped,
|
||||||
|
op.is_sculpt as isSculpt,
|
||||||
|
op.is_row_hole as hasHole,
|
||||||
|
op.remark as remark,
|
||||||
|
op.model_data as modelData
|
||||||
|
|
||||||
select distinct
|
FROM order_plate op
|
||||||
|
|
||||||
oi.body_id as bodyId,
|
JOIN order_goods ogs
|
||||||
oi.group_id as groupId,
|
ON op.organ_id = ogs.organ_id
|
||||||
oi.room_id as roomId,
|
AND op.order_id = ogs.order_id
|
||||||
og.name as groupName,
|
AND op.goods_id = ogs.id
|
||||||
ob.name as bodyName,
|
|
||||||
ob.room_name as roomName,
|
|
||||||
ogs.goods_id as plateGoodsId,
|
|
||||||
ogs.goods_name as goodsName,
|
|
||||||
ogs.brand as brand,
|
|
||||||
ogs.color as color,
|
|
||||||
ogs.material as material,
|
|
||||||
op.id as plateId,
|
|
||||||
op.order_id as orderId,
|
|
||||||
op.name as name,
|
|
||||||
op.plate_no as plateNo,
|
|
||||||
op.custom_plate_no as customPlateNo,
|
|
||||||
op.type as type,
|
|
||||||
op.goods_id as goodsId,
|
|
||||||
op.width as width,
|
|
||||||
op.height as height,
|
|
||||||
op.thickness as thickness,
|
|
||||||
op.seal_left as sealLeft,
|
|
||||||
op.seal_right as sealRight,
|
|
||||||
op.seal_up as sealUp,
|
|
||||||
op.seal_down as sealDown,
|
|
||||||
op.area as area,
|
|
||||||
op.texture as texture,
|
|
||||||
op.hole_face as holeFace,
|
|
||||||
op.open_door_type as openDoorType,
|
|
||||||
op.is_special_shaped as isSpecialShaped,
|
|
||||||
op.is_sculpt as isSculpt,
|
|
||||||
op.remark as remark,
|
|
||||||
op.model_data as modelData
|
|
||||||
|
|
||||||
from order_plate op
|
LEFT JOIN (
|
||||||
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
|
SELECT group_id, plate_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
|
FROM order_item
|
||||||
left join order_group og on op.organ_id = og.organ_id and op.order_id = og.order_id and oi.group_id = og.id
|
WHERE plate_id != 0
|
||||||
left join order_body ob on op.organ_id = ob.organ_id and op.order_id = ob.order_id and oi.body_id = ob.id
|
and source_id = 0
|
||||||
|
and order_id in
|
||||||
where op.organ_id = #{organId} and op.plan_id = #{planId}
|
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||||
|
#{orderIds}
|
||||||
|
</foreach>
|
||||||
|
and organ_id = #{organId}
|
||||||
|
group by group_id, plate_id
|
||||||
|
) oi
|
||||||
|
ON op.id = oi.plate_id
|
||||||
|
|
||||||
|
LEFT JOIN order_group og
|
||||||
|
ON og.id = oi.group_id
|
||||||
|
|
||||||
|
WHERE op.organ_id = #{organId}
|
||||||
|
and op.order_id in
|
||||||
|
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
|
||||||
|
#{orderId}
|
||||||
|
</foreach>
|
||||||
|
AND op.deleted = false
|
||||||
|
AND op.plan_id = #{planId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectIsCuttingPlate" resultType="java.lang.Long">
|
<select id="selectIsCuttingPlate" resultType="java.lang.Long">
|
||||||
|
|||||||
+291
-53
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<resultMap id="PlateDetialMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO">
|
<resultMap id="PlateDetialMap" type="com.cf.imes.module.executor.dal.dataobject.plate.PlateDetailDO">
|
||||||
|
|
||||||
<result property="plateId" column="plateId"/>
|
<result property="plateId" column="plateId"/>
|
||||||
<result property="orderId" column="orderId"/>
|
<result property="orderId" column="orderId"/>
|
||||||
@@ -77,12 +77,6 @@
|
|||||||
<result property="is2v" column="is2v"/>
|
<result property="is2v" column="is2v"/>
|
||||||
<result property="isSide2v" column="isSide2v"/>
|
<result property="isSide2v" column="isSide2v"/>
|
||||||
<result property="modelData" column="modelData" typeHandler="com.cf.imes.framework.mybatis.core.type.CompressByteTypeHandler"/>
|
<result property="modelData" column="modelData" typeHandler="com.cf.imes.framework.mybatis.core.type.CompressByteTypeHandler"/>
|
||||||
|
|
||||||
<collection property="processGroupLists" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.plan.bo.ProcessGroupList" >
|
|
||||||
|
|
||||||
<result property="groupId" column="groupId"/>
|
|
||||||
<result property="groupName" column="groupName"/>
|
|
||||||
</collection >
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
@@ -350,7 +344,7 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<resultMap id="OrderSourcePlateDetialMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO">
|
<resultMap id="OrderSourcePlateDetialMap" type="com.cf.imes.module.executor.dal.dataobject.plate.PlateDetailDO">
|
||||||
<result property="goodsId" column="plateGoodsId"/>
|
<result property="goodsId" column="plateGoodsId"/>
|
||||||
<result property="goodsName" column="goodsName"/>
|
<result property="goodsName" column="goodsName"/>
|
||||||
<result property="brand" column="brand"/>
|
<result property="brand" column="brand"/>
|
||||||
@@ -428,67 +422,311 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectNoPlanPlate" resultMap="PlateDetialMap">
|
<select id="selectNoPlanPlate" resultMap="PlateDetialMap">
|
||||||
|
SELECT
|
||||||
|
og.name AS processGroupName,
|
||||||
|
|
||||||
|
ogs.goods_id as plateGoodsId,
|
||||||
|
ogs.goods_name as goodsName,
|
||||||
|
ogs.color as color,
|
||||||
|
ogs.material as material,
|
||||||
|
|
||||||
select distinct
|
op.id as plateId,
|
||||||
oi.group_id as groupId,
|
op.order_id as orderId,
|
||||||
og.name as groupName,
|
op.name as name,
|
||||||
ogs.goods_id as plateGoodsId,
|
op.plate_no as plateNo,
|
||||||
ogs.goods_name as goodsName,
|
op.custom_plate_no as customPlateNo,
|
||||||
|
op.type as type,
|
||||||
|
op.goods_id as goodsId,
|
||||||
|
op.width,
|
||||||
|
op.height,
|
||||||
|
op.thickness,
|
||||||
|
op.split_width as splitWidth,
|
||||||
|
op.split_height as splitHeight,
|
||||||
|
op.split_thickness as splitThickness,
|
||||||
|
op.seal_left as sealLeft,
|
||||||
|
op.seal_right as sealRight,
|
||||||
|
op.seal_up as sealUp,
|
||||||
|
op.seal_down as sealDown,
|
||||||
|
op.area as area,
|
||||||
|
op.texture as texture,
|
||||||
|
op.hole_face as holeFace,
|
||||||
|
op.hole_arrange as holeArrange,
|
||||||
|
op.is_door as isDoor,
|
||||||
|
op.open_door_type as openDoorType,
|
||||||
|
op.offset_x as offsetX,
|
||||||
|
op.offset_y as offsetY,
|
||||||
|
op.is_special_shaped as isSpecialShaped,
|
||||||
|
op.is_sculpt as isSculpt,
|
||||||
|
op.is_row_hole as hasHole,
|
||||||
|
op.remark as remark,
|
||||||
|
op.model_data as modelData
|
||||||
|
|
||||||
ogs.color as color,
|
FROM order_plate op
|
||||||
ogs.material as material,
|
|
||||||
op.id as plateId,
|
|
||||||
op.order_id as orderId,
|
|
||||||
op.name as name,
|
|
||||||
op.plate_no as plateNo,
|
|
||||||
op.custom_plate_no as customPlateNo,
|
|
||||||
op.type as type,
|
|
||||||
op.goods_id as goodsId,
|
|
||||||
op.width as width,
|
|
||||||
op.height as height,
|
|
||||||
op.thickness as thickness,
|
|
||||||
op.split_width as splitWidth,
|
|
||||||
op.split_height as splitHeight,
|
|
||||||
op.split_thickness as splitThickness,
|
|
||||||
op.seal_left as sealLeft,
|
|
||||||
op.seal_right as sealRight,
|
|
||||||
op.seal_up as sealUp,
|
|
||||||
op.seal_down as sealDown,
|
|
||||||
op.area as area,
|
|
||||||
op.texture as texture,
|
|
||||||
op.hole_face as holeFace,
|
|
||||||
op.hole_arrange as holeArrange,
|
|
||||||
op.is_door as isDoor,
|
|
||||||
op.open_door_type as openDoorType,
|
|
||||||
op.offset_x as offsetX,
|
|
||||||
op.offset_y as offsetY,
|
|
||||||
op.is_special_shaped as isSpecialShaped,
|
|
||||||
op.is_sculpt as isSculpt,
|
|
||||||
op.is_row_hole as hasHole,
|
|
||||||
op.remark as remark,
|
|
||||||
op.model_data as modelData
|
|
||||||
|
|
||||||
from order_plate op
|
JOIN order_goods ogs
|
||||||
join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id
|
ON op.organ_id = ogs.organ_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 and oi.plate_id != 0
|
AND op.order_id = ogs.order_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
|
AND op.goods_id = ogs.id
|
||||||
where op.organ_id = #{organId}
|
|
||||||
|
|
||||||
and op.order_id in
|
LEFT JOIN (
|
||||||
|
SELECT group_id, plate_id
|
||||||
|
FROM order_item
|
||||||
|
WHERE plate_id != 0
|
||||||
|
and source_id = 0
|
||||||
|
and order_id in
|
||||||
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||||
#{orderIds}
|
#{orderIds}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
and organ_id = #{organId}
|
||||||
|
group by group_id, plate_id
|
||||||
|
) oi
|
||||||
|
ON op.id = oi.plate_id
|
||||||
|
|
||||||
|
LEFT JOIN order_group og
|
||||||
|
ON og.id = oi.group_id
|
||||||
|
|
||||||
|
WHERE op.organ_id = #{organId}
|
||||||
|
and op.order_id in
|
||||||
|
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
|
||||||
|
#{orderId}
|
||||||
|
</foreach>
|
||||||
and op.goods_id in
|
and op.goods_id in
|
||||||
<foreach collection="ids" item="ids" open="(" close=")" separator=",">
|
<foreach collection="ids" item="ids" open="(" close=")" separator=",">
|
||||||
#{ids}
|
#{ids}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
AND op.deleted = false
|
||||||
|
AND op.plan_id = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
and op.deleted = false
|
<select id="selectNoPlanPlateWithFilter" resultMap="PlateDetialMap">
|
||||||
|
|
||||||
and op.plan_id = 0
|
SELECT
|
||||||
|
og.name AS processGroupName,
|
||||||
|
|
||||||
|
ogs.goods_id as plateGoodsId,
|
||||||
|
ogs.goods_name as goodsName,
|
||||||
|
ogs.color as color,
|
||||||
|
ogs.material as material,
|
||||||
|
ogs.brand as brand,
|
||||||
|
|
||||||
|
op.id as plateId,
|
||||||
|
op.order_id as orderId,
|
||||||
|
op.name as name,
|
||||||
|
op.plate_no as plateNo,
|
||||||
|
op.custom_plate_no as customPlateNo,
|
||||||
|
op.type as type,
|
||||||
|
op.goods_id as goodsId,
|
||||||
|
op.width,
|
||||||
|
op.height,
|
||||||
|
op.thickness,
|
||||||
|
op.split_width as splitWidth,
|
||||||
|
op.split_height as splitHeight,
|
||||||
|
op.split_thickness as splitThickness,
|
||||||
|
op.seal_left as sealLeft,
|
||||||
|
op.seal_right as sealRight,
|
||||||
|
op.seal_up as sealUp,
|
||||||
|
op.seal_down as sealDown,
|
||||||
|
op.area as area,
|
||||||
|
op.texture as texture,
|
||||||
|
op.hole_face as holeFace,
|
||||||
|
op.hole_arrange as holeArrange,
|
||||||
|
op.is_door as isDoor,
|
||||||
|
op.open_door_type as openDoorType,
|
||||||
|
op.offset_x as offsetX,
|
||||||
|
op.offset_y as offsetY,
|
||||||
|
op.is_special_shaped as isSpecialShaped,
|
||||||
|
op.is_sculpt as isSculpt,
|
||||||
|
op.is_row_hole as hasHole,
|
||||||
|
op.remark as remark,
|
||||||
|
op.model_data as modelData
|
||||||
|
|
||||||
|
FROM order_plate op
|
||||||
|
|
||||||
|
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 (
|
||||||
|
SELECT group_id, plate_id
|
||||||
|
FROM order_item
|
||||||
|
WHERE plate_id != 0
|
||||||
|
AND source_id = 0
|
||||||
|
AND organ_id = #{organId}
|
||||||
|
|
||||||
|
<if test="reqVO.orderIds != null and reqVO.orderIds.size() > 0">
|
||||||
|
AND order_id IN
|
||||||
|
<foreach collection="reqVO.orderIds" item="orderId" open="(" close=")" separator=",">
|
||||||
|
#{orderId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
GROUP BY group_id, plate_id
|
||||||
|
) oi
|
||||||
|
ON op.id = oi.plate_id
|
||||||
|
|
||||||
|
LEFT JOIN order_group og
|
||||||
|
ON og.id = oi.group_id
|
||||||
|
AND og.organ_id = #{organId}
|
||||||
|
|
||||||
|
JOIN orders o
|
||||||
|
ON o.id = op.order_id
|
||||||
|
AND o.organ_id = #{organId}
|
||||||
|
AND o.deleted = false
|
||||||
|
AND o.status IN (1,2,3)
|
||||||
|
|
||||||
|
WHERE op.organ_id = #{organId}
|
||||||
|
AND op.deleted = false
|
||||||
|
AND op.plan_id = 0
|
||||||
|
|
||||||
|
<!-- goodsIdList -->
|
||||||
|
<if test="reqVO.goodsIdList != null and reqVO.goodsIdList.size() > 0">
|
||||||
|
AND op.goods_id IN
|
||||||
|
<foreach collection="reqVO.goodsIdList" item="goodsId" open="(" close=")" separator=",">
|
||||||
|
#{goodsId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- orderIds -->
|
||||||
|
<if test="reqVO.orderIds != null and reqVO.orderIds.size() > 0">
|
||||||
|
AND op.order_id IN
|
||||||
|
<foreach collection="reqVO.orderIds" item="orderId" open="(" close=")" separator=",">
|
||||||
|
#{orderId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- plateId -->
|
||||||
|
<if test="reqVO.plateId != null and reqVO.plateId != ''">
|
||||||
|
AND CAST(op.id AS CHAR) LIKE CONCAT('%', #{reqVO.plateId}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- plateName -->
|
||||||
|
<if test="reqVO.plateName != null and reqVO.plateName != ''">
|
||||||
|
AND op.name LIKE CONCAT('%', #{reqVO.plateName}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- plateNo -->
|
||||||
|
<if test="reqVO.plateNo != null and reqVO.plateNo != ''">
|
||||||
|
AND op.plate_no LIKE CONCAT('%', #{reqVO.plateNo}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- customPlateNo -->
|
||||||
|
<if test="reqVO.customPlateNo != null and reqVO.customPlateNo != ''">
|
||||||
|
AND op.custom_plate_no LIKE CONCAT('%', #{reqVO.customPlateNo}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- material -->
|
||||||
|
<if test="reqVO.material != null and reqVO.material != ''">
|
||||||
|
AND ogs.material LIKE CONCAT('%', #{reqVO.material}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- brand -->
|
||||||
|
<if test="reqVO.brand != null and reqVO.brand != ''">
|
||||||
|
AND ogs.brand LIKE CONCAT('%', #{reqVO.brand}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- color -->
|
||||||
|
<if test="reqVO.color != null and reqVO.color != ''">
|
||||||
|
AND ogs.color LIKE CONCAT('%', #{reqVO.color}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- thickness -->
|
||||||
|
<if test="reqVO.thickness != null">
|
||||||
|
AND op.thickness = #{reqVO.thickness}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- height range -->
|
||||||
|
<if test="reqVO.longMinRang != null">
|
||||||
|
AND op.height <![CDATA[ >= ]]> #{reqVO.longMinRang}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.longMaxRang != null">
|
||||||
|
AND op.height <![CDATA[ <= ]]> #{reqVO.longMaxRang}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- width range -->
|
||||||
|
<if test="reqVO.widthMinRang != null">
|
||||||
|
AND op.width <![CDATA[ >= ]]> #{reqVO.widthMinRang}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.widthMaxRang != null">
|
||||||
|
AND op.width <![CDATA[ <= ]]> #{reqVO.widthMaxRang}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- thickness range -->
|
||||||
|
<if test="reqVO.thicknessMinRang != null">
|
||||||
|
AND op.thickness <![CDATA[ >= ]]> #{reqVO.thicknessMinRang}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.thicknessMaxRang != null">
|
||||||
|
AND op.thickness <![CDATA[ <= ]]> #{reqVO.thicknessMaxRang}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- texture -->
|
||||||
|
<if test="reqVO.texture != null">
|
||||||
|
AND op.texture = #{reqVO.texture}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- special shaped -->
|
||||||
|
<if test="reqVO.isSpecialShaped != null">
|
||||||
|
AND op.is_special_shaped = #{reqVO.isSpecialShaped}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- sculpt -->
|
||||||
|
<if test="reqVO.isSculpt != null">
|
||||||
|
AND op.is_sculpt = #{reqVO.isSculpt}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- row hole -->
|
||||||
|
<if test="reqVO.isRowHole != null">
|
||||||
|
AND op.is_row_hole = #{reqVO.isRowHole}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- remark -->
|
||||||
|
<if test="reqVO.remark != null and reqVO.remark != ''">
|
||||||
|
AND op.remark LIKE CONCAT('%', #{reqVO.remark}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 材质 -->
|
||||||
|
<if test="reqVO.materialList != null and reqVO.materialList.size > 0">
|
||||||
|
AND ogs.material IN
|
||||||
|
<foreach collection="reqVO.materialList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 品牌 -->
|
||||||
|
<if test="reqVO.brandList != null and reqVO.brandList.size > 0">
|
||||||
|
AND ogs.brand IN
|
||||||
|
<foreach collection="reqVO.brandList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 颜色 -->
|
||||||
|
<if test="reqVO.colorList != null and reqVO.colorList.size > 0">
|
||||||
|
AND ogs.color IN
|
||||||
|
<foreach collection="reqVO.colorList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 厚度 -->
|
||||||
|
<if test="reqVO.thicknessList != null and reqVO.thicknessList.size > 0">
|
||||||
|
AND op.thickness IN
|
||||||
|
<foreach collection="reqVO.thicknessList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 纹理 -->
|
||||||
|
<if test="reqVO.textureList != null and reqVO.textureList.size > 0">
|
||||||
|
AND ogs.texture IN
|
||||||
|
<foreach collection="reqVO.textureList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
ORDER BY op.order_id DESC, op.id DESC
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user