diff --git a/src/main/java/com/glxp/api/controller/collect/IoCollectOrderCodeManController.java b/src/main/java/com/glxp/api/controller/collect/IoCollectOrderCodeManController.java index 59e7b74dc..4ce3076d7 100644 --- a/src/main/java/com/glxp/api/controller/collect/IoCollectOrderCodeManController.java +++ b/src/main/java/com/glxp/api/controller/collect/IoCollectOrderCodeManController.java @@ -122,7 +122,7 @@ public class IoCollectOrderCodeManController extends BaseController { } } else { - return ResultVOUtils.error(500, e.getMessage()); + return ResultVOUtils.error(e.getCode(), e.getMessage()); } } } diff --git a/src/main/java/com/glxp/api/service/collect/IoCollectOrderCodeManService.java b/src/main/java/com/glxp/api/service/collect/IoCollectOrderCodeManService.java index 45acd6412..1746a5a5d 100644 --- a/src/main/java/com/glxp/api/service/collect/IoCollectOrderCodeManService.java +++ b/src/main/java/com/glxp/api/service/collect/IoCollectOrderCodeManService.java @@ -538,7 +538,7 @@ public class IoCollectOrderCodeManService extends ServiceImpl ioSplitCodeEntities = splitCodeService.findSplitCodes(collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo(), workPlaceCode); for (IoSplitCodeEntity ioSplitCodeEntity : ioSplitCodeEntities) { - if (IntUtil.value(ioSplitCodeEntity.getRemainCount()) > needCount) { + if (IntUtil.value(ioSplitCodeEntity.getRemainCount()) >= needCount) { return true; } } diff --git a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java index 9e8250bc0..b9beeedcc 100644 --- a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java @@ -170,26 +170,30 @@ public class IoAddInoutService { } //产品是否指定供应商 - if (StrUtil.isEmpty(warehouseEntity.getSupId())) { - orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); - orderEntity.setUpdateTime(new Date()); - orderEntity.setErrMsg("udi码:" + warehouseEntity.getCode() + "未指定供应商!"); - orderService.update(orderEntity); - return ResultVOUtils.error(orderEntity.getErrMsg()); - } - //校验是否是当前供应商 - if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { - UdiRlSupEntity udiRlSupEntity = udiRlSupService.findByUdiRlIdUnitFk(warehouseEntity.getRelId() + "", orderEntity.getFromCorp()); - if (udiRlSupEntity == null) { + + if (!(bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_RETURN) || bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_OUT))) { + if (StrUtil.isEmpty(warehouseEntity.getSupId())) { orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); orderEntity.setUpdateTime(new Date()); - orderEntity.setErrMsg("udi码:" + warehouseEntity.getCode() + "当前供应商不存在此配送产品"); + orderEntity.setErrMsg("udi码:" + warehouseEntity.getCode() + "未指定供应商!"); orderService.update(orderEntity); return ResultVOUtils.error(orderEntity.getErrMsg()); } + //校验是否是当前供应商 + if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { + UdiRlSupEntity udiRlSupEntity = udiRlSupService.findByUdiRlIdUnitFk(warehouseEntity.getRelId() + "", orderEntity.getFromCorp()); + if (udiRlSupEntity == null) { + orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); + orderEntity.setUpdateTime(new Date()); + orderEntity.setErrMsg("udi码:" + warehouseEntity.getCode() + "当前供应商不存在此配送产品"); + orderService.update(orderEntity); + return ResultVOUtils.error(orderEntity.getErrMsg()); + } + } } + //产品是否可以以使用单元入库 UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(warehouseEntity.getRelId()); if (udiRelevanceResponse == null) { diff --git a/src/main/java/com/glxp/api/service/inout/IoSplitFifoInvService.java b/src/main/java/com/glxp/api/service/inout/IoSplitFifoInvService.java index 85209ddca..d374a504e 100644 --- a/src/main/java/com/glxp/api/service/inout/IoSplitFifoInvService.java +++ b/src/main/java/com/glxp/api/service/inout/IoSplitFifoInvService.java @@ -89,7 +89,8 @@ public class IoSplitFifoInvService extends ServiceImpl queues = sysWorkplaceQueueService.list(new LambdaQueryWrapper().eq(SysWorkplaceQueue::getWorkPlaceIdFk, workPlaceCode)); - if (queues.size() == 0){ - throw new JsonException(500,"请增加取货槽"); + if (queues.size() == 0) { + throw new JsonException(500, "请增加取货槽"); } SysWorkplaceQueue workplaceQueue = queues.get(0); // 使用流来过滤掉匹配的元素 @@ -181,11 +183,11 @@ public class IoSplitFifoInvService extends ServiceImpl queue1.getCode().compareTo(queue2.getCode())) .collect(Collectors.toList()); - if (filteredQueues.size() > 0){ + if (filteredQueues.size() > 0) { //还有剩余的槽位 可分配 SysWorkplaceQueue sysWorkplaceQueue = filteredQueues.get(0); return sysWorkplaceQueue.getCode(); - }else { + } else { //增加一个槽位 SysWorkplaceLayer layer = sysWorkplaceLayerService.getOne(new LambdaQueryWrapper().eq(SysWorkplaceLayer::getCode, workplaceQueue.getLayerCode())); SysWorkplaceLayerRequest sysWorkplaceLayerRequest = new SysWorkplaceLayerRequest(); @@ -195,7 +197,7 @@ public class IoSplitFifoInvService extends ServiceImpl