Browse Source

警灯定时任务

java8
shenzhouyu 7 months ago
parent
commit
a313d95f0a
  1. 2
      src/main/java/com/xujie/sys/common/utils/TaskUtils.java
  2. 2
      src/main/java/com/xujie/sys/modules/pms/service/Impl/EamServiceImpl.java

2
src/main/java/com/xujie/sys/common/utils/TaskUtils.java

@ -83,7 +83,7 @@ public class TaskUtils {
//@Scheduled(cron = "${loraurl.sendThreeColourTime}") //@Scheduled(cron = "${loraurl.sendThreeColourTime}")
public void sendThreeColourLight(){eamService.sendThreeColourLight();}; public void sendThreeColourLight(){eamService.sendThreeColourLight();};
//@Scheduled(cron = "0/10 * * * * ?")
//@Scheduled(cron = "${loraurl.sendRedColourTime}")
public void sendLoraRedLight(){eamService.sendLoraRedLight();} public void sendLoraRedLight(){eamService.sendLoraRedLight();}
/** /**

2
src/main/java/com/xujie/sys/modules/pms/service/Impl/EamServiceImpl.java

@ -3816,7 +3816,7 @@ public class EamServiceImpl implements EamService {
@Override @Override
public void sendLoraRedLight() { public void sendLoraRedLight() {
//查询随身机类型的并能发送信息的消息 //查询随身机类型的并能发送信息的消息
List<TpmMessageNotification> notifications = tpmMessageNotificationService.lambdaQuery().eq(TpmMessageNotification::getMesTypNo, "D").eq(TpmMessageNotification::getSendFlag, "Y").list();
List<TpmMessageNotification> notifications = tpmMessageNotificationService.lambdaQuery().eq(TpmMessageNotification::getMesTypNo, "D").eq(TpmMessageNotification::getSendFlag, "Y").isNotNull(TpmMessageNotification::getIp).list();
//根据ip区分多个lora //根据ip区分多个lora
Map<String, List<TpmMessageNotification>> loranotifications = notifications.stream().collect(Collectors.groupingBy(TpmMessageNotification::getIp)); Map<String, List<TpmMessageNotification>> loranotifications = notifications.stream().collect(Collectors.groupingBy(TpmMessageNotification::getIp));

Loading…
Cancel
Save