diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java index 64082628..176bdba3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java @@ -274,7 +274,7 @@ public class OrderController { } else { FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); filterInvWarehouseRequest.setCode(stockOrderEntity.getLocStorageCode()); - filterInvWarehouseRequest.setUserId(userId ); + filterInvWarehouseRequest.setUserId(userId); invWarehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest); } @@ -368,10 +368,10 @@ public class OrderController { return ResultVOUtils.success("验收成功!"); } else - return updateReview(authAdmin, updateExportStatusRequest); + return updateReview(authAdmin, updateExportStatusRequest, entrustReceEntity); } } else - return updateReview(authAdmin, updateExportStatusRequest); + return updateReview(authAdmin, updateExportStatusRequest, null); } @@ -439,12 +439,17 @@ public class OrderController { } - public BaseResponse updateReview(AuthAdmin authAdmin, UpdateExportStatusRequest updateExportStatusRequest) { + public BaseResponse updateReview(AuthAdmin authAdmin, UpdateExportStatusRequest updateExportStatusRequest, EntrustReceEntity entrustReceEntity) { OrderEntity orderEntity = orderService.findById(updateExportStatusRequest.getOrderId()); orderEntity.setReceiveStatus(1); orderEntity.setReviewUser(authAdmin.getId().intValue()); orderEntity.setUpdateTime(new Date()); orderEntity.setAuditTime(new Date()); + if (entrustReceEntity != null && StrUtil.isEmpty(orderEntity.getInvWarehouseCode())) { + orderEntity.setInvWarehouseCode(entrustReceEntity.getInvWarehouseCode()); + } else if (StrUtil.isEmpty(orderEntity.getInvWarehouseCode())) { + orderEntity.setInvWarehouseCode(authAdmin.getLocSubInvCode()); + } orderService.updateOrder(orderEntity); List erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk()); if (erpIds != null && erpIds.size() > 0) { @@ -498,7 +503,7 @@ public class OrderController { updateExportStatusRequest.setOrderId(temp.getOrderIdFk()); AuthAdmin authAdmin = customerService.getUserBean(); - return updateReview(authAdmin, updateExportStatusRequest); + return updateReview(authAdmin, updateExportStatusRequest, null); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java index 071dc800..079e342d 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java @@ -272,7 +272,7 @@ public class OrderServiceImpl implements OrderService { supplementOrder.setInvWarehouseCode(order.getFromSubInvCode()); } else { List invSubWarehouseEntities = invSubWarehouseService.findByParentId(supplementOrder.getLocStorageCode()); - if (CollUtil.isNotEmpty(invSubWarehouseEntities) && invSubWarehouseEntities.size() == 1) { + if (CollUtil.isNotEmpty(invSubWarehouseEntities) && invSubWarehouseEntities.size() > 0) { supplementOrder.setInvWarehouseCode(invSubWarehouseEntities.get(0).getCode()); } }