|
|
|
@ -5,6 +5,7 @@ import com.shxy.xymanager_common.entity.*;
|
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
|
import com.shxy.xymanager_common.util.JSONUtil;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
|
import com.shxy.xymanager_service.service.CmdService;
|
|
|
|
|
import com.shxy.xymanager_service.service.TerminalExtService;
|
|
|
|
|
import com.shxy.xymanager_service.service.MntnService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -30,11 +31,11 @@ public class MntnServiceImpl implements MntnService {
|
|
|
|
|
@Resource
|
|
|
|
|
MntnStatusMapper statusMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
MntnRawReportsMapper rawReportsMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
TerminalExtService terminalExtService;
|
|
|
|
|
@Resource
|
|
|
|
|
MntnCmdResultsMapper resultsMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
CmdService cmdService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public HashMap<String, Object> sync(String cmdid, String ip, String multi, HashMap<String, Object> data) throws Exception {
|
|
|
|
@ -43,7 +44,7 @@ public class MntnServiceImpl implements MntnService {
|
|
|
|
|
throw new ApiException("该装置不存在");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.insertReport(term.getId(), ip, data);
|
|
|
|
|
cmdService.addRawReport(term.getId(), ip, data);
|
|
|
|
|
|
|
|
|
|
MntnStatus status = statusMapper.selectByPrimaryKey(term.getId());
|
|
|
|
|
|
|
|
|
@ -118,16 +119,6 @@ public class MntnServiceImpl implements MntnService {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void insertReport(Integer termId, String ip, HashMap<String, Object> data) {
|
|
|
|
|
String json = JSONUtil.object2Json(data);
|
|
|
|
|
MntnRawReports item = new MntnRawReports();
|
|
|
|
|
item.setTermId(termId);
|
|
|
|
|
item.setContent(json);
|
|
|
|
|
item.setIp(ip);
|
|
|
|
|
item.setCreateTime(System.currentTimeMillis() / 1000);
|
|
|
|
|
rawReportsMapper.insert(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void moveToHistory(MntnCmds cmd) {
|
|
|
|
|
MntnCmdHistory history = new MntnCmdHistory();
|
|
|
|
|
history.setId(cmd.getId());
|
|
|
|
|