Kaynağa Gözat

增加在线判断

shs 1 yıl önce
ebeveyn
işleme
62ef2962a4

+ 4 - 1
aidex-system/src/main/java/com/aidex/common/app/server/impl/AppService.java

@@ -61,7 +61,10 @@ public class AppService implements IAppService {
     * */
     public List<LocationEntity> findAllLocation(Boolean direction){
         // 全部船只信息
-        List<LocationEntity> locationEntities = iGpsService.getLocationBatch();
+        List<MyGpsEntity> allMyGps = iGpsService.findMyGps();
+        // 全部在线设备
+        String macIds = allMyGps.stream().filter(gps -> gps.getStatus().equals("1")).map(MyGpsEntity::getMacid).collect(Collectors.joining(","));
+        List<LocationEntity> locationEntities = iGpsService.getLocationBatchByMac(macIds);
         if(locationEntities.size() <= 0)
             throw new SysException(8821,"暂无运行船只");