|
@@ -1,6 +1,8 @@
|
|
|
package cn.com.ty.lift.business.framework.job;
|
|
|
|
|
|
import cn.com.ty.lift.business.maintenance.dao.entity.MaintenancePlan;
|
|
|
+import cn.com.ty.lift.business.maintenance.dao.entity.model.MaintenanceTask;
|
|
|
+import cn.com.ty.lift.business.maintenance.dao.mapper.MaintenancePlanMapper;
|
|
|
import cn.com.ty.lift.business.maintenance.service.MaintenancePlanService;
|
|
|
import cn.com.ty.lift.business.push.entity.InspectionTips;
|
|
|
import cn.com.ty.lift.business.push.entity.RepairTips;
|
|
@@ -38,6 +40,7 @@ public class BusinessJob {
|
|
|
private MaintenancePlanService maintenancePlanService;
|
|
|
private JmsMessagingTemplate jmsMessagingTemplate;
|
|
|
private PushUserService pushUserService;
|
|
|
+ private MaintenancePlanMapper maintenancePlanMapper;
|
|
|
|
|
|
/**
|
|
|
* 更新维保计划过期状态job:每天1-3点,每10分钟执行一次
|
|
@@ -61,6 +64,21 @@ public class BusinessJob {
|
|
|
} while (pageNum <= pages);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询当天所有维保工的维保任务并提醒
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 */5 * * * ?")
|
|
|
+ public void sendMaintenanceTask() {
|
|
|
+ //查询所有维保工当天的维保任务
|
|
|
+ List<MaintenanceTask> maintenanceTasks = maintenancePlanMapper.queryMaintenanceTask();
|
|
|
+ for (MaintenanceTask task : maintenanceTasks) {
|
|
|
+ PushUserInfo userInfo = new PushUserInfo(task.getDeviceModel(), task.getDeviceFlag());
|
|
|
+ //推送当天每个维保工的维保任务
|
|
|
+ PushMessage.maintainHasTaskDaily(task.getNum())
|
|
|
+ .sendTokenOnPlatform(jmsMessagingTemplate, userInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 年检到期提前45天提醒
|
|
|
*/
|