Pārlūkot izejas kodu

物料导出增加B2C启用状态过滤

hejq 7 gadi atpakaļ
vecāks
revīzija
8381c1208c

+ 3 - 0
src/main/java/com/uas/platform/b2b/controller/BaseInfoController.java

@@ -303,6 +303,7 @@ public class BaseInfoController {
 		pageInfo.sorting("id", org.springframework.data.domain.Sort.Direction.DESC);
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		pageInfo.filter("isSale", Constant.YES);
+		pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
 		modelAndView.addObject("data", null == keyword || "".equals(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
@@ -325,6 +326,7 @@ public class BaseInfoController {
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		pageInfo.filter("isSale", Constant.YES);
 		pageInfo.filter("standard", Constant.YES);
+		pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
 		modelAndView.addObject("data", StringUtils.isEmpty(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
@@ -347,6 +349,7 @@ public class BaseInfoController {
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		pageInfo.filter("isSale", Constant.YES);
 		pageInfo.filter("standard", Constant.NO);
+		pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
 		modelAndView.addObject("data", StringUtils.isEmpty(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()

+ 9 - 8
src/main/java/com/uas/platform/b2b/controller/ProductController.java

@@ -20,6 +20,7 @@ import com.uas.search.b2b.model.Sort.Type;
 import com.uas.search.b2b.util.SearchConstants;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -107,10 +108,7 @@ public class ProductController {
 		logger.log("查看物料", SystemSession.getUser().getUserName() + "查看了物料信息(全部)");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
 		pageParams.getFilters().put("pr_enuu", SystemSession.getUser().getEnterprise().getUu());
-
-		HashMap<String, Object> map = new HashMap<>();
-		map.put("pr_b2cenabled", Constant.YES);
-		pageParams.setNotEqualFilters(map);
+		pageParams.getFilters().put("pr_b2cenabled", Constant.YES);
 
 		List<Sort> sortList = new ArrayList<>();
 		sortList.add(new Sort("pr_id", false, Type.INT, new Long(1)));
@@ -286,9 +284,10 @@ public class ProductController {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("id", org.springframework.data.domain.Sort.Direction.DESC);
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
+		pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
-		modelAndView.addObject("data", null == keyword || "".equals(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
+		modelAndView.addObject("data", StringUtils.isEmpty(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
 				: getAllProductInfo(params, keyword).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/baseInfo/baseInfo", "全部物料资料表"));
 		logger.log("物料资料", "导出Excel列表", "导出全部Excel列表");
@@ -305,11 +304,12 @@ public class ProductController {
 	public ModelAndView exportStandard(String keyword) {
 		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
 		pageInfo.sorting("id", org.springframework.data.domain.Sort.Direction.DESC);
-		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		pageInfo.filter("standard", Constant.YES);
+		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
+		pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
-		modelAndView.addObject("data", null == keyword || "".equals(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
+		modelAndView.addObject("data", StringUtils.isEmpty(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
 				: getStandardProductInfo(params, keyword).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/baseInfo/baseInfo", "标准物料资料表"));
 		logger.log("物料资料", "导出Excel列表", "导出标准Excel列表");
@@ -328,9 +328,10 @@ public class ProductController {
 		pageInfo.sorting("id", org.springframework.data.domain.Sort.Direction.DESC);
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		pageInfo.filter("standard", Constant.NO);
+		pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
-		modelAndView.addObject("data", null == keyword || "".equals(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
+		modelAndView.addObject("data", StringUtils.isEmpty(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
 				:getNonStandardProductInfo(params, keyword).getContent());
 		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/baseInfo/baseInfo", "非标准物料资料表"));
 		logger.log("物料资料", "导出Excel列表", "导出非标准Excel列表");

+ 3 - 0
src/main/java/com/uas/platform/b2b/controller/PurcProductController.java

@@ -95,6 +95,7 @@ public class PurcProductController {
 		pageInfo.sorting("id", org.springframework.data.domain.Sort.Direction.DESC);
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		pageInfo.filter("isPurchase", Constant.YES);
+        pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
 		modelAndView.addObject("data", StringUtils.isEmpty(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
@@ -117,6 +118,7 @@ public class PurcProductController {
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		pageInfo.filter("isPurchase", Constant.YES);
 		pageInfo.filter("standard", Constant.YES);
+        pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
 		modelAndView.addObject("data", StringUtils.isEmpty(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()
@@ -139,6 +141,7 @@ public class PurcProductController {
 		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		pageInfo.filter("isPurchase", Constant.YES);
 		pageInfo.filter("standard", Constant.NO);
+        pageInfo.filter("b2cEnabled", Constant.YES);
 		ModelAndView modelAndView = new ModelAndView();
 		PageParams params = new PageParams(pageInfo);
 		modelAndView.addObject("data", StringUtils.isEmpty(keyword) ? ProductUtils.findByPageInfo(pageInfo, keyword).getContent()