diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index 2f6a5072..e80b30c9 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -593,7 +593,7 @@ public class CensusController { params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } - ArrayList resultList = (ArrayList) resourceDao.selectCensusApplyTable(params); + ArrayList resultList = (ArrayList) resourceService.selectCensusApplyTableNotPaging(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); data.add(index.getOrDefault("deptName", "") == null ? "" : index.getOrDefault("deptName", "").toString()); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java index 90b9cec5..c0ef5566 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java @@ -150,6 +150,13 @@ public interface ResourceService extends CrudService 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); + 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())) { // 浪潮云资源 + 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); + } + return resultList; + } + private List lcSelectCensusApplyTable(Map params) {