fix:bug修复
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package com.sdm.data.model.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sdm.common.entity.req.data.SimulationPoolInfo;
|
||||
import com.sdm.common.entity.resp.data.PoolInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ExportKnowledgeDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description= "文件原始名称")
|
||||
private String originalName;
|
||||
|
||||
@Schema(description= "文件大小")
|
||||
private String fileSize;
|
||||
|
||||
@Schema(description= "projectName:所属项目,只有列表展示使用")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description= "分析方向,只有列表展示使用")
|
||||
private String analysisDirectionName;
|
||||
|
||||
@Schema(description= "工况")
|
||||
private String poolInfos;
|
||||
|
||||
@Schema(description= "版本号(从1开始递增)")
|
||||
private Long versionNo;
|
||||
|
||||
@Schema(description= "创建者名称,列表展示使用")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description= "approvalStatus")
|
||||
private String approvalStatus;
|
||||
|
||||
@Schema(description= "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description= "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description= "备注信息")
|
||||
private String remarks;
|
||||
|
||||
}
|
||||
@@ -37,6 +37,7 @@ import com.sdm.common.utils.*;
|
||||
import com.sdm.common.utils.excel.ExcelUtil;
|
||||
import com.sdm.data.aop.PermissionCheckAspect;
|
||||
import com.sdm.data.model.bo.ApprovalFileDataContentsModel;
|
||||
import com.sdm.data.model.dto.ExportKnowledgeDto;
|
||||
import com.sdm.data.model.entity.*;
|
||||
import com.sdm.common.entity.resp.data.PoolInfo;
|
||||
|
||||
@@ -76,6 +77,7 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
@@ -2734,19 +2736,33 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
ExcelUtil.exportExcelNoMerge(new JSONArray(),exportExcelFormats,httpServletResponse);
|
||||
return response;
|
||||
}
|
||||
List<ExportKnowledgeDto> exportKnowledgeDtoList = new ArrayList<>();
|
||||
for (FileMetadataInfo fileMetadataInfo : dataList) {
|
||||
ExportKnowledgeDto exportKnowledgeDto = new ExportKnowledgeDto();
|
||||
exportKnowledgeDto.setOriginalName(fileMetadataInfo.getOriginalName());
|
||||
exportKnowledgeDto.setProjectName(fileMetadataInfo.getProjectName());
|
||||
exportKnowledgeDto.setAnalysisDirectionName(fileMetadataInfo.getAnalysisDirectionName());
|
||||
exportKnowledgeDto.setVersionNo(fileMetadataInfo.getVersionNo());
|
||||
exportKnowledgeDto.setCreatorName(fileMetadataInfo.getCreatorName());
|
||||
exportKnowledgeDto.setUpdateTime(fileMetadataInfo.getUpdateTime());
|
||||
exportKnowledgeDto.setRemarks(fileMetadataInfo.getRemarks());
|
||||
if (fileMetadataInfo.getApprovalStatus() == null) {
|
||||
fileMetadataInfo.setApprovalStatus("审批完成");
|
||||
}else if (ApprovalFileDataStatusEnum.PENDING.getKey().equals(fileMetadataInfo.getApprovalStatus())) {
|
||||
fileMetadataInfo.setApprovalStatus(ApprovalFileDataStatusEnum.PENDING.getDescription());
|
||||
}else if (ApprovalFileDataStatusEnum.APPROVED.getKey().equals(fileMetadataInfo.getApprovalStatus())) {
|
||||
fileMetadataInfo.setApprovalStatus(ApprovalFileDataStatusEnum.APPROVED.getDescription());
|
||||
}else if (ApprovalFileDataStatusEnum.REJECTED.getKey().equals(fileMetadataInfo.getApprovalStatus())) {
|
||||
fileMetadataInfo.setApprovalStatus(ApprovalFileDataStatusEnum.REJECTED.getDescription());
|
||||
exportKnowledgeDto.setApprovalStatus("审批完成");
|
||||
} else {
|
||||
exportKnowledgeDto.setApprovalStatus(ApprovalFileDataStatusEnum.getDescByKey(fileMetadataInfo.getApprovalStatus()));
|
||||
}
|
||||
fileMetadataInfo.setApprovalStatus("");
|
||||
if (CollectionUtils.isNotEmpty(fileMetadataInfo.getPoolInfos())) {
|
||||
List<TaskBaseInfo> taskBaseInfoList = fileMetadataInfo.getPoolInfos().get(0).getTaskBaseInfoList();
|
||||
if (CollectionUtils.isNotEmpty(taskBaseInfoList)) {
|
||||
// 导出知识库的工况那列展示工况名称
|
||||
exportKnowledgeDto.setPoolInfos(taskBaseInfoList.stream().map(TaskBaseInfo::getTaskName).collect(Collectors.joining(",")));
|
||||
}
|
||||
ExcelUtil.exportExcelNoMerge(JSONArray.from(dataList),exportExcelFormats,httpServletResponse);
|
||||
}
|
||||
// 格式化文件大小
|
||||
exportKnowledgeDto.setFileSize(FileSizeUtils.formatFileSize(BigDecimal.valueOf(fileMetadataInfo.getFileSize())));
|
||||
exportKnowledgeDtoList.add(exportKnowledgeDto);
|
||||
}
|
||||
ExcelUtil.exportExcelNoMerge(JSONArray.from(exportKnowledgeDtoList),exportExcelFormats,httpServletResponse);
|
||||
} else {
|
||||
response = SdmResponse.failed(taskRespond.getMessage());
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public enum ApprovalStatusEnum {
|
||||
|
||||
NOT_START("未审批", 0),
|
||||
ING("进行中", 1),
|
||||
PASSED("评审通过", 2),
|
||||
REJECTED("评审驳回", 3);
|
||||
|
||||
@@ -134,8 +134,8 @@ public class SimulationRunController implements ISimulationRunFeignClient {
|
||||
}
|
||||
|
||||
@SysLog("编辑算例关键结果属性")
|
||||
@PostMapping(value = "/editSimulationKeyResult")
|
||||
public SdmResponse editSimulationKeyResult(@RequestBody KeyResultReq req) {
|
||||
@PostMapping(value = "/editSimulationKeyResult", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public SdmResponse editSimulationKeyResult(KeyResultReq req) {
|
||||
return runService.editSimulationKeyResult(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -815,6 +815,28 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
public SdmResponse editSimulationKeyResult(KeyResultReq req) {
|
||||
SimulationRunKeyResult simulationRunKeyResult = new SimulationRunKeyResult();
|
||||
BeanUtils.copyProperties(req, simulationRunKeyResult);
|
||||
// 如果编辑了文件
|
||||
if (req.getFile() != null) {
|
||||
// 删掉旧文件
|
||||
if (simulationRunKeyResult.getFileId() != null) {
|
||||
DelFileReq delFileReq = new DelFileReq();
|
||||
delFileReq.setDelFileId(simulationRunKeyResult.getFileId());
|
||||
SdmResponse response = dataFeignClient.delFile(delFileReq);
|
||||
if (!response.isSuccess()) {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
// 上传新文件
|
||||
UploadFilesReq filesReq = new UploadFilesReq();
|
||||
BeanUtils.copyProperties(req, filesReq);
|
||||
SdmResponse response = uploadKeyResultFiles(filesReq);
|
||||
if (response.isSuccess() && response.getData() != null) {
|
||||
JSONObject result = JSONObject.from(response.getData());
|
||||
simulationRunKeyResult.setFileId(Long.valueOf((Integer) result.get("fileId")));
|
||||
} else {
|
||||
return SdmResponse.failed("上传文件失败");
|
||||
}
|
||||
}
|
||||
if (!simulationKeyResultService.updateById(simulationRunKeyResult)) {
|
||||
return SdmResponse.failed("更新关键结果失败");
|
||||
}
|
||||
@@ -1012,12 +1034,10 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
JSONObject contentObj = JSONObject.parseObject(approveContent);
|
||||
if (contentObj != null && contentObj.containsKey("taskId")) {
|
||||
String taskId = contentObj.getString("taskId");
|
||||
Float difficult = contentObj.getFloat("difficult");
|
||||
SimulationTask simulationTask = simulationTaskService.lambdaQuery().eq(SimulationTask::getUuid, taskId).one();
|
||||
if (simulationTask != null) {
|
||||
// 审批通过 部署流程 保存部署流程部署id和流程定义id
|
||||
// 审批通过 设置任务进度为100,状态关闭
|
||||
if (NumberConstants.TWO == approveStatus) {
|
||||
simulationTask.setDifficult(difficult);
|
||||
simulationTask.setProgress(100);
|
||||
simulationTask.setExeStatus(TaskExeStatusEnum.CLOSED.getCode());
|
||||
simulationTask.setApprovalStatus(ApprovalStatusEnum.PASSED.getCode());
|
||||
|
||||
@@ -165,7 +165,6 @@ public class ISysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implem
|
||||
* @return true/false
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SdmResponse saveLog(SysLogDTO sysLog) {
|
||||
SysLog log = new SysLog();
|
||||
BeanUtils.copyProperties(sysLog, log);
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.sdm.outbridge.service.lyric.IFreeLinkService;
|
||||
import com.sdm.system.dao.SimulationApproveMapper;
|
||||
import com.sdm.system.model.entity.ApproveTemplateBean;
|
||||
import com.sdm.system.service.ISimulatinoApprovalService;
|
||||
import com.sdm.system.service.ISimulationMessageService;
|
||||
import com.sdm.system.service.impl.approvalNotice.ApproveNoticeStrategy;
|
||||
import com.sdm.system.service.impl.approvalNotice.ApproveNoticeStrategyFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -72,7 +73,7 @@ public class SimulationApproveServiceImpl implements ISimulatinoApprovalService
|
||||
private IFreeLinkService freeLinkService;
|
||||
|
||||
@Autowired
|
||||
private IMessageFeignClient messageFeignClient;
|
||||
private ISimulationMessageService messageService;
|
||||
|
||||
/**
|
||||
* 向CID发起审批流程
|
||||
@@ -275,7 +276,7 @@ public class SimulationApproveServiceImpl implements ISimulatinoApprovalService
|
||||
req.setTenantId(ThreadLocalContext.getTenantId().toString());
|
||||
req.setUserId(ThreadLocalContext.getUserId().toString());
|
||||
req.setSendCid(false);
|
||||
messageFeignClient.sendMessage(req);
|
||||
messageService.sendMessage(req);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user