|
|
@@ -19,10 +19,10 @@ import com.uas.platform.core.exception.SystemException;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.search.exception.SearchException;
|
|
|
-import com.uas.search.model.CollectField;
|
|
|
-import com.uas.search.model.PageParams.FilterField;
|
|
|
-import com.uas.search.model.SPage;
|
|
|
-import com.uas.search.model.Sort;
|
|
|
+import com.uas.platform.b2c.common.search.util.CollectField;
|
|
|
+import com.uas.platform.b2c.common.search.util.PageParams.FilterField;
|
|
|
+import com.uas.platform.b2c.common.search.util.SPage;
|
|
|
+import com.uas.platform.b2c.common.search.util.Sort;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -303,7 +303,7 @@ public class SearcherServiceImpl implements SearcherService {
|
|
|
List<Map<String, Object>> collectResult = new ArrayList<>();
|
|
|
JSONObject jsonObject = FastjsonUtils.parseObject(paramJSON);
|
|
|
Set<Entry<String,Object>> paramEntry = jsonObject.entrySet();
|
|
|
- Map<com.uas.search.model.PageParams.FilterField,Object> param= new LinkedHashMap<>();
|
|
|
+ Map<com.uas.platform.b2c.common.search.util.PageParams.FilterField,Object> param= new LinkedHashMap<>();
|
|
|
for (Entry<String, Object> entry : paramEntry) {
|
|
|
param.put(FilterField.valueOf(entry.getKey().toUpperCase()), entry.getValue());
|
|
|
}
|
|
|
@@ -355,9 +355,9 @@ public class SearcherServiceImpl implements SearcherService {
|
|
|
* @param params
|
|
|
* @return
|
|
|
*/
|
|
|
- private com.uas.search.model.PageParams convertPageParams(PageParams params) {
|
|
|
+ private com.uas.platform.b2c.common.search.util.PageParams convertPageParams(PageParams params) {
|
|
|
PageInfo pageinfo = new PageInfo(params);
|
|
|
- com.uas.search.model.PageParams pageParams = new com.uas.search.model.PageParams();
|
|
|
+ com.uas.platform.b2c.common.search.util.PageParams pageParams = new com.uas.platform.b2c.common.search.util.PageParams();
|
|
|
pageParams.setPage(params.getPage());
|
|
|
pageParams.setSize(params.getCount());
|
|
|
if (!StringUtils.isEmpty(params.getFilter())) {
|
|
|
@@ -370,17 +370,17 @@ public class SearcherServiceImpl implements SearcherService {
|
|
|
if (!StringUtils.isEmpty(params.getSorting())){
|
|
|
//com.alibaba.fastjson.JSONObject sort = FastjsonUtils.parseObject(params.getSorting());
|
|
|
Iterator<org.springframework.data.domain.Sort.Order> iterator = pageinfo.getSort().iterator();
|
|
|
- List<Sort> psort = new ArrayList<>();
|
|
|
+ com.uas.platform.b2c.common.search.util.Sort sort = new com.uas.platform.b2c.common.search.util.Sort();
|
|
|
+ Sort newSort = null;
|
|
|
while (iterator.hasNext()){
|
|
|
org.springframework.data.domain.Sort.Order order = iterator.next();
|
|
|
boolean reverse= false;
|
|
|
if ( "DESC".equals( order.getDirection().toString())){
|
|
|
reverse = true;
|
|
|
}
|
|
|
- Sort b= new Sort( Sort.Field.valueOf(order.getProperty()),reverse);
|
|
|
- psort.add(b);
|
|
|
+ newSort= new Sort( Sort.Field.valueOf(order.getProperty()),reverse);
|
|
|
}
|
|
|
- pageParams.setSort(psort);
|
|
|
+ pageParams.setSort(newSort);
|
|
|
}
|
|
|
return pageParams;
|
|
|
}
|