| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.service_user.dao.*; |
| | | import com.panzhihua.service_user.model.dos.*; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R dataKanBans(DataKanBansDto dataKanBansDto){ |
| | | IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(); |
| | | List<String> communityUserX = new ArrayList<>(); |
| | | List<Integer> communityUserY = new ArrayList<>(); |
| | | |
| | | List<String> communityActiveUserX = new ArrayList<>(); |
| | | List<Integer> communityActiveUserY = new ArrayList<>(); |
| | | List<Integer> communityActiveUserZ = new ArrayList<>(); |
| | | |
| | | List<DataKanbanDTO> dataKanbanDTOS = null; |
| | | if(dataKanBansDto.getType() != null && dataKanBansDto.getType().equals(DataKanBansDto.type.by)){ |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(); |
| | | }else{ |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrder(); |
| | | } |
| | | if (!ObjectUtils.isEmpty(dataKanbanDTOS)) { |
| | | dataKanbanDTOS.forEach(dataKanbanDTO -> { |
| | | communityUserX.add(dataKanbanDTO.getName()); |
| | | communityUserY.add(dataKanbanDTO.getNum()); |
| | | }); |
| | | } |
| | | |
| | | // 获取最近七天数据 |
| | | List<Date> serverndays = com.panzhihua.common.utlis.DateUtils.getOldDays(); |
| | | serverndays.forEach(date -> { |
| | | // 查询社区活动数量 |
| | | DataKanbanDTO dataKanbanDTO = userDao.selectCommunityAddUserOrder(date); |
| | | communityActiveUserX.add(DateFormatUtils.format(date, "MM-dd")); |
| | | communityActiveUserY.add(dataKanbanDTO.getNum()); |
| | | communityActiveUserZ.add(dataKanbanDTO.getDayNum()); |
| | | }); |
| | | indexDataKanbanVO.setCommunityActiveUserX(communityActiveUserX); |
| | | indexDataKanbanVO.setCommunityAddUserY(communityActiveUserY); |
| | | indexDataKanbanVO.setCommunityActiveUserY(communityActiveUserZ); |
| | | indexDataKanbanVO.setCommunityUserX(communityUserX); |
| | | indexDataKanbanVO.setCommunityUserY(communityUserY); |
| | | return R.ok(indexDataKanbanVO); |
| | | } |
| | | } |