Browse Source

Merge remote-tracking branch 'origin/master'

master
niohe·erbao 1 year ago
parent
commit
e5954fb807
40 changed files with 454 additions and 172 deletions
  1. +2
    -0
      kingbasesql/project.sql
  2. +14
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java
  3. +62
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/ReviewProjectDTO.java
  4. +37
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/ReviewProjectListReq.java
  5. +26
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  6. +12
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.java
  7. +50
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.xml
  8. +12
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingExpertService.java
  9. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingService.java
  10. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingExpertServiceImpl.java
  11. +1
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java
  12. +6
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  13. +36
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  14. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectDraft.java
  15. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredDetailVO.java
  16. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDraftVO.java
  17. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java
  18. +0
    -52
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/StepStatusEnum.java
  19. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AbstractProcessBusinessHandle.java
  20. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java
  21. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java
  22. +11
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java
  23. +9
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java
  24. +11
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java
  25. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProcessExecuteChainHandle.java
  26. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java
  27. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectDeclareHandle.java
  28. +11
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java
  29. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java
  30. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java
  31. +23
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java
  32. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  33. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java
  34. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  35. +0
    -40
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProcessDetailVO.java
  36. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
  37. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/staging/enums/MsgTypeEnum.java
  38. +24
    -25
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  39. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java
  40. +53
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/utils/BuildUserUtils.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 '企业统一信息代码';

+ 14
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java View File

@@ -4,6 +4,7 @@ package com.ningdatech.pmapi.meeting.controller;
import com.ningdatech.basic.model.IdVo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.meeting.entity.dto.ReviewProjectDTO;
import com.ningdatech.pmapi.meeting.entity.req.*;
import com.ningdatech.pmapi.meeting.entity.vo.*;
import com.ningdatech.pmapi.meeting.manage.MeetingManage;
@@ -46,6 +47,13 @@ public class MeetingController {
meetingManage.continueInvite(req.getMeetingId());
}

@PostMapping("/convertToAppoint")
@ApiOperation(value = "转为指定抽取")
@WebLog(value = "转为指定抽取")
public void convertToAppoint(@Valid @RequestBody MeetingIdReq req) {
meetingManage.convertToAppoint(req.getMeetingId());
}

@PostMapping("/expertInviteByCreate")
@ApiOperation(value = "新建会议-专家抽取", hidden = true)
@WebLog(value = "新建会议-专家抽取")
@@ -158,4 +166,10 @@ public class MeetingController {
meetingManage.confirmedRoster(req.getMeetingId());
}

@GetMapping("/listReviewProject")
@ApiOperation("评审会议列表")
public PageVo<ReviewProjectDTO> listReviewProject(ReviewProjectListReq req){
return meetingManage.pageReviewProject(req);
}

}

+ 62
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/ReviewProjectDTO.java View File

@@ -0,0 +1,62 @@
package com.ningdatech.pmapi.meeting.entity.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
* <p>
* ReviewProjectDTO
* </p>
*
* @author WendyYang
* @since 10:27 2023/3/8
*/
@Data
public class ReviewProjectDTO {

@ApiModelProperty("会议ID")
private Long meetingId;

@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("项目名称")
private String projectName;

@ApiModelProperty("项目类型")
private Integer projectType;

@ApiModelProperty("预算年度")
private Integer projectYear;

@ApiModelProperty("申报金额")
private BigDecimal declaredAmount;

@ApiModelProperty("申报单位")
private String buildOrgName;

@ApiModelProperty("评审时间")
private LocalDateTime reviewTime;

@ApiModelProperty("评审类型")
private Integer reviewType;

@ApiModelProperty("联系人")
private String connecter;

@ApiModelProperty("联系方式")
private String contact;

@ApiModelProperty("业务领域")
private String bizDomain;

@ApiModelProperty("是否是专家组长")
private Boolean isHeadman;

@ApiModelProperty("是否已评价:0 未自评、1 已自评、2 已终评")
private Integer reviewed;

}

+ 37
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/ReviewProjectListReq.java View File

