Parcourir la source

改成取用户的真正单位code

tags/24080901
PoffyZhang il y a 1 an
Parent
révision
c4c268888e
11 fichiers modifiés avec 40 ajouts et 40 suppressions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/DashboardUserDataScopeProviderImpl.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java
  4. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  5. +11
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  6. +7
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java
  7. +7
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
  8. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java
  9. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  10. +5
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/DashboardUserDataScopeProviderImpl.java Voir le fichier

@@ -32,7 +32,7 @@ public class DashboardUserDataScopeProviderImpl implements DataScopeProvider {
public Optional<DataScopeDTO> 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);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java Voir le fichier

@@ -31,7 +31,7 @@ public class OrdinaryUserDataScopeProviderImpl implements DataScopeProvider {
public Optional<DataScopeDTO> 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);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java Voir le fichier

@@ -30,7 +30,7 @@ public class OrgAdminDataScopeProviderImpl implements DataScopeProvider {
public Optional<DataScopeDTO> 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);


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java Voir le fichier

@@ -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<Project> query = ProjectHelper.projectQuery(req);


+ 11
- 11
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java Voir le fichier

@@ -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()));
}
}



+ 7
- 7
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java Voir le fichier

@@ -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);
}

//根据提交者的区域 他是区管或者超管


+ 7
- 7
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java Voir le fichier

@@ -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<Project> 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;
}


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java Voir le fichier

@@ -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<Project> query = ProjectHelper.projectQuery(req);
List<Project> records = projectService.list(query);


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java Voir le fichier

@@ -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:
//超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员


+ 5
- 5
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Voir le fichier

@@ -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:
//超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java Voir le fichier

@@ -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;
}



Chargement…
Annuler
Enregistrer