@@ -1,6 +1,7 @@ | |||||
package com.ningdatech.pmapi.common.helper; | package com.ningdatech.pmapi.common.helper; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
/** | /** | ||||
@@ -29,4 +30,6 @@ public interface UserInfoHelper { | |||||
* @return | * @return | ||||
*/ | */ | ||||
boolean isSuperOrRegionAdmin(Long userId); | boolean isSuperOrRegionAdmin(Long userId); | ||||
UserFullInfoDTO getUserFullInfoByEmployeeCode(String employeeCode); | |||||
} | } |
@@ -54,4 +54,10 @@ public class UserInfoHelperImpl implements UserInfoHelper { | |||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
} | } | ||||
@Override | |||||
public UserFullInfoDTO getUserFullInfoByEmployeeCode(String employeeCode) { | |||||
UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfoByEmployeeCode(employeeCode); | |||||
return userFullInfo; | |||||
} | |||||
} | } |
@@ -94,8 +94,8 @@ public class ConstructionPlanManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public String startTheProcess(DefaultDeclaredDTO dto) { | public String startTheProcess(DefaultDeclaredDTO dto) { | ||||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | ||||
Long userId = userInfoDetails.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userInfoDetails) ||Objects.isNull(userInfoDetails.getUserId())) | |||||
String employeeCode = userInfoDetails.getEmployeeCode(); | |||||
VUtils.isTrue(Objects.isNull(userInfoDetails) ||Objects.isNull(employeeCode)) | |||||
.throwMessage("获取登录用户失败!"); | .throwMessage("获取登录用户失败!"); | ||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
@@ -122,7 +122,7 @@ public class ConstructionPlanManage { | |||||
.throwMessage("提交失败 该项目不是 方案待申报状态或者未立项阶段"); | .throwMessage("提交失败 该项目不是 方案待申报状态或者未立项阶段"); | ||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
params.setUser(declaredProjectManage.buildUser(userId)); | |||||
params.setUser(declaredProjectManage.buildUser(employeeCode)); | |||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | ||||
@@ -133,7 +133,7 @@ public class ConstructionPlanManage { | |||||
); | ); | ||||
params.setFormData(dto.getFormData()); | params.setFormData(dto.getFormData()); | ||||
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 | ||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(userId,projectInfo); | |||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,projectInfo); | |||||
String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | ||||
log.info("建设方案项目申报成功 【{}】", instanceId); | log.info("建设方案项目申报成功 【{}】", instanceId); | ||||
@@ -152,7 +152,7 @@ public class ConstructionPlanManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public String restartTheProcess(DefaultDeclaredDTO dto) { | public String restartTheProcess(DefaultDeclaredDTO dto) { | ||||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | ||||
VUtils.isTrue(Objects.isNull(userInfoDetails) ||Objects.isNull(userInfoDetails.getUserId())) | |||||
VUtils.isTrue(Objects.isNull(userInfoDetails) ||Objects.isNull(userInfoDetails.getEmployeeCode())) | |||||
.throwMessage("获取登录用户失败!"); | .throwMessage("获取登录用户失败!"); | ||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
@@ -207,11 +207,10 @@ public class ConstructionPlanManage { | |||||
//项目阶段 状态 已定 方案待申报 | //项目阶段 状态 已定 方案待申报 | ||||
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | ||||
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | ||||
Long userId = LoginUserUtil.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||||
//放入用户的单位 | //放入用户的单位 | ||||
req.setBuildOrgCode(userFullInfo.getOrganizationCode()); | |||||
req.setBuildOrgCode(user.getOrganizationCode()); | |||||
return projectLibManage.projectLibList(req); | return projectLibManage.projectLibList(req); | ||||
} | } | ||||
@@ -222,11 +221,10 @@ public class ConstructionPlanManage { | |||||
//项目阶段 状态 已定 方案待申报 | //项目阶段 状态 已定 方案待申报 | ||||
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | ||||
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | ||||
Long userId = LoginUserUtil.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||||
//放入用户的单位 | //放入用户的单位 | ||||
req.setBuildOrgCode(userFullInfo.getOrganizationCode()); | |||||
req.setBuildOrgCode(user.getOrganizationCode()); | |||||
req.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | req.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | ||||
req.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | req.setPageSize(CommonConst.EXPORT_PAGE_SIZE); | ||||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | ||||
@@ -109,8 +109,8 @@ public class DeclaredProjectManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public String startTheProcess(DefaultDeclaredDTO dto) { | public String startTheProcess(DefaultDeclaredDTO dto) { | ||||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | ||||
Long userId = userInfoDetails.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
String employeeCode = userInfoDetails.getEmployeeCode(); | |||||
VUtils.isTrue(StringUtils.isBlank(employeeCode)).throwMessage("获取登录用户 员工号 失败!"); | |||||
ProjectDTO projectInfo = dto.getProjectInfo(); | ProjectDTO projectInfo = dto.getProjectInfo(); | ||||
@@ -152,7 +152,7 @@ public class DeclaredProjectManage { | |||||
} | } | ||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
params.setUser(defaultDeclaredProjectManage.buildUser(userId)); | |||||
params.setUser(defaultDeclaredProjectManage.buildUser(employeeCode)); | |||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | ||||
@@ -166,12 +166,12 @@ public class DeclaredProjectManage { | |||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | ||||
Project project = new Project(); | Project project = new Project(); | ||||
BeanUtils.copyProperties(projectInfo,project); | BeanUtils.copyProperties(projectInfo,project); | ||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(userId,project); | |||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,project); | |||||
String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | ||||
log.info("申报项目成功 【{}】", instanceId); | log.info("申报项目成功 【{}】", instanceId); | ||||
//如果是重新提交的话 判断下 项目是否存在 | //如果是重新提交的话 判断下 项目是否存在 | ||||
if(saveOrUpdateProject(projectInfo, instanceId,userId) && Objects.nonNull(projectInfo.getDraftId())){ | |||||
if(saveOrUpdateProject(projectInfo, instanceId,employeeCode) && Objects.nonNull(projectInfo.getDraftId())){ | |||||
//如果是草稿箱提交 删除对应的草稿箱 | //如果是草稿箱提交 删除对应的草稿箱 | ||||
projectDraftService.removeById(projectInfo.getDraftId()); | projectDraftService.removeById(projectInfo.getDraftId()); | ||||
} | } | ||||
@@ -189,9 +189,9 @@ public class DeclaredProjectManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public String reStartTheProcess(DefaultDeclaredDTO dto) { | public String reStartTheProcess(DefaultDeclaredDTO dto) { | ||||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | ||||
VUtils.isTrue(Objects.isNull(userInfoDetails) || Objects.isNull(userInfoDetails.getUserId())) | |||||
VUtils.isTrue(Objects.isNull(userInfoDetails) || Objects.isNull(userInfoDetails.getEmployeeCode())) | |||||
.throwMessage("获取登录用户失败!"); | .throwMessage("获取登录用户失败!"); | ||||
Long userId = userInfoDetails.getUserId(); | |||||
String employeeCode = userInfoDetails.getEmployeeCode(); | |||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
projectDto.setAreaCode(userInfoDetails.getRegionCode()); | projectDto.setAreaCode(userInfoDetails.getRegionCode()); | ||||
projectDto.setArea(regionCacheHelper.getRegionName(userInfoDetails.getRegionCode(), RegionConst.RL_COUNTY)); | projectDto.setArea(regionCacheHelper.getRegionName(userInfoDetails.getRegionCode(), RegionConst.RL_COUNTY)); | ||||
@@ -224,7 +224,7 @@ public class DeclaredProjectManage { | |||||
.throwMessage("提交失败 该项目不是 单位内部拒绝审核状态或者未立项阶段"); | .throwMessage("提交失败 该项目不是 单位内部拒绝审核状态或者未立项阶段"); | ||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
params.setUser(defaultDeclaredProjectManage.buildUser(userId)); | |||||
params.setUser(defaultDeclaredProjectManage.buildUser(employeeCode)); | |||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | ||||
@@ -237,12 +237,12 @@ public class DeclaredProjectManage { | |||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | ||||
Project project = new Project(); | Project project = new Project(); | ||||
BeanUtils.copyProperties(projectInfo,project); | BeanUtils.copyProperties(projectInfo,project); | ||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(userId,project); | |||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,project); | |||||
String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | ||||
log.info("重新申报项目成功 【{}】", instanceId); | log.info("重新申报项目成功 【{}】", instanceId); | ||||
//保存项目 | //保存项目 | ||||
saveOrUpdateProject(projectDto,instanceId,userId); | |||||
saveOrUpdateProject(projectDto,instanceId,employeeCode); | |||||
return instanceId; | return instanceId; | ||||
} | } | ||||
@@ -254,7 +254,7 @@ public class DeclaredProjectManage { | |||||
* @param instanceId | * @param instanceId | ||||
*/ | */ | ||||
private Boolean saveOrUpdateProject(ProjectDTO projectDto, String instanceId, | private Boolean saveOrUpdateProject(ProjectDTO projectDto, String instanceId, | ||||
Long userId) { | |||||
String employeeCode) { | |||||
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 | ||||
try { | try { | ||||
//保存项目表信息 | //保存项目表信息 | ||||
@@ -265,7 +265,7 @@ public class DeclaredProjectManage { | |||||
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | ||||
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); | ||||
project.setInstCode(instanceId); | project.setInstCode(instanceId); | ||||
project.setSponsor(userId); | |||||
project.setSponsor(employeeCode); | |||||
projectService.saveOrUpdate(project); | projectService.saveOrUpdate(project); | ||||
//保存项目应用 | //保存项目应用 | ||||
if (CollUtil.isNotEmpty(projectDto.getApplicationList())) { | if (CollUtil.isNotEmpty(projectDto.getApplicationList())) { | ||||
@@ -374,9 +374,8 @@ public class DeclaredProjectManage { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | ||||
Long userId = LoginUserUtil.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
UserInfoDetails userFullInfo = LoginUserUtil.loginUserDetail(); | |||||
VUtils.isTrue(Objects.isNull(userFullInfo)).throwMessage("获取登录用户失败!"); | |||||
//放入用户的单位 | //放入用户的单位 | ||||
req.setBuildOrgCode(userFullInfo.getOrganizationCode()); | req.setBuildOrgCode(userFullInfo.getOrganizationCode()); | ||||
return projectlibManager.projectLibList(req); | return projectlibManager.projectLibList(req); | ||||
@@ -384,8 +383,7 @@ public class DeclaredProjectManage { | |||||
public void exportList(HttpServletResponse response, ProjectListReq param) { | public void exportList(HttpServletResponse response, ProjectListReq param) { | ||||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | ||||
Long userId = userInfoDetails.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
VUtils.isTrue(Objects.isNull(userInfoDetails)).throwMessage("获取登录用户失败!"); | |||||
//放入用户的单位 | //放入用户的单位 | ||||
param.setBuildOrgCode(userInfoDetails.getOrganizationCode()); | param.setBuildOrgCode(userInfoDetails.getOrganizationCode()); | ||||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param); | LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param); | ||||
@@ -108,27 +108,31 @@ public class DefaultDeclaredProjectManage { | |||||
} | } | ||||
} | } | ||||
public ProcessInstanceUserDto buildUser(Long userId){ | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
public ProcessInstanceUserDto buildUser(String employeeCode){ | |||||
UserFullInfoDTO userInfoDetail = userInfoHelper.getUserFullInfoByEmployeeCode(employeeCode); | |||||
VUtils.isTrue(Objects.isNull(userFullInfo)) | |||||
.throwMessage("当前登录用户 信息出错!"); | |||||
VUtils.isTrue(Objects.isNull(userInfoDetail)) | |||||
.throwMessage(String.format("【%s】获取不到用户!",employeeCode)); | |||||
return ProcessInstanceUserDto.builder() | return ProcessInstanceUserDto.builder() | ||||
.userId(String.valueOf(userFullInfo.getUserId())) | |||||
.userName(userFullInfo.getRealName()) | |||||
.orgCode(userFullInfo.getOrganizationCode()) | |||||
.orgName(userFullInfo.getOrganizationName()) | |||||
.userId(String.valueOf(userInfoDetail.getEmployeeCode())) | |||||
.userName(userInfoDetail.getRealName()) | |||||
.orgCode(userInfoDetail.getOrganizationCode()) | |||||
.orgName(userInfoDetail.getOrganizationName()) | |||||
.build(); | .build(); | ||||
} | } | ||||
public Map<String, OrgInfoDTO> buildOrgModelMap(Long userId,Project project) { | |||||
public Map<String, OrgInfoDTO> buildOrgModelMap(String employeeCode,Project project) { | |||||
Map<String, OrgInfoDTO> orgMap = new HashMap<>(); | Map<String, OrgInfoDTO> orgMap = new HashMap<>(); | ||||
// 查出所有的单位流程配置 | // 查出所有的单位流程配置 | ||||
List<WflowOrgModels> orgModelsList = orgProcdefService.list(); | List<WflowOrgModels> orgModelsList = orgProcdefService.list(); | ||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfoByEmployeeCode(employeeCode); | |||||
if(Objects.isNull(userFullInfo)){ | |||||
log.warn("取不到员工 返回空map"); | |||||
return Collections.emptyMap(); | |||||
} | |||||
DingOrganization startOrg = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) | DingOrganization startOrg = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) | ||||
.eq(DingOrganization::getOrganizationCode, userFullInfo.getOrganizationCode())); | .eq(DingOrganization::getOrganizationCode, userFullInfo.getOrganizationCode())); | ||||
String startOrgCode = startOrg.getOrganizationCode(); | String startOrgCode = startOrg.getOrganizationCode(); | ||||
@@ -177,12 +181,12 @@ public class DefaultDeclaredProjectManage { | |||||
} | } | ||||
//直接提交预审方法 提取 在省级联审通过的时候 也可以用 | //直接提交预审方法 提取 在省级联审通过的时候 也可以用 | ||||
public String directStartProcess(Project projectInfo,Long userId){ | |||||
VUtils.isTrue(Objects.isNull(userId)) | |||||
.throwMessage("发起人Id 不能为空!"); | |||||
public String directStartProcess(Project projectInfo,String employeeCode){ | |||||
VUtils.isTrue(Objects.isNull(employeeCode)) | |||||
.throwMessage("发起人 员工code 不能为空!"); | |||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
params.setUser(buildUser(userId)); | |||||
params.setUser(buildUser(employeeCode)); | |||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | ||||
@@ -203,7 +207,7 @@ public class DefaultDeclaredProjectManage { | |||||
} | } | ||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | ||||
Map<String, OrgInfoDTO> orgModelMap = buildOrgModelMap(userId,projectInfo); | |||||
Map<String, OrgInfoDTO> orgModelMap = buildOrgModelMap(employeeCode,projectInfo); | |||||
String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | ||||
log.info("提交预审项目成功 【{}】", instanceId); | log.info("提交预审项目成功 【{}】", instanceId); | ||||
@@ -90,8 +90,8 @@ public class PrequalificationDeclaredProjectManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public String startTheProcess(DefaultDeclaredDTO dto) { | public String startTheProcess(DefaultDeclaredDTO dto) { | ||||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | ||||
Long userId = userInfoDetails.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
String employeeCode = userInfoDetails.getEmployeeCode(); | |||||
VUtils.isTrue(Objects.isNull(employeeCode)).throwMessage("获取登录用户失败!"); | |||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
@@ -117,7 +117,7 @@ public class PrequalificationDeclaredProjectManage { | |||||
//入库暂存表 后续处理 对接外部接口 | //入库暂存表 后续处理 对接外部接口 | ||||
projectInfo.setUpdateOn(LocalDateTime.now()); | projectInfo.setUpdateOn(LocalDateTime.now()); | ||||
//保存一下 当前的主管单位发起人 | //保存一下 当前的主管单位发起人 | ||||
projectInfo.setPreStartUserId(userId); | |||||
projectInfo.setPreStartUserId(employeeCode); | |||||
if(projectStagingService.addByProject(projectInfo,"省级部门联审") | if(projectStagingService.addByProject(projectInfo,"省级部门联审") | ||||
&& projectService.updateById(projectInfo)){ | && projectService.updateById(projectInfo)){ | ||||
return "提交省级部门联审成功"; | return "提交省级部门联审成功"; | ||||
@@ -126,7 +126,7 @@ public class PrequalificationDeclaredProjectManage { | |||||
}else if(ProjectStatusEnum.PRE_APPLYING | }else if(ProjectStatusEnum.PRE_APPLYING | ||||
.getCode().equals(projectInfo.getStatus())){ | .getCode().equals(projectInfo.getStatus())){ | ||||
//如果是非省级联审的项目 直接提交 预审 | //如果是非省级联审的项目 直接提交 预审 | ||||
instanceId = defaultDeclaredProjectManage.directStartProcess(projectInfo,userId); | |||||
instanceId = defaultDeclaredProjectManage.directStartProcess(projectInfo,employeeCode); | |||||
}else{ | }else{ | ||||
throw new BusinessException("项目状态 错误 project :" + JSON.toJSONString(projectInfo)); | throw new BusinessException("项目状态 错误 project :" + JSON.toJSONString(projectInfo)); | ||||
} | } | ||||
@@ -143,8 +143,8 @@ public class PrequalificationDeclaredProjectManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public String restartTheProcess(DefaultDeclaredDTO dto) { | public String restartTheProcess(DefaultDeclaredDTO dto) { | ||||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | ||||
Long userId = userInfoDetails.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
String employeeCode = userInfoDetails.getEmployeeCode(); | |||||
VUtils.isTrue(Objects.isNull(employeeCode)).throwMessage("获取登录用户失败!"); | |||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
@@ -168,11 +168,10 @@ public class PrequalificationDeclaredProjectManage { | |||||
//项目阶段 状态 已定 待预审 | //项目阶段 状态 已定 待预审 | ||||
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | ||||
req.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | req.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | ||||
Long userId = LoginUserUtil.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
UserInfoDetails userInfoDetail = LoginUserUtil.loginUserDetail(); | |||||
VUtils.isTrue(Objects.isNull(userInfoDetail)).throwMessage("获取登录用户失败!"); | |||||
//放入用户的主管单位 | //放入用户的主管单位 | ||||
req.setSuperOrgCode(userFullInfo.getOrganizationCode()); | |||||
req.setSuperOrgCode(userInfoDetail.getOrganizationCode()); | |||||
return projectLibManage.projectLibList(req); | return projectLibManage.projectLibList(req); | ||||
} | } | ||||
@@ -182,11 +181,9 @@ public class PrequalificationDeclaredProjectManage { | |||||
//项目阶段 状态 已定 待预审 | //项目阶段 状态 已定 待预审 | ||||
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | ||||
req.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | req.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | ||||
Long userId = LoginUserUtil.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
UserInfoDetails userInfoDetail = LoginUserUtil.loginUserDetail(); | |||||
//放入用户的单位 | //放入用户的单位 | ||||
req.setSuperOrgCode(userFullInfo.getOrganizationCode()); | |||||
req.setSuperOrgCode(userInfoDetail.getOrganizationCode()); | |||||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | ||||
List<Project> records = projectService.list(query); | List<Project> records = projectService.list(query); | ||||
@@ -29,6 +29,7 @@ import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; | import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | |||||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | import com.ningdatech.pmapi.user.util.LoginUserUtil; | ||||
import com.wflow.exception.BusinessException; | import com.wflow.exception.BusinessException; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -146,11 +147,10 @@ public class ProjectAdjustmentManage { | |||||
ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | ||||
ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | ||||
ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode())); | ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode())); | ||||
Long userId = LoginUserUtil.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||||
//放入用户的单位 | //放入用户的单位 | ||||
req.setBuildOrgCode(userFullInfo.getOrganizationCode()); | |||||
req.setBuildOrgCode(user.getOrganizationCode()); | |||||
return projectLibManage.projectLibList(req); | return projectLibManage.projectLibList(req); | ||||
} | } | ||||
@@ -165,11 +165,10 @@ public class ProjectAdjustmentManage { | |||||
ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | ||||
ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | ||||
ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode())); | ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode())); | ||||
Long userId = LoginUserUtil.getUserId(); | |||||
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!"); | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||||
//放入用户的单位 | //放入用户的单位 | ||||
req.setBuildOrgCode(userFullInfo.getOrganizationCode()); | |||||
req.setBuildOrgCode(user.getOrganizationCode()); | |||||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | ||||
List<Project> records = projectService.list(query); | List<Project> records = projectService.list(query); | ||||
@@ -58,7 +58,7 @@ public class ReviewByDeptJointManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public Boolean startTheProcess(Project project) { | public Boolean startTheProcess(Project project) { | ||||
//这里是任务发起的 所以用项目发起人 | //这里是任务发起的 所以用项目发起人 | ||||
Long userId = project.getSponsor(); | |||||
String startUserCode = project.getSponsor(); | |||||
VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
Project projectInfo = projectService.getById(project.getId()); | Project projectInfo = projectService.getById(project.getId()); | ||||
@@ -99,7 +99,7 @@ public class ReviewByDeptJointManage { | |||||
params.setFormData(formData); | params.setFormData(formData); | ||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | ||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(userId,project); | |||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(startUserCode,project); | |||||
String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | ||||
log.info("部门联审申报成功 【{}】", instanceId); | log.info("部门联审申报成功 【{}】", instanceId); | ||||
@@ -279,8 +279,8 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("流程状态") | @ApiModelProperty("流程状态") | ||||
private Integer processStatus; | private Integer processStatus; | ||||
@ApiModelProperty("项目发起人") | |||||
private Long sponsor; | |||||
@ApiModelProperty("项目发起人 员工code") | |||||
private String sponsor; | |||||
@ApiModelProperty("上级条线单位审核意见") | @ApiModelProperty("上级条线单位审核意见") | ||||
private String higherLineSuperOrgReviewComments; | private String higherLineSuperOrgReviewComments; | ||||
@@ -294,11 +294,11 @@ public class Project implements Serializable { | |||||
@ApiModelProperty("动态表单 json") | @ApiModelProperty("动态表单 json") | ||||
private String dynamicForm; | private String dynamicForm; | ||||
@ApiModelProperty("项目发起人 用户id") | |||||
private Long sponsor; | |||||
@ApiModelProperty("项目发起人 员工code") | |||||
private String sponsor; | |||||
@ApiModelProperty("预审发起人 用户id") | |||||
private Long preStartUserId; | |||||
@ApiModelProperty("预审发起人 员工code") | |||||
private String preStartUserId; | |||||
@ApiModelProperty("上级条线单位审核意见") | @ApiModelProperty("上级条线单位审核意见") | ||||
private String higherLineSuperOrgReviewComments; | private String higherLineSuperOrgReviewComments; | ||||
@@ -286,8 +286,8 @@ public class ProjectDetailVO { | |||||
@ApiModelProperty("年度投资金额详情") | @ApiModelProperty("年度投资金额详情") | ||||
private List<AnnualAmountVO> annualAccumulateAmountList; | private List<AnnualAmountVO> annualAccumulateAmountList; | ||||
@ApiModelProperty("项目发起人id") | |||||
private Long sponsor; | |||||
@ApiModelProperty("项目发起人 员工code") | |||||
private String sponsor; | |||||
@ApiModelProperty("上级条线单位审核意见") | @ApiModelProperty("上级条线单位审核意见") | ||||
private String higherLineSuperOrgReviewComments; | private String higherLineSuperOrgReviewComments; | ||||
@@ -155,4 +155,16 @@ public class UserAuthLoginManage { | |||||
userFullInfoDTO.setRealName(userInfo.getRealName()); | userFullInfoDTO.setRealName(userInfo.getRealName()); | ||||
userFullInfoDTO.setUsername(userInfo.getRealName()); | userFullInfoDTO.setUsername(userInfo.getRealName()); | ||||
} | } | ||||
public UserFullInfoDTO getUserFullInfoByEmployeeCode(String employeeCode) { | |||||
UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) | |||||
.eq(UserInfo::getEmployeeCode,employeeCode).last("limit 1")); | |||||
if (Objects.isNull(userInfo)) { | |||||
return null; | |||||
} | |||||
// 返回用户全量信息 | |||||
UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); | |||||
userFullInfoDTOAssembler(userInfo, userFullInfoDTO); | |||||
return userFullInfoDTO; | |||||
} | |||||
} | } |