| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.BattAlarmIdEnum; |
| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.DevalarmDataMapper; |
| | | import com.whyc.pojo.db_alarm.DevalarmData; |
| | | import com.whyc.pojo.web_site.AlarmInspection; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class DevalarmDataService { |
| | |
| | | Map<Integer,String> map= DevAlarmEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取设备告警类型(下拉)"); |
| | | } |
| | | |
| | | public List<AlarmInspection> getListGreatThan(Long devAlarmId) { |
| | | List<AlarmInspection> listGreatThan = mapper.getListGreatThan(devAlarmId); |
| | | Date now = new Date(); |
| | | listGreatThan.forEach(data->{ |
| | | data.setType(2); |
| | | data.setIsExist(1); |
| | | data.setCreateTime(now); |
| | | }); |
| | | return listGreatThan; |
| | | } |
| | | |
| | | public List<Long> getNumListInDB(List<Long> devAlarmNumList) { |
| | | QueryWrapper<DevalarmData> query = Wrappers.query(); |
| | | query.select("num"); |
| | | query.in("num",devAlarmNumList); |
| | | return mapper.selectList(query).stream().map(DevalarmData::getNum).collect(Collectors.toList()); |
| | | } |
| | | } |