索引版本返回

parent 87592467
......@@ -973,6 +973,23 @@ public class ResourceGanttController {
return R.ok(versionData);
}
@PostMapping("/getSceneVersionWithIndexPreview")
@Operation(summary = "获取版本号、当前索引和甘特概览", description = "返回版本信息,并按资源甘特数据统计场景时间、工单、订单、设备和预览图")
public R<Map<String, Object>> getSceneVersionWithIndexPreview(
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "previewWidth、previewHeight 为可选字段,用于控制返回 preview 图片尺寸。",
content = @io.swagger.v3.oas.annotations.media.Content(
mediaType = "application/json",
examples = @io.swagger.v3.oas.annotations.media.ExampleObject(
name = "获取版本和缩略图示例",
value = "{\n \"sceneId\": \"F397427A76754E33A5655C41A7D0BC4A\",\n \"previewWidth\": 896,\n \"previewHeight\": 20\n}"
)
)
)
@RequestBody Map<String, Object> params) {
String sceneId = ParamValidator.getString(params, "sceneId", "场景ID");
return R.ok(planResultService.getSceneVersionWithIndexPreview(sceneId, params));
}
@PostMapping("/revertVersion")
@Operation(summary = "撤销操作", description = "撤销操作",
......@@ -1092,4 +1109,4 @@ public class ResourceGanttController {
}
}
\ No newline at end of file
}
......@@ -57,7 +57,10 @@ public class Machine {
* 设备编码
*/
private String code;
/**
* 设备类型
*
*/
private String capacityTypeName;
/**
......
......@@ -28,6 +28,8 @@ public class SceneService {
@Autowired
private RedisUtils redisUtils;
private final ObjectMapper objectMapper = createObjectMapper();
private ObjectMapper createObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule());
......@@ -72,7 +74,6 @@ public class SceneService {
try {
long totalStart = System.nanoTime();
ObjectMapper objectMapper = createObjectMapper();
SceneChromsome sceneChromsome = (SceneChromsome) redisUtils.get("SceneId." + sceneId);
File file;
if (sceneChromsome == null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment