Ver código fonte

Merge remote-tracking branch 'origin/feature-201839-wangcz' into feature-201839-wangcz

Hu Jie 7 anos atrás
pai
commit
590fdcfb26

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

@@ -987,6 +987,8 @@ public class GoodsController {
     @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) {
+		long l = System.currentTimeMillis();
+		System.out.println("");
         HttpSession session = request.getSession();
         ModelAndView modelAndView = AjaxUtil.checkIsAjax(session, isAjax);
         if (!modelAndView.isEmpty()) {
@@ -1006,6 +1008,8 @@ public class GoodsController {
         modelAndView.addObject("title", "品类产品数列表");
         modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/kindHierarchical", "优软商城--品类产品数列表"));
         session.setAttribute("loading", false);
-        return modelAndView;
+		long l1 = System.currentTimeMillis();
+		System.out.println("消耗的时间是多少?" + (l1 - l));
+		return modelAndView;
     }
 }

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

@@ -4145,6 +4145,7 @@ public class GoodsServiceImpl implements GoodsService {
      */
     @Override
     public com.uas.sso.support.Page<KindHierarchicalCount> getKindProductsCount(Pageable pageable, Date startTime, Date endTime) {
+        System.out.println();
         // 查询一段时间内类目数量,按类目分组查询统计数量
         StringBuffer sql = new StringBuffer("select pr_kind as thirdKind, pr_kindid as kindId, count(1) as count from products where pr_kind is not null ");
 
@@ -4163,7 +4164,7 @@ public class GoodsServiceImpl implements GoodsService {
 
         // 分页参数
         Integer offset = (pageable.getPageNumber() - 1) * pageable.getPageSize();
-        sql.append(" limit ? offset ?");
+        sql.append(" order by count desc limit ? offset ?");
         List<KindHierarchicalCount> kindList = commonDao.query(sql.toString(), KindHierarchicalCount.class, pageable.getPageSize(), offset);
 
         // 根据父级类目id一层层判断是否存在