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 6dbe71e..3ef3a57 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 @@ -19,6 +19,7 @@ import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.StrPool; import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.enumeration.CommonEnum; +import com.ningdatech.pmapi.common.helper.RegionCacheHelper; import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; @@ -89,6 +90,7 @@ public class AnnualPlanLibManage { private final INdProjectStatusChangeService statusChangeService; private final UserInfoHelper userInfoHelper; private final IProjectRenewalFundDeclarationService projectRenewalFundDeclarationService; + private final RegionCacheHelper regionCacheHelper; /** * 年度计划查询状态 @@ -306,6 +308,31 @@ public class AnnualPlanLibManage { } private void assemblyProjectInfo(AnnualLibImportDTO data, Project project) { + Long projectId = data.getProjectId(); + // 从项目库中先查询出对应的项目ID的项目 + Project projectInfo = projectService.getById(projectId); + if (Objects.nonNull(projectInfo)){ + BeanUtils.copyProperties(projectInfo,project); + }else { + // 新增的年度计划库项目 + log.info("项目库中不存在项目ID为:" + projectId + "的项目"); + Long userId = LoginUserUtil.getUserId(); + UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); + + String regionCode = userFullInfo.getRegionCode(); + Integer regionLevel = userFullInfo.getRegionLevel(); + String regionName = regionCacheHelper.getRegionName(regionCode, regionLevel); + project.setAreaCode(regionCode); + project.setArea(regionName); + project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); + project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); + project.setSponsor(userFullInfo.getEmployeeCode()); + project.setBuildOrgName(userFullInfo.getEmpPosUnitName()); + project.setResponsibleMan(userFullInfo.getRealName()); + project.setResponsibleManMobile(userFullInfo.getMobile()); + project.setContactName(userFullInfo.getRealName()); + project.setContactPhone(userFullInfo.getMobile()); + } project.setId(data.getProjectId()); project.setProjectName(data.getProjectName()); project.setProjectIntroduction(data.getProjectIntroduction()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java index 1dd3e35..50a4ce3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java @@ -173,6 +173,7 @@ public class UserAuthLoginManage { userFullInfoDTO.setRealName(userInfo.getRealName()); userFullInfoDTO.setEmployeeCode(employeeCode); userFullInfoDTO.setUsername(userInfo.getRealName()); + userFullInfoDTO.setMobile(userInfo.getMobile()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java index d26d63e..5482f45 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java @@ -47,6 +47,11 @@ public class UserFullInfoDTO { private String organizationCode; /** + * 手机号码 + */ + private String mobile; + + /** * 浙政钉组织名称 */ private String organizationName;