Browse Source

更新产品列表导出分段价格判定方式

hejq 7 years ago
parent
commit
9827ca28f2

+ 1 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/controller/GoodsController.java

@@ -869,6 +869,7 @@ public class GoodsController {
         modelAndView.addObject("dateFormat", dateFormat);
         modelAndView.addObject("data", productsGoods.getContent());
         modelAndView.addObject("goodsService", goodsService);
+        modelAndView.addObject("title", "优软商城--产品库列表");
         modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/background", "优软商城--产品库列表"));
         session.setAttribute("loading", false);
         return modelAndView;

+ 10 - 10
src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java

@@ -353,10 +353,10 @@ public class Goods implements Serializable {
 	private List<GoodsQtyPrice> prices;
 
     /**
-     * 是否有分段价格
+     * 分段价格最大序号值
      */
 	@Transient
-	private boolean piecewise;
+	private Integer maxPriceIndex;
 
 	//*************************************************************************
 	//* 价格区间信息
@@ -1012,14 +1012,6 @@ public class Goods implements Serializable {
 		}
 	}
 
-    public boolean isPiecewise() {
-        return piecewise;
-    }
-
-    public void setPiecewise(boolean piecewise) {
-        this.piecewise = piecewise;
-    }
-
     public static long getSerialVersionUID() {
 		return serialVersionUID;
 	}
@@ -1235,6 +1227,14 @@ public class Goods implements Serializable {
 		}
 	}
 
+	public Integer getMaxPriceIndex() {
+		return maxPriceIndex;
+	}
+
+	public void setMaxPriceIndex(Integer maxPriceIndex) {
+		this.maxPriceIndex = maxPriceIndex;
+	}
+
 	/**
 	 * 用人民币含税单价修改未含税人民币单价
 	 */

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

@@ -3530,7 +3530,7 @@ public class GoodsServiceImpl implements GoodsService {
                 goods.setSelfSale(StringConstant.SALE_SELF);
             }
             goods.setFrozen(getFrozenCount(goods.getBatchCode()));
-            goods.setPiecewise(goods.getPrices().size() > 1 ? true : false);
+            goods.setMaxPriceIndex(goods.getPrices().size() - 1);
         }
 		return page;
 	}

BIN
src/main/resources/jxls-tpl/trade/background.xls