|  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.HashMap; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.concurrent.CopyOnWriteArrayList; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author lin | 
|---|
|  |  |  | 
|---|
|  |  |  | if (device == null) { | 
|---|
|  |  |  | device = deviceMapper.getDeviceByDeviceId(deviceChannel.getDeviceId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if ("WGS84".equals(device.getGeoCoordSys())) { | 
|---|
|  |  |  | deviceChannel.setLongitudeWgs84(deviceChannel.getLongitude()); | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public boolean updateAllGps(Device device) { | 
|---|
|  |  |  | List<DeviceChannel> deviceChannels = channelMapper.getChannelsWithoutTransform(device.getDeviceId()); | 
|---|
|  |  |  | List<DeviceChannel> result = new ArrayList<>(); | 
|---|
|  |  |  | List<DeviceChannel> result = new CopyOnWriteArrayList<>(); | 
|---|
|  |  |  | if (deviceChannels.size() == 0) { | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String now = DateUtil.getNow(); | 
|---|
|  |  |  | deviceChannels.parallelStream().forEach(deviceChannel -> { | 
|---|
|  |  |  | deviceChannel.setUpdateTime(now); | 
|---|
|  |  |  | result.add(updateGps(deviceChannel, device)); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | int limitCount = 300; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<Device> getDeviceByChannelId(String channelId) { | 
|---|
|  |  |  | return channelMapper.getDeviceByChannelId(channelId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|