Browse Source

优化嗲吗

tags/24080901
PoffyZhang 1 year ago
parent
commit
739b1c4481
9 changed files with 58 additions and 13 deletions
  1. +2
    -0
      kingbasesql/project.sql
  2. +6
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  3. +31
    -10
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  4. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectDraft.java
  5. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredDetailVO.java
  6. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDraftVO.java
  7. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java
  8. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  9. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java

+ 2
- 0
kingbasesql/project.sql View File

@@ -0,0 +1,2 @@
ALTER TABLE PUBLIC."nd_project" ADD "org_credit_code" VARCHAR(60);
comment ON COLUMN nd_project.org_credit_code IS '企业统一信息代码';

+ 6
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java View File

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum;
import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
@@ -21,6 +22,7 @@ import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
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.bean.entity.WflowModels; import com.wflow.bean.entity.WflowModels;
import com.wflow.exception.BusinessException; import com.wflow.exception.BusinessException;
@@ -76,8 +78,10 @@ public class ConstructionPlanManage {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String startTheProcess(DefaultDeclaredDTO dto) { public String startTheProcess(DefaultDeclaredDTO dto) {
Long userId = LoginUserUtil.getUserId();
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!");
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail();
Long userId = userInfoDetails.getUserId();
VUtils.isTrue(Objects.isNull(userInfoDetails) ||Objects.isNull(userInfoDetails.getUserId()))
.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!");


+ 31
- 10
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java View File

@@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum;
import com.ningdatech.pmapi.common.helper.RegionCacheHelper;
import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
@@ -28,6 +30,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
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.bean.entity.WflowModels; import com.wflow.bean.entity.WflowModels;
import com.wflow.bean.entity.WflowOrgModels; import com.wflow.bean.entity.WflowOrgModels;
@@ -79,6 +82,8 @@ public class DeclaredProjectManage {
private final UserInfoHelper userInfoHelper; private final UserInfoHelper userInfoHelper;


private final RegionCacheHelper regionCacheHelper;

/** /**
* 新项目 启动实例 * 新项目 启动实例
* *
@@ -87,10 +92,16 @@ public class DeclaredProjectManage {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String startTheProcess(DefaultDeclaredDTO dto) { public String startTheProcess(DefaultDeclaredDTO dto) {
Long userId = LoginUserUtil.getUserId();
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!");
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail();
Long userId = userInfoDetails.getUserId();
VUtils.isTrue(Objects.isNull(userInfoDetails) ||Objects.isNull(userInfoDetails.getUserId()))
.throwMessage("获取登录用户失败!");


ProjectDTO projectInfo = dto.getProjectInfo(); ProjectDTO projectInfo = dto.getProjectInfo();
projectInfo.setAreaCode(userInfoDetails.getRegionCode());
projectInfo.setArea(regionCacheHelper.getRegionName(userInfoDetails.getRegionCode(), RegionConst.RL_COUNTY));
projectInfo.setBuildOrgCode(userInfoDetails.getOrganizationCode());
projectInfo.setBuildOrgName(userInfoDetails.getOrganizationName());


//如果是重新提交的话 判断下 项目是否存在 //如果是重新提交的话 判断下 项目是否存在
if(Objects.nonNull(projectInfo.getId())){ if(Objects.nonNull(projectInfo.getId())){
@@ -105,7 +116,7 @@ public class DeclaredProjectManage {


} }


String regionCode = projectInfo.getAreaCode();
String regionCode = userInfoDetails.getRegionCode();


WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode) .eq(WflowModels::getRegionCode, regionCode)
@@ -138,7 +149,7 @@ public class DeclaredProjectManage {
log.info("申报项目成功 【{}】", instanceId); log.info("申报项目成功 【{}】", instanceId);


//如果是重新提交的话 判断下 项目是否存在 //如果是重新提交的话 判断下 项目是否存在
saveOrUpdateProject(dto.getProjectInfo(), instanceId, regionCode,userId);
saveOrUpdateProject(projectInfo, instanceId,userId);


return instanceId; return instanceId;
} }
@@ -152,10 +163,16 @@ public class DeclaredProjectManage {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String reStartTheProcess(DefaultDeclaredDTO dto) { public String reStartTheProcess(DefaultDeclaredDTO dto) {
Long userId = LoginUserUtil.getUserId();
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!");

UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail();
VUtils.isTrue(Objects.isNull(userInfoDetails) || Objects.isNull(userInfoDetails.getUserId()))
.throwMessage("获取登录用户失败!");
Long userId = userInfoDetails.getUserId();
ProjectDTO projectDto = dto.getProjectInfo(); ProjectDTO projectDto = dto.getProjectInfo();
projectDto.setAreaCode(userInfoDetails.getRegionCode());
projectDto.setArea(regionCacheHelper.getRegionName(userInfoDetails.getRegionCode(), RegionConst.RL_COUNTY));
projectDto.setBuildOrgCode(userInfoDetails.getOrganizationCode());
projectDto.setBuildOrgName(userInfoDetails.getOrganizationName());

VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!");
Project projectInfo = projectService.getById(projectDto.getId()); Project projectInfo = projectService.getById(projectDto.getId());
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");
@@ -193,7 +210,7 @@ public class DeclaredProjectManage {
log.info("重新申报项目成功 【{}】", instanceId); log.info("重新申报项目成功 【{}】", instanceId);


//保存项目 //保存项目
saveOrUpdateProject(projectDto,instanceId,regionCode,userId);
saveOrUpdateProject(projectDto,instanceId,userId);


return instanceId; return instanceId;
} }
@@ -205,7 +222,7 @@ public class DeclaredProjectManage {
* @param instanceId * @param instanceId
*/ */
private void saveOrUpdateProject(ProjectDTO projectDto, String instanceId, private void saveOrUpdateProject(ProjectDTO projectDto, String instanceId,
String regionCode,Long userId) {
Long userId) {
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 //流程启动之后 入库项目 重要业务信息 用于列表查询 展示
try { try {
//保存项目表信息 //保存项目表信息
@@ -213,7 +230,6 @@ public class DeclaredProjectManage {
BeanUtils.copyProperties(projectDto, project); BeanUtils.copyProperties(projectDto, project);
project.setCreateOn(LocalDateTime.now()); project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now());
project.setAreaCode(regionCode);
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);
@@ -292,10 +308,15 @@ public class DeclaredProjectManage {
*/ */
public Long saveToDraft(ProjectDraftSaveDTO dto) { public Long saveToDraft(ProjectDraftSaveDTO dto) {
Long userId = LoginUserUtil.getUserId(); Long userId = LoginUserUtil.getUserId();
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail();

ProjectDTO projectInfo = dto.getProjectInfo(); ProjectDTO projectInfo = dto.getProjectInfo();
ProjectDraft draft = new ProjectDraft(); ProjectDraft draft = new ProjectDraft();
BeanUtils.copyProperties(projectInfo, draft); BeanUtils.copyProperties(projectInfo, draft);
draft.setUserId(dto.getUser().getUserId()); draft.setUserId(dto.getUser().getUserId());
draft.setBuildOrgCode(userInfoDetails.getOrganizationCode());
draft.setAreaCode(userInfoDetails.getRegionCode());

if(CollUtil.isNotEmpty(projectInfo.getDynamicForm())){ if(CollUtil.isNotEmpty(projectInfo.getDynamicForm())){
draft.setDynamicForm(JSON.toJSONString(projectInfo.getDynamicForm())); draft.setDynamicForm(JSON.toJSONString(projectInfo.getDynamicForm()));
} }


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectDraft.java View File

@@ -70,6 +70,9 @@ public class ProjectDraft implements Serializable {
private String buildOrgName; private String buildOrgName;


@ApiModelProperty("建设单位统一社会信用代码") @ApiModelProperty("建设单位统一社会信用代码")
private String orgCreditCode;

@ApiModelProperty("公司编码code")
private String buildOrgCode; private String buildOrgCode;


@ApiModelProperty("建设单位浙政钉ID") @ApiModelProperty("建设单位浙政钉ID")


+ 4
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredDetailVO.java View File

@@ -58,7 +58,10 @@ public class ProjectDeclaredDetailVO {
private String buildUnitName; private String buildUnitName;


@ApiModelProperty("建设单位统一社会信用代码") @ApiModelProperty("建设单位统一社会信用代码")
private String buildUnitCode;
private String orgCreditCode;

@ApiModelProperty("公司编码code")
private String buildOrgCode;


@ApiModelProperty("建设单位浙政钉ID") @ApiModelProperty("建设单位浙政钉ID")
private String buildUnitZheJiangGovernmentDingId; private String buildUnitZheJiangGovernmentDingId;


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDraftVO.java View File

@@ -71,6 +71,9 @@ public class ProjectDraftVO implements Serializable {
private String buildOrgName; private String buildOrgName;


@ApiModelProperty("建设单位统一社会信用代码") @ApiModelProperty("建设单位统一社会信用代码")
private String orgCreditCode;

@ApiModelProperty("公司编码code")
private String buildOrgCode; private String buildOrgCode;


@ApiModelProperty("建设单位浙政钉ID") @ApiModelProperty("建设单位浙政钉ID")


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java View File

@@ -56,6 +56,9 @@ public class ProjectDTO implements Serializable {
private String buildOrgName; private String buildOrgName;


@ApiModelProperty("建设单位统一社会信用代码") @ApiModelProperty("建设单位统一社会信用代码")
private String orgCreditCode;

@ApiModelProperty("公司编码code")
private String buildOrgCode; private String buildOrgCode;


@ApiModelProperty("建设单位浙政钉ID") @ApiModelProperty("建设单位浙政钉ID")


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java View File

@@ -63,6 +63,9 @@ public class Project implements Serializable {
private String buildOrgName; private String buildOrgName;


@ApiModelProperty("建设单位统一社会信用代码") @ApiModelProperty("建设单位统一社会信用代码")
private String orgCreditCode;

@ApiModelProperty("公司编码code")
private String buildOrgCode; private String buildOrgCode;


@ApiModelProperty("建设单位浙政钉ID") @ApiModelProperty("建设单位浙政钉ID")


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java View File

@@ -64,6 +64,9 @@ public class ProjectDetailVO {
private String buildOrgName; private String buildOrgName;


@ApiModelProperty("建设单位统一社会信用代码") @ApiModelProperty("建设单位统一社会信用代码")
private String orgCreditCode;

@ApiModelProperty("公司编码code")
private String buildOrgCode; private String buildOrgCode;


@ApiModelProperty("建设单位浙政钉ID") @ApiModelProperty("建设单位浙政钉ID")


Loading…
Cancel
Save