648540858
2023-03-17 c3ce2bc5d069ba57309567aee4ae418bc0cf75ed
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java
@@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
 * @author lin
@@ -179,11 +180,13 @@
    @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;
@@ -201,4 +204,9 @@
        return true;
    }
    @Override
    public List<Device> getDeviceByChannelId(String channelId) {
        return channelMapper.getDeviceByChannelId(channelId);
    }
}