Explorar el Código

活动标识修改

plf hace 4 años
padre
commit
facd02bec9

+ 2 - 2
src/main/java/com/caimei/service/impl/ProductServiceImpl.java

@@ -45,10 +45,10 @@ public class ProductServiceImpl implements ProductService {
             product.setMainImage(ProductUtils.getImageURL("product", product.getMainImage(), 0, domain));
             Integer activityId = productMapper.findActivityByProductId(product.getProductId());
             if (activityId != null && activityId > 0) {
+                product.setActiveStatus(1);
                 //活动阶梯
                 List<ActivityLadderVo> ladderList = productMapper.findActivityLadder(activityId, product.getProductId());
                 if (ladderList != null && ladderList.size() > 0) {
-                    product.setActiveStatus(1);
                     product.setPrice(ladderList.get(0).getBuyPrice());
                 }
             }
@@ -129,11 +129,11 @@ public class ProductServiceImpl implements ProductService {
         boolean addTaxFlag = ("0".equals(product.getIncludedTax()) && ("1".equals(product.getInvoiceType()) || "2".equals(product.getInvoiceType())));
         Integer activityId = productMapper.findActivityByProductId(product.getProductId());
         if (activityId != null && activityId > 0) {
+            product.setActiveStatus(1);
             //活动阶梯
             List<ActivityLadderVo> ladderList = productMapper.findActivityLadder(activityId, product.getProductId());
             if (ladderList != null && ladderList.size() > 0) {
                 product.setPrice(ladderList.get(0).getBuyPrice());
-                product.setActiveStatus(1);
                 for (ActivityLadderVo ladder : ladderList) {
                     if (addTaxFlag) {
                         BigDecimal addedValueTax = MathUtil.div(MathUtil.mul(ladder.getBuyPrice(), product.getClubTaxPoint()), BigDecimal.valueOf(100), 2);

+ 1 - 1
src/main/java/com/caimei/service/impl/ShoppingCartServiceImpl.java

@@ -92,10 +92,10 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
         boolean addTaxFlag = ("0".equals(product.getIncludedTax()) && ("1".equals(product.getInvoiceType()) || "2".equals(product.getInvoiceType())));
         Integer activityId = productMapper.findActivityByProductId(product.getProductId());
         if (activityId != null && activityId > 0) {
+            product.setActiveStatus(1);
             //活动阶梯
             List<ActivityLadderVo> ladderList = productMapper.findActivityLadder(activityId, product.getProductId());
             if (ladderList != null && ladderList.size() > 0) {
-                product.setActiveStatus(1);
                 for (ActivityLadderVo ladder : ladderList) {
                     if (addTaxFlag) {
                         BigDecimal addedValueTax = MathUtil.div(MathUtil.mul(ladder.getBuyPrice(), product.getClubTaxPoint()), BigDecimal.valueOf(100), 2);