diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectentrust/service/impl/ProjectEntrustInquiryServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectentrust/service/impl/ProjectEntrustInquiryServiceImpl.java index 7615376..d0900e2 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectentrust/service/impl/ProjectEntrustInquiryServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectentrust/service/impl/ProjectEntrustInquiryServiceImpl.java @@ -112,7 +112,8 @@ public class ProjectEntrustInquiryServiceImpl extends BaseServiceImpl().eq("procurement_plan_id",inquiryNoticeVO.getInquiryId()).ne("status",ProjectCommonUtil.ENTRUS_STATUS_9)); if(null == projectEntrust){ @@ -146,7 +147,8 @@ public class ProjectEntrustInquiryServiceImpl extends BaseServiceImpl getMaxBusinessModule(@ApiParam(value = "项目ID", required = true) @PathVariable String projectId){ + + return BaseResponse.success(projectSectionService.getMaxBusinessModule(projectId)); + } } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/IProjectSectionService.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/IProjectSectionService.java index 0a99e24..fb86107 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/IProjectSectionService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/IProjectSectionService.java @@ -194,4 +194,11 @@ public interface IProjectSectionService extends IBaseService{ * @return 返回结果 */ List selectListByProjectId(String projectId); + + /** + * 根据项目ID获取标段最快流程 + * @param projectId 项目ID + * @return 返回业务流程 + */ + Integer getMaxBusinessModule(String projectId); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/impl/ProjectSectionServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/impl/ProjectSectionServiceImpl.java index 383b3f9..296ba6a 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/impl/ProjectSectionServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/impl/ProjectSectionServiceImpl.java @@ -531,6 +531,29 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl sectionList = this.getList(sectionVO); + //标段为空 报错提示 + if(!CollectionUtils.isEmpty(sectionList)){ + //获取标段是否有异常 如果有异常直接流程是归档 12 + long count = sectionList.stream().filter(n -> (ProjectCommonUtil.SECTION_STATUS_9 == n.getStatus())).count(); + if(count > 0){ + maxBusinessModule = ProjectCommonUtil.BUSINESS_MODULE_12; + }else{ + //不是异常获取最大的业务流程 + maxBusinessModule = sectionList.stream().mapToInt(ProjectSection::getBusinessModule).max().getAsInt(); + } + }else{ + ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.throwException(); + } + return maxBusinessModule; + } + /** * 拼装标段模块修改流程实体并插入数据 * @param sectionId 标段ID