|
@@ -3,6 +3,7 @@ package com.css.simulation.resource.project.impl;
|
|
import api.common.pojo.common.PageVO;
|
|
import api.common.pojo.common.PageVO;
|
|
import api.common.pojo.common.ResponseBodyVO;
|
|
import api.common.pojo.common.ResponseBodyVO;
|
|
import api.common.pojo.constants.DictConstants;
|
|
import api.common.pojo.constants.DictConstants;
|
|
|
|
+import api.common.pojo.constants.StateConstant;
|
|
import api.common.pojo.param.KafkaParameter;
|
|
import api.common.pojo.param.KafkaParameter;
|
|
import api.common.pojo.param.MinioParameter;
|
|
import api.common.pojo.param.MinioParameter;
|
|
import api.common.pojo.param.algorithm.AlgorithmParameter;
|
|
import api.common.pojo.param.algorithm.AlgorithmParameter;
|
|
@@ -2590,12 +2591,38 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
//任务运行状态统计-饼图
|
|
//任务运行状态统计-饼图
|
|
@Override
|
|
@Override
|
|
- public ResponseBodyVO selectRunTaskByState() {
|
|
|
|
|
|
+ public ResponseBodyVO<List<Map<String, Object>>> selectRunTaskByState() {
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
params.put("createUserId", AuthUtil.getCurrentUserId());
|
|
params.put("createUserId", AuthUtil.getCurrentUserId());
|
|
- List<Map> list = simulationProjectTaskMapper.selectRunTaskByState(params);
|
|
|
|
|
|
+ List<Map<String, Object>> list = simulationProjectTaskMapper.selectRunTaskByState(params);
|
|
|
|
+ list.forEach(map -> {
|
|
|
|
+ if (StateConstant.Aborted.getEnglish().equals(map.get("runState"))) {
|
|
|
|
+ map.put("runState", StateConstant.Aborted.getChinese());
|
|
|
|
+ }
|
|
|
|
+ if (StateConstant.PendingAnalysis.getEnglish().equals(map.get("runState"))) {
|
|
|
|
+ map.put("runState", StateConstant.PendingAnalysis.getChinese());
|
|
|
|
+ }
|
|
|
|
+ if (StateConstant.Running.getEnglish().equals(map.get("runState"))) {
|
|
|
|
+ map.put("runState", StateConstant.Running.getChinese());
|
|
|
|
+ }
|
|
|
|
+ if (StateConstant.Analysing.getEnglish().equals(map.get("runState"))) {
|
|
|
|
+ map.put("runState", StateConstant.Analysing.getChinese());
|
|
|
|
+ }
|
|
|
|
+ if (StateConstant.Completed.getEnglish().equals(map.get("runState"))) {
|
|
|
|
+ map.put("runState", StateConstant.Completed.getChinese());
|
|
|
|
+ }
|
|
|
|
+ if (StateConstant.Terminated.getEnglish().equals(map.get("runState"))) {
|
|
|
|
+ map.put("runState", StateConstant.Terminated.getChinese());
|
|
|
|
+ }
|
|
|
|
+ if (StateConstant.Terminating.getEnglish().equals(map.get("runState"))) {
|
|
|
|
+ map.put("runState", StateConstant.Terminating.getChinese());
|
|
|
|
+ }
|
|
|
|
+ if (StateConstant.Pending.getEnglish().equals(map.get("runState"))) {
|
|
|
|
+ map.put("runState", StateConstant.Pending.getChinese());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, list);
|
|
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, list);
|
|
}
|
|
}
|
|
|
|
|
|
//项目运行状态统计-饼图
|
|
//项目运行状态统计-饼图
|
|
@@ -4135,9 +4162,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
@Override
|
|
@Override
|
|
public void exportProjectTaskFileById(SimulationManualProjectParam param) {
|
|
public void exportProjectTaskFileById(SimulationManualProjectParam param) {
|
|
String id = param.getId();
|
|
String id = param.getId();
|
|
- if (StringUtil.isEmpty(id)) {
|
|
|
|
- throw new RuntimeException("项目 id 不能为空。");
|
|
|
|
- }
|
|
|
|
|
|
|
|
//获取任务包信息
|
|
//获取任务包信息
|
|
ProjectTaskParam projectTaskParam = new ProjectTaskParam();
|
|
ProjectTaskParam projectTaskParam = new ProjectTaskParam();
|
|
@@ -4243,11 +4267,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
if (param.getIsPagePdf() != null && param.getIsPagePdf()) {
|
|
if (param.getIsPagePdf() != null && param.getIsPagePdf()) {
|
|
// 获取工作信息
|
|
// 获取工作信息
|
|
SimulationManualProjectPo p = simulationProjectMapper.selectProjectBaseById(param);
|
|
SimulationManualProjectPo p = simulationProjectMapper.selectProjectBaseById(param);
|
|
|
|
+ final String algorithmName = algorithmMapper.selectAlgorithmNameByAlgorithmId(param.getAlgorithm());
|
|
|
|
|
|
pdfFile = new File(param.getLocalPdfFilePath());
|
|
pdfFile = new File(param.getLocalPdfFilePath());
|
|
FileInputStream fileInputStream = new FileInputStream(pdfFile);
|
|
FileInputStream fileInputStream = new FileInputStream(pdfFile);
|
|
BufferedInputStream in = new BufferedInputStream(fileInputStream);
|
|
BufferedInputStream in = new BufferedInputStream(fileInputStream);
|
|
- ZipEntry entry = new ZipEntry(rootPath + File.separator + p.getProjectName() + ".pdf");
|
|
|
|
|
|
+ ZipEntry entry = new ZipEntry(rootPath + File.separator + algorithmName + "评价报告.pdf");
|
|
zos.putNextEntry(entry);
|
|
zos.putNextEntry(entry);
|
|
while ((len = in.read(buffer)) != -1) {
|
|
while ((len = in.read(buffer)) != -1) {
|
|
zos.write(buffer, 0, len);
|
|
zos.write(buffer, 0, len);
|
|
@@ -4276,26 +4301,16 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void exportProjectReportAndTaskFileById(SimulationManualProjectParam param) {
|
|
public void exportProjectReportAndTaskFileById(SimulationManualProjectParam param) {
|
|
-
|
|
|
|
- String id = param.getId();
|
|
|
|
- if (StringUtil.isEmpty(id)) {
|
|
|
|
- throw new RuntimeException("工作id不能为空");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //生成本地pdf
|
|
|
|
- String path = StringUtil.getRandomUUID();
|
|
|
|
|
|
+ // 生成本地pdf
|
|
param.setIsCreateLocalPdfFile(true);
|
|
param.setIsCreateLocalPdfFile(true);
|
|
- param.setLocalPdfFilePath(path);
|
|
|
|
-
|
|
|
|
- exportProjectReport(param);
|
|
|
|
-
|
|
|
|
- //下载报告和任务包
|
|
|
|
|
|
+ param.setLocalPdfFilePath(StringUtil.getRandomUUID() + ".pdf");
|
|
param.setIsPagePdf(true);
|
|
param.setIsPagePdf(true);
|
|
-
|
|
|
|
|
|
+ // 下载报告和任务包
|
|
|
|
+ exportProjectReport(param);
|
|
exportProjectTaskFileById(param);
|
|
exportProjectTaskFileById(param);
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public ResponseBodyVO addOrUpdateAutomaticProject(SimulationManualProjectParam param) {
|
|
public ResponseBodyVO addOrUpdateAutomaticProject(SimulationManualProjectParam param) {
|
|
|
|
|