瀏覽代碼

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

姜永辉 1 年之前
父節點
當前提交
5dc03e983d
共有 1 個文件被更改,包括 30 次插入21 次删除
  1. 30 21
      src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

+ 30 - 21
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -157,7 +157,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
     @Transactional(rollbackFor = {Exception.class})
     public void insertOutsideGoodsInto(OutboundVO outboundVO, List<OutboundItemVO> outboundItemVOList) {
         if (outboundItemVOList != null && outboundItemVOList.size() > 0) {
-            Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getSkuId));
+            Map<String, List<OutboundItemVO>> outboundItemVOMap = outboundItemVOList.stream().collect(Collectors.groupingBy(OutboundItemVO::getOutId));
             for (String str : outboundItemVOMap.keySet()) {
                 //提取分组后的明细
                 List<OutboundItemVO> outboundItemVOListGroup = outboundItemVOMap.get(str);
@@ -213,6 +213,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                     inboundItemVO.setIntoType(inboundVO.getIntoType());
                     //入库状态等于已入库 更新合计入库数量/金额 = 入库中数量/入库中金额
                     inboundItemVO
+                            .setPriceInto(outboundItemVO.getPriceOut())
                             .setIntoQty(outboundItemVO.getOutQty())
                             .setIntoAmt(outboundItemVO.getOutQty())
                             .setIntoingQty(BigDecimal.ZERO)
@@ -451,9 +452,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
             //region 库存
             //筛选出skuId不为空的 走库存
             List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-            Map<String, Object> invMap = new HashMap<>();
-            invMap.put("outDetail", invList);
-            inventoryService.operatingInventoryInformation(invMap);
+            if(invList!=null && invList.size() > 0){
+                Map<String, Object> invMap = new HashMap<>();
+                invMap.put("outDetail", invList);
+                inventoryService.operatingInventoryInformation(invMap);
+            }
+
             //endregion
         }
         //endregion
@@ -696,10 +700,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                 //筛选出skuId不为空的 走库存
                 List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
                 List<OutboundItemVO> invDelList = outboundVO.getDeleteItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-                Map<String, Object> invMap = new HashMap<>();
-                invMap.put("outDetail", invList);
-                invMap.put("delOutDetail", invDelList);
-                inventoryService.operatingInventoryInformation(invMap);
+                if ((invList != null && invList.size() > 0) || (invDelList != null && invDelList.size() > 0)) {
+                    Map<String, Object> invMap = new HashMap<>();
+                    invMap.put("outDetail", invList);
+                    invMap.put("delOutDetail", invDelList);
+                    inventoryService.operatingInventoryInformation(invMap);
+                }
                 //endregion
             } else {
                 throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
@@ -962,9 +968,11 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
             //region  修改库存
             //筛选出skuId不为空的 走库存
             List<OutboundItemResponse> invList = outboundItemResponseList.stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-            Map<String, Object> map = new HashMap<>();
-            map.put("delOutDetail", invList);
-            inventoryService.operatingInventoryInformation(map);
+            if(invList!=null && invList.size()>0) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("delOutDetail", invList);
+                inventoryService.operatingInventoryInformation(map);
+            }
             //endregion
         } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
@@ -1279,7 +1287,6 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         accountService.accReceivable(outboundResponse.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
         //endregion
 
-
         //region 外协品新建外协入库单
         //筛选出skuId为空的 走外协品逻辑
         List<OutboundItemVO> outsideGoods = outboundVO.getItemList().stream().filter(it -> it.getSkuId() == null).collect(Collectors.toList());
@@ -1296,10 +1303,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         //筛选出skuId不为空的 走库存
         List<OutboundItemVO> invList = outboundVO.getItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
         List<OutboundItemVO> invDelList = outboundVO.getDeleteItemList().stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-        Map<String, Object> map = new HashMap<>();
-        map.put("outDetail", invList);
-        map.put("delOutDetail", invDelList);
-        inventoryService.operatingInventoryInformation(map);
+        if ((invList != null && invList.size() > 0) || (invDelList != null && invDelList.size() > 0)) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("outDetail", invList);
+            map.put("delOutDetail", invDelList);
+            inventoryService.operatingInventoryInformation(map);
+        }
         //endregion
         return ResponseResultUtil.success(outboundVO);
     }
@@ -1420,7 +1429,6 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         }
         //endregion
 
-
         //region 外协品新建外协入库单
         //筛选出skuId为空的 走外协品逻辑
         OutboundVO outsideGoodVO = outboundConvert.convertResToVO(outboundResponse);
@@ -1433,11 +1441,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
         //region   调用库存
         //筛选出skuId不为空的 走库存
         List<OutboundItemResponse> invList = outboundItemResponseList.stream().filter(it -> it.getSkuId() != null).collect(Collectors.toList());
-        Map<String, Object> map = new HashMap<>();
-        map.put("delOutDetail", invList);
-        inventoryService.operatingInventoryInformation(map);
+        if(invList!=null && invList.size()>0) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("delOutDetail", invList);
+            inventoryService.operatingInventoryInformation(map);
+        }
         //endregion
-
         return ResponseResultUtil.success();
     }