Просмотр исходного кода

增加测试验证查询列表

tags/24080901
WendyYang 7 месяцев назад
Родитель
Сommit
89f0757a15
6 измененных файлов: 152 добавлений и 2 удалений
  1. +4
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/enumeration/ProjectProcessStageEnum.java
  2. +20
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java
  3. +56
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  4. +29
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/TestValidListReq.java
  5. +39
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/TestValidListVO.java
  6. +4
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/InstTypeEnum.java

+ 4
- 1
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;


+ 20
- 0
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<TestValidListVO> pageTestValid(TestValidListReq req){
return purchaseManage.testValidList(req);
}

@GetMapping("/pageSelfTest")
@ApiOperation("获取系统自测列表")
public PageVo<TestValidListVO> pageSelfTest(TestValidListReq req){
return purchaseManage.selfTestList(req);
}

@GetMapping("/pageAdaption")
@ApiOperation("获取适配改造列表")
public PageVo<TestValidListVO> pageAdaption(TestValidListReq req){
return purchaseManage.adaptList(req);
}

}

+ 56
- 0
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<TestValidListVO> queryData(TestValidListReq req,
SFunction<Purchase, Integer> function) {
LambdaQueryWrapper<Purchase> 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<Purchase> page = purchaseService.page(req.page(), query);
if (page.getTotal() == 0) {
return PageVo.empty();
}
List<Purchase> records = page.getRecords();
List<Long> projectIds = CollUtils.fieldList(records, Purchase::getProjectId);
Map<Long, Contract> contractMap = contractService.listByProjectIds(projectIds);
List<TestValidListVO> 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<TestValidListVO> testValidList(TestValidListReq req) {
return queryData(req, Purchase::getTestValidStatus);
}

public PageVo<TestValidListVO> adaptList(TestValidListReq req) {
return queryData(req, Purchase::getAdaptStatus);
}

public PageVo<TestValidListVO> selfTestList(TestValidListReq req) {
return queryData(req, Purchase::getSelfTestStatus);
}

}

+ 29
- 0
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;

/**
* <p>
* TestValidListReq
* </p>
*
* @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;

}

+ 39
- 0
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;

/**
* <p>
* TestValidListVO
* </p>
*
* @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;

}

+ 4
- 1
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;


Загрузка…
Отмена
Сохранить