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