|
@@ -80,25 +80,17 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
}
|
|
|
existsGood.setStockCount(existsGood.getStockCount()+goods.getStockCount());
|
|
|
existsGood.setTaxStockCount(existsGood.getTaxStockCount()+existsGood.getTaxStockCount());
|
|
|
+ existsGood.setSellCount(0);
|
|
|
goodsDao.update(existsGood);
|
|
|
}else{
|
|
|
+ if(Objects.isNull(goods.getStockCount())){
|
|
|
+ goods.setStockCount(0);
|
|
|
+ }
|
|
|
+ if(Objects.isNull(goods.getTaxStockCount())){
|
|
|
+ goods.setTaxStockCount(0);
|
|
|
+ }
|
|
|
+ goods.setSellCount(0);
|
|
|
goodsDao.insert(goods);
|
|
|
- existsGood=goods;
|
|
|
- }
|
|
|
-
|
|
|
- if(StringUtils.isBlank(existsGood.getComplementGoodsIdList())){
|
|
|
- String batchNo = idGeneratorService.generatorId("payment") + "";
|
|
|
- GoodsProcurement gp = new GoodsProcurement();
|
|
|
- gp.setGoodsId(existsGood.getId());
|
|
|
- gp.setGoodsCategoryId(goods.getGoodsCategoryId());
|
|
|
- gp.setSupplyChannel(goods.getSupplyChannel());
|
|
|
- gp.setDiscountPrice(goods.getDiscountPrice());
|
|
|
- gp.setAgreeCostPrice(goods.getAgreeCostPrice());
|
|
|
- gp.setStockCount(goods.getStockCount());
|
|
|
- gp.setTaxStockCount(goods.getTaxStockCount());
|
|
|
- gp.setOperatorId(operatorId);
|
|
|
- gp.setBatchNo(batchNo);
|
|
|
- goodsProcurementDao.insert(gp);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -411,6 +403,12 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
sellOrder.setBatchNo(batchNoGoodsIdMapEntry.getKey());
|
|
|
GoodsProcurement goodsProcurement = goodsProcurementDao.getWithGoodsAndBatchNo(sellOrder.getGoodsId(), sellOrder.getBatchNo());
|
|
|
sellOrder.setSellCost(goodsProcurement.getDiscountPrice().multiply(new BigDecimal(sellOrder.getNum())));
|
|
|
+ Map<String, BigDecimal> CostMap = new HashMap<>();
|
|
|
+ CostMap.put("sellCost", goodsProcurement.getDiscountPrice());
|
|
|
+ if (Objects.nonNull(goodsProcurement.getAgreeCostPrice())) {
|
|
|
+ CostMap.put("SellCost2", goodsProcurement.getAgreeCostPrice());
|
|
|
+ }
|
|
|
+ sellOrder.setSellCost2(JSON.toJSONString(CostMap));
|
|
|
sellOrders.add(sellOrder);
|
|
|
}
|
|
|
}
|
|
@@ -429,6 +427,12 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
sellOrder.setBatchNo(goodsProcurement.getBatchNo());
|
|
|
if(Objects.nonNull(goodsProcurement.getBatchNo())){
|
|
|
sellOrder.setSellCost(goodsProcurement.getDiscountPrice().multiply(new BigDecimal(sellOrder.getNum())));
|
|
|
+ Map<String, BigDecimal> CostMap = new HashMap<>();
|
|
|
+ CostMap.put("sellCost", goodsProcurement.getDiscountPrice());
|
|
|
+ if (Objects.nonNull(goodsProcurement.getAgreeCostPrice())) {
|
|
|
+ CostMap.put("SellCost2", goodsProcurement.getAgreeCostPrice());
|
|
|
+ }
|
|
|
+ sellOrder.setSellCost2(JSON.toJSONString(CostMap));
|
|
|
}
|
|
|
sellOrders.add(sellOrder);
|
|
|
}
|