判断逻辑。。

This commit is contained in:
wangliwen 2022-12-27 11:11:27 +08:00
parent 898e499720
commit 77a3bd0f58
1 changed files with 10 additions and 5 deletions

View File

@ -2871,8 +2871,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
List result = new ArrayList(); List result = new ArrayList();
if (params.containsKey("type") && (null == params.get("type") || org.apache.commons.lang3.StringUtils.isBlank(params.get("type").toString()))) { //查所有 if (!params.containsKey("type") ||
(params.containsKey("type") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("type") != null ? params.get("type").toString() : null))
) { //查所有
int total = 0; int total = 0;
List<Map> ucsApplyDtoList = resourceDao.selectCensusApplyTable(params); List<Map> ucsApplyDtoList = resourceDao.selectCensusApplyTable(params);
result.addAll(ucsApplyDtoList); result.addAll(ucsApplyDtoList);
@ -2890,7 +2891,8 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}).reversed()) }).reversed())
.skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()); .skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList());
return new PageData(newResult, total); return new PageData(newResult, total);
} else if ("云资源".equals(params.get("type").toString()) || "云视频".equals(params.get("type").toString())) { } else if (params.containsKey("type") &&
("云资源".equals(params.get("type") != null ? params.get("type").toString() : null) || "云视频".equals(params.get("type") != null ? params.get("type").toString() : null))) {
List<Map> lcApplyDtoList = lcSelectCensusApplyTable(params); List<Map> lcApplyDtoList = lcSelectCensusApplyTable(params);
result.addAll(lcApplyDtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList())); result.addAll(lcApplyDtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()));
return new PageData(result, lcApplyDtoList.size()); return new PageData(result, lcApplyDtoList.size());
@ -2911,7 +2913,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override @Override
public Object selectCensusApplyTableNotPaging(Map params) { public Object selectCensusApplyTableNotPaging(Map params) {
List<Map> resultList = new ArrayList<>(); List<Map> resultList = new ArrayList<>();
if (params.containsKey("type") && (null == params.get("type") || org.apache.commons.lang3.StringUtils.isBlank(params.get("type").toString()))) { //查所有 if (!params.containsKey("type") ||
(params.containsKey("type") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("type") != null ? params.get("type").toString() : null))
) { // 查所有
resultList = resourceDao.selectCensusApplyTable(params); resultList = resourceDao.selectCensusApplyTable(params);
try { try {
List<Map> lcApplyDtoList = lcSelectCensusApplyTable(params); List<Map> lcApplyDtoList = lcSelectCensusApplyTable(params);
@ -2924,7 +2928,8 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
Map map = (Map) x; Map map = (Map) x;
return DateUtils.parse(map.get("createDate").toString(), DateUtils.DATE_TIME_PATTERN); return DateUtils.parse(map.get("createDate").toString(), DateUtils.DATE_TIME_PATTERN);
}).reversed()).collect(Collectors.toList()); }).reversed()).collect(Collectors.toList());
} else if ("云资源".equals(params.get("type").toString()) || "云视频".equals(params.get("type").toString())) { // 浪潮云资源 } else if (params.containsKey("type") &&
("云资源".equals(params.get("type") != null ? params.get("type").toString() : null) || "云视频".equals(params.get("type") != null ? params.get("type").toString() : null))) { // 浪潮云资源
try { try {
resultList = lcSelectCensusApplyTable(params); resultList = lcSelectCensusApplyTable(params);
resultList = resultList.stream() resultList = resultList.stream()