| | |
| | | */ |
| | | package org.springblade.jfpt.alarm.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.entity.ReportReturnData; |
| | | import org.springblade.jfpt.alarm.constant.AlarmTimeConstant; |
| | | import org.springblade.jfpt.alarm.entity.Alarm; |
| | | import org.springblade.jfpt.alarm.mapper.AlarmMapper; |
| | | import org.springblade.jfpt.alarm.service.IAlarmService; |
| | | import org.springblade.common.entity.AlarmExcel; |
| | | import org.springblade.jfpt.alarm.vo.AlarmVO; |
| | | import org.springblade.jfpt.parcel.util.DateUtils; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | import org.springblade.system.user.entity.User; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | |
| | | @Override |
| | | public IPage<AlarmVO> selectAlarmPage(IPage<AlarmVO> page, AlarmVO alarm) { |
| | | return page.setRecords(baseMapper.selectAlarmPage(page, alarm)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AlarmVO> selectazPage(IPage<AlarmVO> page, AlarmVO alarm) { |
| | | return page.setRecords(baseMapper.selectazPage(page, alarm)); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getChartData(AlarmVO alarm) { |
| | | return baseMapper.getChartData(alarm); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateJtype(String id,String jtype,String bz) { |
| | | baseMapper.updateJtype(id,jtype,bz); |
| | | public void updateJtype(String id,String jtype,String bz,String securityArr,String bs) { |
| | | baseMapper.updateJtype(id,jtype,bz,securityArr,bs); |
| | | } |
| | | |
| | | @Override |
| | | public void updateVaddress(String vaddress, String jid) { |
| | | baseMapper.updateVaddress(vaddress, jid); |
| | | public void updateVaddress(String vaddress,String uids, String jid) { |
| | | baseMapper.updateVaddress(vaddress,uids ,jid); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryPolice() { |
| | | public List<User> queryPolice() { |
| | | return baseMapper.queryPolice(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryPoliceTime(List policeIdArr) { |
| | | public List<AlarmVO> queryPoliceTime(List policeIdArr) { |
| | | return baseMapper.queryPoliceTime(policeIdArr); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryBa() { |
| | | return baseMapper.queryBa(); |
| | | } |
| | | |
| | | @Override |
| | | public List<AlarmVO> getAlarm(AlarmVO alarmVO) { |
| | | return baseMapper.getAlarm(alarmVO); |
| | | } |
| | | |
| | | @Override |
| | | public List<AlarmVO> getAlarming(AlarmVO alarmVO) { |
| | | return baseMapper.getAlarming(alarmVO); |
| | | } |
| | | |
| | | @Override |
| | | public boolean setAlarm(AlarmVO alarmVO) { |
| | | return baseMapper.setAlarm(alarmVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }else { |
| | | long nowTime = new Date().getTime(); |
| | | try { |
| | | long alarmTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(alarm.getAlarmTime()).getTime(); |
| | | //0-5分钟 |
| | | if (nowTime-alarmTime>0 && nowTime-alarmTime<AlarmTimeConstant.FIVE_TIME){ |
| | | count05+=1; |
| | | } |
| | | //5-10分钟 |
| | | if (nowTime-alarmTime>=AlarmTimeConstant.FIVE_TIME && nowTime-alarmTime<AlarmTimeConstant.TEN_TIME){ |
| | | count0510+=1; |
| | | } |
| | | //10-30分钟 |
| | | if (nowTime-alarmTime>=AlarmTimeConstant.TEN_TIME && nowTime-alarmTime<AlarmTimeConstant.THIRTY_TIME){ |
| | | count1030+=1; |
| | | } |
| | | //30分钟以上 |
| | | if (nowTime-alarmTime>=AlarmTimeConstant.THIRTY_TIME){ |
| | | count30+=1; |
| | | } |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | // else { |
| | | // long nowTime = new Date().getTime(); |
| | | // try { |
| | | // long alarmTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(alarm.getAlarmTime()).getTime(); |
| | | // //0-5分钟 |
| | | // if (nowTime-alarmTime>0 && nowTime-alarmTime<AlarmTimeConstant.FIVE_TIME){ |
| | | // count05+=1; |
| | | // } |
| | | // //5-10分钟 |
| | | // if (nowTime-alarmTime>=AlarmTimeConstant.FIVE_TIME && nowTime-alarmTime<AlarmTimeConstant.TEN_TIME){ |
| | | // count0510+=1; |
| | | // } |
| | | // //10-30分钟 |
| | | // if (nowTime-alarmTime>=AlarmTimeConstant.TEN_TIME && nowTime-alarmTime<AlarmTimeConstant.THIRTY_TIME){ |
| | | // count1030+=1; |
| | | // } |
| | | // //30分钟以上 |
| | | // if (nowTime-alarmTime>=AlarmTimeConstant.THIRTY_TIME){ |
| | | // count30+=1; |
| | | // } |
| | | // } catch (ParseException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | } |
| | | //封装数据 |
| | | list.add(count05); |
| | |
| | | } |
| | | return Arrays.asList(0,0,0,0,0,0,0,0,0,0,0,0); |
| | | } |
| | | |
| | | /** |
| | | * 统计时间段内一键求助警情数量数据 |
| | | * @param conditionVo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> selectAlarmTimeData(ConditionVo conditionVo) { |
| | | conditionVo.setStartTime(conditionVo.getStartTime().substring(0,10)); |
| | | conditionVo.setEndTime(conditionVo.getEndTime().substring(0,10)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //查询数据 |
| | | List<Integer> list = baseMapper.selectAlarmTimeData(conditionVo); |
| | | //封装数据 |
| | | map.put("alarmData",list); |
| | | //返回数据 |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryYearAlarm(String deviceNumber) { |
| | | List childList = new ArrayList(); |
| | | for (int i = 1; i <= 12; i++) { |
| | | childList.add(i); |
| | | } |
| | | |
| | | return baseMapper.queryYearAlarm(deviceNumber,childList); |
| | | } |
| | | |
| | | /** |
| | | * 导出主动报警数据表格 |
| | | * @param alarmVO 查询条件 |
| | | */ |
| | | @Override |
| | | public List<AlarmExcel> exportAlarm(AlarmVO alarmVO) { |
| | | return baseMapper.exportAlarm(alarmVO); |
| | | } |
| | | |
| | | /** |
| | | * 获取实时警情数据集合 |
| | | * @param alarmVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ReportReturnData> getAlarmPie(AlarmVO alarmVO) { |
| | | return baseMapper.getAlarmPie(alarmVO); |
| | | } |
| | | |
| | | /** |
| | | * 查询未处理及处理中的警情总数量 |
| | | * @param deviceNumber 设备编号 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer selectEqCount(String deviceNumber) { |
| | | return baseMapper.selectEqCount(deviceNumber); |
| | | } |
| | | } |