Browse Source

处理每次叠加购买数量不正确的问题。

yujia 7 years ago
parent
commit
390f0ba3c4

+ 2 - 14
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -4030,21 +4030,9 @@ public class GoodsServiceImpl implements GoodsService {
                 goods.setMinPackQty(product.getMinPackQty());
                 goods.setPackaging(product.getPackaging());
                 goods.setMinBuyQty();
+                goods.setPerQty();
                 goods.adjustFragmentPrice();
-                if (goods.getAutoPublish() == null) {
-                    goods.setAutoPublish(Boolean.TRUE);
-                }
-                if (goods.getAutoPublish()) {
-                    if (StringUtils.isEmpty(goods.getPackaging()) || StringUtils.isEmpty(goods.getProduceDate()) || (goods.getMinBuyQty() == null) || (goods.getMinPackQty() == null) || (goods.getB2cMaxDelivery() == null) || (goods.getB2cMinDelivery() == null) || StringUtils.isEmpty(goods.getQtyPrice())) {
-                        //做未上架处理
-                        goods.setStatus(Status.NO_SHELVE.value());
-                    } else {
-                        //如果信息填写全,默认上架
-                        goods.setStatus((NumberUtil.compare(goods.getReserve(), goods.getMinBuyQty()) > -1) ? Status.AVAILABLE.value() : Status.UNAVAILABLE.value());
-                    }
-                } else {
-                    goods.setStatus(Status.NO_SHELVE.value());
-                }
+                goods.setStatus();
                 GoodsHistory history = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Update.getPhrase(), false);
                 list.add(history);
             }