@@ -0,0 +1,37 @@
package com.ningdatech.pmapi.meeting.entity.req;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
* <p>
* ReviewProjectListReq
* </p>
*
* @author WendyYang
* @since 10:54 2023/3/8
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ReviewProjectListReq extends PagePo {

@ApiModelProperty("项目名称")
private String projectName;

@ApiModelProperty("建设单位")
private String buildOrgName;

private Long userId;

@ApiModelProperty("是否已评审")
private Boolean reviewed;

private LocalDateTime reviewTimeMin;

private LocalDateTime reviewTimeMax;

}

+ 26
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java View File

@@ -165,6 +165,27 @@ public class MeetingManage {
}

@Transactional(rollbackFor = Exception.class)
public void convertToAppoint(Long meetingId) {
String key = "CONVERT_TO_APPOINT:" + meetingId;
if (!distributedLock.lock(key, RETRY_TIMES)) {
throw BizException.wrap("已进行转换,请勿重复点击");
}
try {
Meeting meeting = meetingService.getById(meetingId);
if (!MeetingStatusEnum.NORMAL.eq(meeting.getStatus())) {
throw BizException.wrap("转换失败,请刷新后重试");
}
expertInviteTask.cancelByMeetingId(meetingId);
LambdaUpdateWrapper<Meeting> meetingUpdate = Wrappers.lambdaUpdate(Meeting.class)
.set(Meeting::getInviteType, ExpertInviteTypeEnum.APPOINT.getCode())
.eq(Meeting::getId, meetingId);
meetingService.update(meetingUpdate);
} finally {
distributedLock.releaseLock(key);
}
}

@Transactional(rollbackFor = Exception.class)
public void expertInviteByCreate(ExpertInviteReq req) {
String key = INVITED_RULE_CREATE + req.getMeetingId();
if (!distributedLock.lock(key, RETRY_TIMES)) {
@@ -675,4 +696,9 @@ public class MeetingManage {
}
}

public PageVo<ReviewProjectDTO> pageReviewProject(ReviewProjectListReq req) {
Page<ReviewProjectDTO> page = meetingExpertService.pageReviewProjectList(req);
return PageVo.of(page.getRecords(), page.getTotal());
}

}

+ 12
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.java View File

@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.ningdatech.pmapi.meeting.entity.dto.ReviewProjectDTO;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.entity.req.ReviewProjectListReq;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
@@ -78,4 +80,14 @@ public interface MeetingExpertMapper extends BaseMapper<MeetingExpert> {
**/
List<MeetingExpert> listExpertLastByMeetingIds(@Param("meetingIds") Collection<Long> meetingIds);

/**
* 查询专家待评审项目
*
* @param page 分页
* @param req 查询参数
* @return 待评审项目分页数据
* @author WendyYang
**/
Page<ReviewProjectDTO> pageReviewProjectList(Page<ReviewProjectDTO> page, @Param("p") ReviewProjectListReq req);

}

+ 50
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.xml View File

@@ -72,4 +72,54 @@
#{item}</foreach>) em WHERE rowNumber = 1
</select>

<sql id="reviewedByHeadman">
<if test="p.reviewed">
and exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
me.expert_id and is_final = true)
</if>
<if test="!p.reviewed">
and not exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
me.expert_id and is_final = true)
</if>
</sql>

<sql id="reviewedByNotHeadman">
<if test="p.reviewed">
and exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
me.expert_id)
</if>
<if test="!p.reviewed">
and not exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
me.expert_id)
</if>
</sql>

