配置统计时,资源是否归属上级

This commit is contained in:
wangliwen 2022-06-22 09:11:39 +08:00
parent 3dc4676491
commit 6a07620ba3
2 changed files with 6 additions and 2 deletions

View File

@ -42,6 +42,8 @@ import java.util.stream.Collectors;
public class CensusControllerV2 { public class CensusControllerV2 {
@Value("${project.place}") @Value("${project.place}")
private Integer projectPlace; private Integer projectPlace;
@Value("${project.higher}")
private Boolean higher;
private static final Logger logger = LoggerFactory.getLogger(CensusControllerV2.class); private static final Logger logger = LoggerFactory.getLogger(CensusControllerV2.class);
@Autowired @Autowired
@ -175,7 +177,7 @@ public class CensusControllerV2 {
String sql = String.format("SELECT COUNT(id) FROM tb_data_resource WHERE dept_id = %s AND type = '应用资源' AND del_flag = 0;", index.get("id").toString()); String sql = String.format("SELECT COUNT(id) FROM tb_data_resource WHERE dept_id = %s AND type = '应用资源' AND del_flag = 0;", index.get("id").toString());
logger.info(sql); logger.info(sql);
Long count = jdbcTemplate.queryForObject(sql, Long.class); Long count = jdbcTemplate.queryForObject(sql, Long.class);
if (!"0".equals(index.get("pid").toString())) { // 有上级部门 if (!"0".equals(index.get("pid").toString()) && higher) { // 有上级部门 配置资源归属上级
Optional<SysDeptDTO> sysDeptDTO = Optional<SysDeptDTO> sysDeptDTO =
Optional.ofNullable(sysDeptService.get(Long.valueOf(index.get("pid").toString()))); Optional.ofNullable(sysDeptService.get(Long.valueOf(index.get("pid").toString())));
if (sysDeptDTO.isPresent() && sysDeptDTO.get().getType() != null && sysDeptDTO.get().getType() >= 2) { if (sysDeptDTO.isPresent() && sysDeptDTO.get().getType() != null && sysDeptDTO.get().getType() >= 2) {

View File

@ -1,6 +1,8 @@
project: project:
# 平台部署位置 0青岛市区 1青岛西海岸 2包头 # 平台部署位置 0青岛市区 1青岛西海岸 2包头
place: 0 place: 0
# 是否将资源归为上级
higher: false
# 大数据部门相关配置 # 大数据部门相关配置
big_date: big_date:
name: 青岛市大数据发展管理局 name: 青岛市大数据发展管理局