@@ -1,6 +1,7 @@ | |||||
package com.ningdatech.pmapi.dashboard.handle; | package com.ningdatech.pmapi.dashboard.handle; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.google.common.collect.Lists; | |||||
import com.google.common.collect.Maps; | import com.google.common.collect.Maps; | ||||
import com.ningdatech.pmapi.dashboard.constant.DashboardConstant; | import com.ningdatech.pmapi.dashboard.constant.DashboardConstant; | ||||
import com.ningdatech.pmapi.dashboard.model.vo.ProtraitProjectOutputVO; | import com.ningdatech.pmapi.dashboard.model.vo.ProtraitProjectOutputVO; | ||||
@@ -51,6 +52,20 @@ public class ApplicationHandler { | |||||
return res; | return res; | ||||
} | } | ||||
public List<ProtraitProjectOutputVO> generateIrsApp(String projectCode) { | |||||
List<ProtraitProjectOutputVO> res = Lists.newArrayList(); | |||||
//.查询应用 | |||||
Project project = projectService.getProjectByCode(projectCode); | |||||
List<ProjectApplication> apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectVersion, project.getVersion()) | |||||
.eq(ProjectApplication::getProjectCode, projectCode)); | |||||
for(ProjectApplication app : apps){ | |||||
String appName = StringUtils.isNotBlank(app.getApplicationName()) ? app.getApplicationName() : app.getRelatedExistsApplication(); | |||||
res.add(generateOutputEntity(appName)); | |||||
} | |||||
return res; | |||||
} | |||||
private ProtraitProjectOutputVO generateOutputEntity(String name){ | private ProtraitProjectOutputVO generateOutputEntity(String name){ | ||||
return ProtraitProjectOutputVO.builder() | return ProtraitProjectOutputVO.builder() | ||||
.name(DashboardConstant.Protrait.PROJECT_SIGNS) | .name(DashboardConstant.Protrait.PROJECT_SIGNS) | ||||
@@ -65,11 +65,11 @@ public class CockpitStatsHandler { | |||||
private List<CockpitStatsVO.PerformanceTop> convertTops(CockpitStats cockpitStats) { | private List<CockpitStatsVO.PerformanceTop> convertTops(CockpitStats cockpitStats) { | ||||
List<CockpitStatsVO.PerformanceTop> tops = Lists.newArrayList(); | List<CockpitStatsVO.PerformanceTop> tops = Lists.newArrayList(); | ||||
tops.add(new CockpitStatsVO.PerformanceTop("top1",BigDecimal.valueOf(4.92),"应用1")); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top2",BigDecimal.valueOf(4.82),"应用2")); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top3",BigDecimal.valueOf(4.72),"应用3")); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top4",BigDecimal.valueOf(4.62),"应用4")); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top5",BigDecimal.valueOf(4.52),"应用5")); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top1",cockpitStats.getPerformanceTop1Score(),cockpitStats.getPerformanceTop1Name())); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top2",cockpitStats.getPerformanceTop2Score(),cockpitStats.getPerformanceTop2Name())); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top3",cockpitStats.getPerformanceTop3Score(),cockpitStats.getPerformanceTop3Name())); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top4",cockpitStats.getPerformanceTop4Score(),cockpitStats.getPerformanceTop4Name())); | |||||
tops.add(new CockpitStatsVO.PerformanceTop("top5",cockpitStats.getPerformanceTop5Score(),cockpitStats.getPerformanceTop5Name())); | |||||
return tops; | return tops; | ||||
} | } | ||||
@@ -217,25 +217,25 @@ public class CockpitStats implements Serializable { | |||||
private String performanceTop1Name; | private String performanceTop1Name; | ||||
@ApiModelProperty("绩效-top2分数") | @ApiModelProperty("绩效-top2分数") | ||||
private double performanceTop2Score; | |||||
private BigDecimal performanceTop2Score; | |||||
@ApiModelProperty("绩效-top2名称") | @ApiModelProperty("绩效-top2名称") | ||||
private String performanceTop2Name; | private String performanceTop2Name; | ||||
@ApiModelProperty("绩效-top3分数") | @ApiModelProperty("绩效-top3分数") | ||||
private double performanceTop3Score; | |||||
private BigDecimal performanceTop3Score; | |||||
@ApiModelProperty("绩效-top3名称") | @ApiModelProperty("绩效-top3名称") | ||||
private String performanceTop3Name; | private String performanceTop3Name; | ||||
@ApiModelProperty("绩效-top4分数") | @ApiModelProperty("绩效-top4分数") | ||||
private double performanceTop4Score; | |||||
private BigDecimal performanceTop4Score; | |||||
@ApiModelProperty("绩效-top4名称") | @ApiModelProperty("绩效-top4名称") | ||||
private String performanceTop4Name; | private String performanceTop4Name; | ||||
@ApiModelProperty("绩效-top5分数") | @ApiModelProperty("绩效-top5分数") | ||||
private double performanceTop5Score; | |||||
private BigDecimal performanceTop5Score; | |||||
@ApiModelProperty("绩效-top5名称") | @ApiModelProperty("绩效-top5名称") | ||||
private String performanceTop5Name; | private String performanceTop5Name; | ||||
@@ -0,0 +1,38 @@ | |||||
package com.ningdatech.pmapi.irs.controller; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.pmapi.dashboard.model.vo.ProtraitProjectOutputVO; | |||||
import com.ningdatech.pmapi.irs.manage.IrsProjectManage; | |||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import java.util.List; | |||||
/** | |||||
* @Classname IrsController | |||||
* @Description irs 一些下拉框信息 | |||||
* @Date 2023/3/13 9:53 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Slf4j | |||||
@Validated | |||||
@RestController | |||||
@RequestMapping("/api/v1/irs/project/") | |||||
@Api(value = "irs", tags = "irs-IRS项目信息") | |||||
@RequiredArgsConstructor | |||||
public class IrsProjectController { | |||||
private final IrsProjectManage irsProjectManage; | |||||
@ApiOperation(value = "IRS项目列表", notes = "IRS项目列表") | |||||
@GetMapping("/list") | |||||
public PageVo<ProjectLibListItemVO> list(ProjectListReq projectListReq) { | |||||
return irsProjectManage.list(projectListReq); | |||||
} | |||||
} |
@@ -0,0 +1,64 @@ | |||||
package com.ningdatech.pmapi.irs.manage; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.google.common.collect.Lists; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.pmapi.dashboard.model.vo.ProtraitProjectOutputVO; | |||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang3.StringUtils; | |||||
import org.springframework.stereotype.Component; | |||||
import java.util.List; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* @Classname IrsProjectManage | |||||
* @Description | |||||
* @Date 2023/8/15 11:43 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Component | |||||
@Slf4j | |||||
@RequiredArgsConstructor | |||||
public class IrsProjectManage { | |||||
private final IProjectService projectService; | |||||
/** | |||||
* IRS档案 项目列表 | |||||
* @param req | |||||
* @return | |||||
*/ | |||||
public PageVo<ProjectLibListItemVO> list(ProjectListReq req) { | |||||
Page<Project> page = req.page(); | |||||
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class) | |||||
.eq(StringUtils.isNotBlank(req.getAreaCode()),Project::getAreaCode,req.getAreaCode()) | |||||
.eq(StringUtils.isNotBlank(req.getRegionCode()),Project::getAreaCode,req.getRegionCode()) | |||||
.like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName()) | |||||
.like(StringUtils.isNotBlank(req.getBuildOrgName()),Project::getBuildOrgName,req.getBuildOrgName()) | |||||
.gt(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()) | |||||
.orderByDesc(Project::getUpdateOn); | |||||
projectService.page(page,wrapper); | |||||
if(CollUtil.isEmpty(page.getRecords())){ | |||||
return PageVo.empty(); | |||||
} | |||||
List<ProjectLibListItemVO> res = page.getRecords().stream().map(p -> { | |||||
ProjectLibListItemVO vo = new ProjectLibListItemVO(); | |||||
vo.setId(p.getId()); | |||||
vo.setProjectName(p.getProjectName()); | |||||
vo.setProjectCode(p.getProjectCode()); | |||||
return vo; | |||||
}).collect(Collectors.toList()); | |||||
return PageVo.of(res,page.getTotal()); | |||||
} | |||||
} |
@@ -26,6 +26,8 @@ import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; | |||||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.common.util.BizUtils; | import com.ningdatech.pmapi.common.util.BizUtils; | ||||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | import com.ningdatech.pmapi.common.util.ExcelDownUtil; | ||||
import com.ningdatech.pmapi.dashboard.handle.ApplicationHandler; | |||||
import com.ningdatech.pmapi.dashboard.handle.ProjectStatusHandler; | |||||
import com.ningdatech.pmapi.datascope.model.DataScopeDTO; | import com.ningdatech.pmapi.datascope.model.DataScopeDTO; | ||||
import com.ningdatech.pmapi.datascope.utils.DataScopeUtil; | import com.ningdatech.pmapi.datascope.utils.DataScopeUtil; | ||||
import com.ningdatech.pmapi.filemanage.model.entity.ProjectApplyBorrow; | import com.ningdatech.pmapi.filemanage.model.entity.ProjectApplyBorrow; | ||||
@@ -129,6 +131,8 @@ public class ProjectLibManage { | |||||
private final IPersonSafetyInfoService personSafetyInfoService; | private final IPersonSafetyInfoService personSafetyInfoService; | ||||
private final ApplicationHandler applicationHandler; | |||||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | ||||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | ||||
query.eq(Project::getNewest, Boolean.TRUE); | query.eq(Project::getNewest, Boolean.TRUE); | ||||
@@ -590,6 +594,8 @@ public class ProjectLibManage { | |||||
vo.setAcceptancePersons(convertPersons(acceptancePersons)); | vo.setAcceptancePersons(convertPersons(acceptancePersons)); | ||||
//查询终验信息 | //查询终验信息 | ||||
vo.setFinalIrsApps(applicationHandler.generateIrsApp(projectInfo.getProjectCode())); | |||||
//查询年度投资金额 要是已验收的项目 | //查询年度投资金额 要是已验收的项目 | ||||
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { | if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { | ||||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | ||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.annotation.JSONField; | |||||
import com.ningdatech.basic.util.NdDateUtils; | import com.ningdatech.basic.util.NdDateUtils; | ||||
import com.ningdatech.pmapi.common.compare.Compare; | import com.ningdatech.pmapi.common.compare.Compare; | ||||
import com.ningdatech.pmapi.common.util.BizUtils; | import com.ningdatech.pmapi.common.util.BizUtils; | ||||
import com.ningdatech.pmapi.dashboard.model.vo.ProtraitProjectOutputVO; | |||||
import com.ningdatech.pmapi.portrait.model.vo.TagVO; | import com.ningdatech.pmapi.portrait.model.vo.TagVO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; | import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; | import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; | ||||
@@ -521,4 +522,7 @@ public class ProjectDetailVO { | |||||
@ApiModelProperty("主管单位统一社会信用代码") | @ApiModelProperty("主管单位统一社会信用代码") | ||||
@Compare("主管单位统一社会信用代码") | @Compare("主管单位统一社会信用代码") | ||||
private String superOrgCreditCode; | private String superOrgCreditCode; | ||||
@ApiModelProperty("终验信息 IRS档案") | |||||
private List<ProtraitProjectOutputVO> finalIrsApps; | |||||
} | } |