diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/common/ProjectCommonUtil.java b/src/main/java/com/chinaunicom/mall/ebtp/project/common/ProjectCommonUtil.java index a2bd7fc..7ded12e 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/common/ProjectCommonUtil.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/common/ProjectCommonUtil.java @@ -403,6 +403,11 @@ public class ProjectCommonUtil { */ public static final int RE_EVALUATION_STATUS_2 = 2; + /** + * 重新评审 3 重评生效 + */ + public static final int RE_EVALUATION_STATUS_3 = 3; + /** * 重新评审 9 审批不通过 */ 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/controller/ProjectReEvaluationController.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/controller/ProjectReEvaluationController.java index 0a1c070..2cb2a79 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/controller/ProjectReEvaluationController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/controller/ProjectReEvaluationController.java @@ -215,4 +215,17 @@ public class ProjectReEvaluationController { return BaseResponse.success(projectReEvaluationService.findTraceDetail(instanceId)); } + + /** + * 项目重评生效 + * @param id 主键ID + * @return 返回结果 + */ + @ApiOperation("项目重评生效") + @GetMapping("/achieve/{id}") + @PreAuthorize("hasAnyAuthority('ebtp-purchase','ebtp-agency-project-manager')") + public BaseResponse achieve(@ApiParam(value = "流程实例id", required = true) @PathVariable("id") String id) { + + return BaseResponse.success(projectReEvaluationService.achieve(id)); + } } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/IProjectReEvaluationService.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/IProjectReEvaluationService.java index 4fd6072..c70f7c8 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/IProjectReEvaluationService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/IProjectReEvaluationService.java @@ -105,4 +105,11 @@ public interface IProjectReEvaluationService extends IBaseService 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、调用流程中心 发起重新评审流程 @@ -213,12 +215,10 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl evaluationQueryWrapper = new QueryWrapper<>(); evaluationQueryWrapper.eq(ProjectReEvaluationField.SECTION_ID,sectionId); - evaluationQueryWrapper.and(wrapper -> wrapper.eq(ProjectReEvaluationField.STATUS,ProjectCommonUtil.RE_EVALUATION_STATUS_0).or().eq(ProjectReEvaluationField.STATUS,ProjectCommonUtil.RE_EVALUATION_STATUS_1)); + evaluationQueryWrapper.in(ProjectReEvaluationField.STATUS, ListUtil.toList(statusArray)); int count = this.count(evaluationQueryWrapper); if(count > 0){ ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_RE_EVAL_FIND_STATUS_ERROR.throwException(); @@ -364,6 +365,14 @@ public class ProjectReEvaluationServiceImpl 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; } diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index bce0279..3cf63ef 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -112,7 +112,7 @@ mybatis-plus: map-underscore-to-camel-case: true auto-mapping-behavior: full # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl mapper-locations: classpath*:com/chinaunicom/mall/ebtp/**/mapper/*Mapper.xml global-config: # 逻辑删除配置