From 898e499720a76b085d525c5caa9d44a5c963138b Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 27 Dec 2022 10:49:17 +0800 Subject: [PATCH] ... --- .../service/impl/ResourceServiceImpl.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index ea2afa62..463344e4 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2910,23 +2910,31 @@ public class ResourceServiceImpl extends CrudServiceImpl resultList; + List resultList = new ArrayList<>(); if (params.containsKey("type") && (null == params.get("type") || org.apache.commons.lang3.StringUtils.isBlank(params.get("type").toString()))) { //查所有 resultList = resourceDao.selectCensusApplyTable(params); - List lcApplyDtoList = lcSelectCensusApplyTable(params); - resultList.addAll(lcApplyDtoList); + try { + List lcApplyDtoList = lcSelectCensusApplyTable(params); + resultList.addAll(lcApplyDtoList); + } catch (Exception exception) { + logger.error("查询浪潮云资源失败", exception); + } resultList = resultList.stream() .sorted(Comparator.comparing(x -> { Map map = (Map) x; return DateUtils.parse(map.get("createDate").toString(), DateUtils.DATE_TIME_PATTERN); }).reversed()).collect(Collectors.toList()); } else if ("云资源".equals(params.get("type").toString()) || "云视频".equals(params.get("type").toString())) { // 浪潮云资源 - resultList = lcSelectCensusApplyTable(params); - resultList = resultList.stream() - .sorted(Comparator.comparing(x -> { - Map map = (Map) x; - return DateUtils.parse(map.get("createDate").toString(), DateUtils.DATE_TIME_PATTERN); - }).reversed()).collect(Collectors.toList()); + try { + resultList = lcSelectCensusApplyTable(params); + resultList = resultList.stream() + .sorted(Comparator.comparing(x -> { + Map map = (Map) x; + return DateUtils.parse(map.get("createDate").toString(), DateUtils.DATE_TIME_PATTERN); + }).reversed()).collect(Collectors.toList()); + } catch (Exception exception) { + logger.error("查询浪潮云资源失败", exception); + } } else { // ucs 特殊 resultList = resourceDao.selectCensusApplyTable(params); }