Commit d6226507 authored by 赵啸非's avatar 赵啸非

添加应用serviceApi参数字段

parent 4a534f42
......@@ -36,8 +36,9 @@ public class AppDatasetDaoImpl extends BaseCRUDDaoMybatis<AppDatasetEntity,Long>
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), paramDto);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), this.cpyQueryParamDto(paramDto), rowBounds);
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), paramDto);
/* RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), this.cpyQueryParamDto(paramDto), rowBounds);*/
}
pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
......
......@@ -62,22 +62,33 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD
@Override
protected void doListBefore(AppDatasetEntity query, Map<String, Object> model, Context context) throws AppException {
/* if(!ObjectUtils.isEmpty(query.getOrConditionList())){
if (!ObjectUtils.isEmpty(query.getOrConditionList())) {
AppDatasetQuery appDatasetQuery = new AppDatasetQuery();
appDatasetQuery.setAndConditionList(query.getOrConditionList());
appDatasetQuery.setOrConditionList(query.getOrConditionList());
appDatasetQuery.setAppId(query.getAppId());
PageInfo pageInfo = this.buildPageInfo(query);
Result<AppInfoFieldEntity> customResult = this.service.findCustomList(appDatasetQuery, pageInfo, context);
//根据查询条件的数量去除数量不足的结果
int count = query.getOrConditionList().size();
List<Long> datasetIdList = customResult.getList().stream().map(item -> item.getDatasetId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(datasetIdList)) {
query.setIdList(datasetIdList);
Map<Long, Long> collect = datasetIdList.stream().collect(Collectors.groupingBy(x -> x, Collectors.counting()));
List<Long> dataSets = collect.entrySet().stream().map(entrySet -> {
if (entrySet.getValue() == count) {
return entrySet.getKey();
} else {
return null;
}
}).filter(f -> f != null).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(dataSets)) {
query.setIdList(dataSets);
}else{
query.setIdList(ListUtil.toList(0L));
}
query.setOrConditionList(null);
}
}*/
if (!ObjectUtils.isEmpty(query.getFieldCode())||!ObjectUtils.isEmpty(query.getFieldName())) {
if (!ObjectUtils.isEmpty(query.getFieldCode()) || !ObjectUtils.isEmpty(query.getFieldName())) {
AppDatasetQuery appDatasetQuery = new AppDatasetQuery();
appDatasetQuery.setFieldCode(query.getFieldCode());
appDatasetQuery.setFieldName(query.getFieldName());
......@@ -90,7 +101,7 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD
List<Long> datasetIdList = customResult.getList().stream().map(item -> item.getDatasetId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(datasetIdList)) {
query.setIdList(datasetIdList);
}else{
} else {
query.setIdList(ListUtil.toList(0L));
}
}
......@@ -113,7 +124,7 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD
list.add(condition);
AppDatasetEntity appDatasetEntity = new AppDatasetEntity();
// appDatasetEntity.setAndConditionList(list);
// appDatasetEntity.setAndConditionList(list);
System.out.println(JSON.toJSONString(appDatasetEntity));
}
......
......@@ -35,6 +35,9 @@ Content-Type: application/json
{
"fieldName": "制定机关",
"fieldValue": "%四川省人民政府%"
},{
"fieldName": "标题",
"fieldValue": "%管理办法%"
}
],
"page": 1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment