| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.service_user.dao.*; |
| | | import com.panzhihua.service_user.model.dos.*; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.grid.GridMemberVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.GridMemberBuildingVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; |
| | |
| | | } |
| | | loginUserInfoVO.setIsmemberrole(2); |
| | | loginUserInfoVO.setIsFourMember(2); |
| | | loginUserInfoVO.setIsCommunityWorker(2); |
| | | // 志愿者状态 |
| | | String phone = sysUserDO.getPhone(); |
| | | Long userCommunityId = sysUserDO.getCommunityId(); |
| | |
| | | loginUserInfoVO.setVolunteerStatus(state); |
| | | } |
| | | //是否四长四员 |
| | | Integer countFourMember=comActFourMemberDao.selectCount(new QueryWrapper<ComActFourMember>().lambda().eq(ComActFourMember::getUserId,sysUserDO.getUserId())); |
| | | Integer countFourMember=comActFourMemberDao.selectCount(new QueryWrapper<ComActFourMember>().lambda().eq(ComActFourMember::getIdCard,sysUserDO.getIdCard())); |
| | | if(countFourMember>0){ |
| | | loginUserInfoVO.setIsFourMember(1); |
| | | } |
| | |
| | | Integer isSysUser = userDao.selectCountSysUser(phone, userCommunityId); |
| | | if (countTeam != null && countTeam > 0) { |
| | | loginUserInfoVO.setIsmemberrole(1); |
| | | loginUserInfoVO.setIsCommunityWorker(1); |
| | | } else if (selectCountMemberRole != null && selectCountMemberRole > 0) { |
| | | loginUserInfoVO.setIsmemberrole(1); |
| | | } else if (isSysUser != null && isSysUser > 0) { |
| | |
| | | sysUserDO.setIdCard(idCard); |
| | | // 通过身份证号判断性别以及出生日期 |
| | | sysUserDO.setSex(IdCard.sex(idCard)); |
| | | sysUserDO.setBirthday(IdCard.birthDay(idCard)); |
| | | sysUserDO.setBirthday(IdcardUtil.getBirthDate(idCard)); |
| | | if (!StringUtils.isEmpty(loginUserInfoVO.getJob())) { |
| | | sysUserDO.setJob(loginUserInfoVO.getJob()); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 数据看板升级版 |
| | | * |
| | | * @return 运营后台数据看板升级版 |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | | * 运营后台-用户数据统计汇总 |
| | | * @return 用户数据统计汇总 |
| | | */ |
| | | @Override |
| | | public R communityStatistics(){ |
| | | //返回结果数据 |
| | | IndexUserStatisticsVo userStatisticsVo = new IndexUserStatisticsVo(); |
| | | //查询所有街道 |
| | | List<IndexUserStreetVo> streetList = userDao.getUserStreetList(); |
| | | streetList.forEach(street -> { |
| | | List<IndexUserCommunityVo> communityList = userDao.getUserCommunityList(street.getStreetId()); |
| | | street.setCommunityList(communityList); |
| | | }); |
| | | userStatisticsVo.setStreetList(streetList); |
| | | return R.ok(userStatisticsVo); |
| | | } |
| | | |
| | | @Override |
| | | public R communityStatisticsExport(){ |
| | | return R.ok(userDao.getUserCommunityExcelExport()); |
| | | } |
| | | } |