diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/common/ProjectExceptionEnum.java b/src/main/java/com/chinaunicom/mall/ebtp/project/common/ProjectExceptionEnum.java index 6752063..68ba062 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/common/ProjectExceptionEnum.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/common/ProjectExceptionEnum.java @@ -167,6 +167,8 @@ public enum ProjectExceptionEnum implements BusinessExceptionAssert { FRAME_EXCEPTION_PROJECT_SECTION_NOT_STATUS(110074, "项目标段信息已经异常处理不可以进行操作!"), FRAME_EXCEPTION_PROJECT_SUPP_REL_VO_LIST_EMPTY(110075, "供应商ID不能为空!"), + + FRAME_EXCEPTION_PROJECT_CHECK_STATUS_ERROR(110079, "调用采购系统校验是否可以发起接口错误"), ; /** diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/feign/EbtpRsmsApi.java b/src/main/java/com/chinaunicom/mall/ebtp/project/feign/EbtpRsmsApi.java index dc553f5..f61b498 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/feign/EbtpRsmsApi.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/feign/EbtpRsmsApi.java @@ -9,6 +9,9 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; +import java.util.List; +import java.util.Map; + /** * 评审 * @author daixc @@ -34,4 +37,12 @@ public interface EbtpRsmsApi { @GetMapping("/v1/jury/copy") BaseResponse copyJury(@RequestParam(name = "oldRoomId") String oldRoomId, @RequestParam(name = "newRoomId") String newRoomId); + + /** + * 根据标段ID集合查询是否能够发起异常处理 + * @param bsIds 标段id集合 + * @return 返回结果 + */ + @PostMapping("/v1/reviewresult/getToExceptionByBsId") + BaseResponse> getToExceptionByBsId(@RequestBody List bsIds); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectexception/controller/ProjectSectionExceptionController.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectexception/controller/ProjectSectionExceptionController.java index ed44d78..34aa1ea 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectexception/controller/ProjectSectionExceptionController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectexception/controller/ProjectSectionExceptionController.java @@ -66,4 +66,17 @@ public class ProjectSectionExceptionController{ return BaseResponse.success(projectSectionException); } + /** + * 获取标段是否有异常信息 + * @param sectionId 标段id + * @return 返回结果 ture 没有异常信息 false 有异常信息 + */ + @ApiOperation("查询标段是否有异常信息") + @GetMapping ("/getBySectionId/{sectionId}") + public BaseResponse getBySectionId(@ApiParam(value = "标段ID", required = true) @PathVariable String sectionId){ + + return BaseResponse.success(projectSectionExceptionService.getBySectionId(sectionId)); + } + + } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectexception/service/IProjectSectionExceptionService.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectexception/service/IProjectSectionExceptionService.java index 4057828..de713b3 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectexception/service/IProjectSectionExceptionService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectexception/service/IProjectSectionExceptionService.java @@ -18,4 +18,12 @@ public interface IProjectSectionExceptionService extends IBaseService 0; } + + @Override + public boolean getBySectionId(String sectionId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ProjectSectionException::getSectionId,sectionId); + return this.count(queryWrapper) <= 0; + } } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java index 9bb5c3e..d8d70fc 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java @@ -185,14 +185,18 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl baseResponse = mallResuApi.findStatusByPurpIdForEval(Long.parseLong(section.getSubprojectId())); - log.info("重评校验子项目信息返回结果:{}",JsonUtils.objectToJson(baseResponse)); - if(!baseResponse.isSuccess()){ - CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess()); - } - if(!baseResponse.getData()){ - ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_EXCEPTION_CHECK_STATUS_ERROR.throwException(); + try { + log.info("重评校验子项目信息请求参数 子项目ID:{}",section.getSubprojectId()); + BaseResponse baseResponse = mallResuApi.findStatusByPurpIdForEval(Long.parseLong(section.getSubprojectId())); + log.info("重评校验子项目信息返回结果:{}",JsonUtils.objectToJson(baseResponse)); + if(!baseResponse.isSuccess()){ + CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess()); + } + if(!baseResponse.getData()){ + ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_EXCEPTION_CHECK_STATUS_ERROR.throwException(); + } + }catch (Exception e){ + ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_CHECK_STATUS_ERROR.throwException(); } //3、调用流程中心 发起重新评审流程 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 ee1635e..2c8dd3b 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 @@ -16,6 +16,7 @@ import com.chinaunicom.mall.ebtp.project.common.ProjectExceptionEnum; import com.chinaunicom.mall.ebtp.project.dictchooseprocess.entity.DictChooseProcess; import com.chinaunicom.mall.ebtp.project.dictchooseprocess.service.IDictChooseProcessService; import com.chinaunicom.mall.ebtp.project.feign.EbtpMallProcessApi; +import com.chinaunicom.mall.ebtp.project.feign.EbtpRsmsApi; import com.chinaunicom.mall.ebtp.project.feign.entity.BizAssessRoom; import com.chinaunicom.mall.ebtp.project.feign.entity.DictProjectConfig; import com.chinaunicom.mall.ebtp.project.feign.entity.SectionFlowVO; @@ -29,14 +30,12 @@ import com.chinaunicom.mall.ebtp.project.projectsection.entity.ProjectSectionVO; import com.chinaunicom.mall.ebtp.project.projectsection.service.IProjectSectionFlowService; import com.chinaunicom.mall.ebtp.project.projectsection.service.IProjectSectionService; import io.seata.core.context.RootContext; -import io.seata.spring.annotation.GlobalTransactional; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -67,6 +66,9 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl sectionVOList = projectSectionMapper.selectEditSectionBySave(projectId); sectionVOList = sectionVOList.stream().filter(n -> (n.getBusinessModule() > (isReviewMethod ? ProjectCommonUtil.BUSINESS_MODULE_2 : ProjectCommonUtil.BUSINESS_MODULE_7) && n.getStatus() < ProjectCommonUtil.BUSINESS_MODULE_12)).collect(Collectors.toList()); + + //查询接口过滤已推送数据的标段信息 + List sectionIds = sectionVOList.stream().map(ProjectSectionVO::getId).collect(Collectors.toList()); + BaseResponse> baseResponse = rsmsApi.getToExceptionByBsId(sectionIds); + ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess()); + + Map pushResultMap = baseResponse.getData(); + sectionVOList = sectionVOList.stream().filter(n -> pushResultMap.get(n.getId())).collect(Collectors.toList()); + return sectionVOList; }