@@ -46,6 +46,12 @@ public class ProjectLibController { | |||||
return projectLibManage.projectLibListWithPermission(req,user); | return projectLibManage.projectLibListWithPermission(req,user); | ||||
} | } | ||||
@GetMapping("/history-list/{id}") | |||||
@ApiOperation("项目历史版本列表") | |||||
public List<ProjectDetailVO> historyProjects(@PathVariable Long id) { | |||||
return projectLibManage.historyProjects(id); | |||||
} | |||||
@GetMapping("/application/list") | @GetMapping("/application/list") | ||||
@ApiOperation("应用列表") | @ApiOperation("应用列表") | ||||
public PageVo<ProjectApplicationVO> applicationList(ProjectApplicationListReq req) { | public PageVo<ProjectApplicationVO> applicationList(ProjectApplicationListReq req) { | ||||
@@ -817,4 +817,29 @@ public class ProjectLibManage { | |||||
}) | }) | ||||
.collect(Collectors.toList()); | .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()); | |||||
} | |||||
} | } |
@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectlib.model.vo; | |||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.alibaba.fastjson.annotation.JSONField; | import com.alibaba.fastjson.annotation.JSONField; | ||||
import com.fasterxml.jackson.annotation.JsonFormat; | import com.fasterxml.jackson.annotation.JsonFormat; | ||||
import com.ningdatech.basic.util.NdDateUtils; | |||||
import com.ningdatech.pmapi.common.util.BizUtils; | import com.ningdatech.pmapi.common.util.BizUtils; | ||||
import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; | import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; | ||||
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; | import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; | ||||
@@ -367,6 +368,18 @@ public class ProjectDetailVO { | |||||
@ApiModelProperty("初审人员") | @ApiModelProperty("初审人员") | ||||
private List<PreInsAcceptancePersonVO> acceptancePersons; | 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() { | public String getProjectTypeName() { | ||||
if (Objects.nonNull(this.projectType)) { | if (Objects.nonNull(this.projectType)) { | ||||