| | |
| | | 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.*; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsBar; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private ITbDykeInvestigationStateService tbDykeInvestigationStateService; |
| | | |
| | | @Autowired |
| | | private IAttAdBaseService attAdBaseService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | tbDykeInvestigationStateService.saveOrUpdate(state); |
| | | |
| | | entity.setTbStateId(state.getGuid()); |
| | | return R.status(this.saveOrUpdate(entity)); |
| | | // return R.status(this.saveOrUpdate(entity)); |
| | | this.saveOrUpdate(entity); |
| | | return R.data(entity); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public StatisticsPie statisticsPie(StatisticsParams statisticsParams) { |
| | | if (StringUtil.isNotBlank(statisticsParams.getAdCode())){ |
| | | //若行政区划不为空 |
| | | String adCode =statisticsParams.getAdCode(); |
| | | |
| | | if (adCode.substring(0,4).indexOf("00") > -1) { |
| | | //前四位包含00说明是湖北省 4200/00000000 |
| | | adCode =StringUtil.format("%{}%",adCode.substring(0,2)); |
| | | } else if (adCode.substring(0,6).indexOf("00") > -1) { |
| | | //前六位包含00说明是市级 420100/000000 |
| | | // adCode = paramAd.substring(0,4); |
| | | adCode =StringUtil.format("%{}%",adCode.substring(0,4)); |
| | | }else if (adCode.substring(0,8).indexOf("00") > -1){ |
| | | //前8位包含00 说明是区级 42011700/0000 |
| | | // adCode = paramAd.substring(0,6); |
| | | adCode =StringUtil.format("%{}%",adCode.substring(0,6)); |
| | | } |
| | | statisticsParams.setAdCode(adCode); |
| | | } |
| | | |
| | | return baseMapper.statisticsPie(statisticsParams); |
| | | } |
| | | |
| | | @Override |
| | | public List<StatisticsBar> statisticsBar(StatisticsParams statisticsParams) { |
| | | // 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); |
| | | // } |
| | | |
| | | |
| | | AttAdBase attAdBase = attAdBaseService.getYwxtAdDetail(statisticsParams.getAdCode()); |
| | | statisticsParams.setAdGrad(attAdBase.getAdGrad()); |
| | | List list = baseMapper.getStatisticsBar(statisticsParams); |
| | | return list; |
| | | } |
| | | |
| | | } |