| | |
| | | package cn.gistack.sm.damSecurity.service.impl; |
| | | |
| | | import cn.gistack.nky.vo.AlarmGetVO; |
| | | import cn.gistack.sm.damSecurity.mapper.DamSecurityMapper; |
| | | import cn.gistack.sm.damSecurity.service.IDamSecurityService; |
| | | import cn.gistack.sm.damSecurity.vo.DamSecurityStatistics; |
| | | import cn.gistack.sm.damSecurity.vo.*; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.mysql.cj.protocol.x.ReusableInputStream; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | public List<DamSecurityStatistics> listRegionCount(DamSecurityStatistics damSecurityStatistics) { |
| | | return damSecurityMapper.listRegionCount(damSecurityStatistics); |
| | | } |
| | | |
| | | @Override |
| | | public List<DamStationStatistics> tableResCount(DamStationStatistics damStationStatistics) { |
| | | return damSecurityMapper.tableResCount(damStationStatistics); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<DamStationStatistics> tableResCountPage(DamStationStatistics damStationStatistics, IPage<DamStationStatistics> page) { |
| | | return page.setRecords(damSecurityMapper.tableResCountPage(damStationStatistics,page)); |
| | | } |
| | | |
| | | @Override |
| | | public List<DamStationStatistics> alarmResCount(DamStationStatistics damStationStatistics,String basCode) { |
| | | return damSecurityMapper.alarmResCount(damStationStatistics,basCode); |
| | | } |
| | | |
| | | @Override |
| | | public List<DamStatisticsRes> damResInfoCount(String adCode) { |
| | | |
| | | List<DamStatisticsRes> list = damSecurityMapper.damResInfoCount(adCode); |
| | | |
| | | // list.forEach(damStatisticsRes -> { |
| | | // List<DamStationStatistics> errorList = damSecurityMapper.getResErrorList(damStatisticsRes,adCode); |
| | | // damStatisticsRes.setErrorList(errorList); |
| | | // }); |
| | | // |
| | | // list.forEach(damStatisticsRes -> { |
| | | // List<DamStationStatistics> normalList = new ArrayList<>(); |
| | | // if (damStatisticsRes.getType().equals("1")){ |
| | | // //渗压 |
| | | // normalList = damSecurityMapper.getResSyNormalList(adCode); |
| | | // }else if (damStatisticsRes.getType().equals("2")){ |
| | | // //渗流 |
| | | // normalList = damSecurityMapper.getResSlNormalList(adCode); |
| | | // }else if (damStatisticsRes.getType().equals("3")){ |
| | | // //位移 |
| | | // normalList = damSecurityMapper.getResWyNormalList(adCode); |
| | | // } |
| | | // damStatisticsRes.setNormalList(normalList); |
| | | // }); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<DamStationStatistics> damResInfoCountMap(HashMap<String,String> obj) { |
| | | String type = obj.get("type"); |
| | | String adCode = obj.get("adCode"); |
| | | String status = obj.get("status"); |
| | | |
| | | |
| | | List<DamStationStatistics> list = new ArrayList<>(); |
| | | if (type.equals("sy")){ |
| | | list = damSecurityMapper.getSyList(adCode,status); |
| | | }else if (type.equals("sl")){ |
| | | list = damSecurityMapper.getSlList(adCode,status); |
| | | }else if (type.equals("wy")){ |
| | | list = damSecurityMapper.getWyList(adCode,status); |
| | | }else { |
| | | return null; |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<DamMonitor> listRegionCountMonitor(DamMonitor damMonitor) { |
| | | |
| | | List<DamMonitor> regionList = getRegionList(damMonitor); |
| | | regionList.forEach(region ->{ |
| | | damMonitor.setAdCode(region.getAdCode()); |
| | | List<LevelPo> levelPoList = damSecurityMapper.getLevelList(damMonitor); |
| | | region.setLevelList(levelPoList); |
| | | }); |
| | | return regionList; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AlarmGetVO> pageMonitor(AlarmGetVO alarmGet, IPage<AlarmGetVO> page) { |
| | | |
| | | //位移 |
| | | if (alarmGet.getType().equals("3")){ |
| | | List<AlarmGetVO> list = damSecurityMapper.pageMonitorWy(page,alarmGet); |
| | | return page.setRecords(list); |
| | | }else{ |
| | | List<AlarmGetVO> list = damSecurityMapper.pageMonitor(page,alarmGet); |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<LevelPo> levelMonitorPie(DamMonitor damMonitor) { |
| | | List<LevelPo> levelPoList = damSecurityMapper.getLevelList(damMonitor); |
| | | return levelPoList; |
| | | } |
| | | |
| | | |
| | | public List<DamMonitor> getRegionList(DamMonitor damMonitor){ |
| | | return damSecurityMapper.getRegionList(damMonitor); |
| | | } |
| | | |
| | | @Override |
| | | public List<DamStatisticsRegion> getDamInfoCountByRegion(DamStatisticsRegion damStatisticsRegion) { |
| | | List<DamStatisticsRegion> list = new ArrayList<>(); |
| | | |
| | | if (damStatisticsRegion.getStatus().equals("total")){ |
| | | //点击总数 |
| | | if (damStatisticsRegion.getType().equals("sy")){ |
| | | list = damSecurityMapper.getDamSyRegion(damStatisticsRegion); |
| | | }else if (damStatisticsRegion.getType().equals("sl")){ |
| | | list = damSecurityMapper.getDamSlRegion(damStatisticsRegion); |
| | | }else if (damStatisticsRegion.getType().equals("wy")){ |
| | | list = damSecurityMapper.getDamWyRegion(damStatisticsRegion); |
| | | } |
| | | }else if (damStatisticsRegion.getStatus().equals("error")){ |
| | | //点异常 |
| | | list = damSecurityMapper.getErrorDamRegion(damStatisticsRegion); |
| | | }else if (damStatisticsRegion.getStatus().equals("normal")){ |
| | | //点正常 |
| | | if (damStatisticsRegion.getType().equals("sy")){ |
| | | list = damSecurityMapper.getDamSyRegionNormal(damStatisticsRegion); |
| | | }else if (damStatisticsRegion.getType().equals("sl")){ |
| | | list = damSecurityMapper.getDamSlRegionNormal(damStatisticsRegion); |
| | | }else if (damStatisticsRegion.getType().equals("wy")){ |
| | | list = damSecurityMapper.getDamWyRegionNormal(damStatisticsRegion); |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | } |