| | |
| | | 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.BattAlarmMapper; |
| | | import com.whyc.pojo.BattAlarm; |
| | | import com.whyc.pojo.RtData; |
| | | import com.whyc.pojo.db_alarm.BattAlarm; |
| | | 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 java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | /* |
| | | 在用电池组实时推送告警信息 |
| | | **/ |
| | | public Response getResBattAlm(int binfId) { |
| | | List<BattAlarm> list=mapper.getResBattAlm(binfId); |
| | | public Response getResBattAlm(int battGroupId) { |
| | | List<BattAlarm> list=mapper.getResBattAlm(battGroupId); |
| | | return new Response().setII(1,list!=null,list,"在用电池组实时推送告警信息"); |
| | | } |
| | | //查询电池告警 |
| | | public Response getBattAlarm(int almLevel, String startTime, String endTime ,int pageNum, int pageSize) { |
| | | public Response getPage(Integer almLevel, String startTime, String endTime ,int pageNum, int pageSize) { |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<BattAlarm> list=mapper.getBattAlarm(almLevel, ThreadLocalUtil.parse(startTime,1),ThreadLocalUtil.parse(endTime,1)); |
| | | List<BattAlarm> list=mapper.getList(almLevel, ThreadLocalUtil.parse(startTime,1),ThreadLocalUtil.parse(endTime,1)); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询电池告警"); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询分页"); |
| | | } |
| | | //确认告警 |
| | | public Response confirmAlarm(int num) { |
| | |
| | | return new Response().set(1,flag>0); |
| | | } |
| | | //取消告警 |
| | | public Response cancleAlarm(int num) { |
| | | public Response cancelAlarm(int num) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.eq("num",num); |
| | | wrapper.set("alm_confirm",0); |