安全修改
This commit is contained in:
parent
8072f94e9c
commit
545094dc79
@ -177,7 +177,10 @@ public class SystemUserController {
|
|||||||
@ApiImplicitParam(name = "userId", required = false, value = "用户id", paramType = "body"),
|
@ApiImplicitParam(name = "userId", required = false, value = "用户id", paramType = "body"),
|
||||||
@ApiImplicitParam(name = "roleName", required = false, value = "角色名称", paramType = "body"),
|
@ApiImplicitParam(name = "roleName", required = false, value = "角色名称", paramType = "body"),
|
||||||
@ApiImplicitParam(name = "isSupervisingRoleName", required = false, value = "1监理角色名称的人", paramType = "body"),
|
@ApiImplicitParam(name = "isSupervisingRoleName", required = false, value = "1监理角色名称的人", paramType = "body"),
|
||||||
@ApiImplicitParam(name = "safeQualityRegionIdForDuty", required = false, value = "安全区域id(多个,分割)查责任人", paramType = "body"),
|
@ApiImplicitParam(name = "safeQualityRegionIdForDuty", required = false, value = "安全区域id(多个,分割)查整改人", paramType = "body"),
|
||||||
|
@ApiImplicitParam(name = "safeQualityRegionIdForReview", required = false, value = "安全区域id(多个,分割)查复查人", paramType = "body"),
|
||||||
|
@ApiImplicitParam(name = "qualityRegionIdForDuty", required = false, value = "质量区域id(多个,分割)查整改人", paramType = "body"),
|
||||||
|
@ApiImplicitParam(name = "qualityRegionIdForReview", required = false, value = "质量区域id(多个,分割)查复查人", paramType = "body"),
|
||||||
@ApiImplicitParam(name = "teamIdList", required = false, value = "班组idList", paramType = "body"),
|
@ApiImplicitParam(name = "teamIdList", required = false, value = "班组idList", paramType = "body"),
|
||||||
@ApiImplicitParam(name = "departmentIdList", required = false, value = "部门idList", paramType = "body"),
|
@ApiImplicitParam(name = "departmentIdList", required = false, value = "部门idList", paramType = "body"),
|
||||||
})
|
})
|
||||||
|
|||||||
@ -993,14 +993,22 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|||||||
if (StrUtil.isNotBlank(enterpriseId)) {
|
if (StrUtil.isNotBlank(enterpriseId)) {
|
||||||
map.put("enterpriseIdList", StrUtil.split(enterpriseId, ","));
|
map.put("enterpriseIdList", StrUtil.split(enterpriseId, ","));
|
||||||
}
|
}
|
||||||
String safeQualityRegionIdForDuty = MapUtils.getString(map, "safeQualityRegionIdForDuty");
|
putSafeQualityRegionIdForDutyParam(map, MapUtils.getString(map, "safeQualityRegionIdForDuty"),QualityRegion::getSecurityDutyIds);
|
||||||
|
putSafeQualityRegionIdForDutyParam(map, MapUtils.getString(map, "safeQualityRegionIdForReview"),QualityRegion::getSecurityReviewIds);
|
||||||
|
putSafeQualityRegionIdForDutyParam(map, MapUtils.getString(map, "qualityRegionIdForDuty"), QualityRegion::getQualityDutyIds);
|
||||||
|
putSafeQualityRegionIdForDutyParam(map, MapUtils.getString(map, "qualityRegionIdForReview"), QualityRegion::getQualityReviewIds);
|
||||||
|
return systemUserMapper.getProjectChilderSystemUserList(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void putSafeQualityRegionIdForDutyParam(Map<String, Object> map, String safeQualityRegionIdForDuty, Function<QualityRegion, String> getUserIds) {
|
||||||
if (StrUtil.isNotBlank(safeQualityRegionIdForDuty)) {
|
if (StrUtil.isNotBlank(safeQualityRegionIdForDuty)) {
|
||||||
List<String> userIds = qualityRegionService.list(new LambdaQueryWrapper<QualityRegion>()
|
List<String> userIds = qualityRegionService.list(new LambdaQueryWrapper<QualityRegion>()
|
||||||
.in(QualityRegion::getId, StrUtil.split(safeQualityRegionIdForDuty, ","))).stream().flatMap(r -> {
|
.in(QualityRegion::getId, StrUtil.split(safeQualityRegionIdForDuty, ","))).stream().flatMap(r -> {
|
||||||
if (StrUtil.isBlank(r.getSecurityDutyIds())) {
|
String uids = getUserIds.apply(r);
|
||||||
|
if (StrUtil.isBlank(uids)) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return StrUtil.split(r.getSecurityDutyIds(), ",").stream();
|
return StrUtil.split(uids, ",").stream();
|
||||||
}
|
}
|
||||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
userIds.add("0");
|
userIds.add("0");
|
||||||
@ -1010,7 +1018,6 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|||||||
}
|
}
|
||||||
map.put("userIdList", userIds);
|
map.put("userIdList", userIds);
|
||||||
}
|
}
|
||||||
return systemUserMapper.getProjectChilderSystemUserList(map);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -166,7 +166,7 @@ public class XzSecurityDangerFieldController {
|
|||||||
.eq(XzSecurityDangerField::getSn, projectSn)
|
.eq(XzSecurityDangerField::getSn, projectSn)
|
||||||
.eq(XzSecurityDangerField::getCompanyProjectType, 2)
|
.eq(XzSecurityDangerField::getCompanyProjectType, 2)
|
||||||
);
|
);
|
||||||
List<XzSecurityDangerFieldVo> companyConfigs = xzSecurityDangerFieldService.getCompanyConfigs(projectSn);
|
List<XzSecurityDangerFieldVo> companyConfigs = xzSecurityDangerFieldService.getCompanyConfigs(projectSn, 2);
|
||||||
List<XzSecurityDangerField> fieldList = companyConfigs.stream().map(vo -> {
|
List<XzSecurityDangerField> fieldList = companyConfigs.stream().map(vo -> {
|
||||||
XzSecurityDangerField field = new XzSecurityDangerField();
|
XzSecurityDangerField field = new XzSecurityDangerField();
|
||||||
BeanUtil.copyProperties(vo, field);
|
BeanUtil.copyProperties(vo, field);
|
||||||
|
|||||||
@ -30,6 +30,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -187,7 +188,7 @@ public class XzSecurityDangerReviewVerifyController {
|
|||||||
* @param dto
|
* @param dto
|
||||||
*/
|
*/
|
||||||
private void saveFieldForProject(XzSecurityDangerReviewVerifyDto dto) {
|
private void saveFieldForProject(XzSecurityDangerReviewVerifyDto dto) {
|
||||||
List<XzSecurityDangerFieldVo> companyConfigs = xzSecurityDangerFieldService.getCompanyConfigs(dto.getSn());
|
List<XzSecurityDangerFieldVo> companyConfigs = xzSecurityDangerFieldService.getCompanyConfigs(dto.getSn(),dto.getCompanyProjectType());
|
||||||
xzSecurityDangerFieldService.remove(new LambdaQueryWrapper<XzSecurityDangerField>()
|
xzSecurityDangerFieldService.remove(new LambdaQueryWrapper<XzSecurityDangerField>()
|
||||||
.eq(XzSecurityDangerField::getSn, dto.getSn())
|
.eq(XzSecurityDangerField::getSn, dto.getSn())
|
||||||
.eq(XzSecurityDangerField::getCompanyProjectType, dto.getCompanyProjectType())
|
.eq(XzSecurityDangerField::getCompanyProjectType, dto.getCompanyProjectType())
|
||||||
@ -233,6 +234,11 @@ public class XzSecurityDangerReviewVerifyController {
|
|||||||
dto.setModType(modType);
|
dto.setModType(modType);
|
||||||
dto.setSn(projectSn);
|
dto.setSn(projectSn);
|
||||||
dto.setCompanyProjectType(2);
|
dto.setCompanyProjectType(2);
|
||||||
|
if (Objects.equals(modType, 1) && dto.getReviewRoleName() == null) {
|
||||||
|
dto.setReviewRoleName("");
|
||||||
|
} else if (Objects.equals(modType, 2) && dto.getVerifyRoleName() == null) {
|
||||||
|
dto.setVerifyRoleName("");
|
||||||
|
}
|
||||||
save(dto);
|
save(dto);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,10 +72,11 @@ public interface IXzSecurityDangerFieldService extends IService<XzSecurityDanger
|
|||||||
/**
|
/**
|
||||||
* 查询企业配置
|
* 查询企业配置
|
||||||
*
|
*
|
||||||
* @param projectSn
|
* @param sn
|
||||||
|
* @param companyProjectType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<XzSecurityDangerFieldVo> getCompanyConfigs(String projectSn);
|
List<XzSecurityDangerFieldVo> getCompanyConfigs(String sn, Integer companyProjectType);
|
||||||
|
|
||||||
void saveAll(SaveAllXzSecurityDangerFieldDto dto);
|
void saveAll(SaveAllXzSecurityDangerFieldDto dto);
|
||||||
|
|
||||||
|
|||||||
@ -137,7 +137,7 @@ public class XzSecurityDangerFieldServiceImpl extends ServiceImpl<XzSecurityDang
|
|||||||
List<XzSecurityDangerFieldVo> list = this.queryList(param);
|
List<XzSecurityDangerFieldVo> list = this.queryList(param);
|
||||||
if (Objects.equals(companyProjectType, 2) && CollUtil.isEmpty(list)) {
|
if (Objects.equals(companyProjectType, 2) && CollUtil.isEmpty(list)) {
|
||||||
//项目不存在,查询企业配置
|
//项目不存在,查询企业配置
|
||||||
list = this.getCompanyConfigs(sn);
|
list = this.getCompanyConfigs(sn, 2);
|
||||||
if (CollUtil.isEmpty(list)) {
|
if (CollUtil.isEmpty(list)) {
|
||||||
list = JSON.parseArray(ResourceUtil.readUtf8Str("init/data/xzSecurityDangerField.json"), XzSecurityDangerFieldVo.class);
|
list = JSON.parseArray(ResourceUtil.readUtf8Str("init/data/xzSecurityDangerField.json"), XzSecurityDangerFieldVo.class);
|
||||||
}
|
}
|
||||||
@ -151,11 +151,17 @@ public class XzSecurityDangerFieldServiceImpl extends ServiceImpl<XzSecurityDang
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<XzSecurityDangerFieldVo> getCompanyConfigs(String projectSn) {
|
public List<XzSecurityDangerFieldVo> getCompanyConfigs(String sn, Integer companyProjectType) {
|
||||||
List<XzSecurityDangerFieldVo> list;
|
List<XzSecurityDangerFieldVo> list;
|
||||||
String headquartersSn = companyService.getHeadquartersSnByProjectSn(projectSn);
|
String headquartersSn;
|
||||||
|
if (Objects.equals(companyProjectType, 2)) {
|
||||||
|
headquartersSn = companyService.getHeadquartersSnByProjectSn(sn);
|
||||||
|
} else {
|
||||||
|
headquartersSn = sn;
|
||||||
|
}
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("sn", headquartersSn);
|
map.put("sn", headquartersSn);
|
||||||
|
map.put("recordType", 1);
|
||||||
map.put("companyProjectType", 1);
|
map.put("companyProjectType", 1);
|
||||||
list = this.queryList(map);
|
list = this.queryList(map);
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user