From a47cd5fff9b8abf9cfc9ba95f4de11bc886553b6 Mon Sep 17 00:00:00 2001 From: shenzhouyu Date: Wed, 30 Apr 2025 09:00:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xujie/sys/common/utils/TaskUtils.java | 10 ++++++++++ .../controller/TpmMachineProjectIncomeController.java | 2 +- .../sys/modules/pms/service/Impl/EamServiceImpl.java | 2 +- src/main/resources/application-dev.yml | 8 +++++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/xujie/sys/common/utils/TaskUtils.java b/src/main/java/com/xujie/sys/common/utils/TaskUtils.java index 9f394f48..cc91c36c 100644 --- a/src/main/java/com/xujie/sys/common/utils/TaskUtils.java +++ b/src/main/java/com/xujie/sys/common/utils/TaskUtils.java @@ -31,6 +31,7 @@ public class TaskUtils { @Autowired private ModbusCommunicateService modbusCommunicateService; + // 添加定时任务 @Scheduled(cron = "${task.data.eamWorkPlanTime}") // 每天0点执行 public void doTask() { @@ -64,4 +65,13 @@ public class TaskUtils { modbusCommunicateService.readPerSecond(); } + //@Scheduled(cron = "${loraurl.getLoraWatchTime}") + public void getLoraWatchMessage(){eamService.getLoraWatch();}; + + //@Scheduled(cron = "${loraurl.sendLoraWatchTime}") + public void sendLoraWatchMessage(){eamService.sendLoraWatch();}; + + //@Scheduled(cron = "${loraurl.sendThreeColourTime}") + public void sendThreeColourLight(){eamService.sendThreeColourLight();}; + } diff --git a/src/main/java/com/xujie/sys/modules/machine/controller/TpmMachineProjectIncomeController.java b/src/main/java/com/xujie/sys/modules/machine/controller/TpmMachineProjectIncomeController.java index 759350c3..f285b896 100644 --- a/src/main/java/com/xujie/sys/modules/machine/controller/TpmMachineProjectIncomeController.java +++ b/src/main/java/com/xujie/sys/modules/machine/controller/TpmMachineProjectIncomeController.java @@ -37,7 +37,7 @@ public class TpmMachineProjectIncomeController { * @param tpmMachineProjectIncome * @return */ - @GetMapping("/queryIncomeList") + @GetMapping("/queryIncomePage") public R queryProjectIncomePage(@RequestParam(name="pageIndex", defaultValue="1") Integer pageIndex, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, TpmMachineProjectIncome tpmMachineProjectIncome){ diff --git a/src/main/java/com/xujie/sys/modules/pms/service/Impl/EamServiceImpl.java b/src/main/java/com/xujie/sys/modules/pms/service/Impl/EamServiceImpl.java index a4881662..cf592e8b 100644 --- a/src/main/java/com/xujie/sys/modules/pms/service/Impl/EamServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/pms/service/Impl/EamServiceImpl.java @@ -3673,7 +3673,7 @@ public class EamServiceImpl implements EamService { List messageNotifications = notifications.stream().filter(obj -> obj.getLastSendTime() == null || calculateFutureTime(obj.getLastSendTime(), obj.getCycleTimeSend() ) < new Date().getTime()).collect(Collectors.toList()); LoraWatchResponseVo responseVo =null; if(messageNotifications != null && messageNotifications.size()>0){ - responseVo = loraWatchUtils.sendThreeColourLight(1, 3); + responseVo = loraWatchUtils.sendThreeColourLight(1, 1); //完成后更新每一条时间 for(TpmMessageNotification notification:messageNotifications){ diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 8cc3f700..e71d968e 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -4,8 +4,8 @@ spring: druid: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:sqlserver://192.168.1.90:1433;databaseName=CKT_MES_II_REAL - #url: jdbc:sqlserver://xujiesoft.vicp.net:11515;databaseName=CKT_MES_II_REAL + #url: jdbc:sqlserver://192.168.1.90:1433;databaseName=CKT_MES_II_REAL + url: jdbc:sqlserver://xujiesoft.vicp.net:11515;databaseName=CKT_MES_II_REAL username: sa password: XJsoft123 initial-size: 10 @@ -70,8 +70,10 @@ page helper: #--------------------------------------------手表设置------------------------------------------------- loraurl: - requestLoraIp: 'http://192.168.1.244:9999' + requestLoraIp: 'http://172.26.58.244:9999' requestGateway: 'http://192.168.1.1' + requestThreeColourLightIp: 'http://192.168.43.222:8080' getLoraWatchTime: 0/30 * * * * ? sendLoraWatchTime: 0/30 * * * * ? + sendThreeColourTime: 0/10 * * * * ?