فهرست منبع

处理测试反馈问题

hejq 7 سال پیش
والد
کامیت
766f1c488b
1فایلهای تغییر یافته به همراه11 افزوده شده و 11 حذف شده
  1. 11 11
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

+ 11 - 11
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -2447,7 +2447,7 @@ public class ProductServiceImpl implements ProductService {
             productInfo = productInfo.setByPrivate(existProducts.get(0));
             productInfo = productInfo.setByPrivate(existProducts.get(0));
             // 用户填写库存量是需要做对应的出入库。如果新填写的库存数大于原库存数,做入库。否则做出库。
             // 用户填写库存量是需要做对应的出入库。如果新填写的库存数大于原库存数,做入库。否则做出库。
             inOutbound = recordInventory(product, existProducts.get(0));
             inOutbound = recordInventory(product, existProducts.get(0));
-            BeanUtils.copyProperties(product, productInfo, "id");
+            BeanUtils.copyProperties(product, productInfo, "id,standard");
         } else {
         } else {
             // 物料不存在,新增操作
             // 物料不存在,新增操作
             productInfo = product;
             productInfo = product;
@@ -2680,7 +2680,7 @@ public class ProductServiceImpl implements ProductService {
     private void bindToPerson(Product productInfo, Long userUU, Long enUU) {
     private void bindToPerson(Product productInfo, Long userUU, Long enUU) {
         List<ProductPerson> productPersonList = productPersonDao.findByProductIdAndUserUU(productInfo.getId(), userUU);
         List<ProductPerson> productPersonList = productPersonDao.findByProductIdAndUserUU(productInfo.getId(), userUU);
         if (CollectionUtils.isEmpty(productPersonList)) {
         if (CollectionUtils.isEmpty(productPersonList)) {
-            ProductPerson productPerson = new ProductPerson(userUU, enUU, productInfo.getId());
+            ProductPerson productPerson = new ProductPerson(enUU, userUU, productInfo.getId());
             productPerson = productPersonDao.save(productPerson);
             productPerson = productPersonDao.save(productPerson);
             logger.info("个人物料", "新增个人物料", "通过卖家中心单个物料上传绑定个人物料", productInfo.getProdNum(), productPerson.getId());
             logger.info("个人物料", "新增个人物料", "通过卖家中心单个物料上传绑定个人物料", productInfo.getProdNum(), productPerson.getId());
         }
         }
@@ -2722,19 +2722,19 @@ public class ProductServiceImpl implements ProductService {
                 throw new IllegalOperatorException("第 " + errMsg.toString() + " 行价格未填写");
                 throw new IllegalOperatorException("第 " + errMsg.toString() + " 行价格未填写");
             }
             }
         }
         }
-        if (!StringUtils.isEmpty(goods.getQtyPrice())) {
+        if (!StringUtils.isEmpty(qtyPrices)) {
             if (CollectionUtils.isNotEmpty(goods.getOriginalPrices())) {
             if (CollectionUtils.isNotEmpty(goods.getOriginalPrices())) {
-                goods.getOriginalPrices().forEach(subPrice -> {
+                qtyPrices.forEach(qtyPrice -> {
                     // 分段数量不能超过最大数量
                     // 分段数量不能超过最大数量
-                    Double endQty = NumberUtil.compare(subPrice.getEnd(), DoubleConstant.maxReserve) == 1 ? DoubleConstant.maxReserve : subPrice.getEnd();
-                    subPrice.setEnd(endQty);
-
-                    // 起始数量不能大于最小订购数
-                    Double startQty = NumberUtil.compare(minBuyQty, subPrice.getStart()) == 1 ? subPrice.getStart() : minBuyQty;
-                    subPrice.setStart(startQty);
+                    Double endQty = NumberUtil.compare(qtyPrice.getEnd(), DoubleConstant.maxReserve) == 1 ? DoubleConstant.maxReserve : qtyPrice.getEnd();
+                    qtyPrice.setEnd(endQty);
                 });
                 });
+
+                // 起始数量不能大于最小订购数
+                Double startQty = NumberUtil.compare(minBuyQty, qtyPrices.get(0).getStart()) == 1 ? qtyPrices.get(0).getStart() : minBuyQty;
+                qtyPrices.get(0).setStart(startQty);
             }
             }
-            goods.setQtyPrice(JSON.toJSONString(goods.getOriginalPrices()));
+            goods.setQtyPrice(JSON.toJSONString(qtyPrices));
         }
         }
         goodsService.setGoodsDefault(goods);
         goodsService.setGoodsDefault(goods);
         boolean autoPublish = goods.getAutoPublish() == null ? true : goods.getAutoPublish();
         boolean autoPublish = goods.getAutoPublish() == null ? true : goods.getAutoPublish();