|
|
|
@ -15,6 +15,7 @@ import com.xujie.sys.modules.pms.data.*; |
|
|
|
import com.xujie.sys.modules.pms.entity.EamWorkOrderCoreComponentsData; |
|
|
|
import com.xujie.sys.modules.pms.entity.SendMessageNotification; |
|
|
|
import com.xujie.sys.modules.pms.entity.TpmMessageNotification; |
|
|
|
import com.xujie.sys.modules.pms.entity.vo.EquipmentFolderLocationVo; |
|
|
|
import com.xujie.sys.modules.pms.entity.vo.LoraWatchResponseVo; |
|
|
|
import com.xujie.sys.modules.pms.mapper.EamDao; |
|
|
|
import com.xujie.sys.modules.pms.mapper.EamMapper; |
|
|
|
@ -3826,6 +3827,21 @@ public class EamServiceImpl implements EamService { |
|
|
|
|
|
|
|
//根据ip区分多个lora |
|
|
|
Map<String, List<TpmMessageNotification>> loranotifications = notifications.stream().collect(Collectors.groupingBy(TpmMessageNotification::getIp)); |
|
|
|
|
|
|
|
//获取所有列表,如果没有就关闭 |
|
|
|
List<EquipmentFolderLocationVo> location = tpmMessageNotificationService.getAllEquipmentFolderLocation(); |
|
|
|
List<String> ips = new ArrayList<>(); |
|
|
|
for (Map.Entry<String,List<TpmMessageNotification>> entry:loranotifications.entrySet()){ |
|
|
|
ips.add(entry.getKey()); |
|
|
|
} |
|
|
|
List<EquipmentFolderLocationVo> collect = location.stream().filter(obj -> ips.stream().noneMatch(obj2 -> obj2.equals(obj.getIP()))).collect(Collectors.toList()); |
|
|
|
if(collect != null && collect.size()>0){ |
|
|
|
for(EquipmentFolderLocationVo vo:collect){ |
|
|
|
loraWatchUtils.sendloraRedLight(vo.getIP(),0, 0,0); |
|
|
|
} |
|
|
|
} |
|
|
|
collect.forEach(item->System.out.println("-----------------"+item.getIP())); |
|
|
|
|
|
|
|
for (Map.Entry<String,List<TpmMessageNotification>> entry:loranotifications.entrySet()){ |
|
|
|
//过滤掉时间不为空并最后时间加上间隔时间大于当前时间的 |
|
|
|
List<TpmMessageNotification> messageNotifications = entry.getValue().stream().filter(obj -> obj.getLastSendTime() == null || calculateFutureTime(obj.getLastSendTime(), obj.getCycleTimeSend() ) < new Date().getTime()).collect(Collectors.toList()); |
|
|
|
@ -3855,6 +3871,7 @@ public class EamServiceImpl implements EamService { |
|
|
|
sendMessageNotification.setSendMes(res); |
|
|
|
sendMessageNotificationService.save(sendMessageNotification); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|