|
@@ -821,6 +821,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
stockGoodsList1 = stockGoodsClient.selectStockGoodsAll();
|
|
stockGoodsList1 = stockGoodsClient.selectStockGoodsAll();
|
|
|
}
|
|
}
|
|
|
List<StockGoods> finalStockGoodsList1 = stockGoodsList1;
|
|
List<StockGoods> finalStockGoodsList1 = stockGoodsList1;
|
|
|
|
|
+ List<StockGoods> stockGoodsList2 = new ArrayList<>();
|
|
|
r.getData().forEach(e -> {
|
|
r.getData().forEach(e -> {
|
|
|
//实际库存有没有库存
|
|
//实际库存有没有库存
|
|
|
StockGoods model = new StockGoods();
|
|
StockGoods model = new StockGoods();
|
|
@@ -842,20 +843,24 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
if (ObjectUtils.isNotNull(sysClient.getParamService("inventory")) && "1".equals(sysClient.getParamService("inventory"))) {
|
|
if (ObjectUtils.isNotNull(sysClient.getParamService("inventory")) && "1".equals(sysClient.getParamService("inventory"))) {
|
|
|
//修改库存单 只修改库存 添加库存在上边
|
|
//修改库存单 只修改库存 添加库存在上边
|
|
|
if (stock != null) {
|
|
if (stock != null) {
|
|
|
- iDeliveryItemsService.receivingInventory(select.getTradeType(), stock.getId(), e);
|
|
|
|
|
|
|
+ StockGoods stockGoods = iDeliveryItemsService.receivingInventory(select.getTradeType(), stock.getId(), e);
|
|
|
|
|
+ stockGoodsList2.add(stockGoods);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
if (stock == null) {
|
|
if (stock == null) {
|
|
|
throw new SecurityException("更新库存失败,未找到库存");
|
|
throw new SecurityException("更新库存失败,未找到库存");
|
|
|
} else {
|
|
} else {
|
|
|
- iDeliveryItemsService.receivingInventory(select.getTradeType(), stock.getId(), e);
|
|
|
|
|
|
|
+ StockGoods stockGoods = iDeliveryItemsService.receivingInventory(select.getTradeType(), stock.getId(), e);
|
|
|
|
|
+ stockGoodsList2.add(stockGoods);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ stockGoodsClient.updateStockList(stockGoodsList2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
List<BusinessOverpaymentItem> list = new ArrayList<>();
|
|
List<BusinessOverpaymentItem> list = new ArrayList<>();
|
|
|
List<StockGoods> finalStockGoodsList = stockGoodsList;
|
|
List<StockGoods> finalStockGoodsList = stockGoodsList;
|
|
|
|
|
+ List<StockGoods> stockGoodsList1 = new ArrayList<>();
|
|
|
deliveryItemsList.forEach(e -> {
|
|
deliveryItemsList.forEach(e -> {
|
|
|
if ("681169".equals(AuthUtil.getTenantId())) {
|
|
if ("681169".equals(AuthUtil.getTenantId())) {
|
|
|
// ===================增加益付款逻辑=========================
|
|
// ===================增加益付款逻辑=========================
|
|
@@ -945,6 +950,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
//更新收货单明细库存
|
|
//更新收货单明细库存
|
|
|
e.setInventoryNumber(stockGoods.getSurplusRouteQuantity());
|
|
e.setInventoryNumber(stockGoods.getSurplusRouteQuantity());
|
|
|
e.setInWeight(stockGoods.getInWeight());
|
|
e.setInWeight(stockGoods.getInWeight());
|
|
|
|
|
+ stockGoodsList1.add(stockGoods);
|
|
|
}
|
|
}
|
|
|
//修改库存单
|
|
//修改库存单
|
|
|
else {
|
|
else {
|
|
@@ -952,6 +958,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
//更新收货单明细库存
|
|
//更新收货单明细库存
|
|
|
e.setInventoryNumber(receiving.getSurplusRouteQuantity());
|
|
e.setInventoryNumber(receiving.getSurplusRouteQuantity());
|
|
|
e.setInWeight(receiving.getInWeight());
|
|
e.setInWeight(receiving.getInWeight());
|
|
|
|
|
+ stockGoodsList1.add(receiving);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
if (ObjectUtils.isNotNull(sysClient.getParamService("inventory")) && "1".equals(sysClient.getParamService("inventory"))) {
|
|
if (ObjectUtils.isNotNull(sysClient.getParamService("inventory")) && "1".equals(sysClient.getParamService("inventory"))) {
|
|
@@ -961,6 +968,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
//更新收货单明细库存
|
|
//更新收货单明细库存
|
|
|
e.setInventoryNumber(stockGoods.getSurplusRouteQuantity());
|
|
e.setInventoryNumber(stockGoods.getSurplusRouteQuantity());
|
|
|
e.setInWeight(stockGoods.getInWeight());
|
|
e.setInWeight(stockGoods.getInWeight());
|
|
|
|
|
+ stockGoodsList1.add(stockGoods);
|
|
|
}
|
|
}
|
|
|
//修改库存单
|
|
//修改库存单
|
|
|
else {
|
|
else {
|
|
@@ -968,12 +976,14 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
//更新收货单明细库存
|
|
//更新收货单明细库存
|
|
|
e.setInventoryNumber(receiving.getSurplusRouteQuantity());
|
|
e.setInventoryNumber(receiving.getSurplusRouteQuantity());
|
|
|
e.setInWeight(receiving.getInWeight());
|
|
e.setInWeight(receiving.getInWeight());
|
|
|
|
|
+ stockGoodsList1.add(receiving);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
if (stock == null) {
|
|
if (stock == null) {
|
|
|
throw new SecurityException("更新库存失败,未找到库存");
|
|
throw new SecurityException("更新库存失败,未找到库存");
|
|
|
} else {
|
|
} else {
|
|
|
- iDeliveryItemsService.receiving(select.getTradeType(), stock.getId(), e);
|
|
|
|
|
|
|
+ StockGoods receiving = iDeliveryItemsService.receiving(select.getTradeType(), stock.getId(), e);
|
|
|
|
|
+ stockGoodsList1.add(receiving);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -992,6 +1002,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
+ stockGoodsClient.saveOrUpdateBatchList(stockGoodsList1);
|
|
|
//更新库存内容
|
|
//更新库存内容
|
|
|
iDeliveryItemsService.updateBatchById(deliveryItemsList);
|
|
iDeliveryItemsService.updateBatchById(deliveryItemsList);
|
|
|
if ("681169".equals(AuthUtil.getTenantId())) {
|
|
if ("681169".equals(AuthUtil.getTenantId())) {
|