移动工作块

parent de289521
......@@ -136,7 +136,7 @@ public class SwaggerMapParamConfig {
break;
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("newStartTime", new StringSchema().description("新的开始时间").example("2025-11-03T07:36:00.000Z"));
properties.put("newMachineId", new StringSchema().description("新机器ID").example(3402));
......@@ -151,6 +151,22 @@ public class SwaggerMapParamConfig {
));
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":
properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112"));
properties.put("operation", new StringSchema().description("操作对象"));
......@@ -175,6 +191,20 @@ public class SwaggerMapParamConfig {
));
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":
properties.put("sceneId", new StringSchema().description("场景ID").example("B571EF6682DB463AB2977B1055A74112"));
properties.put("id", new StringSchema().description("操作ID").example(1));
......@@ -452,6 +482,8 @@ public class SwaggerMapParamConfig {
return "删除订单请求参数";
case "orderMerge":
return "合并订单请求参数";
case "fixStartDate":
return "固定开始日期请求参数";
// 添加 ChromosomeDataController 相关方法的描述
case "queryChromosomeData":
return "分页查询染色体数据请求参数";
......
......@@ -144,7 +144,30 @@ public class ResourceGanttController {
// 1. 提取参数
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", "新的开始时间");
Long newMachineId = ParamValidator.getLong(params, "newMachineId", "新机器ID");
// 2. 验证场景
ParamValidator.validateSceneExists(sceneService, sceneId);
// 将单个opid放入List中
List<Integer> opids = new ArrayList<>();
opids.add(opid);
// 3. 执行业务
Chromosome result = planResultService.Move(sceneId, opids, newStartTime, newMachineId);
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");
......@@ -153,12 +176,41 @@ public class ResourceGanttController {
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")
@Operation(summary = "修改工单", description = "修改工单")
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