Compare commits

..

No commits in common. "14941565b131087ec8d40915c8f24fe4d06d2dde" and "82f944e03426e7d18356cfad48bc12668ea0e4a1" have entirely different histories.

2 changed files with 5 additions and 24 deletions

View File

@ -183,9 +183,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Value("${big_date.assignee_meet_role_id}") @Value("${big_date.assignee_meet_role_id}")
private String defaultAssigneeRoleId; // 会客厅审核人角色 private String defaultAssigneeRoleId; // 会客厅审核人角色
@Value("#{new Boolean(${cloud.enable})}")
private Boolean cloud; // 是否进行云资源统计
@Autowired @Autowired
private ResourceDao resourceDao; private ResourceDao resourceDao;
@ -2368,9 +2365,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
sb.deleteCharAt(sb.length() - 2); sb.deleteCharAt(sb.length() - 2);
sb.append(")"); sb.append(")");
try { try {
if (cloud) { zwyCountListByapplyDept.addAll(lcJdbcTemplate.queryForList(sb.toString()));
zwyCountListByapplyDept.addAll(lcJdbcTemplate.queryForList(sb.toString()));
}
} catch (Exception e) { } catch (Exception e) {
logger.error("查询浪潮数据库申SQL语句--->{}", sb); logger.error("查询浪潮数据库申SQL语句--->{}", sb);
logger.error("查询浪潮数据库异常", e); logger.error("查询浪潮数据库异常", e);
@ -2423,9 +2418,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
if ("250000".equals(params.get("region").toString())) { if ("250000".equals(params.get("region").toString())) {
List<Map<String, Object>> zwyCountListByApplyDept = new ArrayList<>(); List<Map<String, Object>> zwyCountListByApplyDept = new ArrayList<>();
try { try {
if (cloud) { zwyCountListByApplyDept = lcJdbcTemplate.queryForList(getAllsql);
zwyCountListByApplyDept = lcJdbcTemplate.queryForList(getAllsql);
}
} catch (Exception e) { } catch (Exception e) {
logger.error(getAllsql, e); logger.error(getAllsql, e);
} }
@ -2485,9 +2478,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
} else { } else {
List<Map<String, Object>> zwyCountListByApplyDept = new ArrayList<>(); List<Map<String, Object>> zwyCountListByApplyDept = new ArrayList<>();
try { try {
if (cloud) { zwyCountListByApplyDept = lcJdbcTemplate.queryForList(getAllsql);
zwyCountListByApplyDept = lcJdbcTemplate.queryForList(getAllsql);
}
} catch (Exception e) { } catch (Exception e) {
logger.info(getAllsql, e); logger.info(getAllsql, e);
} }
@ -2522,7 +2513,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
resultList = resultList.stream().map(index -> { resultList = resultList.stream().map(index -> {
if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
index.put("level", "municipal"); // 市级别
index.put("count", typeCountListMap.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); index.put("count", typeCountListMap.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
typeCountListMap.get(index.get("dept_id").toString()).stream().forEach(count -> { typeCountListMap.get(index.get("dept_id").toString()).stream().forEach(count -> {
@ -2542,7 +2533,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("3")) typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("3"))
.collect(Collectors.groupingBy(m -> m.get("district").toString())); .collect(Collectors.groupingBy(m -> m.get("district").toString()));
resultList = resultList.stream().map(index -> { resultList = resultList.stream().map(index -> {
index.put("level", "county"); // 区县级别
if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
typeCountListMap1.get(index.get("dept_id").toString()).stream().forEach(count -> { typeCountListMap1.get(index.get("dept_id").toString()).stream().forEach(count -> {
@ -2563,7 +2553,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("4")) typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("4"))
.collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); .collect(Collectors.groupingBy(m -> m.get("dept_id").toString()));
resultList = resultList.stream().map(index -> { resultList = resultList.stream().map(index -> {
index.put("level", "other"); // 企业级别
if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
typeCountListMap2.get(index.get("dept_id").toString()).stream().forEach(count -> { typeCountListMap2.get(index.get("dept_id").toString()).stream().forEach(count -> {
@ -2722,7 +2711,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
resultList.addAll(getDeptTemp4()); // 企业 resultList.addAll(getDeptTemp4()); // 企业
Map<String, Integer> countMap = new HashMap<>(); Map<String, Integer> countMap = new HashMap<>();
resultList = resultList.stream().map(index -> { resultList = resultList.stream().map(index -> {
index.put("level", "municipal"); // 市级别
if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
index.put("count", typeCountListMap.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); index.put("count", typeCountListMap.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
typeCountListMap.get(index.get("dept_id").toString()).stream().forEach(count -> { typeCountListMap.get(index.get("dept_id").toString()).stream().forEach(count -> {
@ -2740,7 +2728,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("3")) typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("3"))
.collect(Collectors.groupingBy(m -> m.get("district").toString())); .collect(Collectors.groupingBy(m -> m.get("district").toString()));
resultList = resultList.stream().map(index -> { resultList = resultList.stream().map(index -> {
index.put("level", "county"); // 区县级别
if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
typeCountListMap1.get(index.get("dept_id").toString()).stream().forEach(count -> { typeCountListMap1.get(index.get("dept_id").toString()).stream().forEach(count -> {
@ -2758,7 +2745,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("4")) typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("4"))
.collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); .collect(Collectors.groupingBy(m -> m.get("dept_id").toString()));
resultList = resultList.stream().map(index -> { resultList = resultList.stream().map(index -> {
index.put("level", "other"); // 企业级别
if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
typeCountListMap2.get(index.get("dept_id").toString()).stream().forEach(count -> { typeCountListMap2.get(index.get("dept_id").toString()).stream().forEach(count -> {
@ -3049,9 +3035,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
sb.append(" ORDER BY apply.\"createDate\" DESC"); sb.append(" ORDER BY apply.\"createDate\" DESC");
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
try { try {
if (cloud) { list = lcJdbcTemplate.queryForList(sb.toString());
list = lcJdbcTemplate.queryForList(sb.toString());
}
list = list.stream().map(index -> { list = list.stream().map(index -> {
logger.info("云资源使用信息信息:" + JSON.toJSONString(index)); logger.info("云资源使用信息信息:" + JSON.toJSONString(index));
switch (index.get("type").toString()) { // 根据类型填充其审核状态 switch (index.get("type").toString()) { // 根据类型填充其审核状态

View File

@ -185,7 +185,4 @@ enke:
# 开启审核组成员支持 # 开启审核组成员支持
auditteam: auditteam:
enable: true enable: true
# 是否统计云资源
cloud:
enable: false