| | |
| | | "order by to_char(CREATETIME, 'mm')"; |
| | | //查询出需要处理的数据 |
| | | List<Map> maps = commonsMapper.selectBySql(sql); |
| | | if(maps.size() == 0){ |
| | | throw new ServiceException("传入类型["+ datum.getName() + ":" + |
| | | datum.getId() +"]未查到相关统计数据,请确认!!!!"); |
| | | } |
| | | |
| | | //当年每月月份之前之和 |
| | | List<Integer> monthCount = new ArrayList<>(12); |
| | | //当年每月的月份数据 |
| | |
| | | //获取当前月的数字 |
| | | Calendar instance = Calendar.getInstance(); |
| | | int nowmonth = instance.get(Calendar.MONTH) + 1; |
| | | if(maps.size() == 0){ |
| | | nowmonth = 0; |
| | | } |
| | | //从1到12月进行处理 |
| | | for (Integer i = 1; i <= 12; i++) { |
| | | //当前月后所有数据设置为0 |
| | |
| | | public R getBtmAndChartIds() { |
| | | QueryWrapper<StatisticConfig> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("user_id", AuthUtil.getUser().getUserId()); |
| | | wrapper.isNotNull("chart_ids"); |
| | | List<StatisticConfig> list = this.list(wrapper); |
| | | Map<String, String> collect = list.stream().collect(Collectors.toMap(StatisticConfig::getBtmname, StatisticConfig::getChartIds)); |
| | | return R.data(collect); |