Merge branch 'server_five' of https://gitea.qinmian.online/five-groups/five-groups-couplet into server_five_dongxiaodong

server_five_dongxiaodong
dongxiaodong 2024-04-10 09:11:30 +08:00
commit c5fbb65b62
1 changed files with 22 additions and 23 deletions

View File

@ -49,31 +49,30 @@ public class ElectronicFenceServiceImpl implements IncidentService {
log.info("电子围栏事件redis存在.......");
for (Fence fence : cacheSet) {
String fenceLongitudeLatitude = fence.getFenceLongitudeLatitude();
if (!StringUtils.isEmpty(fenceLongitudeLatitude)){
log.info("电子围栏没有数据鸭...");
}
/**
*
*/
String[] split = fenceLongitudeLatitude.split(";");
for (String s : split) {
String[] strings = s.split(",");
if (strings.length == 2) {
// 经度
Double trim = Double.valueOf(strings[0].trim());
// 纬度
Double trim1 = Double.valueOf(strings[1].trim());
boolean a = trim <= Double.valueOf(coupletMsgData.getLongitude());
boolean b = trim1 <= Double.valueOf(coupletMsgData.getLatitude());
if (a && b) {
log.info("电子围栏报警啦!!!!您的车驶出范围啦!!!");
if (StringUtils.isEmpty(fenceLongitudeLatitude)){
/**
*
*/
String[] split = fenceLongitudeLatitude.split(";");
for (String s : split) {
String[] strings = s.split(",");
if (strings.length == 2) {
// 经度
Double trim = Double.valueOf(strings[0].trim());
// 纬度
Double trim1 = Double.valueOf(strings[1].trim());
boolean a = trim <= Double.valueOf(coupletMsgData.getLongitude());
boolean b = trim1 <= Double.valueOf(coupletMsgData.getLatitude());
if (a && b) {
log.info("电子围栏报警啦!!!!您的车驶出范围啦!!!");
} else {
log.info("电子围栏报警啦!!!!正常啦!!!");
}
log.info("经度是:" + trim);
log.info("纬度是:" + trim1);
} else {
log.info("电子围栏报警啦!!!!正常啦!!!");
throw new RuntimeException("电子围栏经纬度格式错误" + strings);
}
log.info("经度是:" + trim);
log.info("纬度是:" + trim1);
} else {
throw new RuntimeException("电子围栏经纬度格式错误" + strings);
}
}
}