|
|
@@ -851,14 +851,14 @@ public class GoodsController {
|
|
|
* @return ModelAndView
|
|
|
*/
|
|
|
@RequestMapping(value = "/background/download", method = RequestMethod.GET)
|
|
|
- public ModelAndView exportProductsStandard(GoodsFilter goodsFilter, HttpServletRequest request,
|
|
|
- @RequestParam(required = false, value = "isAjax", defaultValue = "false") Boolean isAjax) {
|
|
|
+ public ModelAndView exportProductsStandard(GoodsFilter goodsFilter, HttpServletRequest request, PageParams params,
|
|
|
+ @RequestParam(required = false, value = "isAjax", defaultValue = "false") Boolean isAjax) {
|
|
|
HttpSession session = request.getSession();
|
|
|
- ModelAndView modelAndView = AjaxUtil.checkIsAjax(session, isAjax);
|
|
|
+ ModelAndView modelAndView = AjaxUtil.checkIsAjax(session, isAjax);
|
|
|
if (!modelAndView.isEmpty()) {
|
|
|
return modelAndView;
|
|
|
}
|
|
|
- PageInfo info = new PageInfo(1, JxlsExcelView.MAX_SIZE);
|
|
|
+ PageInfo info = new PageInfo(params);
|
|
|
Page<Goods> productsGoods = goodsService.getPageDataOfBackground(info, goodsFilter);
|
|
|
if (CollectionUtils.isNotEmpty(productsGoods.getContent())) {
|
|
|
logger.info("产品导出结果 products: " + productsGoods.getContent().size());
|
|
|
@@ -900,6 +900,40 @@ public class GoodsController {
|
|
|
return goodsService.getBrandProductsCount(info, startTime, endTime);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 通过传入参数导出品牌数量
|
|
|
+ *
|
|
|
+ * @param startTime 开始时间
|
|
|
+ * @param endTime 截止时间
|
|
|
+ * @param request 请求
|
|
|
+ * @param isAjax 是否ajax
|
|
|
+ * @return ModelAndView
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/brandProductsCount/export", method = RequestMethod.GET)
|
|
|
+ public ModelAndView exportBrandProductsCount(@DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, HttpServletRequest request,
|
|
|
+ @RequestParam(required = false, value = "isAjax", defaultValue = "false") Boolean isAjax) {
|
|
|
+ HttpSession session = request.getSession();
|
|
|
+ ModelAndView modelAndView = AjaxUtil.checkIsAjax(session, isAjax);
|
|
|
+ if (!modelAndView.isEmpty()) {
|
|
|
+ return modelAndView;
|
|
|
+ }
|
|
|
+ PageInfo info = new PageInfo(1, JxlsExcelView.MAX_SIZE);
|
|
|
+ com.uas.sso.support.Page<BrandCount> brandCountPage = goodsService.getBrandProductsCount(info, startTime, endTime);
|
|
|
+ if (CollectionUtils.isNotEmpty(brandCountPage.getContent())) {
|
|
|
+ logger.info("品牌数量导出结果 size: " + brandCountPage.getContent().size());
|
|
|
+ } else {
|
|
|
+ logger.info("品牌数量导出结果 size: 0");
|
|
|
+ }
|
|
|
+ FastDateFormat dateFormat = FastDateFormat.getInstance("yyyy年MM月dd日 HH:mm");
|
|
|
+ modelAndView.addObject("dateFormat", dateFormat);
|
|
|
+ modelAndView.addObject("data", brandCountPage.getContent());
|
|
|
+ modelAndView.addObject("goodsService", goodsService);
|
|
|
+ modelAndView.addObject("title", "品牌数量列表");
|
|
|
+ modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/brandCount", "优软商城--品牌数量列表"));
|
|
|
+ session.setAttribute("loading", false);
|
|
|
+ return modelAndView;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 通过分页参数获取类目数量
|
|
|
*
|
|
|
@@ -914,4 +948,38 @@ public class GoodsController {
|
|
|
PageInfo info = new PageInfo(params);
|
|
|
return goodsService.getKindProductsCount(info, startTime, endTime);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过传入参数导出品类产品数
|
|
|
+ *
|
|
|
+ * @param startTime 开始时间
|
|
|
+ * @param endTime 截止时间
|
|
|
+ * @param request 请求
|
|
|
+ * @param isAjax 是否ajax
|
|
|
+ * @return ModelAndView
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/kindProductsCount/export", method = RequestMethod.GET)
|
|
|
+ public ModelAndView exportKindProductsCount(@DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, HttpServletRequest request,
|
|
|
+ @RequestParam(required = false, value = "isAjax", defaultValue = "false") Boolean isAjax) {
|
|
|
+ HttpSession session = request.getSession();
|
|
|
+ ModelAndView modelAndView = AjaxUtil.checkIsAjax(session, isAjax);
|
|
|
+ if (!modelAndView.isEmpty()) {
|
|
|
+ return modelAndView;
|
|
|
+ }
|
|
|
+ PageInfo info = new PageInfo(1, JxlsExcelView.MAX_SIZE);
|
|
|
+ com.uas.sso.support.Page<KindHierarchicalCount> kindProductsCount = goodsService.getKindProductsCount(info, startTime, endTime);
|
|
|
+ if (CollectionUtils.isNotEmpty(kindProductsCount.getContent())) {
|
|
|
+ logger.info("品类产品数导出结果 size: " + kindProductsCount.getContent().size());
|
|
|
+ } else {
|
|
|
+ logger.info("品类产品数导出结果 size: 0");
|
|
|
+ }
|
|
|
+ FastDateFormat dateFormat = FastDateFormat.getInstance("yyyy年MM月dd日 HH:mm");
|
|
|
+ modelAndView.addObject("dateFormat", dateFormat);
|
|
|
+ modelAndView.addObject("data", kindProductsCount.getContent());
|
|
|
+ modelAndView.addObject("goodsService", goodsService);
|
|
|
+ modelAndView.addObject("title", "品类产品数列表");
|
|
|
+ modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/kindHierarchical", "优软商城--品类产品数列表"));
|
|
|
+ session.setAttribute("loading", false);
|
|
|
+ return modelAndView;
|
|
|
+ }
|
|
|
}
|