Browse Source

提交

java8
shenzhouyu 9 months ago
parent
commit
a47cd5fff9
  1. 10
      src/main/java/com/xujie/sys/common/utils/TaskUtils.java
  2. 2
      src/main/java/com/xujie/sys/modules/machine/controller/TpmMachineProjectIncomeController.java
  3. 2
      src/main/java/com/xujie/sys/modules/pms/service/Impl/EamServiceImpl.java
  4. 8
      src/main/resources/application-dev.yml

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

@ -31,6 +31,7 @@ public class TaskUtils {
@Autowired @Autowired
private ModbusCommunicateService modbusCommunicateService; private ModbusCommunicateService modbusCommunicateService;
// 添加定时任务 // 添加定时任务
@Scheduled(cron = "${task.data.eamWorkPlanTime}") // 每天0点执行 @Scheduled(cron = "${task.data.eamWorkPlanTime}") // 每天0点执行
public void doTask() { public void doTask() {
@ -64,4 +65,13 @@ public class TaskUtils {
modbusCommunicateService.readPerSecond(); 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();};
} }

2
src/main/java/com/xujie/sys/modules/machine/controller/TpmMachineProjectIncomeController.java

@ -37,7 +37,7 @@ public class TpmMachineProjectIncomeController {
* @param tpmMachineProjectIncome * @param tpmMachineProjectIncome
* @return * @return
*/ */
@GetMapping("/queryIncomeList")
@GetMapping("/queryIncomePage")
public R queryProjectIncomePage(@RequestParam(name="pageIndex", defaultValue="1") Integer pageIndex, public R queryProjectIncomePage(@RequestParam(name="pageIndex", defaultValue="1") Integer pageIndex,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
TpmMachineProjectIncome tpmMachineProjectIncome){ TpmMachineProjectIncome tpmMachineProjectIncome){

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

@ -3673,7 +3673,7 @@ public class EamServiceImpl implements EamService {
List<TpmMessageNotification> messageNotifications = notifications.stream().filter(obj -> obj.getLastSendTime() == null || calculateFutureTime(obj.getLastSendTime(), obj.getCycleTimeSend() ) < new Date().getTime()).collect(Collectors.toList()); List<TpmMessageNotification> messageNotifications = notifications.stream().filter(obj -> obj.getLastSendTime() == null || calculateFutureTime(obj.getLastSendTime(), obj.getCycleTimeSend() ) < new Date().getTime()).collect(Collectors.toList());
LoraWatchResponseVo responseVo =null; LoraWatchResponseVo responseVo =null;
if(messageNotifications != null && messageNotifications.size()>0){ if(messageNotifications != null && messageNotifications.size()>0){
responseVo = loraWatchUtils.sendThreeColourLight(1, 3);
responseVo = loraWatchUtils.sendThreeColourLight(1, 1);
//完成后更新每一条时间 //完成后更新每一条时间
for(TpmMessageNotification notification:messageNotifications){ for(TpmMessageNotification notification:messageNotifications){

8
src/main/resources/application-dev.yml

@ -4,8 +4,8 @@ spring:
druid: druid:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
type: com.alibaba.druid.pool.DruidDataSource 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 username: sa
password: XJsoft123 password: XJsoft123
initial-size: 10 initial-size: 10
@ -70,8 +70,10 @@ page helper:
#--------------------------------------------手表设置------------------------------------------------- #--------------------------------------------手表设置-------------------------------------------------
loraurl: loraurl:
requestLoraIp: 'http://192.168.1.244:9999'
requestLoraIp: 'http://172.26.58.244:9999'
requestGateway: 'http://192.168.1.1' requestGateway: 'http://192.168.1.1'
requestThreeColourLightIp: 'http://192.168.43.222:8080'
getLoraWatchTime: 0/30 * * * * ? getLoraWatchTime: 0/30 * * * * ?
sendLoraWatchTime: 0/30 * * * * ? sendLoraWatchTime: 0/30 * * * * ?
sendThreeColourTime: 0/10 * * * * ?
Loading…
Cancel
Save