🐛 修复计划命令执行报错.

This commit is contained in:
lijiahangmax
2024-05-29 00:41:57 +08:00
parent 16dd34ef58
commit 06a45c9cf2
5 changed files with 27 additions and 6 deletions

View File

@@ -330,7 +330,16 @@ public class ExecCommandServiceImpl implements ExecCommandService {
// 解析参数
return schemaList.stream()
.collect(Collectors.toMap(ExecParameterSchemaDTO::getName,
ExecParameterSchemaDTO::getValue,
s -> {
Object value = s.getValue();
if (value == null) {
value = s.getDefaultValue();
}
if (value == null) {
value = Const.EMPTY;
}
return value;
},
Functions.right()));
}

View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.orion.lang.define.wrapper.DataGrid;
import com.orion.lang.utils.Booleans;
import com.orion.lang.utils.Strings;
import com.orion.lang.utils.collect.Lists;
import com.orion.lang.utils.time.cron.Cron;
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
import com.orion.visor.framework.common.constant.ErrorMessage;
@@ -163,8 +164,12 @@ public class ExecJobServiceImpl implements ExecJobService {
List<Long> hostIdList = execJobHostService.getHostIdByJobId(id);
vo.setHostIdList(hostIdList);
// 查询主机列表
List<HostDO> hostList = hostDAO.selectBatchIds(hostIdList);
vo.setHostList(HostConvert.MAPPER.toList(hostList));
if (!Lists.isEmpty(hostIdList)) {
List<HostDO> hostList = hostDAO.selectBatchIds(hostIdList);
vo.setHostList(HostConvert.MAPPER.toList(hostList));
} else {
vo.setHostList(Lists.empty());
}
return vo;
}