| | |
| | | import com.ruoyi.alarm.external.mapper.ArdAlarmExternalMapper; |
| | | import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarFireMapper; |
| | | import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarMoveMapper; |
| | | import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarPumpMapper; |
| | | import com.ruoyi.alarm.steal.mapper.ArdAlarmStealelecMapper; |
| | | import com.ruoyi.alarm.tube.mapper.ArdAlarmTubeMapper; |
| | | import com.ruoyi.alarm.wall.mapper.ArdAlarmWallMapper; |
| | |
| | | import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper; |
| | | import com.ruoyi.common.core.domain.entity.SysConfig; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.device.camera.domain.ArdCameras; |
| | | import com.ruoyi.device.camera.mapper.ArdCamerasMapper; |
| | | import com.ruoyi.device.radar.domain.ArdEquipRadar; |
| | | import com.ruoyi.device.radar.mapper.ArdEquipRadarMapper; |
| | | import com.ruoyi.statistical.param.ESParam; |
| | | import com.ruoyi.statistical.param.Para; |
| | | import com.ruoyi.statistical.service.StatisticalService; |
| | | import com.ruoyi.statistical.vo.CountVo; |
| | | import com.ruoyi.statistical.vo.UnitVo; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.utils.result.Results; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.net.Socket; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | @Autowired |
| | | private ArdAlarmApponekeyMapper apponekeyMapper; |
| | | @Autowired |
| | | private ArdAlarmRadarPumpMapper pumpMapper; |
| | | @Autowired |
| | | private ArdAlarmWallMapper wallMapper; |
| | | @Autowired |
| | | private ArdAlarmDigitization3Mapper digitization3Mapper; |
| | | @Autowired |
| | | private ArdAlarmTubeMapper tubeMapper; |
| | | @Autowired |
| | | private ArdEquipRadarMapper radarMapper; |
| | | @Autowired |
| | | private ArdCamerasMapper camerasMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> pumpYear(ESParam esParam) { |
| | | List<CountVo> list = pumpMapper.pumpYear(esParam); |
| | | return es(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> wallYear(ESParam esParam) { |
| | | List<CountVo> list = wallMapper.wallYear(esParam); |
| | | return es(list); |
| | |
| | | return es(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> stealelecMonth(ESParam esParam) { |
| | | List<CountVo> list = stealelecMapper.stealelecMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> cameraMonth(ESParam esParam) { |
| | | List<CountVo> list = cameraMapper.cameraMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> moveMonth(ESParam esParam) { |
| | | List<CountVo> list = moveMapper.moveMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> fireMonth(ESParam esParam) { |
| | | List<CountVo> list = fireMapper.fileMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> externalMonth(ESParam esParam) { |
| | | List<CountVo> list = externalMapper.externalMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> accessMonth(ESParam esParam) { |
| | | List<CountVo> list = accessMapper.accessMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> apponekeyMonth(ESParam esParam) { |
| | | List<CountVo> list = apponekeyMapper.apponekeyMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> pumpMonth(ESParam esParam) { |
| | | List<CountVo> list = pumpMapper.pumpMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> wallMonth(ESParam esParam) { |
| | | List<CountVo> list = wallMapper.wallMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> digitizationMonth(ESParam esParam) { |
| | | List<CountVo> list = digitization3Mapper.digitizationMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountVo> tubeMonth(ESParam esParam) { |
| | | List<CountVo> list = tubeMapper.tubeMonth(esParam); |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | @Override |
| | | public UnitVo unit() { |
| | | UnitVo unitVo = new UnitVo(); |
| | | //雷达在线数量 |
| | | List<ArdEquipRadar> radarList = radarMapper.selectList(null); |
| | | Timer timer = new Timer(); |
| | | TimerTask timerTask =new TimerTask(){ |
| | | @Override |
| | | public void run(){ |
| | | Para.setI(0); |
| | | for(Object o : radarList){ |
| | | Thread thread = new Thread(){ |
| | | @Override |
| | | public void run(){ |
| | | try { |
| | | Socket socket = new Socket("192.168.5.226",1200); |
| | | } catch (Exception e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | int i = Para.getI(); |
| | | i++; |
| | | } |
| | | } |
| | | }; |
| | | thread.start(); |
| | | } |
| | | Para.setJ(radarList.size() - Para.getI()); |
| | | } |
| | | }; |
| | | Date date = new Date(); |
| | | timer.scheduleAtFixedRate(timerTask,date,5000); |
| | | unitVo.setRadar(Para.getJ()); |
| | | //光电数量 |
| | | QueryWrapper<ArdCameras> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("id").eq("gdtype","0").eq("state","1"); |
| | | List<ArdCameras> ardCameras = camerasMapper.selectList(queryWrapper); |
| | | unitVo.setCamera(ardCameras.size()); |
| | | return unitVo; |
| | | } |
| | | |
| | | public List<CountVo> es(List<CountVo> list){ |
| | | for (int i = 1; i <= 12 ; i++) { |
| | | String month = null; |
| | | String month; |
| | | if(i<=10){ |
| | | month = "0"+i; |
| | | }else { |
| | |
| | | Boolean bo = false; |
| | | for (int j = 0; j < list.size(); j++) { |
| | | CountVo countVo = list.get(j); |
| | | String mon = countVo.getMonth(); |
| | | String mon = countVo.getDate(); |
| | | if(mon.equals(month)){ |
| | | bo = true; |
| | | } |
| | | } |
| | | if(!bo){ |
| | | CountVo countVo = new CountVo(); |
| | | countVo.setMonth(month); |
| | | countVo.setDate(month); |
| | | countVo.setCount(0); |
| | | list.add(countVo); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public List<CountVo> esMonth(List<CountVo> list,String end){ |
| | | Integer day = Integer.valueOf(end.substring(end.length() - 2)); |
| | | for (int i = 1; i <= day ; i++) { |
| | | String d; |
| | | if(i<=10){ |
| | | d = "0"+i; |
| | | }else { |
| | | d = String.valueOf(i); |
| | | } |
| | | Boolean bo = false; |
| | | for (int j = 0; j < list.size(); j++) { |
| | | CountVo countVo = list.get(j); |
| | | String mon = countVo.getDate(); |
| | | if(mon.equals(d)){ |
| | | bo = true; |
| | | } |
| | | } |
| | | if(!bo){ |
| | | CountVo countVo = new CountVo(); |
| | | countVo.setDate(d); |
| | | countVo.setCount(0); |
| | | list.add(countVo); |
| | | } |