指令数量限制

This commit is contained in:
loujf
2022-12-06 14:41:26 +08:00
parent 5d3d6ee89d
commit c0af93f179

View File

@@ -85,9 +85,11 @@ public class AutoCreateInst {
taskserver.updateByCodeFromCache(acsTask); taskserver.updateByCodeFromCache(acsTask);
continue; continue;
} }
List<Instruction> instructions = instructionService.queryAll("instruction_status < 2");
String maxInstnumber = acsConfigService.findConfigFromCache().get(AcsConfig.MAXINSTNUMBER); String maxInstnumber = acsConfigService.findConfigFromCache().get(AcsConfig.MAXINSTNUMBER);
if (ObjectUtils.isNotEmpty(maxInstnumber)) { if (ObjectUtils.isNotEmpty(maxInstnumber)) {
if (i >= Integer.parseInt(maxInstnumber)) { if (instructions.size() >= Integer.parseInt(maxInstnumber)) {
log.info("系统参数配置最大指令数为:" + maxInstnumber + "无法生成指令");
acsTask.setRemark("系统参数配置最大指令数为:" + maxInstnumber + "无法生成指令"); acsTask.setRemark("系统参数配置最大指令数为:" + maxInstnumber + "无法生成指令");
taskserver.updateByCodeFromCache(acsTask); taskserver.updateByCodeFromCache(acsTask);
continue; continue;