|
|
@@ -42,6 +42,7 @@ import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
|
|
|
import org.springblade.salesPart.ship.mapper.ShipMapper;
|
|
|
import org.springblade.salesPart.ship.service.IShipItemsService;
|
|
|
import org.springblade.salesPart.ship.service.IShipService;
|
|
|
+import org.springblade.salesPart.stock.mapper.StockDescMapper;
|
|
|
import org.springblade.salesPart.stock.service.IStockDescService;
|
|
|
import org.springblade.salesPart.storage.mapper.StorageDescMapper;
|
|
|
import org.springblade.salesPart.vo.ShipVO;
|
|
|
@@ -380,6 +381,11 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockOne.setBalanceQuantity(stockOne.getBalanceQuantity().subtract(item.getSendNum()));
|
|
|
stockOne.setStoreInventory(stockOne.getBalanceQuantity());
|
|
|
stockOne.setInventoryAmount(stockOne.getInventoryAmount().subtract(item.getSendNum().multiply(stockOne.getInventoryCostPrice())));
|
|
|
+ stockOne.setVersion(stockOne.getVersion());
|
|
|
+ boolean count = iStockDescService.updateById(stockOne);
|
|
|
+ if (!count){
|
|
|
+ throw new RuntimeException(stockOne.getCname()+"该产品库存正在操作,请稍后刷新在进行操作!");
|
|
|
+ }
|
|
|
pjStockDescArrayList.add(stockOne);
|
|
|
} else {
|
|
|
throw new RuntimeException("未查到库存账");
|
|
|
@@ -387,7 +393,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
}
|
|
|
shipItemsService.saveOrUpdateBatch(shipItemsList);
|
|
|
orderItemsService.updateBatchById(pjOrderItemsList);
|
|
|
- iStockDescService.updateBatchById(pjStockDescArrayList);
|
|
|
+// iStockDescService.updateBatchById(pjStockDescArrayList);
|
|
|
ship.setShipItemsList(ship.getShipItemsList());
|
|
|
ship.setNumberRows(ship.getShipItemsList().size());
|
|
|
//修改任务发货数量
|
|
|
@@ -479,7 +485,12 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockOne.setBalanceQuantity(stockOne.getBalanceQuantity().add(item.getSendNum()));
|
|
|
stockOne.setStoreInventory(stockOne.getBalanceQuantity());
|
|
|
stockOne.setInventoryAmount(stockOne.getInventoryAmount().add(item.getSendNum().multiply(stockOne.getInventoryCostPrice())));
|
|
|
+ stockOne.setVersion(stockOne.getVersion());
|
|
|
pjStockDescArrayList.add(stockOne);
|
|
|
+ boolean count = iStockDescService.updateById(stockOne);
|
|
|
+ if (!count){
|
|
|
+ throw new RuntimeException(stockOne.getCname()+"该产品库存正在操作,请稍后刷新在进行操作!");
|
|
|
+ }
|
|
|
} else {
|
|
|
throw new RuntimeException("未查到库存账");
|
|
|
}
|
|
|
@@ -487,7 +498,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
}
|
|
|
shipItemsService.updateBatchById(itemsList);
|
|
|
orderItemsService.updateBatchById(pjOrderItemsList);
|
|
|
- iStockDescService.updateBatchById(pjStockDescArrayList);
|
|
|
+// iStockDescService.updateBatchById(pjStockDescArrayList);
|
|
|
ship.setShipItemsList(ship.getShipItemsList());
|
|
|
ship.setNumberRows(ship.getShipItemsList().size());
|
|
|
|
|
|
@@ -720,11 +731,16 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockDesc.setInventoryAmount(item.getSendNum().multiply(item.getPrice()));
|
|
|
stockDesc.setInventoryAmount(stockDesc.getInventoryAmount().add(stockOne.getInventoryAmount()));
|
|
|
stockDesc.setInventoryCostPrice(stockDesc.getInventoryAmount().divide(stockDesc.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ stockDesc.setVersion(stockOne.getVersion());
|
|
|
+ }
|
|
|
+ boolean count = iStockDescService.saveOrUpdate(stockDesc);
|
|
|
+ if (!count){
|
|
|
+ throw new RuntimeException(stockOne.getCname()+"该产品库存正在操作,请稍后刷新在进行操作!");
|
|
|
}
|
|
|
pjStockDescArrayList.add(stockDesc);
|
|
|
});
|
|
|
shipItemsService.saveOrUpdateBatch(shipItemsList);
|
|
|
- iStockDescService.saveOrUpdateBatch(pjStockDescArrayList);
|
|
|
+// iStockDescService.saveOrUpdateBatch(pjStockDescArrayList);
|
|
|
orderItemsService.updateBatchById(pjOrderItemsList);
|
|
|
for (PjShipItems item : ship.getShipItemsList()) {
|
|
|
number = number.add(item.getSendNum());
|
|
|
@@ -1028,10 +1044,16 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
} else {
|
|
|
stockOne.setInventoryCostPrice(stockOne.getInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
|
|
|
}
|
|
|
+ stockOne.setVersion(stockOne.getVersion());
|
|
|
+// iStockDescService.updateById(stockOne);
|
|
|
+ boolean count = iStockDescService.updateById(stockOne);
|
|
|
+ if (!count){
|
|
|
+ throw new RuntimeException(stockOne.getCname()+"该产品库存正在操作,请稍后刷新在进行操作!");
|
|
|
+ }
|
|
|
pjStockDescArrayList.add(stockOne);
|
|
|
}
|
|
|
});
|
|
|
- iStockDescService.updateBatchById(pjStockDescArrayList);
|
|
|
+// iStockDescService.updateBatchById(pjStockDescArrayList);
|
|
|
List<PjProductLaunch> pjProductLaunchList = new ArrayList<>();
|
|
|
ship.getShipItemsList().forEach(item -> {
|
|
|
/** ----------------------修改上架库存---------------------- */
|