feat:报告模板库
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.sdm.common.entity.enums;
|
||||
|
||||
/**
|
||||
* 审批状态枚举
|
||||
*/
|
||||
public enum ApproveStatusEnum {
|
||||
|
||||
NOT_START("未开始", 0),
|
||||
APPROVING("审批中", 1),
|
||||
PASSED("已通过", 2),
|
||||
REJECTED("已驳回", 3);
|
||||
|
||||
private final String name;
|
||||
|
||||
private final Integer code;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
ApproveStatusEnum(String name, Integer code) {
|
||||
this.name = name;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,8 @@ public enum ApproveTypeEnum {
|
||||
KNOWLEDGE_APPROVE(2, "仿真知识库评审"),
|
||||
FLOW_TEMPLATE_APPROVE(3, "流程模板评审"),
|
||||
DELIVERABLE_APPROVE(4, "交付物评审"),
|
||||
PARAM_APPROVE(5, "仿真参数库评审")
|
||||
PARAM_APPROVE(5, "仿真参数库评审"),
|
||||
REPORT_TEMPLATE_APPROVE(6, "报告模板评审")
|
||||
;
|
||||
|
||||
private final int code;
|
||||
|
||||
@@ -43,7 +43,13 @@ public enum DirTypeEnum {
|
||||
* 视频库
|
||||
*/
|
||||
@Schema(description = "视频库文件夹", example = "7")
|
||||
VIDEO_DIR("video", 7);
|
||||
VIDEO_DIR("video", 7),
|
||||
|
||||
/**
|
||||
* 报告模板库
|
||||
*/
|
||||
@Schema(description = "报告模板库文件夹", example = "8")
|
||||
REPORT_TEMPLATE_DIR("reportTemplate", 8);
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +82,9 @@ public enum DirTypeEnum {
|
||||
// 初始化用户业务库目录
|
||||
private static final List<DirTypeEnum> INIT_SPMD_DIR = List.of(
|
||||
DirTypeEnum.KNOWLEDGE_BASE_DIR, DirTypeEnum.PROJECT_NODE_DIR,
|
||||
DirTypeEnum.AVATAR_DIR, DirTypeEnum.SIMULATION_PARAMETER_DIR, DirTypeEnum.TRAIN_MODEL_DIR,DirTypeEnum.SCRIPT_DIR, DirTypeEnum.VIDEO_DIR);
|
||||
DirTypeEnum.AVATAR_DIR, DirTypeEnum.SIMULATION_PARAMETER_DIR,
|
||||
DirTypeEnum.TRAIN_MODEL_DIR, DirTypeEnum.SCRIPT_DIR,
|
||||
DirTypeEnum.VIDEO_DIR, DirTypeEnum.REPORT_TEMPLATE_DIR);
|
||||
public static final List<DirTypeEnum> getInitSpmdDir() {
|
||||
return INIT_SPMD_DIR;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.sdm.common.entity.req.data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Data
|
||||
@Schema(description = "更新脚本或报告模板文件请求参数")
|
||||
public class UpdateScriptAndReportReq {
|
||||
@Schema(description = "需要更新的文件ID")
|
||||
private Long updateFileId;
|
||||
|
||||
@Schema(description = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "需要更新的文件")
|
||||
private MultipartFile updateFile;
|
||||
|
||||
@Schema(description = "所属根目录文件夹名称")
|
||||
private String dirName;
|
||||
}
|
||||
@@ -18,8 +18,8 @@ public class LaunchApproveReq extends BaseBean {
|
||||
@Schema(description = "CID生成的流程ID",defaultValue = "")
|
||||
public String cidFlowId;
|
||||
|
||||
// 审批类型 0.http回调的,replyUrl必须传递,相当于是跨系统的,调用的时候可以不传,replyUrl必须传递 ;1:仿真地图审批(spdm内部feign) 2:知识库审批(spdm内部feign) 3:交付物审批(spdm内部feign)
|
||||
@Schema(description = "审批类型 1:仿真地图审批 2:知识库审批 3:流程模板审批 4:交付物审批",defaultValue = "0")
|
||||
// 审批类型 0.http回调的,replyUrl必须传递,相当于是跨系统的,调用的时候可以不传,replyUrl必须传递 ;1:仿真地图审批(spdm内部feign) 2:知识库审批(spdm内部feign) 4:交付物审批(spdm内部feign)
|
||||
@Schema(description = "审批类型 1:仿真地图审批 2:知识库审批 3:流程模板审批 4:交付物审批 5:仿真参数库审批 6:报告模板审批",defaultValue = "0")
|
||||
@Value("10")
|
||||
public int approveType;
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.sdm.common.feign.impl.capability;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.feign.inter.capability.ISimulationReportFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SimulationReportFeignClientImpl implements ISimulationReportFeignClient {
|
||||
|
||||
@Autowired
|
||||
private ISimulationReportFeignClient reportFeignClient;
|
||||
|
||||
@Override
|
||||
public SdmResponse receiveApproveNotice(LaunchApproveReq req) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = reportFeignClient.receiveApproveNotice(req);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("报告模板审批状态修改失败");
|
||||
}
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("报告模板审批状态修改异常", e);
|
||||
return SdmResponse.failed("报告模板审批状态修改异常");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -177,8 +178,8 @@ public class DataClientFeignClientImpl implements IDataFeignClient {
|
||||
log.info("文件信息批量入库响应:"+ response);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("文件信息批量入库响应", e);
|
||||
return SdmResponse.failed("文件信息批量入库响应");
|
||||
log.error("文件信息批量入库失败", e);
|
||||
return SdmResponse.failed("文件信息批量入库失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,4 +222,28 @@ public class DataClientFeignClientImpl implements IDataFeignClient {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<Long> uploadReportTemplateFile(UploadFilesReq req) {
|
||||
SdmResponse<Long> response;
|
||||
try {
|
||||
response = dataClient.uploadReportTemplateFile(req);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("上传报告模板文件失败:", e);
|
||||
return SdmResponse.failed("上传报告模板文件失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<Long> updateReportTemplateFile(UpdateScriptAndReportReq req) {
|
||||
SdmResponse<Long> response;
|
||||
try {
|
||||
response = dataClient.updateReportTemplateFile(req);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("编辑报告模板文件失败:", e);
|
||||
return SdmResponse.failed("编辑报告模板文件失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.sdm.common.feign.inter.capability;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
|
||||
@FeignClient(name = "capability",contextId = "reportTemplateFeignClient")
|
||||
public interface ISimulationReportFeignClient {
|
||||
|
||||
@PostMapping("/report/approveHandleNotice")
|
||||
SdmResponse receiveApproveNotice(@RequestBody LaunchApproveReq req);
|
||||
|
||||
}
|
||||
@@ -88,4 +88,10 @@ public interface IDataFeignClient {
|
||||
@PostMapping("/data/initNewTenant")
|
||||
SdmResponse initNewTenant(@RequestParam Long tenantId);
|
||||
|
||||
@PostMapping(value = "/data/uploadReportTemplateFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
SdmResponse<Long> uploadReportTemplateFile(UploadFilesReq req);
|
||||
|
||||
@PostMapping(value = "/data/updateReportTemplateFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
SdmResponse<Long> updateReportTemplateFile(UpdateScriptAndReportReq req);
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class BaseService {
|
||||
* @param versionType
|
||||
* @return
|
||||
*/
|
||||
protected String generateVersion(String currentVersion,int versionType)
|
||||
public static String generateVersion(String currentVersion,int versionType)
|
||||
{
|
||||
currentVersion = currentVersion.substring(1);
|
||||
String[] versionSplits = currentVersion.split("\\.");
|
||||
|
||||
Reference in New Issue
Block a user