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:
+27
@@ -0,0 +1,27 @@
|
||||
package com.cf.imes.framework.common.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum OrderStatusEnum {
|
||||
|
||||
EMPTY(0, "默认"),
|
||||
NEW_ORDER(1, "新单"),
|
||||
NO_SORT(2, "未排单"),
|
||||
IN_PRODUCTION(3, "生产中"),
|
||||
FINISH_PRODUCTION(4, "生产完成");
|
||||
|
||||
private final Integer status;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.status .equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(OrderStatusEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.status .equals(this.getStatus()) ;
|
||||
}
|
||||
}
|
||||
+1
@@ -9,6 +9,7 @@ import lombok.Getter;
|
||||
public enum ProcessProcessingTypeEnum {
|
||||
|
||||
CUTTINGMATERIALS(1,"开料"),
|
||||
PACK(5,"打包"),
|
||||
COMPONENTPROCESSING(7,"组件加工"),
|
||||
PLATE(8,"板材加工");
|
||||
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.bo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class ProcessGroupList {
|
||||
|
||||
|
||||
@Schema(description = "加工组名称")
|
||||
private String groupName;
|
||||
|
||||
// @Schema(description = "加工组ID")
|
||||
// private String groupId;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+10
-4
@@ -1,10 +1,12 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.ProcessGroupList;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单板件 Response VO")
|
||||
@Data
|
||||
@@ -173,8 +175,8 @@ public class PlateDetialRespVO {
|
||||
private Integer type;
|
||||
|
||||
|
||||
@Schema(description = "加工组ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long processGroupId;
|
||||
// @Schema(description = "加工组ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// private String processGroupId;
|
||||
|
||||
|
||||
@Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -190,8 +192,12 @@ public class PlateDetialRespVO {
|
||||
private Boolean hasHole;
|
||||
|
||||
|
||||
@Schema(description = "生产单明细ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long itemId;
|
||||
// 加工组ID和名称
|
||||
@Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<ProcessGroupList> processGroupLists;
|
||||
|
||||
// @Schema(description = "生产单明细ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// private Long itemId;
|
||||
|
||||
|
||||
|
||||
|
||||
+51
-3
@@ -10,6 +10,7 @@ import co.elastic.clients.elasticsearch._types.FieldValue;
|
||||
import co.elastic.clients.elasticsearch.core.*;
|
||||
import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cf.imes.framework.common.enums.OrderStatusEnum;
|
||||
import com.cf.imes.framework.common.enums.PlanStatusEnum;
|
||||
import com.cf.imes.framework.common.enums.RemainTypeEnum;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
@@ -20,6 +21,7 @@ import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.cf.imes.framework.security.core.LoginUser;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderSource;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.ProcessGroupList;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.ProcessStepAreaIds;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.ProcessStepSalaryIds;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.dto.Material;
|
||||
@@ -276,6 +278,15 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
}
|
||||
|
||||
public Boolean validateOrderStatus(Long orderId){
|
||||
|
||||
// 查询当前生产单的工序是否已全部加工
|
||||
List<ProcessStepDO> orderProcessStepNDOS = processStepMapper.selectOrderStatus(orderId, getUserOrganId());
|
||||
|
||||
return orderProcessStepNDOS.isEmpty();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public OptimizeParamResVO getOptimizeParam(Long planId) {
|
||||
@@ -415,7 +426,28 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
// PlanDO planDO = planMapper.selectByOrderId(orderId);
|
||||
|
||||
List<PlateDetialRespVO> plateDOS = plateMapper.selectPlateDetialList(orderId,getUserOrganId());
|
||||
List<PlateDetialRespVO> plateDOS = plateMapper.selectPlateDetialList(orderId,getUserOrganId());
|
||||
|
||||
for (PlateDetialRespVO plateDetailsRespVO : plateDOS) {
|
||||
String name = "";
|
||||
if(!plateDetailsRespVO.getProcessGroupLists().isEmpty()) {
|
||||
for (ProcessGroupList groupNameList : plateDetailsRespVO.getProcessGroupLists()) {
|
||||
// 去除最后的逗号
|
||||
name += groupNameList.getGroupName() + ",";
|
||||
|
||||
}
|
||||
name = name.substring(0, name.length() - 1);
|
||||
}
|
||||
plateDetailsRespVO.setProcessGroupName(name);
|
||||
}
|
||||
|
||||
|
||||
// for (PlateDetialRespVO plateDetailsRespVO : plateDOS) {
|
||||
// for (ProcessGroupList groupNameList : plateDetailsRespVO.getProcessGroupLists()) {
|
||||
// plateDetailsRespVO.setProcessGroupName(groupNameList.getGroupName());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
// 造型数据的尺寸长度
|
||||
@@ -467,6 +499,21 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
List<PlateDetialRespVO> plateDOS = plateMapper.selectPlateDetialListByIds(orderIds,getUserOrganId());
|
||||
|
||||
for (PlateDetialRespVO plateDetailsRespVO : plateDOS) {
|
||||
String name = "";
|
||||
if(!plateDetailsRespVO.getProcessGroupLists().isEmpty()) {
|
||||
for (ProcessGroupList groupNameList : plateDetailsRespVO.getProcessGroupLists()) {
|
||||
// 去除最后的逗号
|
||||
name += groupNameList.getGroupName() + ",";
|
||||
|
||||
}
|
||||
name = name.substring(0, name.length() - 1);
|
||||
}
|
||||
plateDetailsRespVO.setProcessGroupName(name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 造型数据的尺寸长度
|
||||
Integer orderModelSize = plateDOS.size();
|
||||
|
||||
@@ -603,9 +650,10 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
for (PlateDetialRespVO plateDetialRespVO : req.getPlateList()) {
|
||||
orderItemDOS.add(OrderItemDO.builder()
|
||||
.id(plateDetialRespVO.getItemId())
|
||||
// .id(plateDetialRespVO.getItemId())
|
||||
.bodyId(plateDetialRespVO.getBodyId())
|
||||
.groupId(plateDetialRespVO.getProcessGroupId())
|
||||
.roomId(plateDetialRespVO.getRoomId())
|
||||
// .groupId(Long.valueOf(plateDetialRespVO.getProcessGroupId()))
|
||||
.orderId(plateDetialRespVO.getOrderId())
|
||||
.type(1)
|
||||
.plateId(plateDetialRespVO.getId())
|
||||
|
||||
+134
-14
@@ -116,33 +116,113 @@
|
||||
|
||||
<resultMap id="PlateDetialMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetialRespVO">
|
||||
|
||||
<result property="itemId" column="itemId"/>
|
||||
<result property="id" column="plateId"/>
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="goodsId" column="goodsId"/>
|
||||
<result property="plateNo" column="plateNo"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="height" column="height"/>
|
||||
<result property="width" column="width"/>
|
||||
<result property="thickness" column="thickness"/>
|
||||
<result property="splitWidth" column="splitWidth"/>
|
||||
<result property="splitHeight" column="splitHeight"/>
|
||||
<result property="splitThickness" column="splitThickness"/>
|
||||
<result property="isSpecialShaped" column="isSpecialShaped"/>
|
||||
<result property="sealLeft" column="sealLeft"/>
|
||||
<result property="sealRight" column="sealRight"/>
|
||||
<result property="sealUp" column="sealUp"/>
|
||||
<result property="sealDown" column="sealDown"/>
|
||||
<result property="area" column="area"/>
|
||||
<result property="texture" column="texture"/>
|
||||
<result property="holeFace" column="holeFace"/>
|
||||
<result property="holeArrange" column="holeArrange"/>
|
||||
<result property="unregularPointCount" column="unregularPointCount"/>
|
||||
<result property="frontHoleCount" column="frontHoleCount"/>
|
||||
<result property="backHoleCount" column="backHoleCount"/>
|
||||
<result property="sideHoleCount" column="sideHoleCount"/>
|
||||
<result property="frontModelCount" column="frontModelCount"/>
|
||||
<result property="backModelCount" column="backModelCount"/>
|
||||
<result property="isDoor" column="isDoor"/>
|
||||
<result property="isArcAcross" column="isArcAcross"/>
|
||||
<result property="moduleTypeId" column="moduleTypeId"/>
|
||||
<result property="isSculpt" column="isSculpt"/>
|
||||
<result property="filterType" column="filterType"/>
|
||||
<result property="offsetX" column="offsetX"/>
|
||||
<result property="offsetY" column="offsetY"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isCancel" column="isCancel"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="openDoorType" column="openDoorType"/>
|
||||
<result property="hasHole" column="hasHole"/>
|
||||
|
||||
<result property="bodyId" column="bodyId"/>
|
||||
<result property="goodsName" column="goodsName"/>
|
||||
<result property="roomId" column="roomId"/>
|
||||
<result property="bodyName" column="bodyName"/>
|
||||
<result property="roomName" column="roomName"/>
|
||||
<result property="processGroupId" column="processGroupId"/>
|
||||
<result property="processGroupName" column="processGroupName"/>
|
||||
<result property="hasHole" column="hasHole"/>
|
||||
|
||||
<collection property="processGroupLists" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.plan.bo.ProcessGroupList">
|
||||
<result property="groupName" column="groupName"/>
|
||||
|
||||
</collection>
|
||||
|
||||
</resultMap>
|
||||
<select id="selectPlateDetialList"
|
||||
resultMap="PlateDetialMap"
|
||||
resultType="java.lang.Long">
|
||||
|
||||
select distinct op.*,
|
||||
oi.id as itemId,
|
||||
select distinct
|
||||
|
||||
op.id as plateId,
|
||||
op.order_id as orderId,
|
||||
op.name as name,
|
||||
op.plate_no as plateNo,
|
||||
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.unregular_point_count as unregularPointCount,
|
||||
op.front_hole_count as frontHoleCount,
|
||||
op.back_hole_count as backHoleCount,
|
||||
op.side_hole_count as sideHoleCount,
|
||||
op.front_model_count as frontModelCount,
|
||||
op.back_model_count as backModelCount,
|
||||
op.is_door as isDoor,
|
||||
op.open_door_type as openDoorType,
|
||||
op.offset_x as offsetX,
|
||||
op.offset_y as offsetY,
|
||||
op.is_arc_across as isArcAcross,
|
||||
op.module_type_id as moduleTypeId,
|
||||
op.is_special_shaped as isSpecialShaped,
|
||||
op.is_sculpt as isSculpt,
|
||||
op.is_row_hole as hasHole,
|
||||
op.remark as remark,
|
||||
op.filter_type as filterType,
|
||||
op.is_cancel as isCancel,
|
||||
|
||||
ogs.goods_name as goodsName,
|
||||
ob.id as bodyId,
|
||||
ob.room_id as roomId,
|
||||
ob.name as bodyName,
|
||||
ob.room_name as roomName,
|
||||
og.id as processGroupId,
|
||||
og.name as processGroupName,
|
||||
op.is_row_hole as hasHole
|
||||
op.is_row_hole as hasHole,
|
||||
og.name as groupName
|
||||
|
||||
from order_plate op
|
||||
left join order_goods ogs on op.goods_id = ogs.id and op.organ_id = ogs.organ_id
|
||||
join order_goods ogs on op.goods_id = ogs.id and op.organ_id = ogs.organ_id
|
||||
join order_item oi on op.id = oi.plate_id and op.organ_id = oi.organ_id
|
||||
join order_body ob on oi.body_id = ob.id and oi.organ_id = ob.organ_id
|
||||
left join order_group og on oi.group_id = og.id and oi.organ_id = og.organ_id
|
||||
@@ -155,15 +235,55 @@
|
||||
resultMap="PlateDetialMap"
|
||||
resultType="java.lang.Long">
|
||||
|
||||
select distinct op.*,
|
||||
oi.id as itemId,
|
||||
select distinct
|
||||
op.id as plateId,
|
||||
op.order_id as orderId,
|
||||
op.name as name,
|
||||
op.plate_no as plateNo,
|
||||
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.unregular_point_count as unregularPointCount,
|
||||
op.front_hole_count as frontHoleCount,
|
||||
op.back_hole_count as backHoleCount,
|
||||
op.side_hole_count as sideHoleCount,
|
||||
op.front_model_count as frontModelCount,
|
||||
op.back_model_count as backModelCount,
|
||||
op.is_door as isDoor,
|
||||
op.open_door_type as openDoorType,
|
||||
op.offset_x as offsetX,
|
||||
op.offset_y as offsetY,
|
||||
op.is_arc_across as isArcAcross,
|
||||
op.module_type_id as moduleTypeId,
|
||||
op.is_special_shaped as isSpecialShaped,
|
||||
op.is_sculpt as isSculpt,
|
||||
op.is_row_hole as hasHole,
|
||||
op.remark as remark,
|
||||
op.filter_type as filterType,
|
||||
op.is_cancel as isCancel,
|
||||
|
||||
ogs.goods_name as goodsName,
|
||||
ob.id as bodyId,
|
||||
ob.room_id as roomId,
|
||||
ob.name as bodyName,
|
||||
ob.room_name as roomName,
|
||||
og.name as processGroupName,
|
||||
CASE WHEN op.unregular_point_count = 0 and op.front_hole_count = 0 and op.back_hole_count = 0 and op.side_hole_count = 0 THEN false ELSE true END AS hasHole
|
||||
op.is_row_hole as hasHole,
|
||||
og.name as groupName
|
||||
from order_plate op
|
||||
left join order_goods ogs on op.goods_id = ogs.id and op.organ_id = ogs.organ_id
|
||||
join order_goods ogs on op.goods_id = ogs.id and op.organ_id = ogs.organ_id
|
||||
join order_item oi on op.id = oi.plate_id and op.organ_id = oi.organ_id
|
||||
join order_body ob on oi.body_id = ob.id and oi.organ_id = ob.organ_id
|
||||
left join order_group og on oi.group_id = og.id and oi.organ_id = og.organ_id
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ public class PackageDetailsRespVO {
|
||||
|
||||
|
||||
@Schema(description = "板材ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String plateId;
|
||||
private Long plateId;
|
||||
|
||||
@Schema(description = "板编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String plateNo;
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public class OrderDO extends BaseDO {
|
||||
private Long id;
|
||||
|
||||
// 订单状态
|
||||
private Long status;
|
||||
private Integer status;
|
||||
|
||||
// 自定义单号
|
||||
private String customOrderNo;
|
||||
|
||||
Reference in New Issue
Block a user