From c4c268888e3b05823ab8af55960901e4ff913259 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 14 Apr 2023 10:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E6=88=90=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=9A=84=E7=9C=9F=E6=AD=A3=E5=8D=95=E4=BD=8Dcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DashboardUserDataScopeProviderImpl.java | 2 +- .../impl/OrdinaryUserDataScopeProviderImpl.java | 2 +- .../impl/OrgAdminDataScopeProviderImpl.java | 2 +- .../manage/ConstructionPlanManage.java | 4 ++-- .../manage/DeclaredProjectManage.java | 22 +++++++++++----------- .../manage/DefaultDeclaredProjectManage.java | 14 +++++++------- .../PrequalificationDeclaredProjectManage.java | 14 +++++++------- .../manage/ProjectAdjustmentManage.java | 4 ++-- .../projectlib/manage/AnnualPlanLibManage.java | 4 ++-- .../pmapi/projectlib/manage/ProjectLibManage.java | 10 +++++----- .../pmapi/todocenter/handle/WithDrawHandle.java | 2 +- 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/DashboardUserDataScopeProviderImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/DashboardUserDataScopeProviderImpl.java index 21c28f2..cae0e2a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/DashboardUserDataScopeProviderImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/DashboardUserDataScopeProviderImpl.java @@ -32,7 +32,7 @@ public class DashboardUserDataScopeProviderImpl implements DataScopeProvider { public Optional findDataFieldProperty() { UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); DataScopeDTO ds = new DataScopeDTO(); - ds.setEmployeeCode(userFullInfo.getOrganizationCode()); + ds.setEmployeeCode(userFullInfo.getEmployeeCode()); ds.setRegionCodes(Lists.newArrayList(userFullInfo.getRegionCode())); ds.setUserId(userFullInfo.getUserId()); ds.setRole(RoleEnum.DASHBOARD); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java index 2cb1565..e8c8b11 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java @@ -31,7 +31,7 @@ public class OrdinaryUserDataScopeProviderImpl implements DataScopeProvider { public Optional findDataFieldProperty() { UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); DataScopeDTO ds = new DataScopeDTO(); - ds.setEmployeeCode(userFullInfo.getOrganizationCode()); + ds.setEmployeeCode(userFullInfo.getEmployeeCode()); ds.setRegionCodes(Lists.newArrayList(userFullInfo.getRegionCode())); ds.setUserId(userFullInfo.getUserId()); ds.setRole(RoleEnum.NORMAL_MEMBER); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java index 03c2ea6..7bcfb21 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java @@ -30,7 +30,7 @@ public class OrgAdminDataScopeProviderImpl implements DataScopeProvider { public Optional findDataFieldProperty() { UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); DataScopeDTO ds = new DataScopeDTO(); - ds.setOrgCode(userFullInfo.getOrganizationCode()); + ds.setOrgCode(userFullInfo.getEmpPosUnitCode()); ds.setUserId(userFullInfo.getUserId()); ds.setEmployeeCode(userFullInfo.getEmployeeCode()); ds.setRole(RoleEnum.COMPANY_MANAGER); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java index d252054..5134c96 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java @@ -205,7 +205,7 @@ public class ConstructionPlanManage { UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); //放入用户的单位 - req.setBuildOrgCode(user.getOrganizationCode()); + req.setBuildOrgCode(user.getEmpPosUnitCode()); return projectLibManage.projectLibList(req); } @@ -219,7 +219,7 @@ public class ConstructionPlanManage { UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); //放入用户的单位 - req.setBuildOrgCode(user.getOrganizationCode()); + req.setBuildOrgCode(user.getEmpPosUnitCode()); req.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); req.setPageSize(CommonConst.EXPORT_PAGE_SIZE); LambdaQueryWrapper query = ProjectHelper.projectQuery(req); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index 4850981..5b26800 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -122,8 +122,8 @@ public class DeclaredProjectManage { projectInfo.setArea(regionCacheHelper.getRegionName(user.getRegionCode(), RegionConst.RL_COUNTY)); } - projectInfo.setBuildOrgCode(user.getOrganizationCode()); - projectInfo.setBuildOrgName(user.getOrganizationName()); + projectInfo.setBuildOrgCode(user.getEmpPosUnitCode()); + projectInfo.setBuildOrgName(user.getEmpPosUnitName()); //项目名称去重 defaultDeclaredProjectManage.checkDuplication(projectInfo); @@ -132,8 +132,8 @@ public class DeclaredProjectManage { //如果主管单位没有 那么主管单位就是自己 if(CommonEnum.NO.getCode().equals(projectInfo.getIsSuperOrg())){ - projectInfo.setSuperOrgCode(user.getOrganizationCode()); - projectInfo.setSuperOrg(user.getOrganizationName()); + projectInfo.setSuperOrgCode(user.getEmpPosUnitCode()); + projectInfo.setSuperOrg(user.getEmpPosUnitName()); } //如果是重新提交的话 判断下 项目是否存在 @@ -198,8 +198,8 @@ public class DeclaredProjectManage { ProjectDTO projectDto = dto.getProjectInfo(); projectDto.setAreaCode(user.getRegionCode()); projectDto.setArea(regionCacheHelper.getRegionName(user.getRegionCode(), RegionConst.RL_COUNTY)); - projectDto.setBuildOrgCode(user.getOrganizationCode()); - projectDto.setBuildOrgName(user.getOrganizationName()); + projectDto.setBuildOrgCode(user.getEmpPosUnitCode()); + projectDto.setBuildOrgName(user.getEmpPosUnitName()); VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); Project projectInfo = projectService.getById(projectDto.getId()); @@ -352,8 +352,8 @@ public class DeclaredProjectManage { ProjectDraft draft = new ProjectDraft(); BeanUtils.copyProperties(projectInfo, draft); draft.setUserId(String.valueOf(userId)); - draft.setBuildOrgCode(user.getOrganizationCode()); - draft.setBuildOrgName(user.getOrganizationName()); + draft.setBuildOrgCode(user.getEmpPosUnitCode()); + draft.setBuildOrgName(user.getEmpPosUnitName()); draft.setAreaCode(user.getRegionCode()); if(CollUtil.isNotEmpty(projectInfo.getDynamicForm())){ @@ -412,11 +412,11 @@ public class DeclaredProjectManage { //如果当前登录是单位管理员 if(user.getIsOrgAdmin()){ query.and(s1 -> s1.eq(Project::getStatus,ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()) - .eq(Project::getSuperOrgCode,user.getOrganizationCode()) - .or(q2 -> q2.eq(Project::getBuildOrgCode,user.getOrganizationCode()))); + .eq(Project::getSuperOrgCode,user.getEmpPosUnitCode()) + .or(q2 -> q2.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()))); }else{ //否则 只能看到 非预审 并且 - query.and(q2 -> q2.eq(Project::getBuildOrgCode,user.getOrganizationCode())); + query.and(q2 -> q2.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode())); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java index 92092eb..ed0bcc5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java @@ -105,8 +105,8 @@ public class DefaultDeclaredProjectManage { return ProcessInstanceUserDto.builder() .userId(String.valueOf(userInfoDetail.getEmployeeCode())) .userName(userInfoDetail.getRealName()) - .orgCode(userInfoDetail.getOrganizationCode()) - .orgName(userInfoDetail.getOrganizationName()) + .orgCode(userInfoDetail.getEmpPosUnitCode()) + .orgName(userInfoDetail.getEmpPosUnitName()) .build(); } @@ -121,10 +121,10 @@ public class DefaultDeclaredProjectManage { log.warn("取不到员工 返回空map"); return Collections.emptyMap(); } - DingOrganization startOrg = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) - .eq(DingOrganization::getOrganizationCode, userFullInfo.getOrganizationCode())); - String startOrgCode = startOrg.getOrganizationCode(); - String startOrgName = startOrg.getOrganizationName(); + + UserFullInfoDTO startUser = userInfoHelper.getUserFullInfo(userFullInfo.getUserId()); + String startOrgCode = startUser.getEmpPosUnitCode(); + String startOrgName = startUser.getEmpPosUnitName(); String startOrgParentCode; String startOrgParentName; // 如果申报时 上级主管单位,由该单位自己审核 @@ -187,7 +187,7 @@ public class DefaultDeclaredProjectManage { public DeclaredProjectStatisticsPO declaredProjectOrgStatistics(Integer year){ UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); //查此人建设单位的项目 - return statisticsService.getOrgStatistics(user.getOrganizationCode(),year); + return statisticsService.getOrgStatistics(user.getEmpPosUnitCode(),year); } //根据提交者的区域 他是区管或者超管 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java index be065fe..9880632 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java @@ -100,9 +100,9 @@ public class PrequalificationDeclaredProjectManage { VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); //要判断 当前操作人 是不是项目主管单位的人 - VUtils.isTrue(Objects.isNull(user.getOrganizationCode())) + VUtils.isTrue(Objects.isNull(user.getEmpPosUnitCode())) .throwMessage(String.format("当前登录人没有单位 【%s】",user.getRealName())); - VUtils.isTrue(!user.getOrganizationCode().equals(projectInfo.getSuperOrgCode())) + VUtils.isTrue(!user.getEmpPosUnitCode().equals(projectInfo.getSuperOrgCode())) .throwMessage(String.format("只有主管单位 【%s】的人 才能够提交",projectInfo.getSuperOrg())); //首先要判断 项目当前状态 是不是 待预审 @@ -264,8 +264,8 @@ public class PrequalificationDeclaredProjectManage { if(user.getIsOrgAdmin() && (ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus()) || ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode().equals(item.getStatus())) - && StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(user.getOrganizationCode()) - && w.getSuperOrgCode().equals(user.getOrganizationCode())){ + && StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(user.getEmpPosUnitCode()) + && w.getSuperOrgCode().equals(user.getEmpPosUnitCode())){ item.setCanPreDeclared(Boolean.TRUE); } return item; @@ -280,13 +280,13 @@ public class PrequalificationDeclaredProjectManage { public UserFullInfoDTO buildPermission(LambdaQueryWrapper query,UserFullInfoDTO user){ if(user.getIsOrgAdmin()){ //单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目 - query.and(q1 -> q1.eq(Project::getBuildOrgCode ,user.getOrganizationCode()) + query.and(q1 -> q1.eq(Project::getBuildOrgCode ,user.getEmpPosUnitCode()) .or(q2 -> q2.eq(Project::getStage,ProjectStatusEnum.NOT_APPROVED.getCode()) .and(s1 -> s1.eq(Project::getStatus,ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()) .or(s2 -> s2.eq(Project::getStatus,ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()))) - .eq(Project::getSuperOrgCode,user.getOrganizationCode()))); + .eq(Project::getSuperOrgCode,user.getEmpPosUnitCode()))); }else{ - query.eq(Project::getBuildOrgCode ,user.getOrganizationCode()); + query.eq(Project::getBuildOrgCode ,user.getEmpPosUnitCode()); } return user; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java index 0dd30c2..d782a49 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java @@ -152,7 +152,7 @@ public class ProjectAdjustmentManage { UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); //放入用户的单位 - req.setBuildOrgCode(user.getOrganizationCode()); + req.setBuildOrgCode(user.getEmpPosUnitCode()); return projectLibManage.projectLibList(req); } @@ -170,7 +170,7 @@ public class ProjectAdjustmentManage { UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); //放入用户的单位 - req.setBuildOrgCode(user.getOrganizationCode()); + req.setBuildOrgCode(user.getEmpPosUnitCode()); LambdaQueryWrapper query = ProjectHelper.projectQuery(req); List records = projectService.list(query); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index ab7cb14..9432ab3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -284,11 +284,11 @@ public class AnnualPlanLibManage { switch (currentUserDataScope.get().getRole()) { case NORMAL_MEMBER: //普通用户 只能看到自己单位去申报的 - query.eq(Project::getBuildOrgCode, user.getOrganizationCode()); + query.eq(Project::getBuildOrgCode, user.getEmpPosUnitCode()); break; case COMPANY_MANAGER: //单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目 - query.eq(Project::getBuildOrgCode, user.getOrganizationCode()); + query.eq(Project::getBuildOrgCode, user.getEmpPosUnitCode()); break; case SUPER_ADMIN: //超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 8777e91..5013125 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -118,8 +118,8 @@ public class ProjectLibManage { item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); if (user.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus()) - && StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(user.getOrganizationCode()) - && w.getSuperOrgCode().equals(user.getOrganizationCode())) { + && StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(user.getEmpPosUnitCode()) + && w.getSuperOrgCode().equals(user.getEmpPosUnitCode())) { item.setCanPreDeclared(Boolean.TRUE); } return item; @@ -237,14 +237,14 @@ public class ProjectLibManage { switch (currentUserDataScope.get().getRole()) { case NORMAL_MEMBER: //普通用户 只能看到自己单位去申报的 - query.eq(Project::getBuildOrgCode, user.getOrganizationCode()); + query.eq(Project::getBuildOrgCode, user.getEmpPosUnitCode()); break; case COMPANY_MANAGER: //单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目 - query.and(q1 -> q1.eq(Project::getBuildOrgCode, user.getOrganizationCode()).or(q2 -> + query.and(q1 -> q1.eq(Project::getBuildOrgCode, user.getEmpPosUnitCode()).or(q2 -> q2.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode()) .eq(Project::getStatus, ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()) - .eq(Project::getSuperOrgCode, user.getOrganizationCode()))); + .eq(Project::getSuperOrgCode, user.getEmpPosUnitCode()))); break; case SUPER_ADMIN: //超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java index d74d5d2..1c4a134 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java @@ -108,7 +108,7 @@ public class WithDrawHandle { // 判断当前工作流任务前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常 // 获取当前当前工作流任务当前审核人信息 UserFullInfoDTO currentUserInfo = userInfoHelper.getUserFullInfoByEmployeeCode(currentProgressNode.getUserId()); - if(!currentUserInfo.getOrganizationCode().equals(user.getOrganizationCode())){ + if(!currentUserInfo.getEmpPosUnitCode().equals(user.getEmpPosUnitCode())){ return Boolean.FALSE; }