Authored by kun

update

1 package com.yoho.ufo.dal; 1 package com.yoho.ufo.dal;
2 2
3 import com.yoho.ufo.model.commoditybasicrole.category.ProductSort; 3 import com.yoho.ufo.model.commoditybasicrole.category.ProductSort;
4 -import com.yohobuy.ufo.model.common.PageModel;  
5 import org.apache.ibatis.annotations.Param; 4 import org.apache.ibatis.annotations.Param;
6 5
7 import java.util.List; 6 import java.util.List;
@@ -48,13 +47,12 @@ public interface ProductSortMapper { @@ -48,13 +47,12 @@ public interface ProductSortMapper {
48 ProductSort selectOneById(Integer id); 47 ProductSort selectOneById(Integer id);
49 48
50 /** 49 /**
51 - * 根据条件查询品类分页数据 50 + * 根据条件查询品类数据
52 * 51 *
53 * @param productSort 52 * @param productSort
54 - * @param pageModel  
55 * @return 53 * @return
56 */ 54 */
57 - List<ProductSort> getProductSortPageList(@Param("productSort") ProductSort productSort, @Param("page") PageModel pageModel); 55 + List<ProductSort> getProductSortList(@Param("productSort") ProductSort productSort);
58 56
59 /** 57 /**
60 * 更新品类状态 58 * 更新品类状态
@@ -72,12 +72,11 @@ @@ -72,12 +72,11 @@
72 <include refid="queryPage"/> 72 <include refid="queryPage"/>
73 </select> 73 </select>
74 74
75 - <select id="getProductSortPageList" resultMap="productSortMap"> 75 + <select id="getProductSortList" resultMap="productSortMap">
76 select <include refid="queryColumns"/> 76 select <include refid="queryColumns"/>
77 from product_sort 77 from product_sort
78 <include refid="queryPage"/> 78 <include refid="queryPage"/>
79 order by update_time desc 79 order by update_time desc
80 - limit #{page.startIndex}, #{page.pageSize}  
81 </select> 80 </select>
82 81
83 <update id="updateProductSortStatus" parameterType="com.yoho.ufo.model.commoditybasicrole.category.ProductSort"> 82 <update id="updateProductSortStatus" parameterType="com.yoho.ufo.model.commoditybasicrole.category.ProductSort">
@@ -5,7 +5,6 @@ import com.yoho.ufo.exception.CommonException; @@ -5,7 +5,6 @@ import com.yoho.ufo.exception.CommonException;
5 import com.yoho.ufo.service.IProductSortService; 5 import com.yoho.ufo.service.IProductSortService;
6 import com.yoho.ufo.util.OvalValidationUtils; 6 import com.yoho.ufo.util.OvalValidationUtils;
7 import com.yohobuy.ufo.model.common.ApiResponse; 7 import com.yohobuy.ufo.model.common.ApiResponse;
8 -import com.yohobuy.ufo.model.common.PageResponseBO;  
9 import com.yohobuy.ufo.model.request.productsort.ProductSortRequestBo; 8 import com.yohobuy.ufo.model.request.productsort.ProductSortRequestBo;
10 import com.yohobuy.ufo.model.response.productsort.ProductSortResponseBo; 9 import com.yohobuy.ufo.model.response.productsort.ProductSortResponseBo;
11 import com.yohobuy.ufo.model.response.productsort.ProductSortTreeViewResponseBo; 10 import com.yohobuy.ufo.model.response.productsort.ProductSortTreeViewResponseBo;
@@ -58,10 +57,10 @@ public class ProductSortController { @@ -58,10 +57,10 @@ public class ProductSortController {
58 } 57 }
59 58
60 59
61 - @RequestMapping(value = "/getProductSortPageList", method = RequestMethod.POST)  
62 - public ApiResponse<PageResponseBO<ProductSortTreeViewResponseBo>> getProductSortPageList(ProductSortRequestBo productSortRequestBo) { 60 + @RequestMapping(value = "/getProductSortList", method = RequestMethod.POST)
  61 + public ApiResponse<List<ProductSortTreeViewResponseBo>> getProductSortList(ProductSortRequestBo productSortRequestBo) {
63 LOGGER.info("getProductSortPageList param = {}", productSortRequestBo); 62 LOGGER.info("getProductSortPageList param = {}", productSortRequestBo);
64 - return new ApiResponse<>(productSortService.getProductSortPageList(productSortRequestBo)); 63 + return new ApiResponse<>(productSortService.getProductSortList(productSortRequestBo));
65 } 64 }
66 65
67 @RequestMapping(value = "/updateProductSortStatus", method = RequestMethod.POST) 66 @RequestMapping(value = "/updateProductSortStatus", method = RequestMethod.POST)
@@ -2,7 +2,6 @@ package com.yoho.ufo.service; @@ -2,7 +2,6 @@ package com.yoho.ufo.service;
2 2
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 import com.yoho.ufo.model.commoditybasicrole.category.ProductSort; 4 import com.yoho.ufo.model.commoditybasicrole.category.ProductSort;
5 -import com.yohobuy.ufo.model.common.PageResponseBO;  
6 import com.yohobuy.ufo.model.request.productsort.ProductSortRequestBo; 5 import com.yohobuy.ufo.model.request.productsort.ProductSortRequestBo;
7 import com.yohobuy.ufo.model.response.productsort.ProductSortResponseBo; 6 import com.yohobuy.ufo.model.response.productsort.ProductSortResponseBo;
8 import com.yohobuy.ufo.model.response.productsort.ProductSortTreeViewResponseBo; 7 import com.yohobuy.ufo.model.response.productsort.ProductSortTreeViewResponseBo;
@@ -31,11 +30,11 @@ public interface IProductSortService { @@ -31,11 +30,11 @@ public interface IProductSortService {
31 ProductSortResponseBo getProductSortById(Integer id); 30 ProductSortResponseBo getProductSortById(Integer id);
32 31
33 /** 32 /**
34 - * 根据条件获取品类分页信息 33 + * 根据条件获取品类信息
35 * @param productSortRequestBo 34 * @param productSortRequestBo
36 * @return 35 * @return
37 */ 36 */
38 - PageResponseBO<ProductSortTreeViewResponseBo> getProductSortPageList(ProductSortRequestBo productSortRequestBo); 37 + List<ProductSortTreeViewResponseBo> getProductSortList(ProductSortRequestBo productSortRequestBo);
39 38
40 /** 39 /**
41 * 更新品类状态 40 * 更新品类状态
1 package com.yoho.ufo.service.impl; 1 package com.yoho.ufo.service.impl;
2 2
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
  4 +import com.google.common.collect.Lists;
4 import com.yoho.core.common.utils.DateUtil; 5 import com.yoho.core.common.utils.DateUtil;
5 import com.yoho.ufo.dal.ProductSortMapper; 6 import com.yoho.ufo.dal.ProductSortMapper;
6 import com.yoho.ufo.exception.CommonException; 7 import com.yoho.ufo.exception.CommonException;
7 import com.yoho.ufo.model.commoditybasicrole.category.ProductSort; 8 import com.yoho.ufo.model.commoditybasicrole.category.ProductSort;
8 import com.yoho.ufo.service.IProductSortService; 9 import com.yoho.ufo.service.IProductSortService;
9 import com.yoho.ufo.util.OrikaUtils; 10 import com.yoho.ufo.util.OrikaUtils;
10 -import com.yohobuy.ufo.model.common.PageModel;  
11 -import com.yohobuy.ufo.model.common.PageResponseBO;  
12 import com.yohobuy.ufo.model.request.productsort.ProductSortRequestBo; 11 import com.yohobuy.ufo.model.request.productsort.ProductSortRequestBo;
13 import com.yohobuy.ufo.model.response.productsort.ProductSortResponseBo; 12 import com.yohobuy.ufo.model.response.productsort.ProductSortResponseBo;
14 import com.yohobuy.ufo.model.response.productsort.ProductSortTreeViewResponseBo; 13 import com.yohobuy.ufo.model.response.productsort.ProductSortTreeViewResponseBo;
@@ -83,19 +82,18 @@ public class ProductSortServiceImpl implements IProductSortService { @@ -83,19 +82,18 @@ public class ProductSortServiceImpl implements IProductSortService {
83 } 82 }
84 83
85 @Override 84 @Override
86 - public PageResponseBO<ProductSortTreeViewResponseBo> getProductSortPageList(ProductSortRequestBo productSortRequestBo) { 85 + public List<ProductSortTreeViewResponseBo> getProductSortList(ProductSortRequestBo productSortRequestBo) {
87 LOGGER.info("getProductSortPageList param = {}", productSortRequestBo); 86 LOGGER.info("getProductSortPageList param = {}", productSortRequestBo);
88 ProductSort productSort = OrikaUtils.map(productSortRequestBo, ProductSort.class); 87 ProductSort productSort = OrikaUtils.map(productSortRequestBo, ProductSort.class);
89 - PageModel pageModel = productSortRequestBo.toPageModel();  
90 int count = productSortMapper.selectProductSortCount(productSort); 88 int count = productSortMapper.selectProductSortCount(productSort);
91 if (count == 0) { 89 if (count == 0) {
92 LOGGER.warn("getProductSortPageList count is 0. param = {}", productSortRequestBo); 90 LOGGER.warn("getProductSortPageList count is 0. param = {}", productSortRequestBo);
93 - return new PageResponseBO<>(); 91 + return Lists.newArrayList();
94 } 92 }
95 - List<ProductSort> productSorts = productSortMapper.getProductSortPageList(productSort, pageModel); 93 + List<ProductSort> productSorts = productSortMapper.getProductSortList(productSort);
96 List<ProductSortTreeViewResponseBo> responseBos = new ArrayList<>(); 94 List<ProductSortTreeViewResponseBo> responseBos = new ArrayList<>();
97 processResult(productSorts, responseBos); 95 processResult(productSorts, responseBos);
98 - return new PageResponseBO<>(count, responseBos, pageModel.getCurrentPage(), pageModel.getPageSize()); 96 + return responseBos;
99 } 97 }
100 98
101 private void processResult(List<ProductSort> productSorts, List<ProductSortTreeViewResponseBo> responseBos) { 99 private void processResult(List<ProductSort> productSorts, List<ProductSortTreeViewResponseBo> responseBos) {
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 fit: true, 60 fit: true,
61 fitColumns: true, 61 fitColumns: true,
62 nowrap: false, 62 nowrap: false,
63 - url: contextPath + "/productSort/getProductSortPageList", 63 + url: contextPath + "/productSort/getProductSortList",
64 method: 'POST', 64 method: 'POST',
65 /*queryParams: { 65 /*queryParams: {
66 'sortName':'' 66 'sortName':''