|
|
@@ -300,64 +300,66 @@ public class BaseInfoController {
|
|
|
|
|
|
/**
|
|
|
* 导出Excel
|
|
|
- *
|
|
|
- * @param keyword
|
|
|
+ *
|
|
|
+ * @param keyword 关键词
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/xls", method = RequestMethod.GET)
|
|
|
public ModelAndView export(String keyword) {
|
|
|
- com.uas.search.b2b.model.PageParams pageParams = new com.uas.search.b2b.model.PageParams(1, JxlsExcelView.MAX_SIZE, new HashMap<String, Object>());
|
|
|
- pageParams.getFilters().put("pr_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- pageParams.getFilters().put("pr_issale", Constant.YES);
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("pr_id", false, Type.LONG, new Long(1)));
|
|
|
- pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ 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("isSale", Constant.YES);
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
- modelAndView.addObject("data", searchService.searchProductsCheckIds(keyword, pageParams).getContent());
|
|
|
+ PageParams params = new PageParams(pageInfo);
|
|
|
+ modelAndView.addObject("data", null == keyword || "".equals(keyword) ? productService.findAllByPageInfo(pageInfo, keyword).getContent()
|
|
|
+ : getAllProductInfo(params, keyword).getContent());
|
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/baseInfo/baseInfo", "全部物料资料表"));
|
|
|
- logger.log("物料资料", "导出Excel列表", "导出全部Excel列表");
|
|
|
+ logger.log("物料资料", "导出Excel列表", "导出全部可卖产品Excel列表");
|
|
|
return modelAndView;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出Excel - 标准
|
|
|
*
|
|
|
+ * @param keyword 关键词
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/xls", params = RequestState.STANDARD, method = RequestMethod.GET)
|
|
|
public ModelAndView exportStandard(String keyword) {
|
|
|
- com.uas.search.b2b.model.PageParams pageParams = new com.uas.search.b2b.model.PageParams(1, JxlsExcelView.MAX_SIZE, new HashMap<String, Object>());
|
|
|
- pageParams.getFilters().put("pr_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- pageParams.getFilters().put("pr_issale", Constant.YES);
|
|
|
- pageParams.getFilters().put("pr_standard", Constant.YES);
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("pr_id", false, Type.LONG, new Long(1)));
|
|
|
- pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ 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("isSale", Constant.YES);
|
|
|
+ pageInfo.filter("standard", Constant.YES);
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
- modelAndView.addObject("data", searchService.searchProductsCheckIds(keyword, pageParams).getContent());
|
|
|
+ PageParams params = new PageParams(pageInfo);
|
|
|
+ modelAndView.addObject("data", null == keyword || "".equals(keyword) ? productService.findAllByPageInfo(pageInfo, keyword).getContent()
|
|
|
+ : getStandardProductInfo(params, keyword).getContent());
|
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/baseInfo/baseInfo", "标准物料资料表"));
|
|
|
- logger.log("物料资料", "导出Excel列表", "导出标准Excel列表");
|
|
|
+ logger.log("物料资料", "导出Excel列表", "导出标准可卖产品Excel列表");
|
|
|
return modelAndView;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出Excel - 非标准
|
|
|
*
|
|
|
+ * @param keyword 关键词
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/xls", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
|
|
|
public ModelAndView exportNonStandard(String keyword) {
|
|
|
- com.uas.search.b2b.model.PageParams pageParams = new com.uas.search.b2b.model.PageParams(1, JxlsExcelView.MAX_SIZE, new HashMap<String, Object>());
|
|
|
- pageParams.getFilters().put("pr_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- pageParams.getFilters().put("pr_issale", Constant.YES);
|
|
|
- pageParams.getFilters().put("pr_standard", Constant.NO);
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("pr_id", false, Type.LONG, new Long(1)));
|
|
|
- pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ 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("isSale", Constant.YES);
|
|
|
+ pageInfo.filter("standard", Constant.NO);
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
- modelAndView.addObject("data", searchService.searchProductsCheckIds(keyword, pageParams).getContent());
|
|
|
+ PageParams params = new PageParams(pageInfo);
|
|
|
+ modelAndView.addObject("data", null == keyword || "".equals(keyword) ? productService.findAllByPageInfo(pageInfo, keyword).getContent()
|
|
|
+ :getNonStandardProductInfo(params, keyword).getContent());
|
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/baseInfo/baseInfo", "非标准物料资料表"));
|
|
|
- logger.log("物料资料", "导出Excel列表", "导出非标准Excel列表");
|
|
|
+ logger.log("物料资料", "导出Excel列表", "导出非标准可卖产品Excel列表");
|
|
|
return modelAndView;
|
|
|
}
|
|
|
|