Compare commits

...

2 Commits

Author SHA1 Message Date
wangliwen 898e499720 ... 2022-12-27 10:49:17 +08:00
wangliwen a04571795d 能力申请出浪潮云资源数据 2022-12-27 10:45:56 +08:00
3 changed files with 47 additions and 1 deletions

View File

@ -593,7 +593,7 @@ public class CensusController {
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
}
ArrayList<Map> resultList = (ArrayList<Map>) resourceDao.selectCensusApplyTable(params);
ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectCensusApplyTableNotPaging(params);
List<List<Object>> date = resultList.stream().map(index -> {
List<Object> data = new ArrayList<>();
data.add(index.getOrDefault("deptName", "") == null ? "" : index.getOrDefault("deptName", "").toString());

View File

@ -150,6 +150,13 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
Object selectCensusApplyTable(Map params);
/**
* 无需分页
* @param params
* @return
*/
Object selectCensusApplyTableNotPaging(Map params);
Object getPraiseList();
Object getPopularList();

View File

@ -2902,6 +2902,45 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}
/**
* 无需分页
*
* @param params
* @return
*/
@Override
public Object selectCensusApplyTableNotPaging(Map params) {
List<Map> 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<Map> 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<Map> lcSelectCensusApplyTable(Map params) {