委托验收补单问题,单独分库默认第一个

fencang
anthonyywj2 3 years ago
parent d5b141adfd
commit a0667dbf60

@ -347,10 +347,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);
}
@ -418,12 +418,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<String> erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk());
if (erpIds != null && erpIds.size() > 0) {
@ -433,6 +438,9 @@ public class OrderController {
StockOrderEntity stockOrderEntity = stockOrderService.findOne(stockOrderFilterRequest);
stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER);
stockOrderEntity.setReviewUser(authAdmin.getId().intValue());
if (entrustReceEntity != null && StrUtil.isEmpty(stockOrderEntity.getInvWarehouseCode())) {
stockOrderEntity.setInvWarehouseCode(entrustReceEntity.getEntrustSubInv());
}
stockOrderEntity.setAuditTime(new Date());
if (StrUtil.isEmpty(stockOrderEntity.getInvWarehouseCode())) {
stockOrderEntity.setInvWarehouseCode(authAdmin.getLocSubInvCode());
@ -446,6 +454,7 @@ public class OrderController {
List<StockOrderEntity> stockOrderEntityLit = stockOrderService.findAllOrders(stockOrderFilterRequest);
if (!stockOrderEntityLit.isEmpty()) {
for (StockOrderEntity stockOrderEntity : stockOrderEntityLit) {
stockOrderEntity.setInvWarehouseCode(orderEntity.getInvWarehouseCode());
stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER);
stockOrderEntity.setReviewUser(authAdmin.getId().intValue());
if (StrUtil.isEmpty(stockOrderEntity.getInvWarehouseCode())) {
@ -478,7 +487,7 @@ public class OrderController {
AuthAdmin authAdmin = customerService.getUserBean();
long customerId = customerService.getCustomerId();
return updateReview(authAdmin, updateExportStatusRequest);
return updateReview(authAdmin, updateExportStatusRequest, null);
}

@ -264,7 +264,7 @@ public class OrderServiceImpl implements OrderService {
supplementOrder.setInvWarehouseCode(order.getFromSubInvCode());
} else {
List<InvSubWarehouseEntity> 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());
}
}

Loading…
Cancel
Save