diff --git a/common/src/main/java/com/sdm/common/entity/resp/data/FileMetadataInfoResp.java b/common/src/main/java/com/sdm/common/entity/resp/data/FileMetadataInfoResp.java index 91f2d93e..3c479d72 100644 --- a/common/src/main/java/com/sdm/common/entity/resp/data/FileMetadataInfoResp.java +++ b/common/src/main/java/com/sdm/common/entity/resp/data/FileMetadataInfoResp.java @@ -119,10 +119,6 @@ public class FileMetadataInfoResp extends BaseResp implements Serializable { @Schema(description = "权限值") private Integer permissionValue; - - @Schema(description = "算列信息") - private SimulationRunResp simulationRunResp; - private String approvalStatus; private String approveType; private String tempMetadata; @@ -140,4 +136,104 @@ public class FileMetadataInfoResp extends BaseResp implements Serializable { private String tag8; private String tag9; private String tag10; + + // 算列信息,前端搞了个框架,无法从第二层对象中获取,只能将索引属性放到这 + private Integer type; + + private String taskId; + + @Schema(description= "流程模板id") + private String flowTemplate; + + @Schema(description= "Run状态 0:未执行 1:执行中 2:完成 3:失败") + private Integer status; + + @Schema(description= "前端的Run展示状态: 未执行 执行中 完成 失败") + private String statusString; + + @Schema(description= "Run总共的流程步骤") + private Integer totalStep; + + @Schema(description= "当前的流程步骤") + private Integer currentStep; + + @Schema(description= "当前的流程步骤名称") + private String currentStepName; + + @Schema(description= "Run执行结果 0:gray 1:red 2:yellow 3:green") + private Integer achieveStatus; + + @Schema(description= "Run执行结果前端展示: gray red yellow green") + private String achieveStatusString; + + @Schema(description= "run描述信息") + private String description; + + private Integer isPersonalTemplate; + + @Schema(description= "英文名") + private Long englishName; + + @Schema(description = "flowable流程完成部署后的流程定义id,根据这个发起流程实例") + public String processDefinitionId; + + @Schema(description= "流程实例id(流程引擎返回的)") + private String flowInstanceId; + + @Schema(description= "完成时间") + private LocalDateTime finishTime; + // 算列信息属性放在上面 + + public void setSimulationRunResp(SimulationRunResp simulationRunResp) { + if (simulationRunResp != null) { + this.type = simulationRunResp.getType(); + this.taskId = simulationRunResp.getTaskId(); + this.flowTemplate = simulationRunResp.getFlowTemplate(); + this.status = simulationRunResp.getStatus(); + this.statusString = convertStatus(simulationRunResp.getStatus()); + this.totalStep = simulationRunResp.getTotalStep(); + this.currentStep = simulationRunResp.getCurrentStep(); + this.currentStepName = simulationRunResp.getCurrentStepName(); + this.achieveStatus = simulationRunResp.getAchieveStatus(); + this.achieveStatusString = convertAchieveStatus(simulationRunResp.getAchieveStatus()); + this.description = simulationRunResp.getDescription(); + this.isPersonalTemplate = simulationRunResp.getIsPersonalTemplate(); + this.englishName = simulationRunResp.getEnglishName(); + this.processDefinitionId = simulationRunResp.getProcessDefinitionId(); + this.flowInstanceId = simulationRunResp.getFlowInstanceId(); + this.finishTime = simulationRunResp.getFinishTime(); + } + } + + /** + * Run状态转换:0-未执行 1-执行中 2-完成 3-失败 + */ + private String convertStatus(Integer status) { + if (status == null) { + return null; + } + return switch (status) { + case 0 -> "未执行"; + case 1 -> "执行中"; + case 2 -> "完成"; + case 3 -> "失败"; + default -> "未知"; + }; + } + + /** + * Run执行结果转换:0-gray 1-red 2-yellow 3-green + */ + private String convertAchieveStatus(Integer achieveStatus) { + if (achieveStatus == null) { + return null; + } + return switch (achieveStatus) { + case 0 -> "gray"; + case 1 -> "red"; + case 2 -> "yellow"; + case 3 -> "green"; + default -> "gray"; + }; + } }