<select id="pageReviewProjectList" resultType="com.ningdatech.pmapi.meeting.entity.dto.ReviewProjectDTO">
select mip.project_id, np.project_name, np.project_type, np.project_year, np.build_org_name,
np.biz_domain, np.declared_amount, mip.meeting_id, m.type meetingType, m.start_time reviewTime,
m.connecter, m.contact, me.is_headman, (select count(1) from nd_expert_review ner where ner.project_id = np.id
and ner.create_by = me.expert_id) reviewed
from nd_project np inner join meeting_inner_project mip on mip.project_id = np.id
inner join meeting m on m.id = mip.meeting_id
inner join meeting_expert me on m.id = me.meeting_id
where m.is_inner_project = true
<if test="p.reviewed != null">
if(me.is_headman,<include refid="reviewedByHeadman"/>,<include refid="reviewedByNotHeadman"/>)
</if>
and me.expert_id = #{p.userId}
<if test="p.projectName != null and p.projectName.length > 0">
and np.project_name like concat('%', #{p.projectName}, '%')
</if>
<if test="p.buildOrgName != null and p.buildOrgName.length > 0">
and np.build_org_name like concat('%', #{buildOrgName}, '%')
</if>
<if test="p.reviewTimeMin != null">
and m.start_time &gt;= #{p.reviewTimeMin}
</if>
<if test="p.reviewTimeMax != null">
and m.start_time &lt;= #{p.reviewTimeMax}
</if>
order by m.start_time desc
</select>

</mapper>

+ 12
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingExpertService.java View File

@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO;
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.ningdatech.pmapi.meeting.entity.dto.ReviewProjectDTO;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum;
import com.ningdatech.pmapi.meeting.entity.req.ReviewProjectListReq;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.Collections;
@@ -143,4 +146,13 @@ public interface IMeetingExpertService extends IService<MeetingExpert> {
return listExpertLastByMeetingIds(Collections.singletonList(meetingId));
}

/**
* 查询专家待评审项目
*
* @param req {@link ReviewProjectListReq}
* @return 待评审项目分页数据
* @author WendyYang
**/
Page<ReviewProjectDTO> pageReviewProjectList(ReviewProjectListReq req);

}

+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingService.java View File

@@ -23,6 +23,13 @@ public interface IMeetingService extends IService<Meeting> {
**/
void stopRandomInvite(Long meetingId);

/**
* 工作台会议状态统计
*
* @param createBy 创建人
* @return 各状态会议统计
* @author WendyYang
**/
Map<MeetingStatusByDashboard, Integer> meetingCountSummary(Long createBy);

}

+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingExpertServiceImpl.java View File

@@ -9,8 +9,10 @@ import com.ningdatech.pmapi.meeting.entity.domain.ExpertInviteRule;
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO;
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.ningdatech.pmapi.meeting.entity.dto.ReviewProjectDTO;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum;
import com.ningdatech.pmapi.meeting.entity.req.ReviewProjectListReq;
import com.ningdatech.pmapi.meeting.mapper.ExpertInviteRuleMapper;
import com.ningdatech.pmapi.meeting.mapper.MeetingExpertMapper;
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService;
@@ -127,4 +129,9 @@ public class MeetingExpertServiceImpl extends ServiceImpl<MeetingExpertMapper, M
return baseMapper.listExpertLastByMeetingIds(meetingIds);
}

@Override
public Page<ReviewProjectDTO> pageReviewProjectList(ReviewProjectListReq req) {
return baseMapper.pageReviewProjectList(req.page(), req);
}

}

+ 1
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java View File

