| | |
| | | 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.TenVo; |
| | | 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.Calendar; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.net.Socket; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | private ArdAlarmDigitization3Mapper digitization3Mapper; |
| | | @Autowired |
| | | private ArdAlarmTubeMapper tubeMapper; |
| | | @Autowired |
| | | private ArdEquipRadarMapper radarMapper; |
| | | @Autowired |
| | | private ArdCamerasMapper camerasMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | return esMonth(list,esParam.getEnd()); |
| | | } |
| | | |
| | | public List<CountVo> es(List<CountVo> list){ |
| | | for (int i = 1; i <= 12 ; i++) { |
| | | String month; |
| | | if(i<=10){ |
| | | month = "0"+i; |
| | | }else { |
| | | month = String.valueOf(i); |
| | | @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 (int i = 0; i < radarList.size(); i++) { |
| | | ArdEquipRadar radar = radarList.get(i); |
| | | String host = radar.getIp(); |
| | | String port = radar.getPort(); |
| | | Thread thread = new Thread(){ |
| | | @Override |
| | | public void run(){ |
| | | try { |
| | | Socket socket = new Socket(host,Integer.valueOf(port)); |
| | | } catch (Exception e) { |
| | | int num = Para.getI(); |
| | | num++; |
| | | } |
| | | } |
| | | }; |
| | | thread.start(); |
| | | } |
| | | int n = Para.getI(); |
| | | 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; |
| | | } |
| | | |
| | | @Override |
| | | public int stealelecNum() { |
| | | return stealelecMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int cameraNum() { |
| | | return cameraMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int moveNum() { |
| | | return moveMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int fireNum() { |
| | | return fireMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int externalNum() { |
| | | return externalMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int accessNum() { |
| | | return accessMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int apponekeyNum() { |
| | | return apponekeyMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int pumpNum() { |
| | | return pumpMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int wallNum() { |
| | | return wallMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int digitizationNum() { |
| | | return digitization3Mapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public int tubeNum() { |
| | | return tubeMapper.selectCount(null); |
| | | } |
| | | |
| | | @Override |
| | | public List<TenVo> ten() { |
| | | return moveMapper.ten(); |
| | | } |
| | | |
| | | public List<CountVo> es(List<CountVo> list){ |
| | | List<CountVo> countVoList = new ArrayList<>(); |
| | | for (int i = 1; i <= 12 ; i++) { |
| | | CountVo vo = new CountVo(); |
| | | String month = i + "月"; |
| | | Boolean bo = false; |
| | | for (int j = 0; j < list.size(); j++) { |
| | | CountVo countVo = list.get(j); |
| | | String mon = countVo.getDate(); |
| | | String mon = Integer.valueOf(countVo.getDate()) + "月"; |
| | | if(mon.equals(month)){ |
| | | bo = true; |
| | | vo.setDate(mon); |
| | | vo.setCount(countVo.getCount()); |
| | | } |
| | | } |
| | | if(!bo){ |
| | | CountVo countVo = new CountVo(); |
| | | countVo.setDate(month); |
| | | countVo.setCount(0); |
| | | list.add(countVo); |
| | | vo.setDate(month); |
| | | vo.setCount(0); |
| | | } |
| | | countVoList.add(vo); |
| | | } |
| | | return list; |
| | | return countVoList; |
| | | } |
| | | |
| | | public List<CountVo> esMonth(List<CountVo> list,String end){ |
| | | List<CountVo> countVoList = new ArrayList<>(); |
| | | Integer day = Integer.valueOf(end.substring(end.length() - 2)); |
| | | String month = end.substring(5,7); |
| | | for (int i = 1; i <= day ; i++) { |
| | | String d; |
| | | if(i<=10){ |
| | | d = "0"+i; |
| | | }else { |
| | | d = String.valueOf(i); |
| | | } |
| | | CountVo vo = new CountVo(); |
| | | String d = month + "月" + i + "日"; |
| | | Boolean bo = false; |
| | | for (int j = 0; j < list.size(); j++) { |
| | | CountVo countVo = list.get(j); |
| | | String mon = countVo.getDate(); |
| | | String mon = month + "月" + Integer.valueOf(countVo.getDate()) + "日"; |
| | | if(mon.equals(d)){ |
| | | bo = true; |
| | | vo.setDate(mon); |
| | | vo.setCount(countVo.getCount()); |
| | | } |
| | | } |
| | | if(!bo){ |
| | | CountVo countVo = new CountVo(); |
| | | countVo.setDate(d); |
| | | countVo.setCount(0); |
| | | list.add(countVo); |
| | | vo.setDate(d); |
| | | vo.setCount(0); |
| | | } |
| | | countVoList.add(vo); |
| | | } |
| | | return list; |
| | | return countVoList; |
| | | } |
| | | } |