车型库项目编辑-编辑主项目时同步修改子项目的studio
This commit is contained in:
+450
-198
@@ -468,35 +468,49 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(ProjectLibraryBase projectLibraryBase) {
|
||||
Date now = new Date();
|
||||
projectLibraryBase.setUpdateTime(now);
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
projectLibraryBase.setUpdateBy(sysUser.getUsername());
|
||||
public void editById(ProjectLibraryBase libraryBase) {
|
||||
|
||||
ProjectLibraryBase original = baseMapper.selectById(projectLibraryBase.getId());
|
||||
|
||||
// 如果studio编辑了认证工程师,需要给旧的认证工程师发送认证清单任务消息
|
||||
if(StringUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer()) && StringUtils.isNotEmpty(original.getCertificationEngineer())){
|
||||
this.editCertificationEngineer(projectLibraryBase, original);
|
||||
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
|
||||
projectLibraryBaseList.add(libraryBase);
|
||||
LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProjectLibraryBase::getParentId,libraryBase.getId());
|
||||
List<ProjectLibraryBase> libraryBaseList = this.list(wrapper);
|
||||
if(ObjectUtils.isNotEmpty(libraryBaseList)){
|
||||
for (ProjectLibraryBase libraryBaseTemp : libraryBaseList) {
|
||||
libraryBaseTemp.setStudioEngineer(libraryBase.getStudioEngineer());
|
||||
}
|
||||
projectLibraryBaseList.addAll(libraryBaseList);
|
||||
}
|
||||
|
||||
checkExitData(projectLibraryBase);
|
||||
saveOrUpdate(projectLibraryBase);
|
||||
checkVersionOrder(projectLibraryBase.getParentId(),projectLibraryBase.getProjectVersion(),projectLibraryBase.getId());
|
||||
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) {
|
||||
Date now = new Date();
|
||||
projectLibraryBase.setUpdateTime(now);
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
projectLibraryBase.setUpdateBy(sysUser.getUsername());
|
||||
|
||||
// 删除当前项目的studio与项目库 角色关系
|
||||
QueryWrapper<ProjectLibraryRoleRelEO> deleteLibraryRoleRelWrapper = new QueryWrapper<>();
|
||||
deleteLibraryRoleRelWrapper.lambda().eq(ProjectLibraryRoleRelEO::getProjectLibraryId,projectLibraryBase.getId());
|
||||
projectLibraryRoleRelEOService.remove(deleteLibraryRoleRelWrapper);
|
||||
//删除当前项目studio项目权限
|
||||
QueryWrapper<ProjectUserPermission> delStudioPermission = new QueryWrapper<>();
|
||||
delStudioPermission.eq("project_id", projectLibraryBase.getId()).eq("belong", ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue());
|
||||
projectUserPermissionService.remove(delStudioPermission);
|
||||
//删除当前项目certification engineer项目权限
|
||||
QueryWrapper<ProjectUserPermission> delCertificationPermission = new QueryWrapper<>();
|
||||
delCertificationPermission.eq("project_id", projectLibraryBase.getId()).eq("belong", ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue());
|
||||
projectUserPermissionService.remove(delCertificationPermission);
|
||||
ProjectLibraryBase original = baseMapper.selectById(projectLibraryBase.getId());
|
||||
|
||||
// 如果studio编辑了认证工程师,需要给旧的认证工程师发送认证清单任务消息
|
||||
if(StringUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer()) && StringUtils.isNotEmpty(original.getCertificationEngineer())){
|
||||
this.editCertificationEngineer(projectLibraryBase, original);
|
||||
}
|
||||
|
||||
checkExitData(projectLibraryBase);
|
||||
saveOrUpdate(projectLibraryBase);
|
||||
checkVersionOrder(projectLibraryBase.getParentId(),projectLibraryBase.getProjectVersion(),projectLibraryBase.getId());
|
||||
|
||||
// 删除当前项目的studio与项目库 角色关系
|
||||
QueryWrapper<ProjectLibraryRoleRelEO> deleteLibraryRoleRelWrapper = new QueryWrapper<>();
|
||||
deleteLibraryRoleRelWrapper.lambda().eq(ProjectLibraryRoleRelEO::getProjectLibraryId,projectLibraryBase.getId());
|
||||
projectLibraryRoleRelEOService.remove(deleteLibraryRoleRelWrapper);
|
||||
//删除当前项目studio项目权限
|
||||
QueryWrapper<ProjectUserPermission> delStudioPermission = new QueryWrapper<>();
|
||||
delStudioPermission.eq("project_id", projectLibraryBase.getId()).eq("belong", ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue());
|
||||
projectUserPermissionService.remove(delStudioPermission);
|
||||
//删除当前项目certification engineer项目权限
|
||||
QueryWrapper<ProjectUserPermission> delCertificationPermission = new QueryWrapper<>();
|
||||
delCertificationPermission.eq("project_id", projectLibraryBase.getId()).eq("belong", ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue());
|
||||
projectUserPermissionService.remove(delCertificationPermission);
|
||||
|
||||
/*// 初始化当前项目的studio与项目库 角色关系
|
||||
ProjectLibraryRoleRelEO projectLibraryRoleRelEO = new ProjectLibraryRoleRelEO();
|
||||
@@ -505,197 +519,198 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
projectLibraryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO);*/
|
||||
|
||||
List<ProjectLibraryRoleRelEO> projectLibraryRoleRelEOList = new ArrayList<>();
|
||||
//初始化当前项目的studio与项目库 法规清单 角色关系
|
||||
ProjectLibraryRoleRelEO lawsInventoryRoleRelEO = new ProjectLibraryRoleRelEO();
|
||||
lawsInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId());
|
||||
lawsInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
lawsInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
lawsInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.LAWS_INVENTORY.getValue());
|
||||
projectLibraryRoleRelEOList.add(lawsInventoryRoleRelEO);
|
||||
List<ProjectLibraryRoleRelEO> projectLibraryRoleRelEOList = new ArrayList<>();
|
||||
//初始化当前项目的studio与项目库 法规清单 角色关系
|
||||
ProjectLibraryRoleRelEO lawsInventoryRoleRelEO = new ProjectLibraryRoleRelEO();
|
||||
lawsInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId());
|
||||
lawsInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
lawsInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
lawsInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.LAWS_INVENTORY.getValue());
|
||||
projectLibraryRoleRelEOList.add(lawsInventoryRoleRelEO);
|
||||
|
||||
// 初始化当前项目的studio与项目库 认证清单 角色关系
|
||||
ProjectLibraryRoleRelEO certificationInventoryRoleRelEO = new ProjectLibraryRoleRelEO();
|
||||
certificationInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId());
|
||||
certificationInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
certificationInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
certificationInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.CERTIFICATION_INVENTORY.getValue());
|
||||
projectLibraryRoleRelEOList.add(certificationInventoryRoleRelEO);
|
||||
this.projectLibraryRoleRelEOService.saveBatch(projectLibraryRoleRelEOList);
|
||||
// 初始化当前项目的studio与项目库 认证清单 角色关系
|
||||
ProjectLibraryRoleRelEO certificationInventoryRoleRelEO = new ProjectLibraryRoleRelEO();
|
||||
certificationInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId());
|
||||
certificationInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
certificationInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
certificationInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.CERTIFICATION_INVENTORY.getValue());
|
||||
projectLibraryRoleRelEOList.add(certificationInventoryRoleRelEO);
|
||||
this.projectLibraryRoleRelEOService.saveBatch(projectLibraryRoleRelEOList);
|
||||
|
||||
//重新设置当前项目studio项目权限
|
||||
List<ProjectUserPermission> engineers = new ArrayList<>();
|
||||
ProjectUserPermission studioPermission = new ProjectUserPermission();
|
||||
studioPermission.setProjectId(projectLibraryBase.getId());
|
||||
studioPermission.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
studioPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue());
|
||||
studioPermission.setCreateTime(now);
|
||||
studioPermission.setUpdateTime(now);
|
||||
engineers.add(studioPermission);
|
||||
//重新设置当前项目certification engineer项目权限
|
||||
if (ObjectUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer())) {
|
||||
for (String certificationEngineer : projectLibraryBase.getCertificationEngineer().split(",")) {
|
||||
ProjectUserPermission certificationPermission = new ProjectUserPermission();
|
||||
certificationPermission.setProjectId(projectLibraryBase.getId());
|
||||
certificationPermission.setUserId(certificationEngineer);
|
||||
certificationPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue());
|
||||
certificationPermission.setCreateTime(now);
|
||||
certificationPermission.setUpdateTime(now);
|
||||
engineers.add(certificationPermission);
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(engineers)) {
|
||||
projectUserPermissionService.saveBatch(engineers);
|
||||
}
|
||||
|
||||
//编辑时如果认证工程师发生变化,同步修改相关人员名单中的认证工程师
|
||||
List<ProjectRelatedPersonnel> result = projectRelatedPersonnelMapper.queryPageList(projectLibraryBase.getId(),
|
||||
DictCodeEnum.DUTY_TERRITORY.getValue(), null, null, null, null,null);
|
||||
//项目的认证工程师
|
||||
String certificationEngineer = projectLibraryBase.getCertificationEngineer();
|
||||
//一个都不选的情况下
|
||||
if ("".equals(certificationEngineer)) {
|
||||
//删除当前项目的相关人员名单中认证工程师权限
|
||||
QueryWrapper<ProjectUserPermission> delWrapper = new QueryWrapper<>();
|
||||
delWrapper.eq("project_id", projectLibraryBase.getId())
|
||||
.eq("belong", ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue());
|
||||
projectUserPermissionService.remove(delWrapper);
|
||||
//删除当前项目的法规清单中认证工程师权限
|
||||
QueryWrapper<ProjectUserPermission> delLawInventoryWrapper = new QueryWrapper<>();
|
||||
delLawInventoryWrapper.eq("project_id", projectLibraryBase.getId())
|
||||
.eq("belong", ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue());
|
||||
projectUserPermissionService.remove(delLawInventoryWrapper);
|
||||
}
|
||||
//选择了其他工程师
|
||||
if(StringUtils.isNotBlank(certificationEngineer)){
|
||||
if(StringUtils.isNotEmpty(original.getCertificationEngineer())){
|
||||
for (String id : original.getCertificationEngineer().split(",")) {
|
||||
if (!certificationEngineer.contains(id)) {
|
||||
//如果原来的认证工程师被删除了,则需要同步删除当前项目的相关人员名单中该认证工程师权限
|
||||
QueryWrapper<ProjectUserPermission> delWrapper = new QueryWrapper<>();
|
||||
delWrapper.eq("project_id", projectLibraryBase.getId()).eq("user_id",id).
|
||||
eq("belong", ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue());
|
||||
projectUserPermissionService.remove(delWrapper);
|
||||
//如果原来的认证工程师被删除了,则需要同步删除当前项目的法规清单中该认证工程师权限
|
||||
QueryWrapper<ProjectUserPermission> delLawInventoryWrapper = new QueryWrapper<>();
|
||||
delLawInventoryWrapper.eq("project_id", projectLibraryBase.getId()).eq("user_id",id).
|
||||
eq("belong", ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue());
|
||||
projectUserPermissionService.remove(delLawInventoryWrapper);
|
||||
}
|
||||
//重新设置当前项目studio项目权限
|
||||
List<ProjectUserPermission> engineers = new ArrayList<>();
|
||||
ProjectUserPermission studioPermission = new ProjectUserPermission();
|
||||
studioPermission.setProjectId(projectLibraryBase.getId());
|
||||
studioPermission.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
studioPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue());
|
||||
studioPermission.setCreateTime(now);
|
||||
studioPermission.setUpdateTime(now);
|
||||
engineers.add(studioPermission);
|
||||
//重新设置当前项目certification engineer项目权限
|
||||
if (ObjectUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer())) {
|
||||
for (String certificationEngineer : projectLibraryBase.getCertificationEngineer().split(",")) {
|
||||
ProjectUserPermission certificationPermission = new ProjectUserPermission();
|
||||
certificationPermission.setProjectId(projectLibraryBase.getId());
|
||||
certificationPermission.setUserId(certificationEngineer);
|
||||
certificationPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue());
|
||||
certificationPermission.setCreateTime(now);
|
||||
certificationPermission.setUpdateTime(now);
|
||||
engineers.add(certificationPermission);
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(engineers)) {
|
||||
projectUserPermissionService.saveBatch(engineers);
|
||||
}
|
||||
|
||||
|
||||
for (ProjectRelatedPersonnel projectRelatedPersonnel : result) {
|
||||
//相关人员名单的认证工程师
|
||||
String certificationEngineerTemp = projectRelatedPersonnel.getCertificationEngineer();
|
||||
if(StringUtils.isNotBlank(certificationEngineerTemp)){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : certificationEngineerTemp.split(",")) {
|
||||
if(certificationEngineer.contains(s)){
|
||||
sb.append(s + ",");
|
||||
//编辑时如果认证工程师发生变化,同步修改相关人员名单中的认证工程师
|
||||
List<ProjectRelatedPersonnel> result = projectRelatedPersonnelMapper.queryPageList(projectLibraryBase.getId(),
|
||||
DictCodeEnum.DUTY_TERRITORY.getValue(), null, null, null, null,null);
|
||||
//项目的认证工程师
|
||||
String certificationEngineer = projectLibraryBase.getCertificationEngineer();
|
||||
//一个都不选的情况下
|
||||
if ("".equals(certificationEngineer)) {
|
||||
//删除当前项目的相关人员名单中认证工程师权限
|
||||
QueryWrapper<ProjectUserPermission> delWrapper = new QueryWrapper<>();
|
||||
delWrapper.eq("project_id", projectLibraryBase.getId())
|
||||
.eq("belong", ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue());
|
||||
projectUserPermissionService.remove(delWrapper);
|
||||
//删除当前项目的法规清单中认证工程师权限
|
||||
QueryWrapper<ProjectUserPermission> delLawInventoryWrapper = new QueryWrapper<>();
|
||||
delLawInventoryWrapper.eq("project_id", projectLibraryBase.getId())
|
||||
.eq("belong", ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue());
|
||||
projectUserPermissionService.remove(delLawInventoryWrapper);
|
||||
}
|
||||
//选择了其他工程师
|
||||
if(StringUtils.isNotBlank(certificationEngineer)){
|
||||
if(StringUtils.isNotEmpty(original.getCertificationEngineer())){
|
||||
for (String id : original.getCertificationEngineer().split(",")) {
|
||||
if (!certificationEngineer.contains(id)) {
|
||||
//如果原来的认证工程师被删除了,则需要同步删除当前项目的相关人员名单中该认证工程师权限
|
||||
QueryWrapper<ProjectUserPermission> delWrapper = new QueryWrapper<>();
|
||||
delWrapper.eq("project_id", projectLibraryBase.getId()).eq("user_id",id).
|
||||
eq("belong", ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue());
|
||||
projectUserPermissionService.remove(delWrapper);
|
||||
//如果原来的认证工程师被删除了,则需要同步删除当前项目的法规清单中该认证工程师权限
|
||||
QueryWrapper<ProjectUserPermission> delLawInventoryWrapper = new QueryWrapper<>();
|
||||
delLawInventoryWrapper.eq("project_id", projectLibraryBase.getId()).eq("user_id",id).
|
||||
eq("belong", ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue());
|
||||
projectUserPermissionService.remove(delLawInventoryWrapper);
|
||||
}
|
||||
}
|
||||
String substring = "";
|
||||
if(StringUtils.isNotBlank(sb)){
|
||||
substring = sb.substring(0, sb.length() - 1);
|
||||
}
|
||||
projectRelatedPersonnel.setCertificationEngineer(substring);
|
||||
}
|
||||
}
|
||||
//批量修改相关人员名单信息中的认证工程师
|
||||
projectRelatedPersonnelService.updateBatchById(result);
|
||||
}
|
||||
/**
|
||||
*法规清单发起任务前或任务结束后修改studio或者修改认证工程师时,
|
||||
*如果设计符合性确认、Pre-Homo确认、 验证符合性确认中的发起人跟责任人引用到了这两人,
|
||||
*而且这两个人不属于相关人员名单的工程接口人和法规工程师,同步删除这两人的权限
|
||||
*/
|
||||
|
||||
List<String> belongs = new ArrayList<>();
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_INITIATOR.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_DUTY.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_INITIATOR.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_DUTY.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_INITIATOR.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_DUTY.getValue());
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("project_library_id", projectLibraryBase.getId());
|
||||
List<ProjectLawsInventoryEO> list = projectLawsInventoryEOService.list(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(list)) {
|
||||
for (ProjectLawsInventoryEO lawsInventoryEO : list) {
|
||||
boolean boo = false;
|
||||
//发起任务前
|
||||
if (TaskAffirmStatusEnum.NOT_STARTED.getValue().equals(lawsInventoryEO.getTaskAffirmStatus())) {
|
||||
boo = true;
|
||||
}
|
||||
//任务结束后
|
||||
if (!boo) {
|
||||
int count = 0;
|
||||
QueryWrapper<ProjectTaskInventoryEO> taskInventoryQueryWrapper = new QueryWrapper<>();
|
||||
taskInventoryQueryWrapper.eq("project_laws_inventory_id",lawsInventoryEO.getId());
|
||||
List<ProjectTaskInventoryEO> taskInventoryRecords = projectTaskInventoryEOMapper.selectList(taskInventoryQueryWrapper);
|
||||
for (ProjectTaskInventoryEO taskInventoryRecord : taskInventoryRecords) {
|
||||
String designStatus = taskInventoryRecord.getDesignStatus();
|
||||
String verifyStatus = taskInventoryRecord.getVerifyStatus();
|
||||
String prehomoStatus = taskInventoryRecord.getPrehomoStatus();
|
||||
boolean designStatusFlag = StringUtils.isBlank(designStatus) || designStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
boolean verifyStatusFlag = StringUtils.isBlank(verifyStatus) || verifyStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
boolean prehomoStatusFlag = StringUtils.isBlank(prehomoStatus) || prehomoStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
if (designStatusFlag && verifyStatusFlag && prehomoStatusFlag) {
|
||||
count++;
|
||||
for (ProjectRelatedPersonnel projectRelatedPersonnel : result) {
|
||||
//相关人员名单的认证工程师
|
||||
String certificationEngineerTemp = projectRelatedPersonnel.getCertificationEngineer();
|
||||
if(StringUtils.isNotBlank(certificationEngineerTemp)){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : certificationEngineerTemp.split(",")) {
|
||||
if(certificationEngineer.contains(s)){
|
||||
sb.append(s + ",");
|
||||
}
|
||||
}
|
||||
String substring = "";
|
||||
if(StringUtils.isNotBlank(sb)){
|
||||
substring = sb.substring(0, sb.length() - 1);
|
||||
}
|
||||
projectRelatedPersonnel.setCertificationEngineer(substring);
|
||||
}
|
||||
if (count == 3) {
|
||||
}
|
||||
//批量修改相关人员名单信息中的认证工程师
|
||||
projectRelatedPersonnelService.updateBatchById(result);
|
||||
}
|
||||
/**
|
||||
*法规清单发起任务前或任务结束后修改studio或者修改认证工程师时,
|
||||
*如果设计符合性确认、Pre-Homo确认、 验证符合性确认中的发起人跟责任人引用到了这两人,
|
||||
*而且这两个人不属于相关人员名单的工程接口人和法规工程师,同步删除这两人的权限
|
||||
*/
|
||||
|
||||
List<String> belongs = new ArrayList<>();
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_INITIATOR.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_DUTY.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_INITIATOR.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_DUTY.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_INITIATOR.getValue());
|
||||
belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_DUTY.getValue());
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("project_library_id", projectLibraryBase.getId());
|
||||
List<ProjectLawsInventoryEO> list = projectLawsInventoryEOService.list(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(list)) {
|
||||
for (ProjectLawsInventoryEO lawsInventoryEO : list) {
|
||||
boolean boo = false;
|
||||
//发起任务前
|
||||
if (TaskAffirmStatusEnum.NOT_STARTED.getValue().equals(lawsInventoryEO.getTaskAffirmStatus())) {
|
||||
boo = true;
|
||||
}
|
||||
}
|
||||
if (boo) {
|
||||
QueryWrapper<ProjectRelatedPersonnel> personnelQueryWrapper = new QueryWrapper<>();
|
||||
personnelQueryWrapper.eq("duty_territory", lawsInventoryEO.getDutyTerritory()).eq("project_id", projectLibraryBase.getId());
|
||||
List<ProjectRelatedPersonnel> personnels = projectRelatedPersonnelService.list(personnelQueryWrapper);
|
||||
|
||||
if (!original.getStudioEngineer().equals(projectLibraryBase.getStudioEngineer())) {
|
||||
StringBuilder participator = new StringBuilder();
|
||||
if (ObjectUtils.isNotEmpty(personnels)) {
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) {
|
||||
participator.append(personnels.get(0).getLawEngineer() + ",");
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getCertificationEngineer())) {
|
||||
participator.append(personnels.get(0).getCertificationEngineer() + ",");
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getEngineeringInterfacePerson())) {
|
||||
participator.append(personnels.get(0).getEngineeringInterfacePerson() + ",");
|
||||
//任务结束后
|
||||
if (!boo) {
|
||||
int count = 0;
|
||||
QueryWrapper<ProjectTaskInventoryEO> taskInventoryQueryWrapper = new QueryWrapper<>();
|
||||
taskInventoryQueryWrapper.eq("project_laws_inventory_id",lawsInventoryEO.getId());
|
||||
List<ProjectTaskInventoryEO> taskInventoryRecords = projectTaskInventoryEOMapper.selectList(taskInventoryQueryWrapper);
|
||||
for (ProjectTaskInventoryEO taskInventoryRecord : taskInventoryRecords) {
|
||||
String designStatus = taskInventoryRecord.getDesignStatus();
|
||||
String verifyStatus = taskInventoryRecord.getVerifyStatus();
|
||||
String prehomoStatus = taskInventoryRecord.getPrehomoStatus();
|
||||
boolean designStatusFlag = StringUtils.isBlank(designStatus) || designStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
boolean verifyStatusFlag = StringUtils.isBlank(verifyStatus) || verifyStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
boolean prehomoStatusFlag = StringUtils.isBlank(prehomoStatus) || prehomoStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
if (designStatusFlag && verifyStatusFlag && prehomoStatusFlag) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (!participator.toString().contains(original.getStudioEngineer())) {
|
||||
//删除当前studio在法规清单中的人员权限
|
||||
QueryWrapper<ProjectUserPermission> del = new QueryWrapper<>();
|
||||
del.eq("project_id", projectLibraryBase.getId()).eq("user_id", original.getStudioEngineer()).in("belong",belongs).
|
||||
eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryEO.getId());
|
||||
projectUserPermissionService.remove(del);
|
||||
if (count == 3) {
|
||||
boo = true;
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(original.getCertificationEngineer())) {
|
||||
for (String id : original.getCertificationEngineer().split(",")) {
|
||||
if (!certificationEngineer.contains(id)) {
|
||||
StringBuilder participator = new StringBuilder();
|
||||
if (ObjectUtils.isNotEmpty(personnels)) {
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) {
|
||||
participator.append(personnels.get(0).getLawEngineer() + ",");
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getEngineeringInterfacePerson())) {
|
||||
participator.append(personnels.get(0).getEngineeringInterfacePerson() + ",");
|
||||
}
|
||||
if (boo) {
|
||||
QueryWrapper<ProjectRelatedPersonnel> personnelQueryWrapper = new QueryWrapper<>();
|
||||
personnelQueryWrapper.eq("duty_territory", lawsInventoryEO.getDutyTerritory()).eq("project_id", projectLibraryBase.getId());
|
||||
List<ProjectRelatedPersonnel> personnels = projectRelatedPersonnelService.list(personnelQueryWrapper);
|
||||
|
||||
if (!original.getStudioEngineer().equals(projectLibraryBase.getStudioEngineer())) {
|
||||
StringBuilder participator = new StringBuilder();
|
||||
if (ObjectUtils.isNotEmpty(personnels)) {
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) {
|
||||
participator.append(personnels.get(0).getLawEngineer() + ",");
|
||||
}
|
||||
participator.append(original.getStudioEngineer());
|
||||
if (!participator.toString().contains(id)) {
|
||||
//删除当前studio在法规清单中的人员权限
|
||||
QueryWrapper<ProjectUserPermission> del = new QueryWrapper<>();
|
||||
del.eq("project_id", projectLibraryBase.getId()).eq("user_id", id).in("belong",belongs).
|
||||
eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryEO.getId());
|
||||
projectUserPermissionService.remove(del);
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getCertificationEngineer())) {
|
||||
participator.append(personnels.get(0).getCertificationEngineer() + ",");
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getEngineeringInterfacePerson())) {
|
||||
participator.append(personnels.get(0).getEngineeringInterfacePerson() + ",");
|
||||
}
|
||||
}
|
||||
if (!participator.toString().contains(original.getStudioEngineer())) {
|
||||
//删除当前studio在法规清单中的人员权限
|
||||
QueryWrapper<ProjectUserPermission> del = new QueryWrapper<>();
|
||||
del.eq("project_id", projectLibraryBase.getId()).eq("user_id", original.getStudioEngineer()).in("belong",belongs).
|
||||
eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryEO.getId());
|
||||
projectUserPermissionService.remove(del);
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(original.getCertificationEngineer())) {
|
||||
for (String id : original.getCertificationEngineer().split(",")) {
|
||||
if (!certificationEngineer.contains(id)) {
|
||||
StringBuilder participator = new StringBuilder();
|
||||
if (ObjectUtils.isNotEmpty(personnels)) {
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) {
|
||||
participator.append(personnels.get(0).getLawEngineer() + ",");
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(personnels.get(0).getEngineeringInterfacePerson())) {
|
||||
participator.append(personnels.get(0).getEngineeringInterfacePerson() + ",");
|
||||
}
|
||||
}
|
||||
participator.append(original.getStudioEngineer());
|
||||
if (!participator.toString().contains(id)) {
|
||||
//删除当前studio在法规清单中的人员权限
|
||||
QueryWrapper<ProjectUserPermission> del = new QueryWrapper<>();
|
||||
del.eq("project_id", projectLibraryBase.getId()).eq("user_id", id).in("belong",belongs).
|
||||
eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryEO.getId());
|
||||
projectUserPermissionService.remove(del);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -703,8 +718,245 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// @Override
|
||||
// public void editById(ProjectLibraryBase projectLibraryBase) {
|
||||
// Date now = new Date();
|
||||
// projectLibraryBase.setUpdateTime(now);
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// projectLibraryBase.setUpdateBy(sysUser.getUsername());
|
||||
//
|
||||
// ProjectLibraryBase original = baseMapper.selectById(projectLibraryBase.getId());
|
||||
//
|
||||
// // 如果studio编辑了认证工程师,需要给旧的认证工程师发送认证清单任务消息
|
||||
// if(StringUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer()) && StringUtils.isNotEmpty(original.getCertificationEngineer())){
|
||||
// this.editCertificationEngineer(projectLibraryBase, original);
|
||||
// }
|
||||
//
|
||||
// checkExitData(projectLibraryBase);
|
||||
// saveOrUpdate(projectLibraryBase);
|
||||
// checkVersionOrder(projectLibraryBase.getParentId(),projectLibraryBase.getProjectVersion(),projectLibraryBase.getId());
|
||||
//
|
||||
// // 删除当前项目的studio与项目库 角色关系
|
||||
// QueryWrapper<ProjectLibraryRoleRelEO> deleteLibraryRoleRelWrapper = new QueryWrapper<>();
|
||||
// deleteLibraryRoleRelWrapper.lambda().eq(ProjectLibraryRoleRelEO::getProjectLibraryId,projectLibraryBase.getId());
|
||||
// projectLibraryRoleRelEOService.remove(deleteLibraryRoleRelWrapper);
|
||||
// //删除当前项目studio项目权限
|
||||
// QueryWrapper<ProjectUserPermission> delStudioPermission = new QueryWrapper<>();
|
||||
// delStudioPermission.eq("project_id", projectLibraryBase.getId()).eq("belong", ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue());
|
||||
// projectUserPermissionService.remove(delStudioPermission);
|
||||
// //删除当前项目certification engineer项目权限
|
||||
// QueryWrapper<ProjectUserPermission> delCertificationPermission = new QueryWrapper<>();
|
||||
// delCertificationPermission.eq("project_id", projectLibraryBase.getId()).eq("belong", ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue());
|
||||
// projectUserPermissionService.remove(delCertificationPermission);
|
||||
//
|
||||
// /*// 初始化当前项目的studio与项目库 角色关系
|
||||
// ProjectLibraryRoleRelEO projectLibraryRoleRelEO = new ProjectLibraryRoleRelEO();
|
||||
// projectLibraryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId());
|
||||
// projectLibraryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
// projectLibraryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
// projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO);*/
|
||||
//
|
||||
// List<ProjectLibraryRoleRelEO> projectLibraryRoleRelEOList = new ArrayList<>();
|
||||
// //初始化当前项目的studio与项目库 法规清单 角色关系
|
||||
// ProjectLibraryRoleRelEO lawsInventoryRoleRelEO = new ProjectLibraryRoleRelEO();
|
||||
// lawsInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId());
|
||||
// lawsInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
// lawsInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
// lawsInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.LAWS_INVENTORY.getValue());
|
||||
// projectLibraryRoleRelEOList.add(lawsInventoryRoleRelEO);
|
||||
//
|
||||
// // 初始化当前项目的studio与项目库 认证清单 角色关系
|
||||
// ProjectLibraryRoleRelEO certificationInventoryRoleRelEO = new ProjectLibraryRoleRelEO();
|
||||
// certificationInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId());
|
||||
// certificationInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
// certificationInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
// certificationInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.CERTIFICATION_INVENTORY.getValue());
|
||||
// projectLibraryRoleRelEOList.add(certificationInventoryRoleRelEO);
|
||||
// this.projectLibraryRoleRelEOService.saveBatch(projectLibraryRoleRelEOList);
|
||||
//
|
||||
// //重新设置当前项目studio项目权限
|
||||
// List<ProjectUserPermission> engineers = new ArrayList<>();
|
||||
// ProjectUserPermission studioPermission = new ProjectUserPermission();
|
||||
// studioPermission.setProjectId(projectLibraryBase.getId());
|
||||
// studioPermission.setUserId(projectLibraryBase.getStudioEngineer());
|
||||
// studioPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue());
|
||||
// studioPermission.setCreateTime(now);
|
||||
// studioPermission.setUpdateTime(now);
|
||||
// engineers.add(studioPermission);
|
||||
// //重新设置当前项目certification engineer项目权限
|
||||
// if (ObjectUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer())) {
|
||||
// for (String certificationEngineer : projectLibraryBase.getCertificationEngineer().split(",")) {
|
||||
// ProjectUserPermission certificationPermission = new ProjectUserPermission();
|
||||
// certificationPermission.setProjectId(projectLibraryBase.getId());
|
||||
// certificationPermission.setUserId(certificationEngineer);
|
||||
// certificationPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue());
|
||||
// certificationPermission.setCreateTime(now);
|
||||
// certificationPermission.setUpdateTime(now);
|
||||
// engineers.add(certificationPermission);
|
||||
// }
|
||||
// }
|
||||
// if (ObjectUtils.isNotEmpty(engineers)) {
|
||||
// projectUserPermissionService.saveBatch(engineers);
|
||||
// }
|
||||
//
|
||||
// //编辑时如果认证工程师发生变化,同步修改相关人员名单中的认证工程师
|
||||
// List<ProjectRelatedPersonnel> result = projectRelatedPersonnelMapper.queryPageList(projectLibraryBase.getId(),
|
||||
// DictCodeEnum.DUTY_TERRITORY.getValue(), null, null, null, null,null);
|
||||
// //项目的认证工程师
|
||||
// String certificationEngineer = projectLibraryBase.getCertificationEngineer();
|
||||
// //一个都不选的情况下
|
||||
// if ("".equals(certificationEngineer)) {
|
||||
// //删除当前项目的相关人员名单中认证工程师权限
|
||||
// QueryWrapper<ProjectUserPermission> delWrapper = new QueryWrapper<>();
|
||||
// delWrapper.eq("project_id", projectLibraryBase.getId())
|
||||
// .eq("belong", ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue());
|
||||
// projectUserPermissionService.remove(delWrapper);
|
||||
// //删除当前项目的法规清单中认证工程师权限
|
||||
// QueryWrapper<ProjectUserPermission> delLawInventoryWrapper = new QueryWrapper<>();
|
||||
// delLawInventoryWrapper.eq("project_id", projectLibraryBase.getId())
|
||||
// .eq("belong", ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue());
|
||||
// projectUserPermissionService.remove(delLawInventoryWrapper);
|
||||
// }
|
||||
// //选择了其他工程师
|
||||
// if(StringUtils.isNotBlank(certificationEngineer)){
|
||||
// if(StringUtils.isNotEmpty(original.getCertificationEngineer())){
|
||||
// for (String id : original.getCertificationEngineer().split(",")) {
|
||||
// if (!certificationEngineer.contains(id)) {
|
||||
// //如果原来的认证工程师被删除了,则需要同步删除当前项目的相关人员名单中该认证工程师权限
|
||||
// QueryWrapper<ProjectUserPermission> delWrapper = new QueryWrapper<>();
|
||||
// delWrapper.eq("project_id", projectLibraryBase.getId()).eq("user_id",id).
|
||||
// eq("belong", ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue());
|
||||
// projectUserPermissionService.remove(delWrapper);
|
||||
// //如果原来的认证工程师被删除了,则需要同步删除当前项目的法规清单中该认证工程师权限
|
||||
// QueryWrapper<ProjectUserPermission> delLawInventoryWrapper = new QueryWrapper<>();
|
||||
// delLawInventoryWrapper.eq("project_id", projectLibraryBase.getId()).eq("user_id",id).
|
||||
// eq("belong", ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue());
|
||||
// projectUserPermissionService.remove(delLawInventoryWrapper);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// for (ProjectRelatedPersonnel projectRelatedPersonnel : result) {
|
||||
// //相关人员名单的认证工程师
|
||||
// String certificationEngineerTemp = projectRelatedPersonnel.getCertificationEngineer();
|
||||
// if(StringUtils.isNotBlank(certificationEngineerTemp)){
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// for (String s : certificationEngineerTemp.split(",")) {
|
||||
// if(certificationEngineer.contains(s)){
|
||||
// sb.append(s + ",");
|
||||
// }
|
||||
// }
|
||||
// String substring = "";
|
||||
// if(StringUtils.isNotBlank(sb)){
|
||||
// substring = sb.substring(0, sb.length() - 1);
|
||||
// }
|
||||
// projectRelatedPersonnel.setCertificationEngineer(substring);
|
||||
// }
|
||||
// }
|
||||
// //批量修改相关人员名单信息中的认证工程师
|
||||
// projectRelatedPersonnelService.updateBatchById(result);
|
||||
// }
|
||||
// /**
|
||||
// *法规清单发起任务前或任务结束后修改studio或者修改认证工程师时,
|
||||
// *如果设计符合性确认、Pre-Homo确认、 验证符合性确认中的发起人跟责任人引用到了这两人,
|
||||
// *而且这两个人不属于相关人员名单的工程接口人和法规工程师,同步删除这两人的权限
|
||||
// */
|
||||
//
|
||||
// List<String> belongs = new ArrayList<>();
|
||||
// belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_INITIATOR.getValue());
|
||||
// belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_DUTY.getValue());
|
||||
// belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_INITIATOR.getValue());
|
||||
// belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_DUTY.getValue());
|
||||
// belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_INITIATOR.getValue());
|
||||
// belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_DUTY.getValue());
|
||||
//
|
||||
// QueryWrapper<ProjectLawsInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.eq("project_library_id", projectLibraryBase.getId());
|
||||
// List<ProjectLawsInventoryEO> list = projectLawsInventoryEOService.list(queryWrapper);
|
||||
// if (ObjectUtils.isNotEmpty(list)) {
|
||||
// for (ProjectLawsInventoryEO lawsInventoryEO : list) {
|
||||
// boolean boo = false;
|
||||
// //发起任务前
|
||||
// if (TaskAffirmStatusEnum.NOT_STARTED.getValue().equals(lawsInventoryEO.getTaskAffirmStatus())) {
|
||||
// boo = true;
|
||||
// }
|
||||
// //任务结束后
|
||||
// if (!boo) {
|
||||
// int count = 0;
|
||||
// QueryWrapper<ProjectTaskInventoryEO> taskInventoryQueryWrapper = new QueryWrapper<>();
|
||||
// taskInventoryQueryWrapper.eq("project_laws_inventory_id",lawsInventoryEO.getId());
|
||||
// List<ProjectTaskInventoryEO> taskInventoryRecords = projectTaskInventoryEOMapper.selectList(taskInventoryQueryWrapper);
|
||||
// for (ProjectTaskInventoryEO taskInventoryRecord : taskInventoryRecords) {
|
||||
// String designStatus = taskInventoryRecord.getDesignStatus();
|
||||
// String verifyStatus = taskInventoryRecord.getVerifyStatus();
|
||||
// String prehomoStatus = taskInventoryRecord.getPrehomoStatus();
|
||||
// boolean designStatusFlag = StringUtils.isBlank(designStatus) || designStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
// boolean verifyStatusFlag = StringUtils.isBlank(verifyStatus) || verifyStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
// boolean prehomoStatusFlag = StringUtils.isBlank(prehomoStatus) || prehomoStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
// if (designStatusFlag && verifyStatusFlag && prehomoStatusFlag) {
|
||||
// count++;
|
||||
// }
|
||||
// }
|
||||
// if (count == 3) {
|
||||
// boo = true;
|
||||
// }
|
||||
// }
|
||||
// if (boo) {
|
||||
// QueryWrapper<ProjectRelatedPersonnel> personnelQueryWrapper = new QueryWrapper<>();
|
||||
// personnelQueryWrapper.eq("duty_territory", lawsInventoryEO.getDutyTerritory()).eq("project_id", projectLibraryBase.getId());
|
||||
// List<ProjectRelatedPersonnel> personnels = projectRelatedPersonnelService.list(personnelQueryWrapper);
|
||||
//
|
||||
// if (!original.getStudioEngineer().equals(projectLibraryBase.getStudioEngineer())) {
|
||||
// StringBuilder participator = new StringBuilder();
|
||||
// if (ObjectUtils.isNotEmpty(personnels)) {
|
||||
// if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) {
|
||||
// participator.append(personnels.get(0).getLawEngineer() + ",");
|
||||
// }
|
||||
// if (ObjectUtils.isNotEmpty(personnels.get(0).getCertificationEngineer())) {
|
||||
// participator.append(personnels.get(0).getCertificationEngineer() + ",");
|
||||
// }
|
||||
// if (ObjectUtils.isNotEmpty(personnels.get(0).getEngineeringInterfacePerson())) {
|
||||
// participator.append(personnels.get(0).getEngineeringInterfacePerson() + ",");
|
||||
// }
|
||||
// }
|
||||
// if (!participator.toString().contains(original.getStudioEngineer())) {
|
||||
// //删除当前studio在法规清单中的人员权限
|
||||
// QueryWrapper<ProjectUserPermission> del = new QueryWrapper<>();
|
||||
// del.eq("project_id", projectLibraryBase.getId()).eq("user_id", original.getStudioEngineer()).in("belong",belongs).
|
||||
// eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryEO.getId());
|
||||
// projectUserPermissionService.remove(del);
|
||||
// }
|
||||
// }
|
||||
// if (ObjectUtils.isNotEmpty(original.getCertificationEngineer())) {
|
||||
// for (String id : original.getCertificationEngineer().split(",")) {
|
||||
// if (!certificationEngineer.contains(id)) {
|
||||
// StringBuilder participator = new StringBuilder();
|
||||
// if (ObjectUtils.isNotEmpty(personnels)) {
|
||||
// if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) {
|
||||
// participator.append(personnels.get(0).getLawEngineer() + ",");
|
||||
// }
|
||||
// if (ObjectUtils.isNotEmpty(personnels.get(0).getEngineeringInterfacePerson())) {
|
||||
// participator.append(personnels.get(0).getEngineeringInterfacePerson() + ",");
|
||||
// }
|
||||
// }
|
||||
// participator.append(original.getStudioEngineer());
|
||||
// if (!participator.toString().contains(id)) {
|
||||
// //删除当前studio在法规清单中的人员权限
|
||||
// QueryWrapper<ProjectUserPermission> del = new QueryWrapper<>();
|
||||
// del.eq("project_id", projectLibraryBase.getId()).eq("user_id", id).in("belong",belongs).
|
||||
// eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryEO.getId());
|
||||
// projectUserPermissionService.remove(del);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* 编辑认证工程师逻辑处理
|
||||
|
||||
Reference in New Issue
Block a user