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:
+23
-6
@@ -22,6 +22,8 @@ import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
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.planitem.PlanItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
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.order.OrderMapper;
|
||||
@@ -30,6 +32,7 @@ import com.cf.imes.module.executor.dal.mysql.orderGroup.OrderGroupMapper;
|
||||
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.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planItem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.remainplaten.RemainPlateMapper;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
@@ -42,6 +45,7 @@ import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
|
||||
@@ -87,6 +91,8 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
@Resource
|
||||
private OrderPartsMapper orderPartsMapper;
|
||||
|
||||
@Resource
|
||||
private PlanItemMapper planItemMapper;
|
||||
|
||||
@Resource
|
||||
private ElasticsearchClient elasticsearchClient;
|
||||
@@ -122,16 +128,27 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
@Override
|
||||
public CommonResult<Boolean> getOrder(Long orderId) {
|
||||
|
||||
List<Long> planIds = goodsMapper.selectNoPlanOrders(orderId, getUserOrganId());
|
||||
List<PlateDO> plateDOS = plateMapper.selectNoCutPlateByPlateId(Collections.singletonList(orderId), getUserOrganId());
|
||||
|
||||
List<Long> planList = planIds.stream().filter(f -> f == 0).toList();
|
||||
|
||||
if(planIds.isEmpty() || !planList.isEmpty()){
|
||||
if(CollUtil.isNotEmpty(plateDOS)){
|
||||
return CommonResult.success(false);
|
||||
}
|
||||
List<Long> planIdList = planMapper.selectPLanList(planIds, getUserOrganId());
|
||||
|
||||
return CommonResult.success(planIdList.isEmpty());
|
||||
List<PlanItemDO> planItemDOS = planItemMapper.selectOrderPlanList(orderId, getUserOrganId());
|
||||
|
||||
if(CollUtil.isNotEmpty(planItemDOS)){
|
||||
|
||||
List<Long> planIds = planItemDOS.stream().map(PlanItemDO::getPlanId).distinct().toList();
|
||||
|
||||
List<Long> planDOS = planMapper.selectPLanList(planIds,getUserOrganId());
|
||||
|
||||
if(CollUtil.isEmpty(planDOS)){
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return CommonResult.success(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
@@ -43,6 +43,9 @@ public class PlanPageReqVO extends PageParam {
|
||||
private List<Integer> status;
|
||||
|
||||
|
||||
@Schema(description = "是否已投产")
|
||||
private Boolean isScheduled;
|
||||
|
||||
@Schema(description = "机台 ID", example = "16707")
|
||||
private Long machineId;
|
||||
|
||||
|
||||
+3
@@ -29,6 +29,9 @@ public class PlanRespVO {
|
||||
@ExcelProperty("排单状态:0 新单,1 板材已申请,2 开料中,3 已开料")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否已投产")
|
||||
private Boolean isScheduled;
|
||||
|
||||
@Schema(description = "板材过滤条件")
|
||||
private String filter;
|
||||
|
||||
|
||||
+2
@@ -27,6 +27,8 @@ public class PlanSaveReqVO {
|
||||
@PlanStatusValid
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否已投产")
|
||||
private Boolean isScheduled;
|
||||
|
||||
@Schema(description = "需要进行排单的板材信息")
|
||||
private SavePlanPlateList savePlanPlateList;
|
||||
|
||||
+5
@@ -43,6 +43,11 @@ public class PlanDO extends BaseDO {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否已投产:0未投产,1已投产
|
||||
*/
|
||||
private Boolean isScheduled;
|
||||
|
||||
/**
|
||||
* 板材过滤条件
|
||||
*/
|
||||
|
||||
+2
@@ -30,6 +30,7 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
return selectJoinPage(reqVO, PlanDO.class, new MPJLambdaWrapperX<PlanDO>()
|
||||
.eq(PlanDO::getDeleted,false)
|
||||
.eq(PlanDO::getOrganId,getUserOrganId())
|
||||
.eqIfPresent(PlanDO::getIsScheduled,reqVO.getIsScheduled())
|
||||
.eqIfPresent(PlanDO::getId, reqVO.getId())
|
||||
.eqIfPresent(PlanDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(PlanDO::getType, reqVO.getType())
|
||||
@@ -52,6 +53,7 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PlanDO>()
|
||||
.eq(PlanDO::getDeleted,false)
|
||||
.eq(PlanDO::getOrganId,getUserOrganId())
|
||||
.eqIfPresent(PlanDO::getIsScheduled,reqVO.getIsScheduled())
|
||||
.eqIfPresent(PlanDO::getId, reqVO.getId())
|
||||
.eqIfPresent(PlanDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(PlanDO::getType, reqVO.getType())
|
||||
|
||||
+11
@@ -51,4 +51,15 @@ public interface PlanItemMapper extends BaseMapperX<PlanItemDO> {
|
||||
List<OrderGoodsResp> selectNoOrderGoodsIdList(@Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper);
|
||||
|
||||
List<OrderPlateIds> selectPlanIncrementPlate(@Param("noPlanIds") List<Long> noPlanIds,@Param("organId") Long organId);
|
||||
|
||||
|
||||
default List<PlanItemDO> selectOrderPlanList(Long orderId,Long organId) {
|
||||
return selectList( new LambdaQueryWrapperX<PlanItemDO>()
|
||||
.eq(PlanItemDO::getOrganId, organId)
|
||||
.eq(PlanItemDO::getOrderId,orderId)
|
||||
.select(PlanItemDO::getPlanId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+1
-1
@@ -402,7 +402,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
List<Integer> goodsNo = respVO.getGoodsNo();
|
||||
Integer cutedType = respVO.getCutedType();
|
||||
|
||||
if(goodsIds.isEmpty()){
|
||||
if(goodsIds.isEmpty() || goodsNo.isEmpty()){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -166,7 +166,8 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
List<PlanItemDO> planItemDOS = new ArrayList<>();
|
||||
|
||||
SavePlanPlateList savePlanPlateList = createReqVO.getSavePlanPlateList();
|
||||
SavePlanPlateList savePlanPlateList = Optional.ofNullable(createReqVO.getSavePlanPlateList()).orElseThrow(()-> new ServiceException(PLAN_PLATE_DATA_ERROR));
|
||||
|
||||
|
||||
if (Boolean.TRUE.equals(createReqVO.getIsMix())) {
|
||||
|
||||
@@ -330,7 +331,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
}else {
|
||||
|
||||
planDO.setStatus(updateReqVO.getStatus());
|
||||
planDO.setIsScheduled(updateReqVO.getIsScheduled());
|
||||
planMapper.updateById(planDO);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user