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