序列化

This commit is contained in:
2026-04-10 17:10:45 +08:00
parent 48d05dda32
commit e789edf637

View File

@@ -771,14 +771,14 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
if (CollUtil.isEmpty(products)) return;
boolean isSendUp = false;
for (ProductStockVO product : products) {
List<ProdConsRelationDTO> consList = prodConsRelationService.selectStockByProdId(product.productId());
List<ProdConsRelationDTO> consList = prodConsRelationService.selectStockByProdId(product.getProductId());
if (CollUtil.isEmpty(consList)) return;
for (ProdConsRelationDTO consInfo : consList) {
BigDecimal surplusStock = consInfo.getSurplusStock();
if (surplusStock == null || surplusStock.compareTo(BigDecimal.ZERO) <= 0) {
continue;
}
surplusStock = NumberUtil.mul(surplusStock, product.number());
surplusStock = NumberUtil.mul(surplusStock, product.getNumber());
BigDecimal beforeNumber = consInfo.getStockNumber();
if (InOutTypeEnum.IN.equals(type)) {
consInfo.setStockNumber(NumberUtil.add(beforeNumber, surplusStock));
@@ -805,7 +805,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
if (flow.getPurchasePrice() != null && flow.getPurchasePrice().compareTo(BigDecimal.ZERO) > 0) {
flow.setSubTotal(NumberUtil.mul(surplusStock, flow.getPurchasePrice()));
}
flow.setProductId(product.productId());
flow.setProductId(product.getProductId());
flow.setOrderId(orderId);
flow.setRemark(remark);
consStockFlowService.save(flow);