|
|
@@ -1,19 +1,25 @@
|
|
|
package com.uas.ps.product.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.ps.core.page.PageInfo;
|
|
|
+import com.uas.ps.core.page.criteria.CriterionExpression;
|
|
|
import com.uas.ps.entity.Product;
|
|
|
import com.uas.ps.product.service.ProductService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* 物料相关的查询接口
|
|
|
@@ -63,12 +69,19 @@ public class ProductGetController {
|
|
|
|
|
|
/**
|
|
|
* 根据分页信息查找企业物料
|
|
|
- * @param pageInfo 分页信息
|
|
|
+ *
|
|
|
+ * @param pageNumber 页码
|
|
|
+ * @param pageSize 分页大小
|
|
|
+ * @param sort 排序
|
|
|
* @param keyword 关键词 不建议使用关键词搜索,jpa获取会很慢
|
|
|
* @return 物料
|
|
|
*/
|
|
|
@RequestMapping(value = "/findByPageInfo", method = RequestMethod.GET)
|
|
|
- public Page<Product> findByPageInfo(PageInfo pageInfo, String keyword) {
|
|
|
+ public Page<Product> findByPageInfo(int pageNumber, int pageSize, String filters, Sort sort, String keyword) {
|
|
|
+ PageInfo pageInfo = new PageInfo(pageNumber, pageSize);
|
|
|
+ Map<String, Object> map = JSON.parseObject(filters);
|
|
|
+ pageInfo.setFilters(map);
|
|
|
+ pageInfo.setSort(sort);
|
|
|
return productService.findByPageInfo(pageInfo, keyword);
|
|
|
}
|
|
|
|