移动工作块

parent de289521
...@@ -136,7 +136,7 @@ public class SwaggerMapParamConfig { ...@@ -136,7 +136,7 @@ public class SwaggerMapParamConfig {
break; break;
case "operationMove": case "operationMove":
properties.put("SceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112")); properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112"));
properties.put("id", new StringSchema().description("操作ID").example(1)); properties.put("id", new StringSchema().description("操作ID").example(1));
properties.put("newStartTime", new StringSchema().description("新的开始时间").example("2025-11-03T07:36:00.000Z")); properties.put("newStartTime", new StringSchema().description("新的开始时间").example("2025-11-03T07:36:00.000Z"));
properties.put("newMachineId", new StringSchema().description("新机器ID").example(3402)); properties.put("newMachineId", new StringSchema().description("新机器ID").example(3402));
...@@ -151,6 +151,22 @@ public class SwaggerMapParamConfig { ...@@ -151,6 +151,22 @@ public class SwaggerMapParamConfig {
)); ));
break; break;
case "operationBlockMove":
properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112"));
properties.put("id", new StringSchema().description("操作ID列表").example("[1, 2, 3]"));
properties.put("newStartTime", new StringSchema().description("新的开始时间").example("2025-11-03T07:36:00.000Z"));
properties.put("newMachineId", new StringSchema().description("新机器ID").example(3402));
examples.put("移动工作块示例", createExample(
"将指定的多个操作移动到新的时间和机器上",
"{\n" +
" \"sceneId\": \"B571EF6682DB463AB2977B1055A74112\",\n" +
" \"id\": [1, 2, 3],\n" +
" \"newStartTime\": \"2025-11-03T07:36:00.000Z\",\n" +
" \"newMachineId\": 3401\n" +
"}"
));
break;
case "operationedit": case "operationedit":
properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112")); properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112"));
properties.put("operation", new StringSchema().description("操作对象")); properties.put("operation", new StringSchema().description("操作对象"));
...@@ -175,6 +191,20 @@ public class SwaggerMapParamConfig { ...@@ -175,6 +191,20 @@ public class SwaggerMapParamConfig {
)); ));
break; break;
case "fixStartDate":
properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112"));
properties.put("id", new StringSchema().description("操作ID").example(1));
properties.put("newStartTime", new StringSchema().description("新的开始时间").example("2025-11-03T07:36:00.000Z"));
examples.put("固定开始日期示例", createExample(
"固定操作的开始日期",
"{\n" +
" \"sceneId\": \"B571EF6682DB463AB2977B1055A74112\",\n" +
" \"id\": 1,\n" +
" \"newStartTime\": \"2025-11-03T07:36:00.000Z\"\n" +
"}"
));
break;
case "spiltOperation": case "spiltOperation":
properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112")); properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112"));
properties.put("id", new StringSchema().description("操作ID").example(1)); properties.put("id", new StringSchema().description("操作ID").example(1));
...@@ -452,6 +482,8 @@ public class SwaggerMapParamConfig { ...@@ -452,6 +482,8 @@ public class SwaggerMapParamConfig {
return "删除订单请求参数"; return "删除订单请求参数";
case "orderMerge": case "orderMerge":
return "合并订单请求参数"; return "合并订单请求参数";
case "fixStartDate":
return "固定开始日期请求参数";
// 添加 ChromosomeDataController 相关方法的描述 // 添加 ChromosomeDataController 相关方法的描述
case "queryChromosomeData": case "queryChromosomeData":
return "分页查询染色体数据请求参数"; return "分页查询染色体数据请求参数";
......
...@@ -144,14 +144,16 @@ public class ResourceGanttController { ...@@ -144,14 +144,16 @@ public class ResourceGanttController {
// 1. 提取参数 // 1. 提取参数
String sceneId = ParamValidator.getString(params, "sceneId", "场景ID"); String sceneId = ParamValidator.getString(params, "sceneId", "场景ID");
List<?> opid = ParamValidator.getList(params, "id", "操作ID"); Integer opid = ParamValidator.getInteger(params, "id", "操作ID");
LocalDateTime newStartTime = ParamValidator.getDateTime(params, "newStartTime", "新的开始时间"); LocalDateTime newStartTime = ParamValidator.getDateTime(params, "newStartTime", "新的开始时间");
Long newMachineId = ParamValidator.getLong(params, "newMachineId", "新机器ID"); Long newMachineId = ParamValidator.getLong(params, "newMachineId", "新机器ID");
// 2. 验证场景 // 2. 验证场景
ParamValidator.validateSceneExists(sceneService, sceneId); ParamValidator.validateSceneExists(sceneService, sceneId);
List<Integer> opids = ParamValidator.convertToIntArray(opid, "操作IDS"); // 将单个opid放入List中
List<Integer> opids = new ArrayList<>();
opids.add(opid);
// 3. 执行业务 // 3. 执行业务
Chromosome result = planResultService.Move(sceneId, opids, newStartTime, newMachineId); Chromosome result = planResultService.Move(sceneId, opids, newStartTime, newMachineId);
...@@ -159,6 +161,56 @@ public class ResourceGanttController { ...@@ -159,6 +161,56 @@ public class ResourceGanttController {
return R.ok("移动成功"); return R.ok("移动成功");
} }
@PostMapping("/operationBlockMove")
@Operation(summary = "移动工作块", description = "移动工作块")
public R<String> operationBlockMove(@RequestBody Map<String, Object> params) {
// 1. 提取参数
String sceneId = ParamValidator.getString(params, "sceneId", "场景ID");
List opid = ParamValidator.getList(params, "id", "操作ID");
LocalDateTime newStartTime = ParamValidator.getDateTime(params, "newStartTime", "新的开始时间");
Long newMachineId = ParamValidator.getLong(params, "newMachineId", "新机器ID");
// 2. 验证场景
ParamValidator.validateSceneExists(sceneService, sceneId);
List<Integer> opids = ParamValidator.convertToIntArray(opid, "操作IDS");
// 3. 执行业务
Chromosome result = planResultService.Move(sceneId, opids, newStartTime, newMachineId);
return R.ok("移动成功");
}
@PostMapping("/fixStartDate")
@Operation(summary = "固定开始日期", description = "固定开始日期")
public R<String> fixStartDate(@RequestBody Map<String, Object> params) {
// 1. 提取参数
String sceneId = ParamValidator.getString(params, "sceneId", "场景ID");
Integer opid = ParamValidator.getInteger(params, "id", "操作ID");
LocalDateTime newStartTime = ParamValidator.getDateTime(params, "newStartTime", "新的开始时间");
// 2. 验证场景
ParamValidator.validateSceneExists(sceneService, sceneId);
// List<Integer> opids = ParamValidator.convertToIntArray(opid, "操作IDS");
List<Integer> opids = new ArrayList<>();
opids.add(opid);
// 3. 执行业务
Chromosome result = planResultService.Move(sceneId, opids, newStartTime, 0L);
return R.ok("固定开始日期成功");
}
@PostMapping("/operationedit") @PostMapping("/operationedit")
@Operation(summary = "修改工单", description = "修改工单") @Operation(summary = "修改工单", description = "修改工单")
public R<Chromosome> operationedit(@RequestBody Map<String, Object> params) { public R<Chromosome> operationedit(@RequestBody Map<String, Object> params) {
......
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