Compare commits

..

3 Commits

Author SHA1 Message Date
wangliwen 14941565b1 Merge branch 'master' into docker_package 2023-01-04 09:32:42 +08:00
wangliwen 6714446624 Merge branch 'dev' 2023-01-04 09:32:31 +08:00
wangliwen 2b4e9e9f47 配置是否需要统计云资源 2023-01-04 09:32:23 +08:00
2 changed files with 24 additions and 5 deletions

View File

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

View File

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