fix: 修正命令内容为空的处理bug

dev
huangfeng 10 months ago
parent 7b729bcba8
commit b6a5314a61

@ -4,6 +4,7 @@ package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.entity.*; import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.exception.ApiException; import com.shxy.xymanager_common.exception.ApiException;
import com.shxy.xymanager_common.util.JSONUtil; import com.shxy.xymanager_common.util.JSONUtil;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_dao.dao.*; import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.CmdService; import com.shxy.xymanager_service.service.CmdService;
import com.shxy.xymanager_service.service.TerminalExtService; import com.shxy.xymanager_service.service.TerminalExtService;
@ -105,10 +106,12 @@ public class MntnServiceImpl implements MntnService {
private HashMap<String, Object> buildCmdMap(MntnCmds cmd) throws Exception { private HashMap<String, Object> buildCmdMap(MntnCmds cmd) throws Exception {
HashMap<String, Object> result = new HashMap<>(); HashMap<String, Object> result = new HashMap<>();
if (StringUtils.isNotBlank(cmd.getCmd())) {
HashMap<String, Object> data = JSONUtil.json2Object(cmd.getCmd(), HashMap.class); HashMap<String, Object> data = JSONUtil.json2Object(cmd.getCmd(), HashMap.class);
result.putAll(data); result.putAll(data);
result.put("cid", cmd.getId()); result.put("cid", cmd.getId());
result.put("cmd", cmd.getName()); result.put("cmd", cmd.getName());
}
if ("upgrade".equalsIgnoreCase(cmd.getName())) { if ("upgrade".equalsIgnoreCase(cmd.getName())) {
result.put("isUpgrade", 1); result.put("isUpgrade", 1);
result.put("sj", 1); result.put("sj", 1);

Loading…
Cancel
Save