This commit is contained in:
Leo
2025-11-13 16:08:45 +08:00
parent e184c7926f
commit 8889791a83
4 changed files with 49 additions and 13 deletions

View File

@@ -22,12 +22,13 @@ public class InstructionController extends BaseController {
/**
* 执行文本指令
* body: { command: "京今日统计" }
* body: { command: "京今日统计", forceGenerate: false }
*/
@PostMapping("/execute")
public AjaxResult execute(@RequestBody Map<String, String> body) {
String cmd = body != null ? body.get("command") : null;
java.util.List<String> result = instructionService.execute(cmd);
public AjaxResult execute(@RequestBody Map<String, Object> body) {
String cmd = body != null ? (body.get("command") != null ? String.valueOf(body.get("command")) : null) : null;
boolean forceGenerate = body != null && body.get("forceGenerate") != null && Boolean.parseBoolean(String.valueOf(body.get("forceGenerate")));
java.util.List<String> result = instructionService.execute(cmd, forceGenerate);
return AjaxResult.success(result);
}

View File

@@ -111,11 +111,14 @@ public class PublicOrderController extends BaseController {
log.info("日期验证通过: 订单日期[{}]", orderDate);
// 获取forceGenerate参数默认为false
boolean forceGenerate = body != null && body.get("forceGenerate") != null && Boolean.parseBoolean(String.valueOf(body.get("forceGenerate")));
// 执行指令
List<String> result;
try {
log.info("开始执行订单指令...");
result = instructionService.execute(trimmedCmd);
log.info("开始执行订单指令... forceGenerate={}", forceGenerate);
result = instructionService.execute(trimmedCmd, forceGenerate);
log.info("订单指令执行完成");
// 记录执行结果