|
|
@@ -360,11 +360,11 @@ public class OrderLogic {
|
|
|
this.updateOrderStatus(orderId, OrderStatusEnum.CLOSE.toString());
|
|
|
}
|
|
|
|
|
|
- private void handleGoodsMaterialStock(OrderInfo orderInfo, List<OrderDetail> orderDetailList, AdminUserCom adminUser) throws Exception {
|
|
|
+ private void handleGoodsMaterialStock(OrderInfo orderInfo, List<OrderDetail> orderDetailList, AdminUserCom adminUser, DirectFlagEnum flagEnum) throws Exception {
|
|
|
List<GoodsMaterialStockDTO> dtoList = new ArrayList<>();
|
|
|
for (OrderDetail orderDetail : orderDetailList) {
|
|
|
GoodsMaterialStockDTO dto = new GoodsMaterialStockDTO();
|
|
|
- dto.setDirectFlag(DirectFlagEnum.ADD.getKey())
|
|
|
+ dto.setDirectFlag(flagEnum.getKey())
|
|
|
.setRemindName(orderDetail.getGoodsMaterialName())
|
|
|
.setCompanyWechatId(orderInfo.getCompanyWechatId())
|
|
|
.setCompanyWechatName(orderInfo.getCompanyWechatName())
|
|
|
@@ -871,13 +871,21 @@ public class OrderLogic {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void ack(String orderBaseId){
|
|
|
+ @Transactional
|
|
|
+ public void ack(String orderBaseId) throws Exception {
|
|
|
OrderInfo orderInfo = orderInfoService.getById(orderBaseId);
|
|
|
if(!StringUtils.equals(orderInfo.getOrderStatus(),OrderStatusEnum.DQR.toString())){
|
|
|
throw new RemoteServiceException("非待确认订单不可操作");
|
|
|
}
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
orderInfo.setOrderStatus(OrderStatusEnum.DFH.toString());
|
|
|
orderInfo.updateById();
|
|
|
+
|
|
|
+ // 确认订单减少物料库存
|
|
|
+ final List<OrderDetail> orderDetailList = orderDetailService.lambdaQuery()
|
|
|
+ .eq(OrderDetail::getOrderId, orderInfo.getOrderId())
|
|
|
+ .list();
|
|
|
+ this.handleGoodsMaterialStock(orderInfo, orderDetailList, adminUser, DirectFlagEnum.SUB);
|
|
|
}
|
|
|
|
|
|
|