| New file | 
|  |  |  | 
|---|
|  |  |  | package com.moral.task; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.moral.entity.Device; | 
|---|
|  |  |  | import com.moral.service.DeviceAdjustValueService; | 
|---|
|  |  |  | import com.moral.service.DeviceAdjustValueTimingService; | 
|---|
|  |  |  | import com.moral.service.DeviceService; | 
|---|
|  |  |  | import com.moral.util.AlarmUtils_2; | 
|---|
|  |  |  | import com.moral.util.LengthOfTimeUtils; | 
|---|
|  |  |  | import com.moral.util.RedisUtils; | 
|---|
|  |  |  | import com.xxl.job.core.biz.model.ReturnT; | 
|---|
|  |  |  | import com.xxl.job.core.handler.annotation.XxlJob; | 
|---|
|  |  |  | import com.xxl.job.core.log.XxlJobLogger; | 
|---|
|  |  |  | import org.slf4j.Logger; | 
|---|
|  |  |  | import org.slf4j.LoggerFactory; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  | import java.time.LocalDateTime; | 
|---|
|  |  |  | import java.time.format.DateTimeFormatter; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Component | 
|---|
|  |  |  | public class OffLineAlarmTask { | 
|---|
|  |  |  | private static transient Logger logger = LoggerFactory.getLogger(OffLineAlarmTask.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | RedisUtils redisUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @XxlJob("OffLineAlarm") | 
|---|
|  |  |  | public ReturnT OffLineAlarm() { | 
|---|
|  |  |  | AlarmUtils_2.sendMail("357328213@qq.com","程序掉线警报!","程序可能离线了!"); | 
|---|
|  |  |  | //AlarmUtils_2.sendMail("357328213@qq.com","程序掉线警报!",programList.toString()+"程序可能离线了!"); | 
|---|
|  |  |  | ReturnT returnT = new ReturnT(500, "校准值变更失败!"); | 
|---|
|  |  |  | return returnT; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|