|
|
@@ -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;
|
|
|
@@ -60,12 +61,12 @@ public class ProductController {
|
|
|
pageParams.getFilters().put("pr_enuu", custUU);
|
|
|
pageParams.getFilters().put("pr_ispurchase", Constant.YES);
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
- map.put("pr_b2bdisabled", Constant.YES);
|
|
|
+ map.put("pr_b2cenabled", Constant.YES);
|
|
|
pageParams.setNotEqualFilters(map);
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("pr_id", false, Type.INT, new Long(1)));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- return searchService.searchProductsCheckIds(keyword, pageParams);
|
|
|
+ return ProductUtils.searchProducts(keyword, pageParams);
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -87,12 +88,12 @@ public class ProductController {
|
|
|
pageParams.getFilters().put("pr_enuu", vendUU);
|
|
|
pageParams.getFilters().put("pr_issale", Constant.YES);
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
- map.put("pr_b2bdisabled", Constant.YES);
|
|
|
+ map.put("pr_b2cenabled", Constant.YES);
|
|
|
pageParams.setNotEqualFilters(map);
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("pr_id", false, Type.INT, new Long(1)));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- return searchService.searchProductsCheckIds(keyword, pageParams);
|
|
|
+ return ProductUtils.searchProducts(keyword, pageParams);
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -107,15 +108,12 @@ 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_b2bdisabled", 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)));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- return searchService.searchProductsCheckIds(keyword, pageParams);
|
|
|
+ return ProductUtils.searchProducts(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -141,15 +139,12 @@ public class ProductController {
|
|
|
pageParams.setKeywordSearchColumns(keywordSearchColumns);
|
|
|
pageParams.getFilters().put("pr_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("pr_standard", Constant.YES);
|
|
|
-
|
|
|
- HashMap<String, Object> map = new HashMap<>();
|
|
|
- map.put("pr_b2bdisabled", 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)));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- return searchService.searchProductsCheckIds(keyword, pageParams);
|
|
|
+ return ProductUtils.searchProducts(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -173,15 +168,11 @@ public class ProductController {
|
|
|
keywordSearchColumns.add("pr_code");
|
|
|
pageParams.getFilters().put("pr_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("pr_standard", Constant.NO);
|
|
|
-
|
|
|
- HashMap<String, Object> map = new HashMap<>();
|
|
|
- map.put("pr_b2bdisabled", 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)));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- return searchService.searchProductsCheckIds(keyword, pageParams);
|
|
|
+ return ProductUtils.searchProducts(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -196,7 +187,7 @@ public class ProductController {
|
|
|
public SPage<Product> getProductInfo(PageParams params, String keyword) {
|
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
|
pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- /*pageInfo.filter("b2bDisabled", Constant.NO);*/
|
|
|
+ pageInfo.filter("b2cEnabled", Constant.YES);
|
|
|
return productService.findB2bEnabledProductInfoByPageInfo(pageInfo, keyword);
|
|
|
}
|
|
|
|
|
|
@@ -213,7 +204,7 @@ public class ProductController {
|
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
|
pageInfo.filter("standard", Constant.YES);
|
|
|
pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- /*pageInfo.filter("b2bDisabled", Constant.NO);*/
|
|
|
+ pageInfo.filter("b2cEnabled", Constant.YES);
|
|
|
return productService.findB2bEnabledProductInfoByPageInfo(pageInfo, keyword);
|
|
|
}
|
|
|
|
|
|
@@ -230,7 +221,7 @@ public class ProductController {
|
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
|
pageInfo.filter("standard", Constant.NO);
|
|
|
pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- /*pageInfo.filter("b2bDisabled", Constant.NO);*/
|
|
|
+ pageInfo.filter("b2cEnabled", Constant.YES);
|
|
|
return productService.findB2bEnabledProductInfoByPageInfo(pageInfo, keyword);
|
|
|
}
|
|
|
|
|
|
@@ -293,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列表");
|
|
|
@@ -312,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列表");
|
|
|
@@ -335,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列表");
|
|
|
@@ -353,6 +347,7 @@ public class ProductController {
|
|
|
logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(全部)");
|
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
|
pageInfo.filter("matchstatus", Status.SUBMITTED.value());
|
|
|
+ pageInfo.filter("b2cEnabled", Constant.YES);
|
|
|
return productService.findB2bEnabledProductInfoByPageInfo(pageInfo, keyword);
|
|
|
}
|
|
|
|
|
|
@@ -379,6 +374,7 @@ public class ProductController {
|
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
|
pageInfo.filter("isPurchase", Constant.YES);
|
|
|
pageInfo.filter("matchstatus", Status.SUBMITTED.value());
|
|
|
+ pageInfo.filter("b2cEnabled", Constant.YES);
|
|
|
return productService.findB2bEnabledProductInfoByPageInfo(pageInfo, keyword);
|
|
|
}
|
|
|
|