瀏覽代碼

历史版本

tags/24080901
PoffyZhang 1 年之前
父節點
當前提交
f720d5f19c
共有 3 個文件被更改,包括 44 次插入0 次删除
  1. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java
  2. +25
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  3. +13
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java 查看文件

@@ -46,6 +46,12 @@ public class ProjectLibController {
return projectLibManage.projectLibListWithPermission(req,user);
}

@GetMapping("/history-list/{id}")
@ApiOperation("项目历史版本列表")
public List<ProjectDetailVO> historyProjects(@PathVariable Long id) {
return projectLibManage.historyProjects(id);
}

@GetMapping("/application/list")
@ApiOperation("应用列表")
public PageVo<ProjectApplicationVO> applicationList(ProjectApplicationListReq req) {


+ 25
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java 查看文件

@@ -817,4 +817,29 @@ public class ProjectLibManage {
})
.collect(Collectors.toList());
}

/**
* 历史版本 项目列表
* @param id
* @return
*/
public List<ProjectDetailVO> historyProjects(Long id) {
Project project = projectService.getById(id);

if(Objects.isNull(project)){
return Collections.emptyList();
}

List<Project> historyProjects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectCode, project.getProjectCode())
.orderByDesc(Project::getCreateOn));

if(CollUtil.isEmpty(historyProjects)){
return Collections.emptyList();
}

return historyProjects.stream()
.map(p -> BeanUtil.copyProperties(p,ProjectDetailVO.class))
.collect(Collectors.toList());
}
}

+ 13
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java 查看文件

@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectlib.model.vo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.util.BizUtils;
import com.ningdatech.pmapi.projectdeclared.model.entity.Contract;
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO;
@@ -367,6 +368,18 @@ public class ProjectDetailVO {
@ApiModelProperty("初审人员")
private List<PreInsAcceptancePersonVO> acceptancePersons;

@ApiModelProperty("版本号str")
private String versionStr;

public String getVersionStr() {
if (Objects.nonNull(this.newest) && this.newest) {
this.versionStr = "当前版本";
return this.versionStr;
}
this.versionStr = "v" + NdDateUtils.format(this.createOn,"yyyyMMddHHmmss");
return this.versionStr;
}


public String getProjectTypeName() {
if (Objects.nonNull(this.projectType)) {


Loading…
取消
儲存