From 551d2b88b767d092ad0318a18d9e82f026f82617 Mon Sep 17 00:00:00 2001 From: dxc Date: Tue, 30 Mar 2021 09:39:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=9F=E6=95=88=E6=8C=89=E9=92=AE=20?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=89=8B=E5=8A=A8=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/common/ProjectCommonUtil.java | 5 +++++ .../ProjectReEvaluationController.java | 13 ++++++++++++ .../service/IProjectReEvaluationService.java | 7 +++++++ .../impl/ProjectReEvaluationServiceImpl.java | 21 ++++++++++++------- 4 files changed, 38 insertions(+), 8 deletions(-) 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/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 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 +361,14 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl Date: Tue, 30 Mar 2021 09:40:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=8E=BB=E6=8E=89=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-local.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: # 逻辑删除配置 From 165060f62a1e3ea06fdce6ed52b91764c4667daf Mon Sep 17 00:00:00 2001 From: dxc Date: Tue, 30 Mar 2021 16:00:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1=E3=80=81=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=BF=87=E6=BB=A4=E5=B7=B2=E6=8E=A8=E9=80=81=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E7=BB=93=E6=9E=9C=E6=95=B0=E6=8D=AE=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E6=AE=B5=202=E3=80=81=E9=87=8D=E6=96=B0=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/common/ProjectExceptionEnum.java | 2 ++ .../mall/ebtp/project/feign/EbtpRsmsApi.java | 11 ++++++++++ .../ProjectSectionExceptionController.java | 13 ++++++++++++ .../IProjectSectionExceptionService.java | 8 ++++++++ .../ProjectSectionExceptionServiceImpl.java | 8 ++++++++ .../impl/ProjectReEvaluationServiceImpl.java | 20 +++++++++++-------- .../impl/ProjectSectionServiceImpl.java | 15 ++++++++++++-- 7 files changed, 67 insertions(+), 10 deletions(-) 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; }