@@ -14,11 +14,12 @@ | |||
<dependency> | |||
<groupId>com.google.guava</groupId> | |||
<artifactId>guava</artifactId> | |||
<version>33.0.0-jre</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>cn.hutool</groupId> | |||
<artifactId>hutool-all</artifactId> | |||
<version>5.8.5</version> | |||
<version>5.8.25</version> | |||
</dependency> | |||
<!--lombok--> | |||
<dependency> | |||
@@ -64,6 +65,7 @@ | |||
<dependency> | |||
<groupId>org.apache.tomcat.embed</groupId> | |||
<artifactId>tomcat-embed-core</artifactId> | |||
<version>9.0.87</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework.boot</groupId> | |||
@@ -2,26 +2,18 @@ package com.hz.pm.api.dashboard.handle; | |||
import cn.hutool.core.util.StrUtil; | |||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.google.common.collect.Lists; | |||
import com.google.common.collect.Maps; | |||
import com.hz.pm.api.App; | |||
import com.hz.pm.api.dashboard.constant.DashboardConstant; | |||
import com.hz.pm.api.dashboard.model.vo.ProtraitProjectOutputVO; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.dashboard.model.vo.PortraitProjectOutputVO; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | |||
import com.hz.pm.api.projectlib.service.IProjectApplicationService; | |||
import com.hz.pm.api.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.Collections; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Objects; | |||
/** | |||
* @Classname ApplicationHandler | |||
@@ -33,37 +25,10 @@ import java.util.Objects; | |||
@RequiredArgsConstructor | |||
@Slf4j | |||
public class ApplicationHandler { | |||
private final IProjectApplicationService applicationService; | |||
private final IProjectService projectService; | |||
private final App app; | |||
/** | |||
* 生成项目产出 | |||
* | |||
* @param projectCode | |||
* @return | |||
*/ | |||
public Map<String, ProtraitProjectOutputVO> generateOutput(String projectCode) { | |||
Map<String, ProtraitProjectOutputVO> res = Maps.newHashMap(); | |||
//1.初始化 项目体征 | |||
res.put(DashboardConstant.Protrait.PROJECT_SIGNS, | |||
generateOutputEntity(DashboardConstant.Protrait.PROJECT_SIGNS)); | |||
//2.查询应用 | |||
Project project = projectService.getProjectByCode(projectCode); | |||
if (Objects.nonNull(project)) { | |||
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.put(appName, generateOutputEntity(appName)); | |||
} | |||
} | |||
return res; | |||
} | |||
private final IProjectApplicationService applicationService; | |||
public List<ProtraitProjectOutputVO> generateIrsApp(String projectCode, Integer version) { | |||
public List<PortraitProjectOutputVO> generateIrsApp(String projectCode, Integer version) { | |||
//.查询应用 | |||
Wrapper<ProjectApplication> paQuery = Wrappers.lambdaQuery(ProjectApplication.class) | |||
.eq(ProjectApplication::getProjectVersion, version) | |||
@@ -72,7 +37,7 @@ public class ApplicationHandler { | |||
if (apps.isEmpty()) { | |||
return Collections.emptyList(); | |||
} | |||
List<ProtraitProjectOutputVO> retApps = Lists.newArrayList(); | |||
List<PortraitProjectOutputVO> retApps = Lists.newArrayList(); | |||
for (ProjectApplication app : apps) { | |||
String appName = StrUtil.blankToDefault(app.getApplicationName(), app.getRelatedExistsApplication()); | |||
retApps.add(generateOutputEntity(appName)); | |||
@@ -80,14 +45,14 @@ public class ApplicationHandler { | |||
return retApps; | |||
} | |||
private ProtraitProjectOutputVO generateOutputEntity(String name) { | |||
return ProtraitProjectOutputVO.builder() | |||
private PortraitProjectOutputVO generateOutputEntity(String name) { | |||
return PortraitProjectOutputVO.builder() | |||
.name(DashboardConstant.Protrait.PROJECT_SIGNS) | |||
.generateData(new ProtraitProjectOutputVO.GenerateData()) | |||
.componentUsage(new ProtraitProjectOutputVO.ComponentUsage()) | |||
.cloudResourceUsage(new ProtraitProjectOutputVO.CloudResourceUsage()) | |||
.dataUsage(new ProtraitProjectOutputVO.DataUsage()) | |||
.operationReport(new ProtraitProjectOutputVO.OperationReport()) | |||
.generateData(new PortraitProjectOutputVO.GenerateData()) | |||
.componentUsage(new PortraitProjectOutputVO.ComponentUsage()) | |||
.cloudResourceUsage(new PortraitProjectOutputVO.CloudResourceUsage()) | |||
.dataUsage(new PortraitProjectOutputVO.DataUsage()) | |||
.operationReport(new PortraitProjectOutputVO.OperationReport()) | |||
.build(); | |||
} | |||
} |
@@ -15,7 +15,7 @@ import java.util.Map; | |||
@Data | |||
@ApiModel("驾驶舱项目画像VO") | |||
public class DashboardProjectProtraitVO { | |||
public class DashboardProjectPortraitVO { | |||
@ApiModelProperty("项目信息") | |||
private ProtraitProjectInfoVO projectInfo; | |||
@@ -24,7 +24,7 @@ public class DashboardProjectProtraitVO { | |||
private List<Tag> projectFeatures; | |||
@ApiModelProperty("项目产出") | |||
private Map<String,ProtraitProjectOutputVO> projectOutput; | |||
private Map<String, PortraitProjectOutputVO> projectOutput; | |||
} | |||
@@ -14,42 +14,28 @@ import lombok.Data; | |||
@Data | |||
@Builder | |||
@ApiModel("驾驶舱项目画像里的项目产出VO") | |||
public class ProtraitProjectOutputVO { | |||
public ProtraitProjectOutputVO(){ | |||
} | |||
public ProtraitProjectOutputVO(String name,CloudResourceUsage cloudResourceUsage,DataUsage dataUsage, | |||
ComponentUsage componentUsage,GenerateData generateData,OperationReport operationReport){ | |||
this.name = name; | |||
this.cloudResourceUsage = cloudResourceUsage; | |||
this.dataUsage = dataUsage; | |||
this.componentUsage = componentUsage; | |||
this.generateData = generateData; | |||
this.operationReport = operationReport; | |||
} | |||
public class PortraitProjectOutputVO { | |||
@ApiModelProperty("名称") | |||
private String name; | |||
@ApiModelProperty("云资源使用情况") | |||
private CloudResourceUsage cloudResourceUsage = new CloudResourceUsage(); | |||
private CloudResourceUsage cloudResourceUsage; | |||
@ApiModelProperty("数据使用情况") | |||
private DataUsage dataUsage = new DataUsage(); | |||
private DataUsage dataUsage; | |||
@ApiModelProperty("组件使用情况") | |||
private ComponentUsage componentUsage = new ComponentUsage(); | |||
private ComponentUsage componentUsage; | |||
@ApiModelProperty("产生数据") | |||
private GenerateData generateData = new GenerateData(); | |||
private GenerateData generateData; | |||
@ApiModelProperty("试运行报告") | |||
private OperationReport operationReport = new OperationReport(); | |||
private OperationReport operationReport; | |||
@Data | |||
public static class CloudResourceUsage{ | |||
public static class CloudResourceUsage { | |||
@ApiModelProperty("云资源实例使用数") | |||
private String instancesNum = DashboardConstant.Protrait.NONE; | |||
@@ -58,7 +44,7 @@ public class ProtraitProjectOutputVO { | |||
} | |||
@Data | |||
public static class DataUsage{ | |||
public static class DataUsage { | |||
@ApiModelProperty("数据共享申请量") | |||
private String sharedApplicationVolume = DashboardConstant.Protrait.NONE; | |||
@@ -69,11 +55,11 @@ public class ProtraitProjectOutputVO { | |||
private String sharedInterfaceCallVolume = DashboardConstant.Protrait.NONE; | |||
@ApiModelProperty("协同接口使用量") | |||
private String collaborativeInterfaceCallVolume= DashboardConstant.Protrait.NONE; | |||
private String collaborativeInterfaceCallVolume = DashboardConstant.Protrait.NONE; | |||
} | |||
@Data | |||
public static class ComponentUsage{ | |||
public static class ComponentUsage { | |||
@ApiModelProperty("组件申请量") | |||
private String applicationVolume = DashboardConstant.Protrait.NONE; | |||
@@ -88,7 +74,7 @@ public class ProtraitProjectOutputVO { | |||
} | |||
@Data | |||
public static class GenerateData{ | |||
public static class GenerateData { | |||
@ApiModelProperty("产生数据量") | |||
private String volume = DashboardConstant.Protrait.NONE; | |||
@@ -102,16 +88,17 @@ public class ProtraitProjectOutputVO { | |||
private String approvalPassRate = DashboardConstant.Protrait.NONE; | |||
@ApiModelProperty("数据接口被调用量") | |||
private String dataInterfaceCallsVolume = DashboardConstant.Protrait.NONE; | |||
private String dataInterfaceCallsVolume = DashboardConstant.Protrait.NONE; | |||
@ApiModelProperty("协同接口使用量") | |||
private String collaborativeInterfaceCallVolume = DashboardConstant.Protrait.NONE; | |||
} | |||
@Data | |||
public static class OperationReport{ | |||
public static class OperationReport { | |||
@ApiModelProperty("试运行报告通过率") | |||
private String passRate = DashboardConstant.Protrait.NONE; | |||
} | |||
} | |||
@@ -4,8 +4,7 @@ import cn.hutool.json.JSONUtil; | |||
import com.alibaba.fastjson.JSON; | |||
import com.alibaba.fastjson.annotation.JSONField; | |||
import com.hz.pm.api.common.compare.Compare; | |||
import com.hz.pm.api.dashboard.model.vo.ProtraitProjectOutputVO; | |||
import com.hz.pm.api.external.model.dto.MhProjectSchemeTargetDTO; | |||
import com.hz.pm.api.dashboard.model.vo.PortraitProjectOutputVO; | |||
import com.hz.pm.api.portrait.model.vo.TagVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.PurchaseFullInfoVO; | |||
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; | |||
@@ -515,7 +514,7 @@ public class ProjectDetailVO { | |||
private String superOrgCreditCode; | |||
@ApiModelProperty("终验信息 IRS档案") | |||
private List<ProtraitProjectOutputVO> finalIrsApps; | |||
private List<PortraitProjectOutputVO> finalIrsApps; | |||
@ApiModelProperty("建议项目总投资") | |||
private BigDecimal proposeTotalInvest; | |||