diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinOutInPlanServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinOutInPlanServiceImpl.java index ed6533f..d7292c8 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinOutInPlanServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinOutInPlanServiceImpl.java @@ -141,15 +141,17 @@ public class BusinOutInPlanServiceImpl extends ServiceImpl inPlanList = this.getOrderByContainerCode(containerCode, PlanTypeEnum.IN.getValue()); + if (inPlanList != null && inPlanList.size()>0) { + for (BusinOutInPlan businOutInPlan : inPlanList) { + businOutInPlan.setPlanStatus(PlanStatusEnum.CANCEL.getValue()); + } + this.updateBatchById(inPlanList); } - BusinOutInPlan businOutInPlanOut = this.getOrderByContainerCode(containerCode, PlanTypeEnum.OUT.getValue()); - if (businOutInPlanOut != null) { - return Result.err().msg("此托盘存在相关未完成的出库任务单据:" + businOutInPlan.getOrderNo()); + List outPlanList = this.getOrderByContainerCode(containerCode, PlanTypeEnum.OUT.getValue()); + if (outPlanList != null && outPlanList.size()>0) { + return Result.err().msg("此托盘存在相关未完成的出库任务单据:" + outPlanList.get(0).getOrderNo()); } BaseContainer container = baseContainerService.queryContainerByCode(containerCode); if (container == null) { @@ -255,7 +257,7 @@ public class BusinOutInPlanServiceImpl extends ServiceImpl getOrderByContainerCode(String containerCode, String planType) { // 如果没有指定计划类型 就默认是入库 if (StringUtils.isBlank(planType)) { @@ -270,9 +272,9 @@ public class BusinOutInPlanServiceImpl extends ServiceImpl list = this.list(wq); + return list; } @Override @@ -364,8 +366,8 @@ public class BusinOutInPlanServiceImpl extends ServiceImpl callEmptyContainerByQty(BaseContainerCallBo bo) { //如果呼叫指定的托盘,先判断是否已有未执行的任务 if (bo.getContainerCode() != null) { - BusinOutInPlan businOutInPlan = this.getOrderByContainerCode(bo.getContainerCode(), PlanTypeEnum.CALL.getValue()); - if (businOutInPlan != null) { + List planList = this.getOrderByContainerCode(bo.getContainerCode(), PlanTypeEnum.CALL.getValue()); + if (planList != null && planList.size()>0) { return Result.err().msg("此托盘已呼叫,等待出库"); } }