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