| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | |
| | | import com.whyc.mapper.LockInfMapper; |
| | | import com.whyc.pojo.db_area.LockInf; |
| | | import com.whyc.pojo.db_lock_alarm.LockAlarm; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.swing.*; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询锁实时告警信息"); |
| | | } |
| | | //确认告警 |
| | | public Response confirmAlm(Integer lockId) { |
| | | UpdateWrapper wrapper= new UpdateWrapper<LockAlarm>(); |
| | | wrapper.eq("lock_id",lockId); |
| | | wrapper.set("alm_is_confirmed",1); |
| | | wrapper.set("alm_confirmed_time",new Date()); |
| | | mapper.update((LockAlarm) ActionUtil.objeNull,wrapper); |
| | | return new Response().set(1,true,"确认告警成功!"); |
| | | } |
| | | //取消告警 |
| | | public Response cancleAlm(Integer lockId) { |
| | | UpdateWrapper wrapper= new UpdateWrapper<LockAlarm>(); |
| | | wrapper.eq("lock_id",lockId); |
| | | wrapper.set("alm_is_confirmed",0); |
| | | wrapper.set("alm_confirmed_time", ThreadLocalUtil.parse("2000-01-01 00:00:00",1)); |
| | | mapper.update((LockAlarm) ActionUtil.objeNull,wrapper); |
| | | return new Response().set(1,true,"取消告警成功!"); |
| | | } |
| | | } |