修复更新通道是更新各个坐标系德位置信息
This commit is contained in:
@@ -46,4 +46,9 @@ public interface IDeviceChannelService {
|
||||
* @return
|
||||
*/
|
||||
List<ChannelReduce> queryAllChannelList(String platformId);
|
||||
|
||||
/**
|
||||
* 数据位置信息格式处理
|
||||
*/
|
||||
boolean updateAllGps(Device device);
|
||||
}
|
||||
|
||||
@@ -176,5 +176,29 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||
return channelMapper.queryChannelListInAll(null, null, null, platformId, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateAllGps(Device device) {
|
||||
List<DeviceChannel> deviceChannels = channelMapper.getChannelsWithoutTransform(device.getDeviceId());
|
||||
List<DeviceChannel> result = new ArrayList<>();
|
||||
if (deviceChannels.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
deviceChannels.parallelStream().forEach(deviceChannel -> {
|
||||
result.add(updateGps(deviceChannel, device));
|
||||
});
|
||||
int limitCount = 300;
|
||||
if (result.size() > limitCount) {
|
||||
for (int i = 0; i < result.size(); i += limitCount) {
|
||||
int toIndex = i + limitCount;
|
||||
if (i + limitCount > result.size()) {
|
||||
toIndex = result.size();
|
||||
}
|
||||
channelMapper.batchUpdate(result.subList(i, toIndex));
|
||||
}
|
||||
}else {
|
||||
channelMapper.batchUpdate(result);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user