|
@@ -7,6 +7,7 @@ import com.uas.ps.entity.ProductUsers;
|
|
|
import com.uas.ps.product.entity.InviteProdInfo;
|
|
import com.uas.ps.product.entity.InviteProdInfo;
|
|
|
import com.uas.ps.product.entity.ProductPrivateView;
|
|
import com.uas.ps.product.entity.ProductPrivateView;
|
|
|
import com.uas.ps.product.search.model.PageParams;
|
|
import com.uas.ps.product.search.model.PageParams;
|
|
|
|
|
+import com.uas.ps.product.search.service.RestTempSearchService;
|
|
|
import com.uas.ps.product.service.ProductService;
|
|
import com.uas.ps.product.service.ProductService;
|
|
|
import com.uas.ps.product.search.model.SPage;
|
|
import com.uas.ps.product.search.model.SPage;
|
|
|
import com.uas.ps.product.search.service.SearchService;
|
|
import com.uas.ps.product.search.service.SearchService;
|
|
@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
@@ -40,6 +42,14 @@ public class ProductGetController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ProductUsersService productUsersService;
|
|
private ProductUsersService productUsersService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RestTempSearchService restTempSearchService;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 物料信息表
|
|
|
|
|
+ */
|
|
|
|
|
+ final String PRODUCT_TABLE_NAME = "v$product$private";
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据enUU和code查找企业物料
|
|
* 根据enUU和code查找企业物料
|
|
|
* @param enUU 企业UU
|
|
* @param enUU 企业UU
|
|
@@ -100,16 +110,42 @@ public class ProductGetController {
|
|
|
* @param filters 过滤条件(包含)
|
|
* @param filters 过滤条件(包含)
|
|
|
* @param notEqualFilters 过滤条件(不包含)
|
|
* @param notEqualFilters 过滤条件(不包含)
|
|
|
* @param keyword 关键字
|
|
* @param keyword 关键字
|
|
|
- * @return
|
|
|
|
|
|
|
+ * @return SPage<Product>
|
|
|
*/
|
|
*/
|
|
|
@RequestMapping(value = "/searchProducts", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/searchProducts", method = RequestMethod.GET)
|
|
|
- public SPage<Product> searchProducts(int page, int size, String filters, String notEqualFilters, String keyword) {
|
|
|
|
|
|
|
+ public SPage<Product> searchProducts(int page, int size, String filters, String notEqualFilters, String keyword, String keywordSearchColumns) {
|
|
|
Map<String, Object> equalMap = JSON.parseObject(filters);
|
|
Map<String, Object> equalMap = JSON.parseObject(filters);
|
|
|
Map<String, Object> notEqualMap = JSON.parseObject(notEqualFilters);
|
|
Map<String, Object> notEqualMap = JSON.parseObject(notEqualFilters);
|
|
|
- PageParams pageParams = new PageParams(page, size, equalMap, notEqualMap);
|
|
|
|
|
|
|
+ List<String> searchColumns = new ArrayList<>();
|
|
|
|
|
+ if (null != keywordSearchColumns) {
|
|
|
|
|
+ searchColumns = JSON.parseArray(keywordSearchColumns, String.class);
|
|
|
|
|
+ }
|
|
|
|
|
+ PageParams pageParams = new PageParams(page, size, equalMap, notEqualMap, searchColumns);
|
|
|
return searchService.searchProducts(keyword, pageParams);
|
|
return searchService.searchProducts(keyword, pageParams);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 物料搜索接口
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param page 页码
|
|
|
|
|
+ * @param size 大小
|
|
|
|
|
+ * @param filters 过滤条件(包含)
|
|
|
|
|
+ * @param notEqualFilters 过滤条件(不包含)
|
|
|
|
|
+ * @param keyword 关键字
|
|
|
|
|
+ * @return SPage<Integer>
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/searchProductIds", method = RequestMethod.GET)
|
|
|
|
|
+ public SPage<Integer> searchProductIds(int page, int size, String filters, String notEqualFilters, String keyword, String keywordSearchColumns) {
|
|
|
|
|
+ Map<String, Object> equalMap = JSON.parseObject(filters);
|
|
|
|
|
+ Map<String, Object> notEqualMap = JSON.parseObject(notEqualFilters);
|
|
|
|
|
+ List<String> searchColumns = new ArrayList<>();
|
|
|
|
|
+ if (null != keywordSearchColumns) {
|
|
|
|
|
+ searchColumns = JSON.parseArray(keywordSearchColumns, String.class);
|
|
|
|
|
+ }
|
|
|
|
|
+ PageParams pageParams = new PageParams(page, size, equalMap, notEqualMap, searchColumns);
|
|
|
|
|
+ return restTempSearchService.searchIds(keyword, PRODUCT_TABLE_NAME, pageParams);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据分页信息查找个人物料
|
|
* 根据分页信息查找个人物料
|
|
|
*
|
|
*
|
|
@@ -123,7 +159,7 @@ public class ProductGetController {
|
|
|
public SPage<ProductUsers> findProductUsersByPageInfo(int page, int size, String filters, String notEqualFilters, Sort sort, String keyword) {
|
|
public SPage<ProductUsers> findProductUsersByPageInfo(int page, int size, String filters, String notEqualFilters, Sort sort, String keyword) {
|
|
|
Map<String, Object> equalMap = JSON.parseObject(filters);
|
|
Map<String, Object> equalMap = JSON.parseObject(filters);
|
|
|
Map<String, Object> notEqualMap = JSON.parseObject(notEqualFilters);
|
|
Map<String, Object> notEqualMap = JSON.parseObject(notEqualFilters);
|
|
|
- PageParams pageParams = new PageParams(page, size, equalMap, notEqualMap);
|
|
|
|
|
|
|
+ PageParams pageParams = new PageParams(page, size, equalMap, notEqualMap, null);
|
|
|
if (StringUtils.isEmpty(keyword)) {
|
|
if (StringUtils.isEmpty(keyword)) {
|
|
|
PageInfo pageInfo = new PageInfo(page, size);
|
|
PageInfo pageInfo = new PageInfo(page, size);
|
|
|
for (Map.Entry<String, Object> map : equalMap.entrySet()) {
|
|
for (Map.Entry<String, Object> map : equalMap.entrySet()) {
|