|
|
@ -163,34 +163,34 @@ public class CmdServiceImpl implements CmdService {
|
|
|
|
case "quickhb":
|
|
|
|
case "quickhb":
|
|
|
|
this.quickhb(model);
|
|
|
|
this.quickhb(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "reset":
|
|
|
|
case "yw_cmd_android_reboot":
|
|
|
|
this.reset(model);
|
|
|
|
this.reset(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "reset-mcu":
|
|
|
|
case "yw_cmd_mcu_reboot":
|
|
|
|
this.resetmcu(model);
|
|
|
|
this.resetmcu(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "upload-logs":
|
|
|
|
case "yw_cmd_upload_i1_zip_log":
|
|
|
|
this.uploadlogs(model);
|
|
|
|
this.uploadlogs(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "set-cma":
|
|
|
|
case "i1_cmd_set_i1_server_ip_port":
|
|
|
|
this.setcma(model);
|
|
|
|
this.setcma(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "set-mntn":
|
|
|
|
case "i1_cmd_set_xy_yw_ip_port":
|
|
|
|
this.setmntn(model);
|
|
|
|
this.setmntn(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "set-hb":
|
|
|
|
case "i1_cmd_set_i1_heart_beat_time":
|
|
|
|
this.sethb(model);
|
|
|
|
this.sethb(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "upgrade":
|
|
|
|
case "upgrade":
|
|
|
|
this.upgrade(model);
|
|
|
|
this.upgrade(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "start-frpc":
|
|
|
|
case "yw_cmd_start_frpc":
|
|
|
|
this.startfrpc(model);
|
|
|
|
this.startfrpc(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "stop-frpc":
|
|
|
|
case "yw_cmd_stop_frpc":
|
|
|
|
this.stopfrpc(model);
|
|
|
|
this.stopfrpc(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "stop-aging-test":
|
|
|
|
case "i1_cmd_stop_aging_test":
|
|
|
|
this.stopagingtest(model);
|
|
|
|
this.stopagingtest(model);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -282,150 +282,168 @@ public class CmdServiceImpl implements CmdService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void reset(CmdModel model) {
|
|
|
|
private void reset(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "yw_cmd_android_reboot";
|
|
|
|
String name = "yw_cmd_android_reboot";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
cmd.setName(name);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void resetmcu(CmdModel model) {
|
|
|
|
private void resetmcu(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "yw_cmd_mcu_reboot";
|
|
|
|
String name = "yw_cmd_mcu_reboot";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
cmd.setName(name);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void uploadlogs(CmdModel model) {
|
|
|
|
private void uploadlogs(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
} else if (StringUtils.isBlank(model.getUrl())) {
|
|
|
|
} else if (StringUtils.isBlank(model.getUrl())) {
|
|
|
|
throw new ApiException("url不能为空");
|
|
|
|
throw new ApiException("url不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "yw_cmd_upload_i1_zip_log";
|
|
|
|
String name = "yw_cmd_upload_i1_zip_log";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("url", model.getUrl());
|
|
|
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
cmd.setName(name);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
cmd.setCmd(json);
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("url", model.getUrl());
|
|
|
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCmd(json);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setcma(CmdModel model) {
|
|
|
|
private void setcma(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
} else if (StringUtils.isBlank(model.getIp())) {
|
|
|
|
} else if (StringUtils.isBlank(model.getIp())) {
|
|
|
|
throw new ApiException("ip不能为空");
|
|
|
|
throw new ApiException("ip不能为空");
|
|
|
|
} else if (model.getPort() == null) {
|
|
|
|
} else if (model.getPort() == null) {
|
|
|
|
throw new ApiException("port不能为空");
|
|
|
|
throw new ApiException("port不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "i1_cmd_set_i1_server_ip_port";
|
|
|
|
String name = "i1_cmd_set_i1_server_ip_port";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("value_str", model.getIp());
|
|
|
|
|
|
|
|
map.put("value_int", model.getPort());
|
|
|
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
cmd.setName(name);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
cmd.setCmd(json);
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("value_str", model.getIp());
|
|
|
|
|
|
|
|
map.put("value_int", model.getPort());
|
|
|
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCmd(json);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setmntn(CmdModel model) {
|
|
|
|
private void setmntn(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
} else if (StringUtils.isBlank(model.getIp())) {
|
|
|
|
} else if (StringUtils.isBlank(model.getIp())) {
|
|
|
|
throw new ApiException("ip不能为空");
|
|
|
|
throw new ApiException("ip不能为空");
|
|
|
|
} else if (model.getPort() == null) {
|
|
|
|
} else if (model.getPort() == null) {
|
|
|
|
throw new ApiException("port不能为空");
|
|
|
|
throw new ApiException("port不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "i1_cmd_set_xy_yw_ip_port";
|
|
|
|
String name = "i1_cmd_set_xy_yw_ip_port";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("value_str", model.getIp());
|
|
|
|
|
|
|
|
map.put("value_int", model.getPort());
|
|
|
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
cmd.setName(name);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
cmd.setCmd(json);
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("value_str", model.getIp());
|
|
|
|
|
|
|
|
map.put("value_int", model.getPort());
|
|
|
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCmd(json);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void sethb(CmdModel model) {
|
|
|
|
private void sethb(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
} else if (model.getHb() == null) {
|
|
|
|
} else if (model.getHb() == null) {
|
|
|
|
throw new ApiException("hb不能为空");
|
|
|
|
throw new ApiException("hb不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "i1_cmd_set_i1_heart_beat_time";
|
|
|
|
String name = "i1_cmd_set_i1_heart_beat_time";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
map.put("value_int", model.getHb());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCmd(json);
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
map.put("value_int", model.getHb());
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCmd(json);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void upgrade(CmdModel model) {
|
|
|
|
private void upgrade(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
} else if (StringUtils.isBlank(model.getUrl())) {
|
|
|
|
} else if (StringUtils.isBlank(model.getUrl())) {
|
|
|
|
throw new ApiException("url不能为空");
|
|
|
|
throw new ApiException("url不能为空");
|
|
|
|
} else if (StringUtils.isBlank(model.getMd5())) {
|
|
|
|
} else if (StringUtils.isBlank(model.getMd5())) {
|
|
|
@ -434,24 +452,27 @@ public class CmdServiceImpl implements CmdService {
|
|
|
|
throw new ApiException("fn不能为空");
|
|
|
|
throw new ApiException("fn不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "upgrade";
|
|
|
|
String name = "upgrade";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("url", model.getUrl());
|
|
|
|
|
|
|
|
map.put("md5", model.getMd5());
|
|
|
|
|
|
|
|
map.put("fileName", model.getFn());
|
|
|
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
cmd.setName(name);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
cmd.setCmd(json);
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("url", model.getUrl());
|
|
|
|
|
|
|
|
map.put("md5", model.getMd5());
|
|
|
|
|
|
|
|
map.put("fileName", model.getFn());
|
|
|
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCmd(json);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void startfrpc(CmdModel model) {
|
|
|
|
private void startfrpc(CmdModel model) {
|
|
|
@ -500,38 +521,44 @@ public class CmdServiceImpl implements CmdService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void stopfrpc(CmdModel model) {
|
|
|
|
private void stopfrpc(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "yw_cmd_stop_frpc";
|
|
|
|
String name = "yw_cmd_stop_frpc";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
cmd.setName(name);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void stopagingtest(CmdModel model) {
|
|
|
|
private void stopagingtest(CmdModel model) {
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String name = "i1_cmd_stop_aging_test";
|
|
|
|
String name = "i1_cmd_stop_aging_test";
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTermIdEqualTo(model.getTermId());
|
|
|
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
cmd.setTermId(model.getTermId());
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
cmd.setName(name);
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|