From 208a4da61007eb7a738a959a070f8b3ddf55f23d Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 16 Jun 2023 10:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E6=9C=9F=E5=88=97=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectdeclared/manage/DelayedApplyManage.java | 17 +++++++++++++++++ .../pmapi/projectlib/model/vo/ProjectLibListItemVO.java | 3 +++ 2 files changed, 20 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java index bfef5a1..b8bd7df 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java @@ -45,6 +45,7 @@ import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant; import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; import com.ningdatech.pmapi.user.util.LoginUserUtil; import com.wflow.bean.entity.WflowModels; +import com.wflow.contants.HisProInsEndActId; import com.wflow.exception.BusinessException; import com.wflow.workflow.bean.dto.OrgInfoDTO; import com.wflow.workflow.bean.vo.ProcessStartParamsVo; @@ -53,6 +54,8 @@ import com.wflow.workflow.service.ProcessModelService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.flowable.engine.HistoryService; +import org.flowable.engine.history.HistoricProcessInstance; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -88,6 +91,7 @@ public class DelayedApplyManage { private final ProjectLibManage projectLibManage; private final NoticeManage noticeManage; private final IProjectInstService projectInstService; + private final HistoryService historyService; /** * 延期的-项目列表 @@ -132,6 +136,19 @@ public class DelayedApplyManage { item.setBuildCycle(StringUtils.isNotBlank(w.getBuildCycle()) ? Integer.valueOf(w.getBuildCycle()) : null); item.setPlanAcceptanceTime(w.getPlanAcceptanceTime()); + // 判断当前项目是否已经开启了延期申请并且没有审批完成 + String instCode = w.getInstCode(); + // 获取流程通过后的流程实例 + HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() + .processInstanceId(instCode) + .singleResult(); + ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) + .eq(ProjectInst::getInstCode, instCode)); + Integer instType = projectInst.getInstType(); + if (InstTypeEnum.APPLY_DELAY.getCode().equals(instType) && + !HisProInsEndActId.END.equals(newInstance.getEndActivityId())){ + item.setCanDelayApply(Boolean.FALSE); + } return item; }); return PageVo.of(records, total); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 30fd30a..8cc1c39 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -133,6 +133,9 @@ public class ProjectLibListItemVO { @ApiModelProperty("是否有上级条线主管部门 0没有 1有") private Integer isHigherSuperOrg; + @ApiModelProperty("是否可以申请延期") + private Boolean canDelayApply = Boolean.TRUE; + //预审申报时候 需不需要上传上级条线意见文件 private Boolean needUploadSuperLineFile; public Boolean getNeedUploadSuperLineFile() {