|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.xydl.cac.controller;
|
|
|
|
package com.xydl.cac.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.util.StringUtils;
|
|
|
|
import com.xydl.cac.entity.I2syncConfig;
|
|
|
|
import com.xydl.cac.entity.I2syncConfig;
|
|
|
|
import com.xydl.cac.entity.I2syncField;
|
|
|
|
import com.xydl.cac.entity.I2syncField;
|
|
|
|
import com.xydl.cac.entity.I2syncRecord;
|
|
|
|
import com.xydl.cac.entity.I2syncRecord;
|
|
|
@ -11,6 +12,7 @@ import com.xydl.cac.model.i2sync.Datanode;
|
|
|
|
import com.xydl.cac.model.i2sync.Monitordata;
|
|
|
|
import com.xydl.cac.model.i2sync.Monitordata;
|
|
|
|
import com.xydl.cac.model.i2sync.Request;
|
|
|
|
import com.xydl.cac.model.i2sync.Request;
|
|
|
|
import com.xydl.cac.service.I2syncService;
|
|
|
|
import com.xydl.cac.service.I2syncService;
|
|
|
|
|
|
|
|
import com.xydl.cac.util.DataTable;
|
|
|
|
import com.xydl.cac.util.DateUtil;
|
|
|
|
import com.xydl.cac.util.DateUtil;
|
|
|
|
import com.xydl.cac.util.JSONUtil;
|
|
|
|
import com.xydl.cac.util.JSONUtil;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
@ -103,7 +105,7 @@ public class I2syncController extends BasicController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Datanode node = new Datanode();
|
|
|
|
Datanode node = new Datanode();
|
|
|
|
node.setSensorid("HNHFT001Q1W000104");
|
|
|
|
node.setSensorid("HNHFT001Q1W000104");
|
|
|
|
node.setType("027002");
|
|
|
|
node.setType(DataTable.getDevType(tablename));
|
|
|
|
node.setEquipmentid("HNHFT001Q1W000104");
|
|
|
|
node.setEquipmentid("HNHFT001Q1W000104");
|
|
|
|
node.setTimestamp(DateUtil.format(new Date()));
|
|
|
|
node.setTimestamp(DateUtil.format(new Date()));
|
|
|
|
node.setAttr(attrs);
|
|
|
|
node.setAttr(attrs);
|
|
|
@ -116,7 +118,11 @@ public class I2syncController extends BasicController {
|
|
|
|
Request request = new Request();
|
|
|
|
Request request = new Request();
|
|
|
|
request.setMonitordata(monitordata);
|
|
|
|
request.setMonitordata(monitordata);
|
|
|
|
String xml = JSONUtil.object2Xml(request);
|
|
|
|
String xml = JSONUtil.object2Xml(request);
|
|
|
|
return Response.success(xml);
|
|
|
|
Response<String> resp = Response.success(xml);
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(node.getType())) {
|
|
|
|
|
|
|
|
resp.setWarnMsg("改类型还未配置对应的监测类型编码");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return resp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|