危大工程修改

This commit is contained in:
pengjie 2024-04-23 21:48:10 +08:00
parent 74eba49e13
commit f256f5ee25
3 changed files with 57 additions and 32 deletions

View File

@ -192,7 +192,11 @@ public class DataScopeHandler implements DataPermissionHandler {
Table table = (Table) fromItem; Table table = (Table) fromItem;
String name = table.getName(); String name = table.getName();
if (tables.contains(name)) { if (tables.contains(name)) {
String aliasName = table.getAlias().getName(); String aliasName = null;
Alias alias = table.getAlias();
if (alias != null) {
aliasName = alias.getName();
}
rtList.add((StringUtils.isEmpty(aliasName) ? name : aliasName) + "." + field); rtList.add((StringUtils.isEmpty(aliasName) ? name : aliasName) + "." + field);
} }
} }
@ -206,7 +210,11 @@ public class DataScopeHandler implements DataPermissionHandler {
if (rightItem instanceof Table) { if (rightItem instanceof Table) {
Table joinTable = (Table) rightItem; Table joinTable = (Table) rightItem;
if (tables.contains(joinTable.getName())) { if (tables.contains(joinTable.getName())) {
String aliasName = joinTable.getAlias().getName(); String aliasName = null;
Alias alias = joinTable.getAlias();
if (alias != null) {
aliasName = alias.getName();
}
rtList.add((StringUtils.isEmpty(aliasName) ? joinTable.getName() : aliasName) + "." + field); rtList.add((StringUtils.isEmpty(aliasName) ? joinTable.getName() : aliasName) + "." + field);
} }
} }

View File

@ -141,42 +141,54 @@ public class DangerousEngineeringRecordController {
dangerousEngineeringRecord.setEngineeringTypeName(engineeringType.getTypeName()); dangerousEngineeringRecord.setEngineeringTypeName(engineeringType.getTypeName());
dangerousEngineeringRecord.setBuildStartTime(buildTime.get(0)); dangerousEngineeringRecord.setBuildStartTime(buildTime.get(0));
dangerousEngineeringRecord.setBuildEndTime(buildTime.get(1)); dangerousEngineeringRecord.setBuildEndTime(buildTime.get(1));
dangerousEngineeringRecord.setPlanStartTime(planTime.get(0)); dangerousEngineeringRecord.setPlanStartTime(planTime== null ? null : planTime.get(0));
dangerousEngineeringRecord.setPlanEndTime(planTime.get(1)); dangerousEngineeringRecord.setPlanEndTime(planTime == null ? null : planTime.get(1));
dangerousEngineeringRecord.setResponsibilityCompanyId(enterpriseInfo.getId()); dangerousEngineeringRecord.setResponsibilityCompanyId(enterpriseInfo.getId());
dangerousEngineeringRecord.setSecurityConstructionSchemeType(MapUtils.getString(map, "securityConstructionSchemeType").equals("未完成") ? 1 : 2); String securityConstructionSchemeType = MapUtils.getString(map, "securityConstructionSchemeType");
dangerousEngineeringRecord.setSpecialConstructionSchemeType(MapUtils.getString(map, "specialConstructionSchemeType").equals("未完成") ? 1 : 2); securityConstructionSchemeType = securityConstructionSchemeType == null ? "未完成" : securityConstructionSchemeType;
dangerousEngineeringRecord.setTechnicalDisclosureType(MapUtils.getString(map, "technicalDisclosureType").equals("未完成") ? 1 : 2); String specialConstructionSchemeType = MapUtils.getString(map, "specialConstructionSchemeType");
specialConstructionSchemeType = specialConstructionSchemeType == null ? "未完成" : specialConstructionSchemeType;
String technicalDisclosureType = MapUtils.getString(map, "technicalDisclosureType");
technicalDisclosureType = technicalDisclosureType == null ? "未完成" : technicalDisclosureType;
dangerousEngineeringRecord.setSecurityConstructionSchemeType(securityConstructionSchemeType.equals("未完成") ? 1 : 2);
dangerousEngineeringRecord.setSpecialConstructionSchemeType(specialConstructionSchemeType.equals("未完成") ? 1 : 2);
dangerousEngineeringRecord.setTechnicalDisclosureType(technicalDisclosureType.equals("未完成") ? 1 : 2);
dangerousEngineeringRecord.setTypeDescribeList(typeDescribeList); dangerousEngineeringRecord.setTypeDescribeList(typeDescribeList);
dangerousEngineeringRecord.setControlItemList(controlIds); dangerousEngineeringRecord.setControlItemList(controlIds);
List<Map<String, Object>> teFiles = (List<Map<String, Object>>) map.get("technicalDisclosureFile"); List<Map<String, Object>> teFiles = (List<Map<String, Object>>) map.get("technicalDisclosureFile");
List<Map<String, Object>> teFile = new ArrayList<>(); List<Map<String, Object>> teFile = new ArrayList<>();
for (Map<String, Object> file : teFiles) { if (teFiles != null) {
Map<String, Object> teMap = new HashMap<>(); for (Map<String, Object> file : teFiles) {
teMap.put("name", file.get("name")); Map<String, Object> teMap = new HashMap<>();
teMap.put("url", file.get("url")); teMap.put("name", file.get("name"));
teMap.put("iconType", file.get("contentType")); teMap.put("url", file.get("url"));
teFile.add(teMap); teMap.put("iconType", file.get("contentType"));
teFile.add(teMap);
}
} }
dangerousEngineeringRecord.setTechnicalDisclosureFile(JSON.toJSONString(teFile)); dangerousEngineeringRecord.setTechnicalDisclosureFile(JSON.toJSONString(teFile));
List<Map<String, Object>> seFiles = (List<Map<String, Object>>) map.get("securityConstructionSchemeFile"); List<Map<String, Object>> seFiles = (List<Map<String, Object>>) map.get("securityConstructionSchemeFile");
List<Map<String, Object>> seFile = new ArrayList<>(); List<Map<String, Object>> seFile = new ArrayList<>();
for (Map<String, Object> file : seFiles) { if (seFiles != null) {
Map<String, Object> seMap = new HashMap<>(); for (Map<String, Object> file : seFiles) {
seMap.put("name", file.get("name")); Map<String, Object> seMap = new HashMap<>();
seMap.put("url", file.get("url")); seMap.put("name", file.get("name"));
seMap.put("iconType", file.get("contentType")); seMap.put("url", file.get("url"));
seFile.add(seMap); seMap.put("iconType", file.get("contentType"));
seFile.add(seMap);
}
} }
dangerousEngineeringRecord.setSecurityConstructionSchemeFile(JSON.toJSONString(seFile)); dangerousEngineeringRecord.setSecurityConstructionSchemeFile(JSON.toJSONString(seFile));
List<Map<String, Object>> spFiles = (List<Map<String, Object>>) map.get("specialConstructionSchemeFile"); List<Map<String, Object>> spFiles = (List<Map<String, Object>>) map.get("specialConstructionSchemeFile");
List<Map<String, Object>> spFile = new ArrayList<>(); List<Map<String, Object>> spFile = new ArrayList<>();
for (Map<String, Object> file : spFiles) { if (spFiles != null) {
Map<String, Object> spMap = new HashMap<>(); for (Map<String, Object> file : spFiles) {
spMap.put("name", file.get("name")); Map<String, Object> spMap = new HashMap<>();
spMap.put("url", file.get("url")); spMap.put("name", file.get("name"));
spMap.put("iconType", file.get("contentType")); spMap.put("url", file.get("url"));
spFile.add(spMap); spMap.put("iconType", file.get("contentType"));
spFile.add(spMap);
}
} }
dangerousEngineeringRecord.setSpecialConstructionSchemeFile(JSON.toJSONString(spFile)); dangerousEngineeringRecord.setSpecialConstructionSchemeFile(JSON.toJSONString(spFile));
dangerousEngineeringRecord.setResponsibilityCompany(enterpriseInfo.getEnterpriseName()); dangerousEngineeringRecord.setResponsibilityCompany(enterpriseInfo.getEnterpriseName());

View File

@ -84,16 +84,21 @@ public class ProjectEnterpriseController {
}) })
@PostMapping(value = "/selectDetailList") @PostMapping(value = "/selectDetailList")
public Result<List<Map<String, Object>>> selectDetailList(@RequestBody Map<String,Object> map) { public Result<List<Map<String, Object>>> selectDetailList(@RequestBody Map<String,Object> map) {
List<EntityMap> pageList = projectEnterpriseService.selectProjectEnterpriseList(map); map.put("pageNo", -1);
List<String> enterpriseIds = pageList.stream().map(e -> e.get("id").toString()).collect(Collectors.toList()); map.put("pageSize", 10);
List<WorkerInfo> workerInfoList = workerInfoService.list(Wrappers.<WorkerInfo>lambdaQuery() IPage<EnterpriseInfo> pageList = projectEnterpriseService.selectProjectEnterprisePage(map);
.in(WorkerInfo::getEnterpriseId, enterpriseIds)); List<Long> enterpriseIds = pageList.getRecords().stream().map(e -> e.getId()).collect(Collectors.toList());
Map<String, Object> userMap = new HashMap<>();
userMap.put("projectSn", map.get("projectSn").toString());
List<SystemUser> systemUserList = systemUserService.getProjectChilderSystemUserList(userMap);
List<WorkerInfo> workerInfoList = workerInfoService.listByIds(systemUserList.stream().map(u -> u.getWorkerId()).collect(Collectors.toList()));
workerInfoList = workerInfoList.stream().filter(w -> enterpriseIds.contains(w.getEnterpriseId())).collect(Collectors.toList());
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
for (EntityMap entityMap : pageList) { for (EnterpriseInfo enterpriseInfo : pageList.getRecords()) {
for (WorkerInfo workerInfo : workerInfoList) { for (WorkerInfo workerInfo : workerInfoList) {
if (workerInfo.getEnterpriseId().equals(entityMap.get("id"))) { if (workerInfo.getEnterpriseId().toString().equals(enterpriseInfo.getId().toString())) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("name", workerInfo.getWorkerName() + " —— " + entityMap.get("enterpriseName")); resultMap.put("name", workerInfo.getWorkerName() + " —— " + enterpriseInfo.getEnterpriseName());
resultMap.put("id", workerInfo.getId()); resultMap.put("id", workerInfo.getId());
list.add(resultMap); list.add(resultMap);
} }