Compare commits
4 Commits
be805a0272
...
5a56e557fd
Author | SHA1 | Date |
---|---|---|
wangliwen | 5a56e557fd | |
wangliwen | 2a230b9c40 | |
wangliwen | 898e499720 | |
wangliwen | a04571795d |
|
@ -593,7 +593,7 @@ public class CensusController {
|
||||||
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
|
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<List<Object>> date = resultList.stream().map(index -> {
|
||||||
List<Object> data = new ArrayList<>();
|
List<Object> data = new ArrayList<>();
|
||||||
data.add(index.getOrDefault("deptName", "") == null ? "" : index.getOrDefault("deptName", "").toString());
|
data.add(index.getOrDefault("deptName", "") == null ? "" : index.getOrDefault("deptName", "").toString());
|
||||||
|
|
|
@ -150,6 +150,13 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
|
||||||
|
|
||||||
Object selectCensusApplyTable(Map params);
|
Object selectCensusApplyTable(Map params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无需分页
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object selectCensusApplyTableNotPaging(Map params);
|
||||||
|
|
||||||
Object getPraiseList();
|
Object getPraiseList();
|
||||||
|
|
||||||
Object getPopularList();
|
Object getPopularList();
|
||||||
|
|
|
@ -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) {
|
private List<Map> lcSelectCensusApplyTable(Map params) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue