Browse Source

Merge remote-tracking branch 'origin/dev-mysql' into dev-mysql

wangdy 7 years ago
parent
commit
d48795ed18

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

@@ -2273,13 +2273,22 @@ public class GoodsServiceImpl implements GoodsService {
         if (StringUtils.hasText(code)) {
             pageInfo.expression(like("code", code, false));
         }
-        return goodsDao.findAll(new Specification<Goods>() {
+        Page<Goods> goodsPage = goodsDao.findAll(new Specification<Goods>() {
             @Override
             public Predicate toPredicate(Root<Goods> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
                 query.where(pageInfo.getPredicates(root, query, builder));
                 return null;
             }
         }, pageInfo);
+        for (Goods goods : goodsPage.getContent()) {
+            if (goods.getUuid() != null) {
+                Component component = componentDao.findByUuid(goods.getUuid());
+                if (component != null) {
+                    goods.setAttach(component.getAttach());
+                }
+            }
+        }
+        return goodsPage;
     }
 
     @Override

+ 6 - 6
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -468,7 +468,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 					prices2.add(price);
 				}
 			} else if (j == prices1.size() - 1) {
-				price.setEnd(DoubleConstant.maxReserve);
+				price.setEnd(DoubleConstant.maxMinPackageQty);
 				if (prices1.size() == 1) {
 					price.setStart(DoubleConstant.minReserve);
 				} else {
@@ -574,7 +574,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				priceMaxMinPrice[1] = rmbMinPackPrice;
 			}
 		}
-		qtyPrice.setEnd(DoubleConstant.maxReserve);
+		qtyPrice.setEnd(DoubleConstant.maxMinPackageQty);
 		return qtyPrice;
 	}
 
@@ -704,7 +704,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		} else {
 			Double cellPrice = Double.valueOf(firstValue.toString());
 			if (validatePrice(cellPrice)) {
-				GoodsQtyPrice qtyPrice = getOneQtyPrice(aProduct.getMinBuyQty(), DoubleConstant.maxReserve,
+				GoodsQtyPrice qtyPrice = getOneQtyPrice(aProduct.getMinBuyQty(), DoubleConstant.maxMinPackageQty,
 						cellPrice, aProduct.getRmbTaxRate(), aProduct.getCurrency());
 				qtyPriceList.add(qtyPrice);
 			} else {
@@ -756,7 +756,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		if (start == null || lastEnd == null) {
 			return false;
 		}
-		return start.compareTo(lastEnd) > 0 && start.compareTo(DoubleConstant.maxReserve) <= 0;
+		return start.compareTo(lastEnd) > 0 && start.compareTo(DoubleConstant.maxMinPackageQty) <= 0;
 	}
 
 	/**
@@ -775,7 +775,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			Double price = Double.valueOf(priceValue.toString());
 			Double start = Double.valueOf(startValue.toString());
 			if (validatePrice(price) && validateStartNumber(start, aProduct.getMinBuyQty())) {
-				GoodsQtyPrice qtyPrice = getOneQtyPrice(Double.valueOf(startValue.toString()), DoubleConstant.maxReserve,
+				GoodsQtyPrice qtyPrice = getOneQtyPrice(Double.valueOf(startValue.toString()), DoubleConstant.maxMinPackageQty,
 						price, aProduct.getRmbTaxRate(), aProduct.getCurrency());
 				qtyPriceList.add(qtyPrice);
 				qtyPriceList.get(0).setEnd(Double.valueOf(startValue.toString()) - 1);
@@ -805,7 +805,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			Double start = Double.valueOf(startValue.toString());
 			Double lastEnd = qtyPriceList.get(qtyPriceList.size() - 1).getStart();
 			if (validatePrice(price) && validateStartNumber(start, lastEnd)) {
-				GoodsQtyPrice qtyPrice = getOneQtyPrice(start, DoubleConstant.maxReserve,
+				GoodsQtyPrice qtyPrice = getOneQtyPrice(start, DoubleConstant.maxMinPackageQty,
 						price, aProduct.getRmbTaxRate(), aProduct.getCurrency());
 				qtyPriceList.get(qtyPriceList.size() - 1).setEnd(start - 1);
 				qtyPriceList.add(qtyPrice);