| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.core.util.*; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | |
| | | import com.panzhihua.service_user.model.dos.SysUserNoticeDO; |
| | | import com.panzhihua.service_user.model.dos.SysUserRoleDO; |
| | | import com.panzhihua.service_user.model.dtos.DataKanbanDTO; |
| | | import com.panzhihua.service_user.model.dtos.UsersStatisticsDTO; |
| | | import com.panzhihua.service_user.service.EventGridMemberBuildingRelationService; |
| | | import com.panzhihua.service_user.service.UserService; |
| | | |
| | |
| | | sysUserDO1.setPassword(encode); |
| | | sysUserDO1.setType(1); |
| | | sysUserDO1.setAppId(appId); |
| | | //设置默认头像地址 |
| | | sysUserDO1.setImageUrl("https://www.psciio.com//idcard/f15c91f940624ed59537ecced1059f18.jpg"); |
| | | //设置默认用户名 |
| | | sysUserDO1.setNickName("用户" + RandomUtil.randomString(8)); |
| | | num = userDao.insert(sysUserDO1); |
| | | } else { |
| | | String encode = new BCryptPasswordEncoder().encode(UserConstants.PASSWORD); |
| | |
| | | LambdaQueryWrapper<SysUserDO> queryWrapper = new LambdaQueryWrapper<>(); |
| | | List<ActivityManagerVO> activityManagerVOS = new ArrayList<>(); |
| | | queryWrapper = new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getCommunityId, communityId) |
| | | .eq(SysUserDO::getStatus, 1).eq(SysUserDO::getType, 3); |
| | | .eq(SysUserDO::getStatus, 1).eq(SysUserDO::getType, 3); |
| | | if (!ObjectUtils.isEmpty(param)) { |
| | | queryWrapper = queryWrapper.eq(SysUserDO::getName, param); |
| | | } |
| | |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | //因操作日志数据量太大,如果没有时间查询条件,默认查询最近十五天的数据 |
| | | if (StrUtil.isEmpty(sysOperLogVO.getStartTime()) && StrUtil.isEmpty(sysOperLogVO.getEndTime())){ |
| | | sysOperLogVO.setStartTime(com.panzhihua.common.utlis.DateUtils.getBeforeDay(15)); |
| | | sysOperLogVO.setEndTime(com.panzhihua.common.utlis.DateUtils.getCurrentDateymd()); |
| | | } |
| | | IPage<SysOperLogVO> iPage = sysOperLogDAO.pageOperLog(page, sysOperLogVO); |
| | | return R.ok(iPage); |
| | | } |
| | |
| | | activeDate = getMonthTwentyDays(); |
| | | } |
| | | } |
| | | |
| | | //获取最近活跃人数 |
| | | Map<String, Long> active = userDao.getActive(activeX, streetId, areaCode, appId); |
| | | List<UsersStatisticsDTO> actives = userDao.getActive(activeX, streetId, areaCode, appId); |
| | | //获取最近注册人数 |
| | | Map<String, Long> dailyAdd = userDao.getDailyAdd(activeX, streetId, areaCode, appId); |
| | | List<UsersStatisticsDTO> dailyAdds = userDao.getDailyAdd(activeX, streetId, areaCode, appId); |
| | | Map<String, String> activeMap = actives.stream().collect(Collectors.toMap(UsersStatisticsDTO::getSpecificDate, UsersStatisticsDTO::getTotal)); |
| | | Map<String, String> dailyAddMap = dailyAdds.stream().collect(Collectors.toMap(UsersStatisticsDTO::getSpecificDate, UsersStatisticsDTO::getTotal)); |
| | | |
| | | |
| | | for (Date date : activeDate) { |
| | | String dateStr = DateUtil.format(date, "yyyy-MM-dd"); |
| | | activeY.add(active.containsKey(dateStr) ? active.get("activeUser").toString() : "0"); |
| | | adY.add(dailyAdd.containsKey(dateStr) ? dailyAdd.get("addUser").toString() : "0"); |
| | | activeY.add(activeMap.containsKey(dateStr) ? activeMap.get(dateStr) : "0"); |
| | | adY.add(dailyAddMap.containsKey(dateStr) ? dailyAddMap.get(dateStr) : "0"); |
| | | |
| | | } |
| | | vo.setUserX(getMAndD(activeDate)); |