| | |
| | | // String encode = new BCryptPasswordEncoder().encode("lbsq123456"); |
| | | // System.out.println(encode); |
| | | |
| | | List<String> dates = new ArrayList<>(); |
| | | // List<String> dates = new ArrayList<>(); |
| | | // Date date = new Date(); |
| | | // for (int i = 19; i >= 0; i--) { |
| | | // Date date1 = DateUtils.addDays(date, -i); |
| | | // dates.add(DateFormatUtils.format(date1, "MM-dd")); |
| | | // } |
| | | // System.out.println(dates); |
| | | |
| | | Date date = new Date(); |
| | | for (int i = 19; i >= 0; i--) { |
| | | Date date1 = DateUtils.addDays(date, -i); |
| | | dates.add(DateFormatUtils.format(date1, "MM-dd")); |
| | | } |
| | | System.out.println(dates); |
| | | Long offset = DateUtil.between(new Date(), DateUtil.beginOfMonth(date), DateUnit.DAY); |
| | | System.out.println(offset); |
| | | |
| | | // BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); |
| | | // boolean matches = encoder.matches("admin1234567", encode); |
| | |
| | | return R.ok(realUserVO); |
| | | } |
| | | |
| | | // @Override |
| | | // public R userActivity(Integer type, Long streetId, Long areaCode, Integer range, String appId) { |
| | | // UserActivityAnalysisVO vo = new UserActivityAnalysisVO(); |
| | | // List<Date> activeX = getTwentyDays(); |
| | | // List<String> activeY = new ArrayList<>(); |
| | | // List<String> adY = new ArrayList<>(); |
| | | // if (org.apache.commons.lang3.ObjectUtils.isNotEmpty(range)) { |
| | | // if (range.equals(1)) { |
| | | // //本月数据 |
| | | // activeX = getMonthTwentyDays(); |
| | | // } |
| | | // } |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | // for (Date date : activeX) { |
| | | // Map<String, Long> map = userDao.getDailyAddAndActive(DateUtil.parse(sdf.format(date)), streetId, areaCode, appId); |
| | | // adY.add(map.get("addUser").toString()); |
| | | // activeY.add(map.get("activeUser").toString()); |
| | | // } |
| | | // vo.setUserX(getMAndD(activeX)); |
| | | // vo.setAddUserY(adY); |
| | | // vo.setActiveUserY(activeY); |
| | | // return R.ok(vo); |
| | | // } |
| | | |
| | | @Override |
| | | public R userActivity(Integer type, Long streetId, Long areaCode, Integer range, String appId) { |
| | | UserActivityAnalysisVO vo = new UserActivityAnalysisVO(); |
| | | List<Date> activeX = getTwentyDays(); |
| | | String activeX = com.panzhihua.common.utlis.DateUtils.getTwentyDay(); |
| | | List<Date> activeDate = getTwentyDays(); |
| | | List<String> activeY = new ArrayList<>(); |
| | | List<String> adY = new ArrayList<>(); |
| | | if (org.apache.commons.lang3.ObjectUtils.isNotEmpty(range)) { |
| | | if (range.equals(1)) { |
| | | //本月数据 |
| | | activeX = getMonthTwentyDays(); |
| | | activeX = com.panzhihua.common.utlis.DateUtils.getMonthTwentyDay(); |
| | | activeDate = getMonthTwentyDays(); |
| | | } |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for (Date date : activeX) { |
| | | Map<String, Long> map = userDao.getDailyAddAndActive(DateUtil.parse(sdf.format(date)), streetId, areaCode, appId); |
| | | adY.add(map.get("addUser").toString()); |
| | | activeY.add(map.get("activeUser").toString()); |
| | | |
| | | //获取最近活跃人数 |
| | | Map<String, Long> active = userDao.getActive(activeX, streetId, areaCode, appId); |
| | | //获取最近注册人数 |
| | | Map<String, Long> dailyAdd = userDao.getDailyAdd(activeX, streetId, areaCode, appId); |
| | | 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"); |
| | | |
| | | } |
| | | vo.setUserX(getMAndD(activeX)); |
| | | vo.setUserX(getMAndD(activeDate)); |
| | | vo.setAddUserY(adY); |
| | | vo.setActiveUserY(activeY); |
| | | return R.ok(vo); |
| | |
| | | return dates; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取最近本月20天数据 |
| | | * |