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

添加应用serviceApi参数字段

parent 4a534f42
...@@ -36,8 +36,9 @@ public class AppDatasetDaoImpl extends BaseCRUDDaoMybatis<AppDatasetEntity,Long> ...@@ -36,8 +36,9 @@ public class AppDatasetDaoImpl extends BaseCRUDDaoMybatis<AppDatasetEntity,Long>
} else if (pageInfo.getPrePageResult() == -1) { } else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), paramDto); list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), paramDto);
} else { } else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult()); list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), paramDto);
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), this.cpyQueryParamDto(paramDto), rowBounds); /* RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId(SQLID_CUSTOM_LIST), this.cpyQueryParamDto(paramDto), rowBounds);*/
} }
pageInfo.setTotalResult(count); pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo); result.setPageInfo(pageInfo);
......
...@@ -62,22 +62,33 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD ...@@ -62,22 +62,33 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD
@Override @Override
protected void doListBefore(AppDatasetEntity query, Map<String, Object> model, Context context) throws AppException { 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 appDatasetQuery = new AppDatasetQuery();
appDatasetQuery.setAndConditionList(query.getOrConditionList()); appDatasetQuery.setOrConditionList(query.getOrConditionList());
appDatasetQuery.setAppId(query.getAppId()); appDatasetQuery.setAppId(query.getAppId());
PageInfo pageInfo = this.buildPageInfo(query); PageInfo pageInfo = this.buildPageInfo(query);
Result<AppInfoFieldEntity> customResult = this.service.findCustomList(appDatasetQuery, pageInfo, context); 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()); List<Long> datasetIdList = customResult.getList().stream().map(item -> item.getDatasetId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(datasetIdList)) { Map<Long, Long> collect = datasetIdList.stream().collect(Collectors.groupingBy(x -> x, Collectors.counting()));
query.setIdList(datasetIdList); 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); 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 appDatasetQuery = new AppDatasetQuery();
appDatasetQuery.setFieldCode(query.getFieldCode()); appDatasetQuery.setFieldCode(query.getFieldCode());
appDatasetQuery.setFieldName(query.getFieldName()); appDatasetQuery.setFieldName(query.getFieldName());
...@@ -90,7 +101,7 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD ...@@ -90,7 +101,7 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD
List<Long> datasetIdList = customResult.getList().stream().map(item -> item.getDatasetId()).collect(Collectors.toList()); List<Long> datasetIdList = customResult.getList().stream().map(item -> item.getDatasetId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(datasetIdList)) { if (!ObjectUtils.isEmpty(datasetIdList)) {
query.setIdList(datasetIdList); query.setIdList(datasetIdList);
}else{ } else {
query.setIdList(ListUtil.toList(0L)); query.setIdList(ListUtil.toList(0L));
} }
} }
......
...@@ -35,6 +35,9 @@ Content-Type: application/json ...@@ -35,6 +35,9 @@ Content-Type: application/json
{ {
"fieldName": "制定机关", "fieldName": "制定机关",
"fieldValue": "%四川省人民政府%" "fieldValue": "%四川省人民政府%"
},{
"fieldName": "标题",
"fieldValue": "%管理办法%"
} }
], ],
"page": 1, "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