1、修改贵州院UDP推送
This commit is contained in:
parent
5043434a6f
commit
5732629274
@ -22,7 +22,7 @@ import java.util.List;
|
|||||||
public class GZYForwarder extends Forwarder{
|
public class GZYForwarder extends Forwarder{
|
||||||
private final Logger logger = LoggerFactory.getLogger(GZYForwarder.class);
|
private final Logger logger = LoggerFactory.getLogger(GZYForwarder.class);
|
||||||
|
|
||||||
static final String FORWARDER_NAME = "贵州交勘院";
|
static final String FORWARDER_NAME = "贵州交勘院UDP";
|
||||||
@Value("${gzy.server.host}")
|
@Value("${gzy.server.host}")
|
||||||
private String host;
|
private String host;
|
||||||
|
|
||||||
@ -56,11 +56,9 @@ public class GZYForwarder extends Forwarder{
|
|||||||
int sendNum = 0;
|
int sendNum = 0;
|
||||||
if(records.size() == 0) return 0;
|
if(records.size() == 0) return 0;
|
||||||
|
|
||||||
GZYData gzyData = new GZYData();
|
|
||||||
gzyData.setIdentityName(projectId);
|
|
||||||
|
|
||||||
|
|
||||||
for(GnssCalcData locationRecord: records) {
|
for(GnssCalcData locationRecord: records) {
|
||||||
|
GZYData gzyData = new GZYData();
|
||||||
|
gzyData.setIdentityName(locationRecord.getDeviceid());
|
||||||
GZYData.Data tranData = new GZYData.Data();
|
GZYData.Data tranData = new GZYData.Data();
|
||||||
tranData.setCollectTime(locationRecord.getCreatetime().format(formatter));
|
tranData.setCollectTime(locationRecord.getCreatetime().format(formatter));
|
||||||
double n = NumberUtils.scale(locationRecord.getRposn(), 2);
|
double n = NumberUtils.scale(locationRecord.getRposn(), 2);
|
||||||
@ -70,13 +68,13 @@ public class GZYForwarder extends Forwarder{
|
|||||||
tranData.setY(e);
|
tranData.setY(e);
|
||||||
tranData.setZ(d);
|
tranData.setZ(d);
|
||||||
gzyData.addData(tranData);
|
gzyData.addData(tranData);
|
||||||
|
String json = GsonUtil.toJson(gzyData);
|
||||||
|
String msg = "JGKJ" + json + "#!";
|
||||||
|
logger.info("forward to GZY");
|
||||||
|
logger.info(msg);
|
||||||
|
udpClient.sendMessage(msg);
|
||||||
sendNum++;
|
sendNum++;
|
||||||
}
|
}
|
||||||
String json = GsonUtil.toJson(gzyData);
|
|
||||||
String msg = "JGKJ" + json + "#!";
|
|
||||||
logger.info("forward to GZY");
|
|
||||||
logger.info(msg);
|
|
||||||
udpClient.sendMessage(msg);
|
|
||||||
return sendNum;
|
return sendNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user