| | |
| | | // 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); |
| | |
| | | } else if ("wx98d62711dfbd8425".equals(uuLoginVO.getAppid())) { |
| | | appId = "10001"; |
| | | secret = "d89f3a35931c386956c1a402a8e09941"; |
| | | }else { |
| | | } else { |
| | | return R.fail("appid未传"); |
| | | } |
| | | uuLoginVO.setAppid(appId); |
| | |
| | | } |
| | | Map<String, String> headerMap = new HashMap<>(); |
| | | headerMap.put("appid", appId); |
| | | String resultJson = HttpClientUtil.get("https://api.uucsh.cn/member/wx/get-access?province=" + uuLoginVO.getProvince() + "&city=" + uuLoginVO.getCity() + "&area=" + uuLoginVO.getArea() + "&appid="+appId+"×tamp=" + uuLoginVO.getTimestamp() + "&sign=" + uuLoginVO.getSign() + "&mobile=" + uuLoginVO.getMobile() + "&couponId=" + uuLoginVO.getCouponId(), headerMap, null); |
| | | String resultJson = HttpClientUtil.get("https://api.uucsh.cn/member/wx/get-access?province=" + uuLoginVO.getProvince() + "&city=" + uuLoginVO.getCity() + "&area=" + uuLoginVO.getArea() + "&appid=" + appId + "×tamp=" + uuLoginVO.getTimestamp() + "&sign=" + uuLoginVO.getSign() + "&mobile=" + uuLoginVO.getMobile() + "&couponId=" + uuLoginVO.getCouponId(), headerMap, null); |
| | | JSONObject result = JSON.parseObject(resultJson); |
| | | if (result.get("status").equals(1)) { |
| | | return R.ok(result.get("data")); |
| | |
| | | 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天数据 |
| | | * |