Merge remote-tracking branch 'origin/guoshengxiong' into guoshengxiong
This commit is contained in:
commit
d929e896c4
@ -911,31 +911,33 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
if (!systemUser1.getXzProjectOrgId().toString().equals(systemUser.getXzProjectOrgId().toString())) {
|
||||
// 判断是否存在工作流的流程中
|
||||
List<HistoricProcessInstance> list = historyService.createHistoricProcessInstanceQuery().unfinished().list();
|
||||
Set<String> processDefinitionId = list.stream().map(l -> l.getProcessDefinitionId()).collect(Collectors.toSet());
|
||||
Set<String> startUserIds = list.stream().map(l -> l.getStartUserId()).collect(Collectors.toSet());
|
||||
List<WflowModels> models = wflowModelsMapper.selectList(Wrappers.<WflowModels>lambdaQuery()
|
||||
.in(WflowModels::getProcessDefId, processDefinitionId));
|
||||
List<String> modelName = new ArrayList<>();
|
||||
for (WflowModels model : models) {
|
||||
List<String> userIds = new ArrayList<>();
|
||||
JSONObject process = JSONObject.parseObject(model.getProcess());
|
||||
JSONArray assignedUser1 = process.getJSONObject("props").getJSONArray("assignedUser");
|
||||
if (assignedUser1 != null) {
|
||||
for (int i = 0; i < assignedUser1.size(); i++) {
|
||||
JSONObject jsonObject = assignedUser1.getJSONObject(i);
|
||||
userIds.add(jsonObject.getString("id"));
|
||||
if (list.size() > 0) {
|
||||
Set<String> processDefinitionId = list.stream().map(l -> l.getProcessDefinitionId()).collect(Collectors.toSet());
|
||||
Set<String> startUserIds = list.stream().map(l -> l.getStartUserId()).collect(Collectors.toSet());
|
||||
List<WflowModels> models = wflowModelsMapper.selectList(Wrappers.<WflowModels>lambdaQuery()
|
||||
.in(WflowModels::getProcessDefId, processDefinitionId));
|
||||
List<String> modelName = new ArrayList<>();
|
||||
for (WflowModels model : models) {
|
||||
List<String> userIds = new ArrayList<>();
|
||||
JSONObject process = JSONObject.parseObject(model.getProcess());
|
||||
JSONArray assignedUser1 = process.getJSONObject("props").getJSONArray("assignedUser");
|
||||
if (assignedUser1 != null) {
|
||||
for (int i = 0; i < assignedUser1.size(); i++) {
|
||||
JSONObject jsonObject = assignedUser1.getJSONObject(i);
|
||||
userIds.add(jsonObject.getString("id"));
|
||||
}
|
||||
}
|
||||
getUserIds(process.getJSONObject("children"), userIds);
|
||||
if (userIds.contains(systemUser.getUserId().toString())) {
|
||||
modelName.add(model.getFormName());
|
||||
}
|
||||
}
|
||||
getUserIds(process.getJSONObject("children"), userIds);
|
||||
if (userIds.contains(systemUser.getUserId().toString())) {
|
||||
modelName.add(model.getFormName());
|
||||
if (startUserIds.contains(systemUser.getUserId().toString())) {
|
||||
throw new OpenAlertException("该人员有正在进行中的审批流程,不可修改组织机构信息,请完成流程后再进行修改");
|
||||
}
|
||||
if (modelName.size() > 0) {
|
||||
throw new OpenAlertException("该人员有正在进行中的审批流程,不可修改组织机构信息,请完成流程后再进行修改");
|
||||
}
|
||||
}
|
||||
if (startUserIds.contains(systemUser.getUserId().toString())) {
|
||||
throw new OpenAlertException("该人员有正在进行中的审批流程,不可修改组织机构信息,请完成流程后再进行修改");
|
||||
}
|
||||
if (modelName.size() > 0) {
|
||||
throw new OpenAlertException("该人员有正在进行中的审批流程,不可修改组织机构信息,请完成流程后再进行修改");
|
||||
}
|
||||
}
|
||||
QueryWrapper<SystemUser> queryWrapper = new QueryWrapper<>();
|
||||
@ -1249,107 +1251,109 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
String id = MapUtils.getString(map, "id");
|
||||
// 判断是否存在工作流的流程中
|
||||
List<HistoricProcessInstance> list = historyService.createHistoricProcessInstanceQuery().unfinished().list();
|
||||
Set<String> processDefinitionId = list.stream().map(l -> l.getProcessDefinitionId()).collect(Collectors.toSet());
|
||||
StringBuilder stringBuilder = new StringBuilder("该人员有正在进行中的");
|
||||
List<String> modelName = new ArrayList<>();
|
||||
if (processDefinitionId.size() > 0) {
|
||||
Set<String> startUserIds = list.stream().map(l -> l.getStartUserId()).collect(Collectors.toSet());
|
||||
if (list.size() > 0) {
|
||||
Set<String> processDefinitionId = list.stream().map(l -> l.getProcessDefinitionId()).collect(Collectors.toSet());
|
||||
StringBuilder stringBuilder = new StringBuilder("该人员有正在进行中的");
|
||||
List<String> modelName = new ArrayList<>();
|
||||
if (processDefinitionId.size() > 0) {
|
||||
List<WflowModels> models = wflowModelsMapper.selectList(Wrappers.<WflowModels>lambdaQuery()
|
||||
.in(WflowModels::getProcessDefId, processDefinitionId));
|
||||
for (WflowModels model : models) {
|
||||
List<String> userIds = new ArrayList<>();
|
||||
JSONObject process = JSONObject.parseObject(model.getProcess());
|
||||
JSONArray assignedUser1 = process.getJSONObject("props").getJSONArray("assignedUser");
|
||||
if (assignedUser1 != null) {
|
||||
for (int i = 0; i < assignedUser1.size(); i++) {
|
||||
JSONObject jsonObject = assignedUser1.getJSONObject(i);
|
||||
userIds.add(jsonObject.getString("id"));
|
||||
Set<String> startUserIds = list.stream().map(l -> l.getStartUserId()).collect(Collectors.toSet());
|
||||
if (processDefinitionId.size() > 0) {
|
||||
List<WflowModels> models = wflowModelsMapper.selectList(Wrappers.<WflowModels>lambdaQuery()
|
||||
.in(WflowModels::getProcessDefId, processDefinitionId));
|
||||
for (WflowModels model : models) {
|
||||
List<String> userIds = new ArrayList<>();
|
||||
JSONObject process = JSONObject.parseObject(model.getProcess());
|
||||
JSONArray assignedUser1 = process.getJSONObject("props").getJSONArray("assignedUser");
|
||||
if (assignedUser1 != null) {
|
||||
for (int i = 0; i < assignedUser1.size(); i++) {
|
||||
JSONObject jsonObject = assignedUser1.getJSONObject(i);
|
||||
userIds.add(jsonObject.getString("id"));
|
||||
}
|
||||
}
|
||||
getUserIds(process.getJSONObject("children"), userIds);
|
||||
if (userIds.contains(id)) {
|
||||
modelName.add(model.getFormName());
|
||||
}
|
||||
}
|
||||
getUserIds(process.getJSONObject("children"), userIds);
|
||||
if (userIds.contains(id)) {
|
||||
modelName.add(model.getFormName());
|
||||
if (modelName.size() > 0 || startUserIds.contains(id)) {
|
||||
stringBuilder.append("审批流程");
|
||||
}
|
||||
}
|
||||
if (modelName.size() > 0 || startUserIds.contains(id)) {
|
||||
stringBuilder.append("审批流程");
|
||||
}
|
||||
// 判断是否存在安全检查中
|
||||
List<XzSecurityQualityInspectionRecord> xzSecurityQualityInspectionRecords = xzSecurityQualityInspectionRecordService.list(Wrappers.<XzSecurityQualityInspectionRecord>lambdaQuery()
|
||||
.ne(XzSecurityQualityInspectionRecord::getStatus, 5)
|
||||
.ne(XzSecurityQualityInspectionRecord::getStatus, 6)
|
||||
.and(item -> item.eq(XzSecurityQualityInspectionRecord::getChangeId, id)
|
||||
.or().eq(XzSecurityQualityInspectionRecord::getReviewId, id)
|
||||
.or().eq(XzSecurityQualityInspectionRecord::getVerifyManId, id)
|
||||
.or().eq(XzSecurityQualityInspectionRecord::getInspectManId, id)));
|
||||
if (xzSecurityQualityInspectionRecords.size() > 0) {
|
||||
if (stringBuilder.length() > 10) {
|
||||
stringBuilder.append("、");
|
||||
}
|
||||
stringBuilder.append("安全检查台账");
|
||||
}
|
||||
}
|
||||
// 判断是否存在安全检查中
|
||||
List<XzSecurityQualityInspectionRecord> xzSecurityQualityInspectionRecords = xzSecurityQualityInspectionRecordService.list(Wrappers.<XzSecurityQualityInspectionRecord>lambdaQuery()
|
||||
.ne(XzSecurityQualityInspectionRecord::getStatus, 5)
|
||||
.ne(XzSecurityQualityInspectionRecord::getStatus, 6)
|
||||
.and(item -> item.eq(XzSecurityQualityInspectionRecord::getChangeId, id)
|
||||
.or().eq(XzSecurityQualityInspectionRecord::getReviewId, id)
|
||||
.or().eq(XzSecurityQualityInspectionRecord::getVerifyManId, id)
|
||||
.or().eq(XzSecurityQualityInspectionRecord::getInspectManId, id)));
|
||||
if (xzSecurityQualityInspectionRecords.size() > 0) {
|
||||
if (stringBuilder.length() > 10) {
|
||||
stringBuilder.append("、");
|
||||
// 判断是否存在质量检查中
|
||||
List<QualityInspectionRecord> qualityInspectionRecords = qualityInspectionRecordService.list(Wrappers.<QualityInspectionRecord>lambdaQuery()
|
||||
.ne(QualityInspectionRecord::getStatus, 5)
|
||||
.ne(QualityInspectionRecord::getStatus, 6)
|
||||
.and(item -> item.eq(QualityInspectionRecord::getChangeId, id)
|
||||
.or().eq(QualityInspectionRecord::getReviewId, id)
|
||||
.or().eq(QualityInspectionRecord::getVerifyManId, id)
|
||||
.or().eq(QualityInspectionRecord::getInspectManId, id)));
|
||||
if (qualityInspectionRecords.size() > 0) {
|
||||
if (stringBuilder.length() > 10) {
|
||||
stringBuilder.append("、");
|
||||
}
|
||||
stringBuilder.append("质量检查台账");
|
||||
}
|
||||
stringBuilder.append("安全检查台账");
|
||||
}
|
||||
// 判断是否存在质量检查中
|
||||
List<QualityInspectionRecord> qualityInspectionRecords = qualityInspectionRecordService.list(Wrappers.<QualityInspectionRecord>lambdaQuery()
|
||||
.ne(QualityInspectionRecord::getStatus, 5)
|
||||
.ne(QualityInspectionRecord::getStatus, 6)
|
||||
.and(item -> item.eq(QualityInspectionRecord::getChangeId, id)
|
||||
.or().eq(QualityInspectionRecord::getReviewId, id)
|
||||
.or().eq(QualityInspectionRecord::getVerifyManId, id)
|
||||
.or().eq(QualityInspectionRecord::getInspectManId, id)));
|
||||
if (qualityInspectionRecords.size() > 0) {
|
||||
if (stringBuilder.length() > 10) {
|
||||
stringBuilder.append("、");
|
||||
}
|
||||
stringBuilder.append("质量检查台账");
|
||||
}
|
||||
List<XzCheckingRoute> checkingPointList = xzCheckingRouteService.list(Wrappers.<XzCheckingRoute>lambdaQuery()
|
||||
.apply("find_in_set({0}, inspect_user_ids)", id)
|
||||
.or()
|
||||
.apply("find_in_set({0}, notice_user_ids)", id));
|
||||
label:
|
||||
for (XzCheckingRoute xzCheckingRoute : checkingPointList) {
|
||||
List<XzCheckingRouteTask> xzCheckingRouteTasks = xzCheckingRouteTaskService.list(Wrappers.<XzCheckingRouteTask>lambdaQuery()
|
||||
.eq(XzCheckingRouteTask::getXzCheckingRouteId, xzCheckingRoute.getId()));
|
||||
for (XzCheckingRouteTask xzCheckingRouteTask : xzCheckingRouteTasks) {
|
||||
List<CheckingPointInfo> checkingPointInfos = checkingPointInfoService.list(Wrappers.<CheckingPointInfo>lambdaQuery()
|
||||
.eq(CheckingPointInfo::getXzCheckingRouteTaskId, xzCheckingRouteTask.getId())
|
||||
.eq(CheckingPointInfo::getCheckingPointUserId, id));
|
||||
if (checkingPointInfos == null || checkingPointInfos.size() == 0) {
|
||||
if (stringBuilder.length() > 10) {
|
||||
stringBuilder.append("、");
|
||||
List<XzCheckingRoute> checkingPointList = xzCheckingRouteService.list(Wrappers.<XzCheckingRoute>lambdaQuery()
|
||||
.apply("find_in_set({0}, inspect_user_ids)", id)
|
||||
.or()
|
||||
.apply("find_in_set({0}, notice_user_ids)", id));
|
||||
label:
|
||||
for (XzCheckingRoute xzCheckingRoute : checkingPointList) {
|
||||
List<XzCheckingRouteTask> xzCheckingRouteTasks = xzCheckingRouteTaskService.list(Wrappers.<XzCheckingRouteTask>lambdaQuery()
|
||||
.eq(XzCheckingRouteTask::getXzCheckingRouteId, xzCheckingRoute.getId()));
|
||||
for (XzCheckingRouteTask xzCheckingRouteTask : xzCheckingRouteTasks) {
|
||||
List<CheckingPointInfo> checkingPointInfos = checkingPointInfoService.list(Wrappers.<CheckingPointInfo>lambdaQuery()
|
||||
.eq(CheckingPointInfo::getXzCheckingRouteTaskId, xzCheckingRouteTask.getId())
|
||||
.eq(CheckingPointInfo::getCheckingPointUserId, id));
|
||||
if (checkingPointInfos == null || checkingPointInfos.size() == 0) {
|
||||
if (stringBuilder.length() > 10) {
|
||||
stringBuilder.append("、");
|
||||
}
|
||||
stringBuilder.append("巡检任务");
|
||||
break label;
|
||||
}
|
||||
stringBuilder.append("巡检任务");
|
||||
break label;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (stringBuilder.length() > 10) {
|
||||
throw new CustomException(stringBuilder + ",请完成流程后再删除账号", HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
// 判断是否有参与到流程审批中
|
||||
List<WflowModels> modelList = wflowModelsMapper.selectList(null);
|
||||
modelName = new ArrayList<>();
|
||||
for (WflowModels model : modelList) {
|
||||
List<String> userIds = new ArrayList<>();
|
||||
JSONObject process = JSONObject.parseObject(model.getProcess());
|
||||
JSONArray assignedUser1 = process.getJSONObject("props").getJSONArray("assignedUser");
|
||||
if (assignedUser1 != null) {
|
||||
for (int i = 0; i < assignedUser1.size(); i++) {
|
||||
JSONObject jsonObject = assignedUser1.getJSONObject(i);
|
||||
userIds.add(jsonObject.getString("id"));
|
||||
if (stringBuilder.length() > 10) {
|
||||
throw new CustomException(stringBuilder + ",请完成流程后再删除账号", HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
// 判断是否有参与到流程审批中
|
||||
List<WflowModels> modelList = wflowModelsMapper.selectList(null);
|
||||
modelName = new ArrayList<>();
|
||||
for (WflowModels model : modelList) {
|
||||
List<String> userIds = new ArrayList<>();
|
||||
JSONObject process = JSONObject.parseObject(model.getProcess());
|
||||
JSONArray assignedUser1 = process.getJSONObject("props").getJSONArray("assignedUser");
|
||||
if (assignedUser1 != null) {
|
||||
for (int i = 0; i < assignedUser1.size(); i++) {
|
||||
JSONObject jsonObject = assignedUser1.getJSONObject(i);
|
||||
userIds.add(jsonObject.getString("id"));
|
||||
}
|
||||
}
|
||||
getUserIds(process.getJSONObject("children"), userIds);
|
||||
if (userIds.contains(id)) {
|
||||
modelName.add(model.getFormName());
|
||||
}
|
||||
}
|
||||
getUserIds(process.getJSONObject("children"), userIds);
|
||||
if (userIds.contains(id)) {
|
||||
modelName.add(model.getFormName());
|
||||
if (modelName.size() > 0) {
|
||||
throw new CustomException("该人员有参与工作流流程审批,请调整流程后再删除账号", HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
if (modelName.size() > 0) {
|
||||
throw new CustomException("该人员有参与工作流流程审批,请调整流程后再删除账号", HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
String projectSn = MapUtils.getString(map, "projectSn");
|
||||
SystemUser systemUser = getById(id);
|
||||
if (systemUser == null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user