|
@@ -250,6 +250,40 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
int taxStockCount = goods.stream().mapToInt(Goods::getTaxStockCount).sum();
|
|
|
existsGood.setStockCount((Objects.isNull(existsGood.getStockCount())?0:existsGood.getStockCount()) + stockCount);
|
|
|
existsGood.setTaxStockCount((Objects.isNull(existsGood.getTaxStockCount())?0:existsGood.getTaxStockCount()) + taxStockCount);
|
|
|
+ Goods newGoods = goods.get(0);
|
|
|
+ if(Objects.nonNull(newGoods.getGoodsCategoryId())&&!newGoods.getGoodsCategoryId().equals(existsGood.getGoodsCategoryId())){
|
|
|
+ existsGood.setGoodsCategoryId(newGoods.getGoodsCategoryId());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getName())&&!newGoods.getName().equals(existsGood.getName())){
|
|
|
+ existsGood.setName(newGoods.getName());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getType())&&!newGoods.getType().equals(existsGood.getType())){
|
|
|
+ existsGood.setType(newGoods.getType());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getSpecification())&&!newGoods.getSpecification().equals(existsGood.getSpecification())){
|
|
|
+ existsGood.setSpecification(newGoods.getSpecification());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getMarketPrice())&&!newGoods.getMarketPrice().equals(existsGood.getMarketPrice())){
|
|
|
+ existsGood.setMarketPrice(newGoods.getMarketPrice());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getDiscountPrice())&&!newGoods.getDiscountPrice().equals(existsGood.getDiscountPrice())){
|
|
|
+ existsGood.setDiscountPrice(newGoods.getDiscountPrice());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getGroupPurchasePrice())&&!newGoods.getGroupPurchasePrice().equals(existsGood.getGroupPurchasePrice())){
|
|
|
+ existsGood.setGroupPurchasePrice(newGoods.getGroupPurchasePrice());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getImage())&&!newGoods.getImage().equals(existsGood.getImage())){
|
|
|
+ existsGood.setImage(newGoods.getImage());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getStockType())&&!newGoods.getStockType().equals(existsGood.getStockType())){
|
|
|
+ existsGood.setStockType(newGoods.getStockType());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getBrief())&&!newGoods.getBrief().equals(existsGood.getBrief())){
|
|
|
+ existsGood.setBrief(newGoods.getBrief());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(newGoods.getStockWarning())&&!newGoods.getStockWarning().equals(existsGood.getStockWarning())){
|
|
|
+ existsGood.setStockWarning(newGoods.getStockWarning());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(existsGoods)){
|
|
@@ -271,8 +305,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
gp.setGoodsId(existsSnIdMap.get(goods.getSn()));
|
|
|
gp.setGoodsCategoryId(goods.getGoodsCategoryId());
|
|
|
gp.setSupplyChannel(goods.getSupplyChannel());
|
|
|
- gp.setDiscountPrice(goods.getCostPrice()
|
|
|
- );
|
|
|
+ gp.setDiscountPrice(goods.getCostPrice());
|
|
|
gp.setAgreeCostPrice(goods.getAgreeCostPrice());
|
|
|
gp.setStockCount(goods.getStockCount());
|
|
|
gp.setTaxStockCount(goods.getTaxStockCount());
|