| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeInvestigation; |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeInvestigationState; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; |
| | | import cn.gistack.sm.sjztmd.entity.*; |
| | | import cn.gistack.sm.sjztmd.mapper.TbDykeInvestigationMapper; |
| | | import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; |
| | | import cn.gistack.sm.sjztmd.service.*; |
| | |
| | | |
| | | @Autowired |
| | | private ITbDykeInvestigationStateService tbDykeInvestigationStateService; |
| | | |
| | | @Autowired |
| | | private IAttAdBaseService attAdBaseService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | |
| | | @Override |
| | | public List<StatisticsBar> statisticsBar(StatisticsParams statisticsParams) { |
| | | String adCode = statisticsParams.getAdCode(); |
| | | String adGuid = ""; |
| | | //默认省 |
| | | String adGrad = "1"; |
| | | // String adCode = statisticsParams.getAdCode(); |
| | | // String adGuid = ""; |
| | | // //默认省 |
| | | // String adGrad = "1"; |
| | | // |
| | | // //若行政区划不为空 |
| | | // if (StringUtil.isNotBlank(adCode)){ |
| | | // if (adCode.substring(0,4).indexOf("00") > -1) { |
| | | // //前四位包含00说明是湖北省 4200/00000000 |
| | | // adGrad = "1"; |
| | | // adGuid =StringUtil.format("%{}%",adCode.substring(0,2)); |
| | | // statisticsParams.setAdGuid(adGuid); |
| | | // } else if (adCode.substring(0,6).indexOf("00") > -1) { |
| | | // //前六位包含00说明是市级 420100/000000 |
| | | // adGrad = "2"; |
| | | // adGuid =StringUtil.format("%{}%",adCode.substring(0,4)); |
| | | // statisticsParams.setAdGuid(adGuid); |
| | | // }else if (adCode.substring(0,8).indexOf("00") > -1){ |
| | | // //前8位包含00 说明是区级 42011700/0000 |
| | | // adGrad = "3"; |
| | | // } |
| | | // } |
| | | // |
| | | // List<StatisticsBar> list = new ArrayList<>(); |
| | | // |
| | | // if (adGrad.equals("3")){ |
| | | // //区级展示自己 |
| | | // list = baseMapper.getCountyStatisticsBar(statisticsParams); |
| | | // }else if (adGrad.equals("2")){ |
| | | // //市级展示区 |
| | | // list = baseMapper.getCityStatisticsBar(statisticsParams); |
| | | // }else if (adGrad.equals("1")){ |
| | | // //省级展示市 |
| | | // list = baseMapper.getProvinceStatisticsBar(statisticsParams); |
| | | // } |
| | | |
| | | //若行政区划不为空 |
| | | if (StringUtil.isNotBlank(adCode)){ |
| | | if (adCode.substring(0,4).indexOf("00") > -1) { |
| | | //前四位包含00说明是湖北省 4200/00000000 |
| | | adGrad = "1"; |
| | | adGuid =StringUtil.format("%{}%",adCode.substring(0,2)); |
| | | statisticsParams.setAdGuid(adGuid); |
| | | } else if (adCode.substring(0,6).indexOf("00") > -1) { |
| | | //前六位包含00说明是市级 420100/000000 |
| | | adGrad = "2"; |
| | | adGuid =StringUtil.format("%{}%",adCode.substring(0,4)); |
| | | statisticsParams.setAdGuid(adGuid); |
| | | }else if (adCode.substring(0,8).indexOf("00") > -1){ |
| | | //前8位包含00 说明是区级 42011700/0000 |
| | | adGrad = "3"; |
| | | } |
| | | } |
| | | List<StatisticsBar> list = new ArrayList<>(); |
| | | |
| | | if (adGrad.equals("3")){ |
| | | //区级展示自己 |
| | | list = baseMapper.getCountyStatisticsBar(statisticsParams); |
| | | }else if (adGrad.equals("2")){ |
| | | //市级展示区 |
| | | list = baseMapper.getCityStatisticsBar(statisticsParams); |
| | | }else if (adGrad.equals("1")){ |
| | | //省级展示市 |
| | | list = baseMapper.getProvinceStatisticsBar(statisticsParams); |
| | | } |
| | | |
| | | AttAdBase attAdBase = attAdBaseService.getYwxtAdDetail(statisticsParams.getAdCode()); |
| | | statisticsParams.setAdGrad(attAdBase.getAdGrad()); |
| | | List list = baseMapper.getStatisticsBar(statisticsParams); |
| | | return list; |
| | | } |
| | | |