From 89f0757a15c7a4376690afd4eb2e6b83b16741fb Mon Sep 17 00:00:00 2001 From: WendyYang Date: Wed, 27 Mar 2024 15:44:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=9F=A5=E8=AF=A2=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enumeration/ProjectProcessStageEnum.java | 5 +- .../controller/PurchaseController.java | 20 ++++++++ .../api/projectdeclared/manage/PurchaseManage.java | 56 ++++++++++++++++++++++ .../model/req/TestValidListReq.java | 29 +++++++++++ .../projectdeclared/model/vo/TestValidListVO.java | 39 +++++++++++++++ .../projectlib/model/enumeration/InstTypeEnum.java | 5 +- 6 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/TestValidListReq.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/TestValidListVO.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ProjectProcessStageEnum.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ProjectProcessStageEnum.java index 5580521..7a05966 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ProjectProcessStageEnum.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ProjectProcessStageEnum.java @@ -31,7 +31,10 @@ public enum ProjectProcessStageEnum { APPLY_DELAY(6, "申请延期审批流程"), APPLY_BORROW(7, "申请借阅审批流程"), PROJECT_RECORD_APPROVAL_PROCESS(8, "立项备案审批流程"), - XC_APPROVAL_PROCESS(9, "信创审批流程"); + XC_APPROVAL_PROCESS(9, "信创审批流程"), + SELF_TEST(10, "系统自测审批流程"), + ADAPTION(11, "适配改造审批流程"), + TEST_VALID(12, "测试验证审批流程"); private final Integer code; private final String desc; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java index 9dc5a70..8265d94 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java @@ -5,7 +5,9 @@ import com.hz.pm.api.projectdeclared.manage.PurchaseManage; import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO; import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseRecordReq; import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq; +import com.hz.pm.api.projectdeclared.model.req.TestValidListReq; import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; +import com.hz.pm.api.projectdeclared.model.vo.TestValidListVO; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.basic.model.PageVo; @@ -75,4 +77,22 @@ public class PurchaseController { purchaseManage.submitPurchaseRecord(req); } + @GetMapping("/pageTestValid") + @ApiOperation("获取测试验证列表") + public PageVo pageTestValid(TestValidListReq req){ + return purchaseManage.testValidList(req); + } + + @GetMapping("/pageSelfTest") + @ApiOperation("获取系统自测列表") + public PageVo pageSelfTest(TestValidListReq req){ + return purchaseManage.selfTestList(req); + } + + @GetMapping("/pageAdaption") + @ApiOperation("获取适配改造列表") + public PageVo pageAdaption(TestValidListReq req){ + return purchaseManage.adaptList(req); + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java index 7c1c20a..43fbc7a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java @@ -4,10 +4,15 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.ReflectUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONUtil; import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; import com.hz.pm.api.common.helper.UserInfoHelper; @@ -26,9 +31,12 @@ import com.hz.pm.api.projectdeclared.model.enumerization.PurchaseScopeEnum; import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq; import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq.PurchaseNoticeTenderDTO; import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseRecordReq; +import com.hz.pm.api.projectdeclared.model.req.TestValidListReq; import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; +import com.hz.pm.api.projectdeclared.model.vo.TestValidListVO; import com.hz.pm.api.projectdeclared.service.IContractService; import com.hz.pm.api.projectdeclared.service.IPurchaseService; +import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; import com.hz.pm.api.projectlib.helper.ProjectHelper; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; @@ -49,6 +57,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.file.entity.File; import com.ningdatech.file.entity.vo.result.FileResultVO; import com.ningdatech.file.service.FileService; +import io.swagger.models.auth.In; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -62,6 +71,8 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Consumer; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -85,6 +96,8 @@ public class PurchaseManage { private final MhFileClient mhFileClient; private final FileService fileService; + + /** * 待采购的-项目列表 * @@ -358,4 +371,47 @@ public class PurchaseManage { purchaseService.saveOrUpdate(purchase); } + private PageVo queryData(TestValidListReq req, + SFunction function) { + LambdaQueryWrapper query = Wrappers.lambdaQuery(Purchase.class) + .like(StrUtil.isNotBlank(req.getBidName()), Purchase::getBidName, req.getBidName()) + .le(req.getCreateOnMax() != null, Purchase::getCreateOn, req.getCreateOnMax()) + .ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin()) + .eq(req.getStatus() != null, function, req.getStatus()) + .isNotNull(function) + .orderByDesc(Purchase::getCreateOn); + Page page = purchaseService.page(req.page(), query); + if (page.getTotal() == 0) { + return PageVo.empty(); + } + List records = page.getRecords(); + List projectIds = CollUtils.fieldList(records, Purchase::getProjectId); + Map contractMap = contractService.listByProjectIds(projectIds); + List data = records.stream().map(w -> { + TestValidListVO item = new TestValidListVO(); + item.setBidId(w.getId()); + item.setBizName(w.getBidName()); + item.setProjectId(w.getProjectId()); + String projectCode = ProjectIdCodeCacheUtil.get(w.getProjectId()); + item.setProjectCode(projectCode); + Contract contract = contractMap.get(w.getId()); + item.setContractAmount(contract.getTotalAmount()); + item.setStatus(function.apply(w)); + return item; + }).collect(Collectors.toList()); + return PageVo.of(data, page.getTotal()); + } + + public PageVo testValidList(TestValidListReq req) { + return queryData(req, Purchase::getTestValidStatus); + } + + public PageVo adaptList(TestValidListReq req) { + return queryData(req, Purchase::getAdaptStatus); + } + + public PageVo selfTestList(TestValidListReq req) { + return queryData(req, Purchase::getSelfTestStatus); + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/TestValidListReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/TestValidListReq.java new file mode 100644 index 0000000..27bfa77 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/TestValidListReq.java @@ -0,0 +1,29 @@ +package com.hz.pm.api.projectdeclared.model.req; + +import com.ningdatech.basic.model.PagePo; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDateTime; + +/** + *

+ * TestValidListReq + *

+ * + * @author WendyYang + * @since 14:49 2024/3/27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class TestValidListReq extends PagePo { + + private String bidName; + + private Integer status; + + private LocalDateTime createOnMin; + + private LocalDateTime createOnMax; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/TestValidListVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/TestValidListVO.java new file mode 100644 index 0000000..400cf50 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/TestValidListVO.java @@ -0,0 +1,39 @@ +package com.hz.pm.api.projectdeclared.model.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + *

+ * TestValidListVO + *

+ * + * @author WendyYang + * @since 14:43 2024/3/27 + */ +@Data +public class TestValidListVO { + + @ApiModelProperty("标段ID") + private Long bidId; + + @ApiModelProperty("标段名称") + private String bizName; + + @ApiModelProperty("合同金额") + private BigDecimal contractAmount; + + @ApiModelProperty("状态") + private Integer status; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + private Long projectId; + + private String projectCode; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/InstTypeEnum.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/InstTypeEnum.java index f8bdf85..23d0b93 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/InstTypeEnum.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/InstTypeEnum.java @@ -30,7 +30,10 @@ public enum InstTypeEnum { DECLARED_RECORD(8, "立项备案审批流程"), XCFHX_APPLY(9, "信创审查审批流程"), - APPLY_BORROW(7, "申请借阅审批流程"); + APPLY_BORROW(7, "申请借阅审批流程"), + SELF_TEST(10, "系统自测审批流程"), + ADAPTION(11, "适配改造审批流程"), + TEST_VALID(12, "测试验证审批流程"); private Integer code; private String desc;