修复上报的坐标未按照坐标系转换的BUG
This commit is contained in:
@@ -459,4 +459,47 @@ public interface DeviceMapper {
|
||||
"</foreach>" +
|
||||
"</script>"})
|
||||
void batchUpdate(List<Device> devices);
|
||||
|
||||
|
||||
@Update(value = {" <script>" +
|
||||
"SELECT " +
|
||||
"coalesce(custom_name, name) as name, " +
|
||||
"id" +
|
||||
",device_id" +
|
||||
",manufacturer" +
|
||||
",model" +
|
||||
",firmware" +
|
||||
",transport" +
|
||||
",stream_mode" +
|
||||
",on_line" +
|
||||
",register_time" +
|
||||
",keepalive_time" +
|
||||
",ip" +
|
||||
",create_time" +
|
||||
",update_time" +
|
||||
",port" +
|
||||
",expires" +
|
||||
",subscribe_cycle_for_catalog" +
|
||||
",subscribe_cycle_for_mobile_position" +
|
||||
",mobile_position_submission_interval" +
|
||||
",subscribe_cycle_for_alarm" +
|
||||
",host_address" +
|
||||
",charset" +
|
||||
",ssrc_check" +
|
||||
",geo_coord_sys" +
|
||||
",media_server_id" +
|
||||
",sdp_ip" +
|
||||
",local_ip" +
|
||||
",password" +
|
||||
",as_message_channel" +
|
||||
",heart_beat_interval" +
|
||||
",heart_beat_count" +
|
||||
",position_capability" +
|
||||
",broadcast_push_after_ack" +
|
||||
",server_id" +
|
||||
" FROM wvp_device" +
|
||||
" WHERE device_id in"+
|
||||
"<foreach collection='deviceIds' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||
" </script>"})
|
||||
List<Device> queryByDeviceIds(List<String> deviceIds);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ConcurrentReferenceHashMap;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.time.Duration;
|
||||
@@ -844,27 +843,27 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
}
|
||||
// 此处来源默认为WGS84, 所以直接入库
|
||||
commonGBChannelMapper.updateGpsByDeviceId(gpsMsgInfoList);
|
||||
|
||||
Map<String, GPSMsgInfo> gpsMsgInfoMap = new ConcurrentReferenceHashMap<>();
|
||||
for (GPSMsgInfo gpsMsgInfo : gpsMsgInfoList) {
|
||||
gpsMsgInfoMap.put(gpsMsgInfo.getId(), gpsMsgInfo);
|
||||
}
|
||||
|
||||
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(new ArrayList<>(gpsMsgInfoMap.keySet()));
|
||||
if (channelList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
channelList.forEach(commonGBChannel -> {
|
||||
MobilePosition mobilePosition = new MobilePosition();
|
||||
mobilePosition.setDeviceId(commonGBChannel.getGbDeviceId());
|
||||
mobilePosition.setChannelId(commonGBChannel.getGbId());
|
||||
mobilePosition.setDeviceName(commonGBChannel.getGbName());
|
||||
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||
mobilePosition.setTime(DateUtil.getNow());
|
||||
mobilePosition.setLongitude(commonGBChannel.getGbLongitude());
|
||||
mobilePosition.setLatitude(commonGBChannel.getGbLatitude());
|
||||
eventPublisher.mobilePositionEventPublish(mobilePosition);
|
||||
});
|
||||
//
|
||||
// Map<String, GPSMsgInfo> gpsMsgInfoMap = new ConcurrentReferenceHashMap<>();
|
||||
// for (GPSMsgInfo gpsMsgInfo : gpsMsgInfoList) {
|
||||
// gpsMsgInfoMap.put(gpsMsgInfo.getId(), gpsMsgInfo);
|
||||
// }
|
||||
//
|
||||
// List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(new ArrayList<>(gpsMsgInfoMap.keySet()));
|
||||
// if (channelList.isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
// channelList.forEach(commonGBChannel -> {
|
||||
// MobilePosition mobilePosition = new MobilePosition();
|
||||
// mobilePosition.setDeviceId(commonGBChannel.getGbDeviceId());
|
||||
// mobilePosition.setChannelId(commonGBChannel.getGbId());
|
||||
// mobilePosition.setDeviceName(commonGBChannel.getGbName());
|
||||
// mobilePosition.setCreateTime(DateUtil.getNow());
|
||||
// mobilePosition.setTime(DateUtil.getNow());
|
||||
// mobilePosition.setLongitude(commonGBChannel.getGbLongitude());
|
||||
// mobilePosition.setLatitude(commonGBChannel.getGbLatitude());
|
||||
// eventPublisher.mobilePositionEventPublish(mobilePosition);
|
||||
// });
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
@@ -540,7 +540,6 @@ public class PlatformServiceImpl implements IPlatformService, CommandLineRunner
|
||||
}
|
||||
for (CommonGBChannel channel : channelList) {
|
||||
GPSMsgInfo gpsMsgInfo = redisCatchStorage.getGpsMsgInfo(channel.getGbDeviceId());
|
||||
|
||||
// 无最新位置则发送当前位置
|
||||
if (gpsMsgInfo != null && (gpsMsgInfo.getLng() == 0 && gpsMsgInfo.getLat() == 0)) {
|
||||
gpsMsgInfo = null;
|
||||
|
||||
@@ -356,6 +356,7 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform {
|
||||
if (parentPlatform == null) {
|
||||
return;
|
||||
}
|
||||
log.info("[发送 移动位置订阅] {}/{}->{},{}", parentPlatform.getServerGBId(), gpsMsgInfo.getId(), gpsMsgInfo.getLng(), gpsMsgInfo.getLat());
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("[发送 移动位置订阅] {}/{}->{},{}", parentPlatform.getServerGBId(), gpsMsgInfo.getId(), gpsMsgInfo.getLng(), gpsMsgInfo.getLat());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user