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 2ed22d283..69e7464b8 100644 --- a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java @@ -255,31 +255,17 @@ public class IoAddInoutService { List orderEntities = orderService.isExitRepeat(orderEntity.getCorpOrderId(), orderEntity.getBillNo()); if (CollUtil.isNotEmpty(orderEntities)) { - orderEntity.setErrMsg("单据重复上传"); - orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); - orderEntity.setUpdateTime(new Date()); - orderService.update(orderEntity); - return ResultVOUtils.error(orderEntity.getErrMsg()); + return updateErrMsg(orderEntity, "单据重复上传"); } - if (StrUtil.isEmpty(orderEntity.getFromCorp()) && StrUtil.isEmpty(orderEntity.getFromInvCode())) { - orderEntity.setErrMsg("未选择往来单位"); - orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); - orderEntity.setUpdateTime(new Date()); - orderService.update(orderEntity); - return ResultVOUtils.error(orderEntity.getErrMsg()); + return updateErrMsg(orderEntity, "未选择往来单位"); } if (StrUtil.isEmpty(orderEntity.getInvCode())) { - orderEntity.setErrMsg("未选择当前仓库信息"); - orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); - orderEntity.setUpdateTime(new Date()); - orderService.update(orderEntity); - return ResultVOUtils.error(orderEntity.getErrMsg()); + return updateErrMsg(orderEntity, "未选择当前仓库信息"); } - String errMsg = ""; List orderDetailBizEntities = orderDetailBizService.findByOrderId(orderEntity.getBillNo()); if (CollUtil.isNotEmpty(orderDetailBizEntities)) { @@ -290,15 +276,31 @@ public class IoAddInoutService { if (orderDetailBizEntity.getBindRlFk() == null) { errMsg = errMsg + orderDetailBizEntity.getCoName() + "未绑定耗材字典编码;"; } + + if (orderDetailBizEntity.getBindRlFk() == null) { + + errMsg = errMsg + orderDetailBizEntity.getCoName() + "该产品未指定唯一耗材编码;"; + + } + if (StrUtil.isEmpty(orderDetailBizEntity.getSupId())) { + errMsg = errMsg + orderDetailBizEntity.getCoName() + "该产品未指定供应商;"; + } + if (orderDetailBizEntity.getCount() == 0) { + errMsg = errMsg + orderDetailBizEntity.getCoName() + "产品数量不能为0;"; + } + + if (bussinessTypeEntity.getCheckWebNew() == 1 || bussinessTypeEntity.getCheckWebNew() == 3) { + if (StrUtil.isEmpty(orderDetailBizEntity.getBatchNo()) + && StrUtil.isEmpty(orderDetailBizEntity.getProductDate()) + && StrUtil.isEmpty(orderDetailBizEntity.getExpireDate())) { + return ResultVOUtils.error(500, orderDetailBizEntity.getCoName() + "三期不能全为空!"); + } + } } } if (StrUtil.isNotEmpty(errMsg)) { - orderEntity.setErrMsg(errMsg); - orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); - orderEntity.setUpdateTime(new Date()); - orderService.update(orderEntity); - return ResultVOUtils.error(orderEntity.getErrMsg()); + return updateErrMsg(orderEntity, "未选择当前仓库信息"); } orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); @@ -314,6 +316,14 @@ public class IoAddInoutService { return ResultVOUtils.success(); } + BaseResponse updateErrMsg(IoOrderEntity orderEntity, String errMsg) { + orderEntity.setErrMsg(errMsg); + orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); + orderEntity.setUpdateTime(new Date()); + orderService.update(orderEntity); + return ResultVOUtils.error(orderEntity.getErrMsg()); + } + /** * 业务单生成扫码单