@@ -34,8 +34,7 @@ public class MeetingServiceImpl extends ServiceImpl<MeetingMapper, Meeting> impl
@Override
public Map<MeetingStatusByDashboard, Integer> meetingCountSummary(Long createBy) {
List<CountGroupByDTO<String>> meetingCountSummary = baseMapper.meetingCountSummary(createBy);
return CollUtils.listToMap(meetingCountSummary,
w -> MeetingStatusByDashboard.valueOf(w.getGroupKey()),
return CollUtils.listToMap(meetingCountSummary, w -> MeetingStatusByDashboard.valueOf(w.getGroupKey()),
CountGroupByDTO::getTotal);
}



+ 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.ningdatech.basic.function.VUtils;
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.helper.UserInfoHelper;
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.IProjectService;
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.wflow.bean.entity.WflowModels;
import com.wflow.exception.BusinessException;
@@ -76,8 +78,10 @@ public class ConstructionPlanManage {
*/
@Transactional(rollbackFor = Exception.class)
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();
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!");


+ 36
- 11
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.ningdatech.basic.function.VUtils;
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.helper.RegionCacheHelper;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
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.IProjectService;
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.wflow.bean.entity.WflowModels;
import com.wflow.bean.entity.WflowOrgModels;
@@ -79,6 +82,8 @@ public class DeclaredProjectManage {
private final UserInfoHelper userInfoHelper;

private final RegionCacheHelper regionCacheHelper;

/**
* 新项目 启动实例
*
@@ -87,10 +92,16 @@ public class DeclaredProjectManage {
*/
@Transactional(rollbackFor = Exception.class)
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();
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())){
@@ -105,7 +116,7 @@ public class DeclaredProjectManage {

}

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

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

//如果是重新提交的话 判断下 项目是否存在
saveOrUpdateProject(dto.getProjectInfo(), instanceId, regionCode,userId);
if(saveOrUpdateProject(projectInfo, instanceId,userId) && Objects.nonNull(projectInfo.getDraftId())){
//如果是草稿箱提交 删除对应的草稿箱
projectDraftService.removeById(projectInfo.getDraftId());
}

return instanceId;
}
@@ -152,10 +166,16 @@ public class DeclaredProjectManage {
*/
@Transactional(rollbackFor = Exception.class)
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.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!");
Project projectInfo = projectService.getById(projectDto.getId());
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");
@@ -193,7 +213,7 @@ public class DeclaredProjectManage {
log.info("重新申报项目成功 【{}】", instanceId);

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

return instanceId;
}
@@ -204,8 +224,8 @@ public class DeclaredProjectManage {
* @param projectDto
* @param instanceId
*/
private void saveOrUpdateProject(ProjectDTO projectDto, String instanceId,
String regionCode,Long userId) {
private Boolean saveOrUpdateProject(ProjectDTO projectDto, String instanceId,
Long userId) {
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示
try {
//保存项目表信息
@@ -213,7 +233,6 @@ public class DeclaredProjectManage {
BeanUtils.copyProperties(projectDto, project);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
project.setAreaCode(regionCode);
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
project.setInstCode(instanceId);
@@ -244,6 +263,7 @@ public class DeclaredProjectManage {
log.error("项目信息入库错误 ", e);
throw new BusinessException("项目信息入库错误 :" + e.getMessage());
}
return Boolean.TRUE;
}

public PageVo<ProjectDraftVO> pageDraft(DeclaredProjectListParamDTO params) {
@@ -292,10 +312,15 @@ public class DeclaredProjectManage {
*/
public Long saveToDraft(ProjectDraftSaveDTO dto) {
Long userId = LoginUserUtil.getUserId();
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail();

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

if(CollUtil.isNotEmpty(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;

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

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

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

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

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

@ApiModelProperty("建设单位浙政钉ID")
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;

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

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

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


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java View File

@@ -3,9 +3,9 @@ package com.ningdatech.pmapi.projectlib.controller;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;


+ 0
- 52
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/StepStatusEnum.java View File

@@ -1,52 +0,0 @@
package com.ningdatech.pmapi.projectlib.enumeration;

import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@Getter
@AllArgsConstructor
@NoArgsConstructor
/**
* 环节状态枚举
* @author CMM
* @since 2023/02/24 11:51
*/
public enum StepStatusEnum {
/**
* 环节状态
*/
NOT_START(1, "未开始"),
ON_GOING(2, "进行中"),
REJECTED(3,"被驳回"),
COMPLETED(4,"已完成");

private Integer code;
private String desc;

public static String getDescByCode(Integer code) {
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
}
for (StepStatusEnum t : StepStatusEnum.values()) {
if (code.equals(t.getCode())) {
return t.desc;
}
}
return StringUtils.EMPTY;
}

public boolean eq(String val) {
return this.name().equals(val);
}

public static boolean contains (StepStatusEnum e, List<StepStatusEnum> enums){
return enums.contains(e);
}
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AbstractProcessBusinessHandle.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.projectlib.handle;

import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessDetailVO;

import java.util.List;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java View File

@@ -10,12 +10,12 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;

import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java View File

@@ -4,15 +4,15 @@ package com.ningdatech.pmapi.projectlib.handle;
import java.util.List;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;

/**


+ 11
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java View File

@@ -6,16 +6,17 @@ import java.util.Objects;

import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
@@ -33,10 +34,12 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle

private final IProjectInstService projectInstService;
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;

public ConstructionPlanReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService){
public ConstructionPlanReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){
this.projectInstService = projectInstService;
this.processInstanceService = processInstanceService;
this.buildUserUtils = buildUserUtils;
}

@Override
@@ -66,11 +69,15 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle
} else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) {
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
}

// 装配节点审核人员信息
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
buildUserUtils.buildUserByProcessInfo(progressInfo);

// 根据流程处理详情获取流程完成时间
if(StepStatusEnum.contains(processDetailVO.getStepStatus(),
Lists.newArrayList(StepStatusEnum.REJECTED,
StepStatusEnum.COMPLETED))){
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1);
LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime());
processDetailVO.setFinishTime(finishTime);


+ 9
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java View File

@@ -6,16 +6,17 @@ import java.util.Objects;

import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
@@ -33,10 +34,12 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {

private final IProjectInstService projectInstService;
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;

public DeptUnitedReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService){
public DeptUnitedReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){
this.projectInstService = projectInstService;
this.processInstanceService = processInstanceService;
this.buildUserUtils = buildUserUtils;
}

@Override
@@ -64,11 +67,13 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {
} else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) {
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
}
// 装配节点审核人员信息
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
buildUserUtils.buildUserByProcessInfo(progressInfo);
// 根据流程处理详情获取流程完成时间
if(StepStatusEnum.contains(processDetailVO.getStepStatus(),
Lists.newArrayList(StepStatusEnum.REJECTED,
StepStatusEnum.COMPLETED))){
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1);
LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime());
processDetailVO.setFinishTime(finishTime);


+ 11
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java View File

@@ -5,13 +5,14 @@ import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.enums.StepStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@@ -32,10 +33,12 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle {

private final IProjectInstService projectInstService;
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;

public PreliminaryPreviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService) {
public PreliminaryPreviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils) {
this.projectInstService = projectInstService;
this.processInstanceService = processInstanceService;
this.buildUserUtils = buildUserUtils;
}

@Override
@@ -63,11 +66,15 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle {
} else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) {
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
}

// 装配节点审核人员信息
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
buildUserUtils.buildUserByProcessInfo(progressInfo);

// 根据流程处理详情获取流程完成时间
if(StepStatusEnum.contains(processDetailVO.getStepStatus(),
Lists.newArrayList(StepStatusEnum.REJECTED,
StepStatusEnum.COMPLETED))){
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1);
LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime());
processDetailVO.setFinishTime(finishTime);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProcessExecuteChainHandle.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.projectlib.handle;

import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import org.springframework.stereotype.Component;

import java.util.Collections;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java View File

@@ -6,6 +6,8 @@ import java.util.*;

import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@@ -13,10 +15,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectDeclareHandle.java View File

@@ -1,10 +1,10 @@
package com.ningdatech.pmapi.projectlib.handle;

import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;



+ 11
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java View File

@@ -8,16 +8,17 @@ import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.enums.StepStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;


/**
@@ -31,10 +32,12 @@ import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle {
private final IProjectInstService projectInstService;
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;

public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService){
public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){
this.projectInstService = projectInstService;
this.processInstanceService = processInstanceService;
this.buildUserUtils = buildUserUtils;
}

@Override
@@ -66,11 +69,15 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle
} else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) {
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
}

// 装配节点审核人员信息
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
buildUserUtils.buildUserByProcessInfo(progressInfo);

// 根据流程处理详情获取流程完成时间
if(StepStatusEnum.contains(processDetailVO.getStepStatus(),
Lists.newArrayList(StepStatusEnum.REJECTED,
StepStatusEnum.COMPLETED))){
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1);
LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime());
processDetailVO.setFinishTime(finishTime);


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java View File

@@ -5,6 +5,8 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*;
import java.util.Arrays;
import java.util.List;

import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@@ -13,10 +15,8 @@ import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java View File

@@ -4,6 +4,8 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*;

import java.util.*;

import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@@ -12,10 +14,8 @@ import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;



+ 23
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java View File

@@ -2,7 +2,9 @@ package com.ningdatech.pmapi.projectlib.handle;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
@@ -11,11 +13,13 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;

import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.enums.StepStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@@ -33,10 +37,12 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle {
private final IProjectInstService projectInstService;

private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;

public UnitInnerAuditHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService){
public UnitInnerAuditHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){
this.projectInstService = projectInstService;
this.processInstanceService = processInstanceService;
this.buildUserUtils = buildUserUtils;
}

@Override
@@ -59,11 +65,15 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle {
} else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) {
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED);
}

// 装配节点审核人员信息
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
buildUserUtils.buildUserByProcessInfo(progressInfo);

// 根据流程处理详情获取流程完成时间
if(StepStatusEnum.contains(processDetailVO.getStepStatus(),
Lists.newArrayList(StepStatusEnum.REJECTED,
StepStatusEnum.COMPLETED))){
List<ProgressNode> progressInfo = instanceDetail.getProgressInfo();
ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1);
LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime());
processDetailVO.setFinishTime(finishTime);
@@ -72,4 +82,13 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle {
processDetailVO.setProcessName(CommonConst.UNIT_INNER_AUDIT);
processSchedule.add(processDetailVO);
}

private void buildUser(List<ProgressNode> progressInfo, Map<String, ProcessInstanceUserDto> userMap) {
for (ProgressNode progressNode : progressInfo) {
progressNode.setUser(userMap.get(progressNode.getUserId()));
if (CollUtil.isNotEmpty(progressNode.getChildren())) {
buildUser(progressNode.getChildren(), userMap);
}
}
}
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -17,12 +17,12 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;


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

@@ -28,6 +28,9 @@ public class ProjectDTO implements Serializable {
@ApiModelProperty("主键")
private Long id;

@ApiModelProperty("如果是通过草稿箱提交的 要传下草稿id")
private Long draftId;

@ApiModelProperty("所属地区编号")
private String areaCode;

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

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

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

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

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

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

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


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

@@ -1,40 +0,0 @@
package com.ningdatech.pmapi.projectlib.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
* 流程进度详情VO
*
* @author CMM
* @since 2023/02/24 11:25
*/
@ApiModel(value = "ProcessDetailVO", description = "流程进度详情VO")
@Data
public class ProcessDetailVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("环节状态")
private StepStatusEnum stepStatus;

@ApiModelProperty("流程名称")
private String processName;

@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime finishTime;

@ApiModelProperty("流程处理进度详情")
private ProcessProgressVo processProgressVo;


}

+ 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;

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

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

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


+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/staging/enums/MsgTypeEnum.java View File

@@ -1,6 +1,5 @@
package com.ningdatech.pmapi.staging.enums;

import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;


+ 24
- 25
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -9,6 +9,7 @@ import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
@@ -38,7 +39,9 @@ import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq;
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq;
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq;
import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.contants.HisProInsEndActId;
@@ -97,6 +100,8 @@ public class TodoCenterManage {
private final INdWorkNoticeStagingService workNoticeStagingService;
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage;
private final IProjectApplicationService projectApplicationService;
private final UserInfoHelper userInfoHelper;
private final BuildUserUtils buildUserUtils;


/**
@@ -363,14 +368,27 @@ public class TodoCenterManage {
} else {
// 当前登录用户不是流程发起人
List<ProgressNode> currentProgressInfo = currentInstanceDetail.getProgressInfo();

ProgressNode progressNode = currentProgressInfo.get(currentProgressInfo.size() - 1);
ProgressNode beforeProgressNode;
ProgressNode currentProgressNode;
// 说明当前节点是子流程节点
if (progressNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) {
List<ProgressNode> children = progressNode.getChildren();
beforeProgressNode = children.get(children.size() - 2);
currentProgressNode = children.get(children.size() - 1);
} else {
beforeProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 2);
currentProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 1);
}
// 获取当前工作流任务前一个审核人信息
ProgressNode beforeProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 2);
ProcessInstanceUserDto beforeUser = beforeProgressNode.getUser();
UserFullInfoDTO beforeUserInfo = userInfoHelper.getUserFullInfo(Long.valueOf(beforeUser.getUserId()));
// 获取当前当前工作流任务当前审核人信息
ProgressNode currentProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 1);
ProcessInstanceUserDto currentUser = currentProgressNode.getUser();
UserFullInfoDTO currentUserInfo = userInfoHelper.getUserFullInfo(Long.valueOf(currentUser.getUserId()));
// 判断当前工作流任务前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常
boolean orgFlag = currentUser.getOrgCode().equals(beforeUser.getOrgCode());
boolean orgFlag = currentUserInfo.getOrganizationCode().equals(beforeUserInfo.getOrganizationCode());
boolean userFlag = beforeUser.getUserId().equals(String.valueOf(userId));
if (!orgFlag) {
throw new BizException("下一个审核人和您不是同一个部门,无法撤回!");
@@ -573,21 +591,10 @@ public class TodoCenterManage {
ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId);

List<ProgressNode> progressInfo = progressInstanceDetail.getProgressInfo();
buildUserUtils.buildUserByProcessInfo(progressInfo);

Set<String> userSet = Sets.newHashSet();
progressInfo.forEach(node -> {
if (CollUtil.isNotEmpty(node.getChildren())) {
for (ProgressNode innerNode : node.getChildren()) {
userSet.add(innerNode.getUserId());
}
} else {
userSet.add(node.getUserId());
}
});
Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet);

// 装配节点审核人员信息
buildUser(progressInfo, userMap);
//// 装配节点审核人员信息
//buildUser(progressInfo, userMap);

ProcessProgressDetailVo res = new ProcessProgressDetailVo();
res.setProcessProgressVo(progressInstanceDetail);
@@ -596,14 +603,6 @@ public class TodoCenterManage {
return res;
}

private void buildUser(List<ProgressNode> progressInfo, Map<String, ProcessInstanceUserDto> userMap) {
for (ProgressNode progressNode : progressInfo) {
progressNode.setUser(userMap.get(progressNode.getUserId()));
if (CollUtil.isNotEmpty(progressNode.getChildren())) {
buildUser(progressNode.getChildren(), userMap);
}
}
}

/**
* 待办中心我已处理项目列表查询


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java View File

@@ -39,13 +39,13 @@ public class ResToBeProcessedVO implements Serializable {
private String projectName;

@ApiModelProperty("建设单位名称")
private String buildOrgName;
private String buildOrg;

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

@ApiModelProperty("申报金额")
private BigDecimal declareAmount;
private BigDecimal declaredAmount;

@ApiModelProperty("预算年度")
private Integer projectYear;


+ 53
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/utils/BuildUserUtils.java View File

@@ -0,0 +1,53 @@
package com.ningdatech.pmapi.todocenter.utils;

import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Sets;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.process.ProgressNode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* 装配节点用户信息工具类
*
* @author CMM
* @since 2023/03/08 11:52
*/
@Slf4j
@RequiredArgsConstructor
@Component
public class BuildUserUtils {

private final IUserInfoService userInfoService;

public void buildUserByProcessInfo(List<ProgressNode> progressInfo) {
Set<String> userSet = Sets.newHashSet();
progressInfo.forEach(node -> {
if (CollUtil.isNotEmpty(node.getChildren())) {
for (ProgressNode innerNode : node.getChildren()) {
userSet.add(innerNode.getUserId());
}
} else {
userSet.add(node.getUserId());
}
});
Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet);
buildUser(progressInfo,userMap);
}
private void buildUser(List<ProgressNode> progressInfo, Map<String, ProcessInstanceUserDto> userMap) {
for (ProgressNode progressNode : progressInfo) {
progressNode.setUser(userMap.get(progressNode.getUserId()));
if (CollUtil.isNotEmpty(progressNode.getChildren())) {
buildUser(progressNode.getChildren(), userMap);
}
}
}


}

Loading…
Cancel
Save