| | |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils; |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.dto.common.CategoryInfoDTO; |
| | | import com.yeshi.fanli.dto.common.GoodsOtherInfoDTO; |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt; |
| | |
| | | |
| | | data.put("todayOrder", todayOrder); |
| | | data.put("yesterdayOrder", yesterdayOrder); |
| | | |
| | | data.put("genzong", yesterdayOrder); |
| | | data.put("yesterdayOrder", yesterdayOrder); |
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败")); |
| | | e.printStackTrace(); |
| | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("pe", pe); |
| | | data.put("result_list", list); |
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } catch (CommonOrderException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | | } catch (Exception e) { |
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 统计提现申请总金额 |
| | | * |
| | | * @param callback |
| | | * @param channelArray |
| | | * 渠道名 为空是统计所有 |
| | | * @param dateType |
| | | * 显示视图:日-1 、月-2、 年-3 |
| | | * @param state |
| | | * 状态: 1-未到账 2-已到账 3-已失效 |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getHongBaoMoney") |
| | | public void getHongBaoMoney(String callback, String channelArray, Integer dateType, Integer state, String year, |
| | | String startTime, String endTime, PrintWriter out) { |
| | | |
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime); |
| | | if (validateMsg != null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg)); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | |
| | | JSONObject data = countHistoryHongBao(channelArray, dateType, state, year, startTime, endTime, 2); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 统计红包信息 |
| | | * |
| | | * @param channelArray |
| | | * @param dateType |
| | | * @param state |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public JSONObject countHistoryHongBao(String channelArray, Integer dateType, Integer state, String year, |
| | | String startTime, String endTime, int countType) throws Exception { |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) { |
| | | startTime = null; |
| | | endTime = null; |
| | | } |
| | | |
| | | List<String> channelList = null; |
| | | if (channelArray != null && channelArray.trim().length() > 0) { |
| | | Gson gson = new Gson(); |
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() { |
| | | }.getType()); |
| | | } |
| | | |
| | | if (channelList == null || channelList.size() == 0) { |
| | | channelList = new ArrayList<String>(); |
| | | channelList.add("all"); |
| | | } |
| | | |
| | | if (dateType == 1 && year != null) { |
| | | year = null; // 设置为空 |
| | | } else if (dateType == 2) { |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) { |
| | | if (year != null) |
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | } |
| | | |
| | | Gson gson = new Gson(); |
| | | Object objectDate = null; |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year); |
| | | |
| | | JSONArray line_list = new JSONArray(); |
| | | for (String channel : channelList) { |
| | | List<ChartTDO> list = null; |
| | | if (countType == 1) { |
| | | list = hongBaoV2CountService.countHongBaoNum(channel, dateType, state, year, startTime, endTime); |
| | | } else if (countType == 2) { |
| | | list = hongBaoV2CountService.countHongBaoMoney(channel, dateType, state, year, startTime, endTime); |
| | | } |
| | | |
| | | if ("all".equalsIgnoreCase(channel)) { |
| | | channel = "总计"; |
| | | } |
| | | |
| | | JSONObject innerList = new JSONObject(); |
| | | innerList.put("name", channel); |
| | | |
| | | if (dateType != 3) { |
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list))); |
| | | } else { |
| | | // 年视图 |
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list); |
| | | |
| | | if (objectDate == null) { |
| | | objectDate = map.get("date"); |
| | | } |
| | | innerList.put("data", gson.toJson(map.get("value"))); |
| | | } |
| | | line_list.add(innerList); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (objectDate != null) { |
| | | data.put("xAxis_list", gson.toJson(objectDate)); |
| | | } else { |
| | | data.put("xAxis_list", gson.toJson(dateList)); |
| | | } |
| | | data.put("line_list", line_list); |
| | | return data; |
| | | } |
| | | |
| | | /** |
| | | * 分类型订单数与比例 |
| | | * |
| | | * @param callback |
| | | * @param dateType |
| | | * 日 -1 月-2 年-3 |
| | | * @param type |
| | | * 返利订单-1 分享订单-2 邀请订单-3 |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getTypeNumber") |
| | | public void getTypeNumber(String callback, Integer dateType, String typeArray, String year, String startTime, |
| | | String endTime, PrintWriter out) { |
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime); |
| | | if (validateMsg != null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg)); |
| | | return; |
| | | } |
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) { |
| | | startTime = null; |
| | | endTime = null; |
| | | } |
| | | |
| | | List<Integer> channelList = null; |
| | | if (typeArray != null && typeArray.trim().length() > 0) { |
| | | Gson gson = new Gson(); |
| | | channelList = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() { |
| | | }.getType()); |
| | | } |
| | | |
| | | if (channelList == null || channelList.size() == 0) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("订单类型不能为空")); |
| | | return; |
| | | } |
| | | |
| | | if (dateType == 1 && year != null) { |
| | | year = null; // 设置为空 |
| | | } else if (dateType == 2) { |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) { |
| | | if (year != null) |
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | } |
| | | |
| | | Gson gson = new Gson(); |
| | | Object objectDate = null; |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year); |
| | | try { |
| | | JSONArray line_list = new JSONArray(); |
| | | for (Integer type : channelList) { |
| | | List<ChartTDO> list = hongBaoV2CountService.countHongBaoType(dateType, type, year, startTime, endTime); |
| | | JSONObject innerList = new JSONObject(); |
| | | if (type == 1) { |
| | | innerList.put("name", "返利订单"); |
| | | } else if (type == 2) { |
| | | innerList.put("name", "分享订单"); |
| | | } else if (type == 3) { |
| | | innerList.put("name", "邀请订单"); |
| | | } |
| | | |
| | | if (dateType != 3) { |
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list))); |
| | | } else { |
| | | // 年视图 |
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list); |
| | | |
| | | if (objectDate == null) { |
| | | objectDate = map.get("date"); |
| | | } |
| | | innerList.put("data", gson.toJson(map.get("value"))); |
| | | } |
| | | |
| | | line_list.add(innerList); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (objectDate != null) { |
| | | data.put("xAxis_list", gson.toJson(objectDate)); |
| | | } else { |
| | | data.put("xAxis_list", gson.toJson(dateList)); |
| | | } |
| | | |
| | | data.put("line_list", line_list); |
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | |
| | | private IntegralDetailService integralDetailService;
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 查询用户信息列表 正常用户/异常用户
|
| | | *
|
| | |
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,Integer userType,
|
| | | Integer days, String startTime, String endTime, Integer orderMode, Integer type, PrintWriter out) {
|
| | |
|
| | | Integer days, String startTime, String endTime, Integer orderMode, Integer type,String level,
|
| | | Integer activeCode, PrintWriter out) {
|
| | | try {
|
| | | if (type == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户类型type不能为空"));
|
| | |
| | | }
|
| | |
|
| | | List<UserInfoVO> userList = userInfoService.query((pageIndex - 1) * pageSize, pageSize, type, key, keyType,
|
| | | userRank, days, startTime, endTime, orderField, orderMode,userType);
|
| | | userRank, days, startTime, endTime, orderField, orderMode,userType, level, activeCode);
|
| | |
|
| | | if (userList == null || userList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无相关数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime,userType);
|
| | | long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime,userType, level, activeCode);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("resultList", gson.toJson(userList));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | |
| | | long monthUser = userInfoCountService.countNewUser(null, 1);
|
| | | data.put("todayUser", todayUser);
|
| | | data.put("monthUser", monthUser);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | |
| | | @RequestMapping(value = "deleteUser")
|
| | | public void delete(String callback, String idArray, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | |
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("当前账户失效,请重新登陆。")));
|
| | |
| | | @RequestMapping(value = "forbiddenUser")
|
| | | public void forbiddenUser(String callback, Long uid, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
|
| | | return;
|
| | |
| | |
|
| | | String reason = "后台封禁,操作人:" + admin.getId() + "-" + admin.getName();
|
| | | userAccountService.forbiddenUserAll(uid, reason);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("用户封禁成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | |
| | | @RequestMapping(value = "relieveForbiddenUser")
|
| | | public void relieveForbiddenUser(String callback, Long uid, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
|
| | | return;
|
| | |
| | | forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
|
| | | }
|
| | | }
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("用户解封成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | |
| | | }
|
| | |
|
| | | forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
|
| | |
|
| | | } catch (ForbiddenUserIdentifyCodeException e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除队员关系
|
| | | * |
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteThreeSale")
|
| | | public void deleteThreeSale(String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int count = threeSaleService.deleteByPrimaryKey(id);
|
| | |
|
| | | if (count > 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "queryMyFirstTeams")
|
| | | public void queryMyFirstTeams(String callback, Integer pageIndex, Integer pageSize, String key, Long bossId,
|
| | | PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (bossId == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | |
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | List<ThreeSale> firstTeamList = threeSaleService.queryMyFirstTeamList((pageIndex - 1) * pageSize, pageSize,
|
| | | key, bossId);
|
| | | if (firstTeamList == null || firstTeamList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无一度队员"));
|
| | | return;
|
| | | }
|
| | |
|
| | | /* 获取邀请用户头像 、昵称 */
|
| | | for (ThreeSale threeSale : firstTeamList) {
|
| | | UserInfo worker = threeSale.getWorker();
|
| | | if (worker == null) {
|
| | | worker = new UserInfo();
|
| | | threeSale.setWorker(worker);
|
| | | } else {
|
| | | Long id = worker.getId();
|
| | |
|
| | | UserInfo currentInfo = userInfoService.selectByPKey(id);
|
| | | if (currentInfo != null) {
|
| | | worker.setNickName(currentInfo.getNickName());
|
| | | worker.setPortrait(currentInfo.getPortrait());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | long count = threeSaleService.queryCountMyFirstTeamList(key, bossId);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(firstTeamList));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "queryMySecondTeams")
|
| | | public void queryMySecondTeams(String callback, Integer pageIndex, Integer pageSize, String key, Long bossId,
|
| | | PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (bossId == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | |
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | List<ThreeSale> firstTeamList = threeSaleService.queryMySecondTeamList((pageIndex - 1) * pageSize, pageSize,
|
| | | key, bossId);
|
| | | if (firstTeamList == null || firstTeamList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无二度队员"));
|
| | | return;
|
| | | }
|
| | |
|
| | | /* 获取邀请用户头像 、昵称 */
|
| | | for (ThreeSale threeSale : firstTeamList) {
|
| | | UserInfo worker = threeSale.getWorker();
|
| | | if (worker == null) {
|
| | | worker = new UserInfo();
|
| | | threeSale.setWorker(worker);
|
| | | } else {
|
| | | Long id = worker.getId();
|
| | |
|
| | | UserInfo currentInfo = userInfoService.selectByPKey(id);
|
| | | if (currentInfo != null) {
|
| | | worker.setNickName(currentInfo.getNickName());
|
| | | worker.setPortrait(currentInfo.getPortrait());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | long count = threeSaleService.queryCountMySecondTeamList(key, bossId);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(firstTeamList));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 队员关系
|
| | |
| | | */
|
| | | @RequestMapping(value = "getRelationList")
|
| | | public void getRelationList(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer type,
|
| | | Integer state, String startTime, String endTime, PrintWriter out) {
|
| | | Integer state, String startTime, String endTime, Integer validState, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | |
| | | } else if (type == 1) {
|
| | | // 一级用户
|
| | | listQuery = threeSaleService.listFirstTeamQuery((pageIndex - 1) * pageSize, pageSize, uid, state,
|
| | | startTime, endTime);
|
| | | startTime, endTime, validState);
|
| | | } else if (type == 2) {
|
| | | // 二级用户
|
| | | listQuery = threeSaleService.listSecondTeamQuery((pageIndex - 1) * pageSize, pageSize, uid, state,
|
| | | startTime, endTime);
|
| | | startTime, endTime, validState);
|
| | | }
|
| | |
|
| | | if (listQuery == null || listQuery.size() == 0) {
|
| | |
| | | }
|
| | |
|
| | | for (ThreeSale threeSale : listQuery) {
|
| | | // 用户信息
|
| | | UserInfo boss = threeSale.getBoss();
|
| | | threeSale.setBoss(userInfoService.selectByPKey(boss.getId()));
|
| | | |
| | | UserInfo worker = threeSale.getWorker();
|
| | | threeSale.setWorker(userInfoService.selectByPKey(worker.getId()));
|
| | | |
| | | |
| | | Integer expire = threeSale.getExpire();
|
| | | if (threeSale.getState()) {
|
| | | threeSale.setExpire(1); // 邀请成功
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | long count = 0;
|
| | | if (type == 0) {
|
| | |
| | | count = threeSaleService.countSuperiorQuery(state, uid);
|
| | | } else if (type == 1) {
|
| | | // 一级用户
|
| | | count = threeSaleService.countFirstTeamQuery(uid, state, startTime, endTime);
|
| | | count = threeSaleService.countFirstTeamQuery(uid, state, startTime, endTime, validState);
|
| | | } else if (type == 2) {
|
| | | // 二级用户
|
| | | count = threeSaleService.countSecondTeamQuery(uid, state, startTime, endTime);
|
| | | count = threeSaleService.countSecondTeamQuery(uid, state, startTime, endTime, validState);
|
| | | }
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(userMoneyDetailsList));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
|
| | |
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.service.inter.count.UserSystemCouponCountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponGiveRecordService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.user.SystemCouponVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponCountVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 奖励券数量曲线图
|
| | | * @param callback
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getRebateCouponUsedNumCharts")
|
| | | public void getRebateCouponUsedNumCharts(String callback, Integer dateType, String year, String startTime,
|
| | | String endTime, PrintWriter out){
|
| | | try {
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | JSONObject data = getChartsData(dateType, year, startTime, endTime, 1, null);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 奖励券数量曲线图
|
| | | * @param callback
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getRebateCouponMoneyCharts")
|
| | | public void getRebateCouponMoneyCharts(String callback, Integer dateType, String year, String startTime,
|
| | | String endTime, PrintWriter out){
|
| | | try {
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | JSONObject data = getChartsData(dateType, year, startTime, endTime, 2, null);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 奖励券数量曲线图
|
| | | * @param callback
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getFreeCouponMoneyCharts")
|
| | | public void getFreeCouponMoneyCharts(String callback, Integer dateType, String year, String startTime,
|
| | | String endTime, Integer coupon, PrintWriter out){
|
| | | try {
|
| | | if (coupon == null || (coupon.intValue() < 0 && coupon.intValue() > 4)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("券类型不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | | String couponType = null;
|
| | | if (coupon == 1) {
|
| | | couponType = "freeCoupon";
|
| | | } else if (coupon == 2){
|
| | | couponType = "welfareFreeCoupon";
|
| | | } else if (coupon == 3){
|
| | | couponType = "freeCouponBuy";
|
| | | }
|
| | | |
| | | JSONObject data = getChartsData(dateType, year, startTime, endTime, 3, couponType);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | public JSONObject getChartsData(Integer dateType, String year, String startTime,
|
| | | String endTime, int source, String couponType) throws Exception {
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null;
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | | Gson gson = new Gson();
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | List<ChartTDO> list = null;
|
| | | if (source == 1) {
|
| | | // 奖励券数量
|
| | | innerList.put("name", "数量");
|
| | | list = userSystemCouponCountService.getRebateCouponUsedNumToCharts(dateType, year,
|
| | | startTime, endTime);
|
| | | } else if (source == 2) {
|
| | | // 奖励券金额
|
| | | innerList.put("name", "金额");
|
| | | list = userSystemCouponCountService.getRebateCouponMoneyToCharts(dateType, year,
|
| | | startTime, endTime);
|
| | | } else if (source == 3) {
|
| | | // 奖励券金额
|
| | | innerList.put("name", "金额");
|
| | | list = userSystemCouponCountService.getFreeCouponMoneyToCharts(dateType, year,
|
| | | startTime, endTime, couponType);
|
| | | }
|
| | | |
| | | Object objectDate = null;
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | | return data;
|
| | | }
|
| | | }
|
| | |
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.exception.homemodule.FloatADException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | |
|
| | |
|
| | | /**
|
| | | * 修改状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | floatADervice.switchState(id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (FloatADException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 删除
|
| | | *
|
| | | * @param callback
|
| | |
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(versionList));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | specialService.switchState(id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (SpecialException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | if (mySettings.getNoInvitationBonus() == null) {
|
| | | mySettings.setNoInvitationBonus(0);
|
| | | }
|
| | | |
| | | if (mySettings.getNoDisplayPhoneNum() == null) {
|
| | | mySettings.setNoDisplayPhoneNum(0);
|
| | | }
|
| | |
|
| | | if (mySettings.getOpenSpreadHongBao() == null) {
|
| | | if (userTaoLiJinDetailService.countDetail(uid) > 0) {
|
| | |
| | | data.put("count", count);
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(resultList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | |
| | | // 更新福利中心未读数量
|
| | | if (page == 1) {
|
| | | } catch (UserSystemCouponException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "查询失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | // 更新福利中心未读数量
|
| | | if (page == 1) {
|
| | | try {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | | } catch (Exception e) {
|
| | | }
|
| | | } catch (UserSystemCouponException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "查询失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | | public interface HongBaoV2CountMapper {
|
| | |
| | | */
|
| | | Long countNumberByUid(@Param("uid") Long uid);
|
| | |
|
| | | /**
|
| | | * 统计总金额
|
| | | * |
| | | * @param channel
|
| | | * 渠道
|
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countHongBaoMoney(@Param("channel") String channel, @Param("dateType") Integer dateType,
|
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 统计总个数
|
| | | * |
| | | * @param channel
|
| | | * 渠道
|
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countHongBaoNum(@Param("channel") String channel, @Param("dateType") Integer dateType,
|
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 统计总个数
|
| | | * |
| | | * @param channel
|
| | | * 渠道
|
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countHongBaoType(@Param("dateType") Integer dateType, @Param("type") Integer type,
|
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 统计总个数
|
| | | * |
| | | * @param channel
|
| | | * 渠道
|
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countHongBaoTotalNum(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | // 累计提成订单数量(包含无效订单)
|
| | | int getTotalTiChengCount(Long uid);
|
| | |
| | |
|
| | | Date getLastHongBaoTime(@Param("uid") Long uid);
|
| | |
|
| | | /**
|
| | | * 根据渠道 统计新增用户24小时内产生的订单数量
|
| | | * |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> count24HOderByChannel(@Param("channel") String channel, @Param("type") Integer type,
|
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | List<HongBaoV2VO> listShareAndInviteMoney(@Param("start") long start, @Param("count") int count,
|
| | | @Param("date") String date);
|
| | |
| | | List<ThreeSale> getExpireRecord(@Param("bossId")Long bossId, @Param("workerId")Long workerId);
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询一度队员集合
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> queryMyFirstTeamList(@Param("start") int start, @Param("count") int count, @Param("key") String key,
|
| | | @Param("bossId") Long bossId);
|
| | |
|
| | | long queryCountMyFirstTeamList(@Param("key") String key, @Param("bossId") Long bossId);
|
| | |
|
| | | /**
|
| | | * 查询二度队员集合
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> queryMySecondTeamList(@Param("start") int start, @Param("count") int count,
|
| | | @Param("key") String key, @Param("bossId") Long bossId);
|
| | |
|
| | | long queryCountMySecondTeamList(@Param("key") String key, @Param("bossId") Long bossId);
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 一级查询
|
| | |
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listFirstTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
|
| | | @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | | @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime,
|
| | | @Param("validState") Integer validState);
|
| | |
|
| | | long countFirstTeamQuery(@Param("uid") Long uid, @Param("state") Integer state,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | | long countFirstTeamQuery(@Param("uid") Long uid, @Param("state") Integer state, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime, @Param("validState") Integer validState);
|
| | |
|
| | | /**
|
| | | * 二级查询
|
| | |
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listSecondTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
|
| | | @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | | @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime
|
| | | ,@Param("validState") Integer validState);
|
| | |
|
| | | long countSecondTeamQuery(@Param("uid") Long uid, @Param("state") Integer state,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("validState") Integer validState);
|
| | |
|
| | | /**
|
| | | * 上级查询
|
| | |
| | | List<UserInfoVO> query(@Param("start") long start, @Param("count") int count, @Param("userState") Integer userState,
|
| | | @Param("key") String key, @Param("keyType") Integer keyType, @Param("userRank") String userRank,
|
| | | @Param("days") Integer days, @Param("startTime") String startTime, @Param("endTime") String endTime,
|
| | | @Param("orderField") Integer orderField, @Param("orderMode") Integer orderMode,@Param("userType") Integer userType);
|
| | | @Param("orderField") Integer orderField, @Param("orderMode") Integer orderMode,
|
| | | @Param("userType") Integer userType, @Param("level")String level, @Param("activeCode") Integer activeCode);
|
| | |
|
| | | long queryCount(@Param("userState") Integer userState, @Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("userRank") String userRank, @Param("days") Integer days, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime,@Param("userType") Integer userType);
|
| | | @Param("endTime") String endTime,@Param("userType") Integer userType, @Param("level")String level,
|
| | | @Param("activeCode") Integer activeCode);
|
| | |
|
| | | /**
|
| | | * 统计当前查询结果总金额
|
| | |
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.vo.user.SystemCouponVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponCountVO;
|
| | |
| | | Long countFreeCouponRecord(@Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("state") Integer state);
|
| | |
|
| | | /**
|
| | | * 奖励券使用数量曲线图
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> getRebateCouponUsedNumToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | |
| | | |
| | | /**
|
| | | * 奖励券使用成功金额曲线图
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> getRebateCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | |
| | | |
| | | /**
|
| | | * 奖励券使用成功金额曲线图
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> getFreeCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("couponType")String couponType);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | // 上上级关系状态
|
| | | @Transient
|
| | | private Boolean stateSuper;
|
| | | // 有效关系
|
| | | @Transient
|
| | | private Integer validState;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | this.stateSuper = stateSuper;
|
| | | }
|
| | |
|
| | | public Integer getValidState() {
|
| | | return validState;
|
| | | }
|
| | |
|
| | | public void setValidState(Integer validState) {
|
| | | this.validState = validState;
|
| | | }
|
| | | |
| | | }
|
| | |
| | |
|
| | | // 消息类型的枚举
|
| | | public enum UserSettingTypeEnum {
|
| | | cancelNotice("通知免打扰(20:00-8:00)"), noNewsRedDot("不看消息红点提醒"), noBonusCount("不看奖金统计"), noShareRecordAndStorage(
|
| | | "不看分享记录和选品库"), noInvitationBonus("不看邀请拿奖金"), openSpreadHongBao("开启推广红包");
|
| | |
|
| | | cancelNotice("通知免打扰(20:00-8:00)"),
|
| | | noNewsRedDot("不看消息红点提醒"), |
| | | noBonusCount("不看奖金统计"), |
| | | noShareRecordAndStorage("不看分享记录和选品库"),
|
| | | noInvitationBonus("不看邀请拿奖金"),
|
| | | openSpreadHongBao("开启推广红包"),
|
| | | noDisplayPhoneNum("不允许查看手机号码");
|
| | | |
| | | |
| | | private final String desc;
|
| | |
|
| | | private UserSettingTypeEnum(String desc) {
|
| | |
| | | <result column="updateTime" property="updateTime" jdbcType="BIGINT" />
|
| | | <result column="expire" property="expire" jdbcType="INTEGER" />
|
| | |
|
| | | <result column="validState" property="validState" jdbcType="INTEGER" />
|
| | | |
| | | <association property="boss" column="boss_id"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="boss_id" property="id" jdbcType="BIGINT" />
|
| | |
| | | worker_id = #{workerId}
|
| | | </delete>
|
| | |
|
| | | <!-- 查询一度队员集合 -->
|
| | | <select id="queryMyFirstTeamList" resultMap="BaseResultMap">
|
| | | SELECT * FROM `yeshi_ec_threesale` yet
|
| | | WHERE yet.`state` = '1' AND
|
| | | yet.`boss_id` = #{bossId} AND (yet.expire = 0
|
| | | OR yet.expire IS NULL)
|
| | | <if test="key != null and key !='' ">
|
| | | and yet.`worker_id` like '%${key}%'
|
| | | </if>
|
| | | ORDER BY yet.createtime DESC LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="queryCountMyFirstTeamList" resultType="java.lang.Long">
|
| | | SELECT count(yet.id) FROM `yeshi_ec_threesale` yet
|
| | | WHERE yet.`state` =
|
| | | '1' AND yet.`boss_id` = #{bossId} AND (yet.expire = 0
|
| | | OR yet.expire IS
|
| | | NULL)
|
| | | <if test="key != null and key !='' ">
|
| | | and yet.`worker_id` like '%${key}%'
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | | <!-- 查询二度队员集合 -->
|
| | | <select id="queryMySecondTeamList" resultMap="BaseResultMap">
|
| | | SELECT yet.* FROM (
|
| | | SELECT DISTINCT(ts.`id`) AS id FROM
|
| | | `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON
|
| | | ts.`boss_id`=tf.`worker_id`
|
| | | WHERE ts.`state` = '1' AND tf.`boss_id`=#{bossId} AND tf.`state` = 1
|
| | | <if test="key != null and key !='' ">
|
| | | and ts.`worker_id` like '%${key}%'
|
| | | </if>
|
| | | )A
|
| | | LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
|
| | | ORDER BY
|
| | | yet.`createtime` DESC LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="queryCountMySecondTeamList" resultType="java.lang.Long">
|
| | | SELECT COUNT(A.id) FROM (
|
| | | SELECT DISTINCT(ts.`id`) AS id FROM
|
| | | `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON
|
| | | ts.`boss_id`=tf.`worker_id`
|
| | | WHERE ts.`state` = '1' AND tf.`boss_id`=#{bossId} AND tf.`state` = 1
|
| | | <if test="key != null and key !='' ">
|
| | | and ts.`worker_id` like '%${key}%'
|
| | | </if>
|
| | | )A
|
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | | <select id="listFirstTeamQuery" resultMap="AllResultMap">
|
| | | SELECT * FROM `yeshi_ec_threesale`
|
| | | <select id="listFirstTeamQuery" resultMap="BaseResultMap">
|
| | | SELECT t.*,d.`tvr_type` AS validState FROM `yeshi_ec_threesale` t
|
| | | LEFT JOIN `yeshi_ec_user_invite_valid_record` d ON (d.`tvr_uid` = t.`boss_id` AND d.`tvr_worker_id` = t.`worker_id`)
|
| | | WHERE 1=1
|
| | | <if test="uid != null">
|
| | | AND `boss_id` = #{uid}
|
| | | AND t.`boss_id` = #{uid}
|
| | | </if>
|
| | | <if test="state == 0">
|
| | | AND `state` = 0 AND (expire = 0 OR expire IS NULL)
|
| | | <if test="state != null">
|
| | | AND t.`state` = #{state}
|
| | | </if>
|
| | | <if test="state == 1">
|
| | | AND `state` = 1
|
| | | <if test="validState == 1">
|
| | | AND d.`tvr_type` = 1
|
| | | </if>
|
| | | <if test="state ==2">
|
| | | AND `expire` = 1 <!-- 失效 -->
|
| | | <if test="validState == 0">
|
| | | AND d.`tvr_type` is null
|
| | | </if>
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | <![CDATA[AND FROM_UNIXTIME(createTime/1000) >= #{startTime}]]>
|
| | | <![CDATA[AND FROM_UNIXTIME(t.createTime/1000) >= #{startTime}]]>
|
| | | </if>
|
| | | <if test="endTime != null and endTime !='' ">
|
| | | <![CDATA[AND FROM_UNIXTIME(createTime/1000) <= #{endTime}]]>
|
| | | <![CDATA[AND FROM_UNIXTIME(t.createTime/1000) <= #{endTime}]]>
|
| | | </if>
|
| | | ORDER BY createTime DESC
|
| | | ORDER BY t.createTime DESC
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="countFirstTeamQuery" resultType="java.lang.Long">
|
| | | SELECT count(id) FROM `yeshi_ec_threesale`
|
| | | SELECT count(t.id) FROM `yeshi_ec_threesale` t
|
| | | LEFT JOIN `yeshi_ec_user_invite_valid_record` d ON (d.`tvr_uid` = t.`boss_id` AND d.`tvr_worker_id` = t.`worker_id`)
|
| | | WHERE 1=1
|
| | | <if test="uid != null">
|
| | | AND `boss_id` = #{uid}
|
| | | AND t.`boss_id` = #{uid}
|
| | | </if>
|
| | | <if test="state == 0">
|
| | | AND `state` = 0 AND (expire = 0 OR expire IS NULL)
|
| | | <if test="state != null">
|
| | | AND t.`state` = #{state}
|
| | | </if>
|
| | | <if test="state == 1">
|
| | | AND `state` = 1
|
| | | <if test="validState == 1">
|
| | | AND d.`tvr_type` = 1
|
| | | </if>
|
| | | <if test="state ==2">
|
| | | AND `expire` = 1 <!-- 失效 -->
|
| | | <if test="validState == 0">
|
| | | AND d.`tvr_type` is null
|
| | | </if>
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | <![CDATA[AND FROM_UNIXTIME(createTime/1000) >= #{startTime}]]>
|
| | | <![CDATA[AND FROM_UNIXTIME(t.createTime/1000) >= #{startTime}]]>
|
| | | </if>
|
| | | <if test="endTime != null and endTime !=''">
|
| | | <![CDATA[AND FROM_UNIXTIME(createTime/1000) <= #{endTime}]]>
|
| | | <if test="endTime != null and endTime !='' ">
|
| | | <![CDATA[AND FROM_UNIXTIME(t.createTime/1000) <= #{endTime}]]>
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listSecondTeamQuery" resultMap="AllResultMap">
|
| | | SELECT yet.* FROM (
|
| | | SELECT DISTINCT(ts.`id`) AS id FROM
|
| | | `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON
|
| | | ts.`boss_id`=tf.`worker_id`
|
| | | WHERE 1=1 AND tf.`state` = 1
|
| | | <select id="listSecondTeamQuery" resultMap="BaseResultMap">
|
| | | SELECT yet.*,d.`tvr_type` AS validState FROM (SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id` WHERE 1=1 AND tf.`state` = 1
|
| | | <if test="uid != null">
|
| | | AND tf.`boss_id` = #{uid}
|
| | | </if>
|
| | | <if test="state == 0">
|
| | | AND ts.`state` = 0 AND (ts.expire = 0 OR ts.expire IS
|
| | | NULL)
|
| | | </if>
|
| | | <if test="state == 1">
|
| | | AND ts.`state` = 1
|
| | | </if>
|
| | | <if test="state ==2">
|
| | | AND ts.`expire` = 1 <!-- 失效 -->
|
| | | <if test="state != null">
|
| | | AND ts.`state` = #{state}
|
| | | </if>
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) >= #{startTime}]]>
|
| | | <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) >= #{startTime}]]>
|
| | | </if>
|
| | | <if test="endTime != null and endTime !=''">
|
| | | <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) <= #{endTime}]]>
|
| | | <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) <= #{endTime}]]>
|
| | | </if>
|
| | |
|
| | | )A LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
|
| | | ORDER BY
|
| | | yet.`createtime` DESC
|
| | | LEFT JOIN `yeshi_ec_user_invite_valid_record` d ON (d.`tvr_uid` = yet.`boss_id` AND d.`tvr_worker_id` = yet.`worker_id`)
|
| | | where 1=1 |
| | | <if test="validState == 1">
|
| | | AND d.`tvr_type` = 1
|
| | | </if>
|
| | | <if test="validState == 0">
|
| | | AND d.`tvr_type` is null
|
| | | </if>
|
| | | ORDER BY yet.`createtime` DESC
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="countSecondTeamQuery" resultType="java.lang.Long">
|
| | | SELECT COUNT(A.id) FROM (
|
| | | SELECT DISTINCT(ts.`id`) AS id FROM
|
| | | `yeshi_ec_threesale` ts
|
| | | SELECT COUNT(A.id) FROM (SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON
|
| | | ts.`boss_id`=tf.`worker_id`
|
| | | WHERE 1=1 AND tf.`state` = 1
|
| | | <if test="uid != null">
|
| | | AND tf.`boss_id` = #{uid}
|
| | | </if>
|
| | | <if test="state == 0">
|
| | | AND ts.`state` = 0 AND (ts.expire = 0 OR ts.expire IS
|
| | | NULL)
|
| | | </if>
|
| | | <if test="state == 1">
|
| | | AND ts.`state` = 1
|
| | | </if>
|
| | | <if test="state ==2">
|
| | | AND ts.`expire` = 1 <!-- 失效 -->
|
| | | <if test="state != null">
|
| | | AND ts.`state` = #{state}
|
| | | </if>
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) >= #{startTime}]]>
|
| | | <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) >= #{startTime}]]>
|
| | | </if>
|
| | | <if test="endTime != null and endTime !=''">
|
| | | <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) <= #{endTime}]]>
|
| | | <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) <= #{endTime}]]>
|
| | | </if>
|
| | | )A
|
| | | LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
|
| | | LEFT JOIN `yeshi_ec_user_invite_valid_record` d ON (d.`tvr_uid` = yet.`boss_id` AND d.`tvr_worker_id` = yet.`worker_id`)
|
| | | where 1=1 |
| | | <if test="validState == 0">
|
| | | AND d.`tvr_type` is null
|
| | | </if>
|
| | | <if test="validState == 1">
|
| | | AND d.`tvr_type` = 1
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="listSuperiorQuery" resultMap="AllResultMap">
|
| | | <select id="listSuperiorQuery" resultMap="BaseResultMap">
|
| | | SELECT * FROM `yeshi_ec_threesale` ts
|
| | | WHERE ts.`worker_id` = #{uid}
|
| | | <if test="state == 0">
|
| | |
| | |
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
| | | <result column="userLevel" property="userLevel" jdbcType="VARCHAR" />
|
| | | <result column="inviteCode" property="inviteCode" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | |
| | | AND DATE_FORMAT(hb.`hb_create_time`,'%Y%m') =
|
| | | DATE_FORMAT(CURDATE(),'%Y%m'))AS monthOrder <!-- 累计本月订单 -->
|
| | | ,(SELECT COUNT(tr.`id`) FROM `yeshi_ec_threesale` tr <!-- 队员 -->
|
| | | WHERE tr.`boss_id`=u.id AND tr.state = 1) AS totalPlayers
|
| | | WHERE tr.`boss_id`=u.id AND tr.state = 1) AS totalPlayers,
|
| | | tuls_level As userLevel, ext.uie_invite_code AS inviteCode
|
| | | FROM
|
| | | yeshi_ec_user u
|
| | | LEFT JOIN yeshi_ec_binding_account b ON u.`id` =
|
| | |
| | | LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
|
| | | LEFT
|
| | | JOIN yeshi_ec_user_info_extra_taobao tb ON tb.`uiet_uid` = u.id
|
| | |
|
| | | LEFT JOIN yeshi_ec_team_user_level_statistic lc ON lc.`tuls_uid` = u.id
|
| | | <if test="userState == 2">
|
| | | LEFT JOIN
|
| | | (SELECT A.uid AS buid,MAX(A.f_wxUnionId) AS
|
| | |
| | | WHERE u.`state` =2
|
| | | )A GROUP BY A.uid) B ON u.id= B.buid
|
| | | </if>
|
| | | |
| | |
|
| | | where 1=1
|
| | | <if test="userState == 1">
|
| | | AND u.`state` <![CDATA[<>]]>
|
| | | 2 <!-- 正常用户 -->
|
| | | AND u.`state` <![CDATA[<>]]>2 <!-- 未被封禁用户 -->
|
| | | </if>
|
| | | <if test="userState == 2">
|
| | | AND u.`state` =2 <!-- 封禁用户 -->
|
| | |
| | | <if test="userType!=null">
|
| | | AND u.type=#{userType}
|
| | | </if>
|
| | |
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
|
| | | DATE_FORMAT(#{startTime},'%Y%m%d')
|
| | |
| | | <if test="userRank != null">
|
| | | AND rak.ur_name = #{userRank}
|
| | | </if>
|
| | | <if test = "level != null and level != ''">
|
| | | AND lc.tuls_level = #{level}
|
| | | </if>
|
| | | |
| | | <if test="activeCode == 0">
|
| | | AND (ext.`uie_invite_code` is null OR ext.`uie_invite_code`='')
|
| | | </if>
|
| | | |
| | | <if test="activeCode == 1">
|
| | | AND (ext.`uie_invite_code` is not null OR ext.`uie_invite_code`<![CDATA[<>]]>'')
|
| | | </if>
|
| | | |
| | | <if test="days != null">
|
| | | <!-- 注册时间 -->
|
| | | AND <![CDATA[DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(u.createtime/1000)]]>
|
| | |
| | | yeshi_ec_user_info_extra ext ON u.`id` = ext.uie_uid
|
| | | LEFT JOIN
|
| | | yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
|
| | | LEFT JOIN yeshi_ec_team_user_level_statistic lc ON lc.`tuls_uid` = u.id
|
| | | |
| | | where 1=1
|
| | |
|
| | | <if test="userState == 1">
|
| | |
| | | <if test="userRank != null">
|
| | | AND rak.ur_name = #{userRank}
|
| | | </if>
|
| | | <if test = "level != null and level != ''">
|
| | | AND lc.tuls_level = #{level}
|
| | | </if>
|
| | | |
| | | <if test="activeCode == 0">
|
| | | AND (ext.`uie_invite_code` is null OR ext.`uie_invite_code`='')
|
| | | </if>
|
| | | |
| | | <if test="activeCode == 1">
|
| | | AND (ext.`uie_invite_code` is not null OR ext.`uie_invite_code`<![CDATA[<>]]>'')
|
| | | </if>
|
| | | <if test="days != null"> <!-- 注册时间 -->
|
| | | AND <![CDATA[DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(u.createtime/1000)]]>
|
| | | </if>
|
| | |
| | | </if>
|
| | | </sql>
|
| | |
|
| | | <select id="countHongBaoMoney" resultMap="ChartMap">
|
| | | SELECT CAST(SUM(t.`hb_money`)AS DECIMAL(19,2)) AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM yeshi_ec_hongbao_v2 t
|
| | | <if test="channel != null and channel != 'all' ">
|
| | | LEFT JOIN (SELECT a.`lua_uid` AS uid FROM
|
| | | `yeshi_ec_log_user_active` a WHERE a.`lua_channel`='${channel}' GROUP
|
| | | BY a.`lua_uid`) a ON t.`hb_uid`=a.uid
|
| | | </if>
|
| | | WHERE t.`hb_uid` IS NOT NULL AND (t.`hb_type`=1 OR t.`hb_type`=20)
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Select_State" />
|
| | | <if test="channel != null and channel != 'all' ">
|
| | | AND a.uid is not null
|
| | | </if>
|
| | |
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`hb_create_time`
|
| | | </select>
|
| | |
|
| | | <select id="countHongBaoNum" resultMap="ChartMap">
|
| | | SELECT COUNT(t.`hb_id`)AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM yeshi_ec_hongbao_v2 t
|
| | | <if test="channel != null and channel != 'all' ">
|
| | | LEFT JOIN (SELECT a.`lua_uid` AS uid FROM
|
| | | `yeshi_ec_log_user_active` a WHERE a.`lua_channel`='${channel}' GROUP
|
| | | BY a.`lua_uid`) a ON t.`hb_uid`=a.uid
|
| | | </if>
|
| | | WHERE t.`hb_uid` IS NOT NULL AND (t.`hb_type`=1 OR t.`hb_type`=20)
|
| | |
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Select_State" />
|
| | | <if test="channel != null and channel != 'all' ">
|
| | | AND a.uid is not null
|
| | | </if>
|
| | |
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`hb_create_time`
|
| | | </select>
|
| | |
|
| | | <select id="countNumberByUid" resultType="java.lang.Long">
|
| | | select count(hb_id)
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countHongBaoType" resultMap="ChartMap">
|
| | | SELECT COUNT(t.`hb_id`)AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM yeshi_ec_hongbao_v2 t
|
| | | WHERE t.`hb_uid` IS NOT NULL
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Select_Type" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`hb_create_time`
|
| | | </select>
|
| | |
|
| | | <select id="countHongBaoTotalNum" resultMap="ChartMap">
|
| | | SELECT COUNT(t.`hb_id`)AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM yeshi_ec_hongbao_v2 t
|
| | | WHERE t.`hb_uid` IS NOT NULL AND t.`hb_type`
|
| | | not in(1,3,4)
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`hb_create_time`
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countMoneyByUidAndState" resultType="java.math.BigDecimal">
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="count24HOderByChannel" resultMap="ChartMap">
|
| | | SELECT <!-- COALESCE(SUM(b.money*2),0) AS 'commision', -->
|
| | | COALESCE(COUNT(b.hb_id),0) AS 'showValue',
|
| | | <!-- COALESCE(SUM(b.payMoney),0) AS 'payMoney', -->
|
| | | <if test="type == 1">
|
| | | FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | | </if>
|
| | | <if test="type == 2">
|
| | | FROM_UNIXTIME(u.`createtime`/1000,'%m') AS 'showDate'
|
| | | </if>
|
| | | <if test="type == 3">
|
| | | FROM_UNIXTIME(u.`createtime`/1000,'%Y') AS 'showDate'
|
| | | </if>
|
| | | FROM
|
| | | (
|
| | | SELECT h.* FROM yeshi_ec_hongbao_v2 h
|
| | | LEFT JOIN (SELECT
|
| | | a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active` a
|
| | | WHERE
|
| | | a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a
|
| | | ON
|
| | | a.uid=h.`hb_uid` WHERE a.uid IS NOT NULL AND (h.`hb_type`=1 OR
|
| | | h.`hb_type`=20)
|
| | | ) b
|
| | | LEFT JOIN yeshi_ec_user u ON u.`id`=b.hb_uid
|
| | | WHERE <![CDATA[ b.hb_create_time<FROM_UNIXTIME((u.`createtime`+1000*60*60*24)/1000,'%Y-%m-%d %h:%m:%s')]]>
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
|
| | | '${endTime}'
|
| | | </if>
|
| | | <if test="years != null and years != '' ">
|
| | | AND FROM_UNIXTIME(u.`createtime`/1000,'%Y') = '${years}'
|
| | | </if>
|
| | | <if test="type == 1">
|
| | | GROUP BY FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="type == 2">
|
| | | GROUP BY FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m')
|
| | | </if>
|
| | | <if test="type == 3">
|
| | | GROUP BY FROM_UNIXTIME(u.`createtime`/1000,'%Y')
|
| | | </if>
|
| | | ORDER BY u.`createtime`
|
| | |
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="listShareAndInviteMoney" resultMap="BaseResultMap">
|
| | | SELECT IFNULL(SUM(h.`hb_money`),0) as totalMoney,h.*
|
| | |
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper.BaseResultMap"/>
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <select id="listRebateCoupon" resultMap="BaseResultMap">
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` uc
|
| | |
| | | AND uc.`usc_id` = #{key}
|
| | | </if>
|
| | | </if>
|
| | | </select>
|
| | | |
| | | <select id="getRebateCouponUsedNumToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(COUNT(c.`usc_id`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(c.`usc_use_time`,'%Y-%m-%d') AS 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 2">
|
| | | DATE_FORMAT(c.`usc_use_time`,'%m') AS 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 3">
|
| | | DATE_FORMAT(c.`usc_use_time`,'%Y') AS 'showDate'
|
| | | </if>
|
| | | FROM yeshi_ec_user_system_coupon c |
| | | LEFT JOIN yeshi_ec_system_coupon p ON p.`sc_id`= c.`usc_coupon_id`
|
| | | WHERE c.`usc_state` = 3 AND p.`sc_type` = 'rebatePercentCoupon'
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND DATE_FORMAT(c.`usc_use_time`,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND DATE_FORMAT(c.`usc_use_time`,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}'
|
| | | </if>
|
| | | <if test="year != null and year != '' ">
|
| | | AND DATE_FORMAT(c.`usc_use_time`,'%Y') = '${year}'
|
| | | </if>
|
| | | |
| | | <if test="dateType == 1">
|
| | | GROUP BY DATE_FORMAT(c.`usc_use_time`,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="dateType == 2">
|
| | | GROUP BY DATE_FORMAT(c.`usc_use_time`,'%Y-%m')
|
| | | </if>
|
| | | <if test="dateType == 3">
|
| | | GROUP BY DATE_FORMAT(c.`usc_use_time`,'%Y')
|
| | | </if>
|
| | | ORDER BY c.`usc_use_time`
|
| | | </select>
|
| | | |
| | | |
| | | <select id="getRebateCouponMoneyToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(SUM(c.`hb_money`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(c.`hb_get_time`,'%Y-%m-%d') AS 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 2">
|
| | | DATE_FORMAT(c.`hb_get_time`,'%m') AS 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 3">
|
| | | DATE_FORMAT(c.`hb_get_time`,'%Y') AS 'showDate'
|
| | | </if>
|
| | | FROM yeshi_ec_hongbao_v2 c |
| | | WHERE c.`hb_type`= 10
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND DATE_FORMAT(c.`hb_get_time`,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND DATE_FORMAT(c.`hb_get_time`,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}'
|
| | | </if>
|
| | | <if test="year != null and year != '' ">
|
| | | AND DATE_FORMAT(c.`hb_get_time`,'%Y') = '${year}'
|
| | | </if>
|
| | | |
| | | <if test="dateType == 1">
|
| | | GROUP BY DATE_FORMAT(c.`hb_get_time`,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="dateType == 2">
|
| | | GROUP BY DATE_FORMAT(c.`hb_get_time`,'%Y-%m')
|
| | | </if>
|
| | | <if test="dateType == 3">
|
| | | GROUP BY DATE_FORMAT(c.`hb_get_time`,'%Y')
|
| | | </if>
|
| | | ORDER BY c.`hb_get_time`
|
| | | </select>
|
| | |
|
| | | <select id="getFreeCouponMoneyToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(SUM(v2.`hb_money`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(v2.`hb_get_time`,'%Y-%m-%d') AS 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 2">
|
| | | DATE_FORMAT(v2.`hb_get_time`,'%m') AS 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 3">
|
| | | DATE_FORMAT(v2.`hb_get_time`,'%Y') AS 'showDate'
|
| | | </if>
|
| | | FROM yeshi_ec_user_system_coupon c |
| | | LEFT JOIN yeshi_ec_system_coupon sp ON sp.`sc_id` = c.`usc_coupon_id` |
| | | LEFT JOIN `yeshi_ec_user_system_coupon_record` pr ON c.`usc_id` = pr.`ucr_user_coupon_id`
|
| | | LEFT JOIN `yeshi_ec_common_order` co ON pr.`ucr_order_no` = co.`co_order_no`
|
| | | LEFT JOIN `yeshi_ec_hongbao_order` ho ON ho.`ho_order_id` = co.`co_id`
|
| | | LEFT JOIN `yeshi_ec_hongbao_v2` v2 ON ho.`ho_hongbao_id` = v2.`hb_id`
|
| | | WHERE pr.`ucr_state` = 3 AND sp.`sc_type` = #{couponType}
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND DATE_FORMAT(v2.`hb_get_time`,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND DATE_FORMAT(v2.`hb_get_time`,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}'
|
| | | </if>
|
| | | <if test="year != null and year != '' ">
|
| | | AND DATE_FORMAT(v2.`hb_get_time`,'%Y') = '${year}'
|
| | | </if>
|
| | | |
| | | <if test="dateType == 1">
|
| | | GROUP BY DATE_FORMAT(v2.`hb_get_time`,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="dateType == 2">
|
| | | GROUP BY DATE_FORMAT(v2.`hb_get_time`,'%Y-%m')
|
| | | </if>
|
| | | <if test="dateType == 3">
|
| | | GROUP BY DATE_FORMAT(v2.`hb_get_time`,'%Y')
|
| | | </if>
|
| | | ORDER BY v2.`hb_get_time`
|
| | | </select>
|
| | |
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.count;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.HongBaoV2CountMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.HongBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | | @Service
|
| | |
| | | @Resource
|
| | | private HongBaoV2CountMapper hongBaoV2CountMapper;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderMapper taoBaoOrderMapper;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderMapper commonOrderMapper;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderGoodsMapper commonOrderGoodsMapper;
|
| | |
|
| | | @Resource
|
| | | private HongBaoOrderMapper hongBaoOrderMapper;
|
| | |
|
| | | @Resource
|
| | | private OrderMapper orderMapper;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
|
| | |
|
| | | public List<ChartTDO> dayFactory(String startTime, String endTime, List<ChartTDO> list)
|
| | | throws Exception {
|
| | |
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | |
|
| | | if (startTime.equals(endTime)) {
|
| | | ChartTDO chartTDO = list.get(0);
|
| | | String total = chartTDO.getShowValue();
|
| | | if (total == null) {
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | listObject.add(chartTDO);
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | String plusDay = "";
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd");
|
| | | for (int i = 0; i < 1000; i++) {
|
| | | if (i == 0) {
|
| | | plusDay = startTime;
|
| | | } else {
|
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | String total = null;
|
| | | ChartTDO chart = new ChartTDO();
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String createDate = chartTDO.getShowDate();
|
| | | String month = createDate.toString();
|
| | | if (plusDay.equalsIgnoreCase(month)) {
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = "0";
|
| | | }
|
| | | chart.setShowValue(total);
|
| | | Date parseDate = sdf.parse(plusDay.toString());
|
| | | chart.setShowDate(sdf2.format(parseDate));
|
| | | listObject.add(chart);
|
| | |
|
| | | if (plusDay.equals(endTime)) {
|
| | | break; // 时间结束
|
| | | }
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<ChartTDO> monthFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | // 12 个月处理
|
| | | for (int i = 1; i <= 12; i++) {
|
| | | |
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String createDate = chartTDO.getShowDate();
|
| | | String month = createDate.toString();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = "0";
|
| | | }
|
| | | |
| | | ChartTDO mapObject = new ChartTDO();
|
| | | mapObject.setShowValue(total);
|
| | | mapObject.setShowDate(i + "月");
|
| | | listObject.add(mapObject);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<ChartTDO> yearFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | ChartTDO chartTDO = list.get(i);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | showValue = "0";
|
| | | }
|
| | | chartTDO.setShowValue(showValue);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ChartTDO> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoMoney(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ChartTDO> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoNum(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ChartTDO> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public Long countOrderByTypeAndDate(Integer orderType, String preDay) {
|
| | | return hongBaoV2CountMapper.countOrderByTypeAndDate(orderType, preDay);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public List<ChartTDO> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | |
|
| | | List<ChartTDO> result_list = null;
|
| | |
|
| | | List<ChartTDO> listTotal = hongBaoV2CountMapper.countHongBaoTotalNum(dateType, year, startTime,
|
| | | endTime);
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | List<ChartTDO> type_list = hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if (type_list == null || type_list.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | switch (dateType) {
|
| | | case 1: // 按天处理
|
| | | result_list = dayFactory(startTime, endTime, type_list);
|
| | | break;
|
| | | case 2: // 按月处理
|
| | | result_list = monthFactory(type_list);
|
| | | break;
|
| | | case 3:
|
| | | result_list = yearFactory(type_list);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | | float proportion = 0;
|
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listTotal.size(); j++) {
|
| | | ChartTDO innerChart = result_list.get(j);
|
| | | String innerDate = innerChart.getShowDate();
|
| | | if (innerDate != null && innerDate.equals(showDate)) {
|
| | | String innerValue = innerChart.getShowValue();
|
| | | long innerData = Long.parseLong(innerValue);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | | if (showData > 0) {
|
| | | proportion = innerData / showData;
|
| | | }
|
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | | chartTDO.setShowValue(proportion+"");
|
| | | }
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public BigDecimal countMoneyByUidAndState(Long uid, Integer state) {
|
| | | return hongBaoV2CountMapper.countMoneyByUidAndState(uid, state);
|
| | |
| | | return hongBaoV2CountMapper.getLastHongBaoTime(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ChartTDO> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.count24HOderByChannel(channel, type, years, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<HongBaoV2VO> listShareAndInviteMoney(long start, int count, String date) {
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponCountMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | |
| | | @Override
|
| | | public long countFreeCouponRecord(String key, Integer keyType, Integer state){
|
| | | return userSystemCouponCountMapper.countFreeCouponRecord(key, keyType, state);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<ChartTDO> getRebateCouponUsedNumToCharts(Integer dateType, String year, |
| | | String startTime, String endTime){
|
| | | return userSystemCouponCountMapper.getRebateCouponUsedNumToCharts(dateType, year, startTime, endTime);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<ChartTDO> getRebateCouponMoneyToCharts(Integer dateType, String year, |
| | | String startTime, String endTime){
|
| | | return userSystemCouponCountMapper.getRebateCouponMoneyToCharts(dateType, year, startTime, endTime);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<ChartTDO> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime, |
| | | String endTime, String couponType){
|
| | | return userSystemCouponCountMapper.getFreeCouponMoneyToCharts(dateType, year, startTime, endTime, couponType);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | floatADMapper.updateByPrimaryKey(exchangeObject);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void switchState(Long id) throws FloatADException {
|
| | | if (id == null) {
|
| | | throw new FloatADException(1, "请传递正确参数");
|
| | | }
|
| | | FloatAD resultObj = floatADMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new FloatADException(1, "此内容已不存在");
|
| | | }
|
| | | |
| | | Integer state = resultObj.getState();
|
| | | if (state == null || state == 0) {
|
| | | state = 1;
|
| | | } else {
|
| | | state = 0;
|
| | | }
|
| | | |
| | | FloatAD updateObj = new FloatAD();
|
| | | updateObj.setId(id);
|
| | | updateObj.setState(state);
|
| | | floatADMapper.updateByPrimaryKeySelective(updateObj);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteByPrimaryKeyList(List<Long> list) throws Exception{
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void switchState(Long id) throws SpecialException {
|
| | | if (id == null) {
|
| | | throw new SpecialException(1, "请传递正确参数");
|
| | | }
|
| | | |
| | | Special resultObj = specialMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new SpecialException(1, "此内容已不存在");
|
| | | }
|
| | | |
| | | Long state = resultObj.getState();
|
| | | if (state == null || state == 0) {
|
| | | state = 1L;
|
| | | } else {
|
| | | state = 0L;
|
| | | }
|
| | | |
| | | Special updateObj = new Special();
|
| | | updateObj.setId(id);
|
| | | updateObj.setState(state);
|
| | | specialMapper.updateByPrimaryKeySelective(updateObj);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | mineTypeNum = UserSettingTypeEnum.noInvitationBonus;
|
| | | } else if (type.equals(UserSettingTypeEnum.openSpreadHongBao.name())) {
|
| | | mineTypeNum = UserSettingTypeEnum.openSpreadHongBao;
|
| | | } else if (type.equals(UserSettingTypeEnum.noDisplayPhoneNum.name())) {
|
| | | mineTypeNum = UserSettingTypeEnum.noDisplayPhoneNum;
|
| | | } else {
|
| | | throw new UserCustomSettingsException(1, "参数类型不匹配");
|
| | | }
|
| | |
| | | userSettingsVO.setNoInvitationBonus(state);
|
| | | } else if (typeEnum.equals(UserSettingTypeEnum.openSpreadHongBao)) {
|
| | | userSettingsVO.setOpenSpreadHongBao(state);
|
| | | } else if (typeEnum.equals(UserSettingTypeEnum.noDisplayPhoneNum)) {
|
| | | userSettingsVO.setOpenSpreadHongBao(state);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | | import com.yeshi.fanli.vo.user.UserInfoVO;
|
| | |
|
| | | import net.coobird.thumbnailator.Thumbnails;
|
| | |
| | |
|
| | | @Override
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime,Integer userType) {
|
| | | return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime,userType);
|
| | | String startTime, String endTime,Integer userType, String level, Integer activeCode) {
|
| | | return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime,userType, level, activeCode);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,Integer userType) {
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,
|
| | | Integer userType, String level, Integer activeCode) {
|
| | |
|
| | | List<UserInfoVO> userList = userInfoMapper.query(start, count, userState, key, keyType, userRank, days,
|
| | | startTime, endTime, orderField, orderMode,userType);
|
| | | startTime, endTime, orderField, orderMode,userType, level, activeCode);
|
| | |
|
| | | if (userList == null || userList.size() == 0) {
|
| | | return null;
|
| | |
| | | // 二度队员数量
|
| | | int secondTeamCount = shareMapper.mySecondTeamCount(uid + "");
|
| | | userInfoVO.setCountLevelTwo(secondTeamCount);
|
| | | |
| | | String userLevel = userInfoVO.getUserLevel();
|
| | | if (!StringUtil.isNullOrEmpty(userLevel)) {
|
| | | userInfoVO.setUserLevel(UserLevelUtil.getByEnumName(userLevel).getName());
|
| | | }
|
| | | |
| | | String inviteCode = userInfoVO.getInviteCode();
|
| | | if (!StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | userInfoVO.setInviteCode("已激活");
|
| | | } else {
|
| | | userInfoVO.setInviteCode("未激活");
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return threeSaleMapper.countSecondTeam(uid, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> queryMyFirstTeamList(int start, int count, String key, Long bossId) {
|
| | | return threeSaleMapper.queryMyFirstTeamList(start, count, key, bossId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long queryCountMyFirstTeamList(String key, Long bossId) {
|
| | | return threeSaleMapper.queryCountMyFirstTeamList(key, bossId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> queryMySecondTeamList(int start, int count, String key, Long bossId) {
|
| | | return threeSaleMapper.queryMySecondTeamList(start, count, key, bossId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long queryCountMySecondTeamList(String key, Long bossId) {
|
| | | return threeSaleMapper.queryCountMySecondTeamList(key, bossId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int deleteByPrimaryKey(Long id) {
|
| | |
| | | }
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
| | | String endTime) {
|
| | | return threeSaleMapper.listFirstTeamQuery(start, count, uid, state, startTime, endTime);
|
| | | String endTime, Integer validState) {
|
| | | return threeSaleMapper.listFirstTeamQuery(start, count, uid, state, startTime, endTime, validState);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime) {
|
| | | return threeSaleMapper.countFirstTeamQuery(uid, state, startTime, endTime);
|
| | | public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime, Integer validState) {
|
| | | return threeSaleMapper.countFirstTeamQuery(uid, state, startTime, endTime, validState);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
| | | String endTime) {
|
| | | return threeSaleMapper.listSecondTeamQuery(start, count, uid, state, startTime, endTime);
|
| | | String endTime, Integer validState) {
|
| | | return threeSaleMapper.listSecondTeamQuery(start, count, uid, state, startTime, endTime, validState);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime) {
|
| | | return threeSaleMapper.countSecondTeamQuery(uid, state, startTime, endTime);
|
| | | public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime, Integer validState) {
|
| | | return threeSaleMapper.countSecondTeamQuery(uid, state, startTime, endTime, validState);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | | public interface HongBaoV2CountService {
|
| | |
| | | */
|
| | | public Integer countNumberByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 统计总金额
|
| | | * |
| | | * @param channel
|
| | | * 渠道
|
| | | * @param dateType
|
| | | * 日期格式 日-1 月-2 年-3
|
| | | * @param state
|
| | | * 状态
|
| | | * @param years
|
| | | * 年份
|
| | | * @param startTime
|
| | | * 开始时间
|
| | | * @param endTime
|
| | | * 结束时间
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | | * 统计总金额
|
| | | * |
| | | * @param channel
|
| | | * 渠道
|
| | | * @param dateType
|
| | | * 日期格式 日-1 月-2 年-3
|
| | | * @param state
|
| | | * 状态
|
| | | * @param years
|
| | | * 年份
|
| | | * @param startTime
|
| | | * 开始时间
|
| | | * @param endTime
|
| | | * 结束时间
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | | * 分类型订单数与比例
|
| | | * |
| | | * @param dateType
|
| | | * @param type
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<ChartTDO> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | | * 统计提成订单数量
|
| | |
| | | */
|
| | | public Date getLastHongBaoTime(Long uid);
|
| | |
|
| | | public List<ChartTDO> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | | * 统计所有类型订单数量
|
| | | * |
| | | * @param dateType
|
| | | * @param type
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<ChartTDO> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | | * 查询邀请=分享奖金
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.vo.user.SystemCouponVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponCountVO;
|
| | |
| | | public List<SystemCouponVO> listSystemCouponByFree(long start, int count, String key, Integer sort);
|
| | |
|
| | | public long countSystemCouponFree(String key);
|
| | |
|
| | | /**
|
| | | * 曲线图-奖励券使用数量
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO> getRebateCouponUsedNumToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime);
|
| | |
|
| | | /**
|
| | | * 奖励券使用成功金额曲线图
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO> getRebateCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime);
|
| | |
|
| | | /**
|
| | | * 统计免单券金额
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param couponType
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime, String couponType);
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 根据券类型 统计免单金额
|
| | |
| | | */
|
| | | public List<FloatAD> getValidFloatADCache(String position, Integer type, String platform, Integer versionCode);
|
| | |
|
| | | |
| | | /**
|
| | | * 状态切换
|
| | | * @param id
|
| | | * @throws FloatADException
|
| | | */
|
| | | public void switchState(Long id) throws FloatADException;
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void setVersions(Long specialId,List<Long> versions) throws Exception;
|
| | |
|
| | | /**
|
| | | * 更改状态
|
| | | * @param id
|
| | | * @throws SpecialException
|
| | | */
|
| | | public void switchState(Long id) throws SpecialException;
|
| | |
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,
|
| | | Integer userType);
|
| | | Integer userType, String level, Integer activeCode);
|
| | |
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime, Integer userType);
|
| | | String startTime, String endTime, Integer userType, String level, Integer activeCode);
|
| | |
|
| | | public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime);
|
| | |
|
| | |
| | | // 获取二级用户数量
|
| | | long getSecondUsersCount(Long uid);
|
| | |
|
| | | /**
|
| | | * 查询一度队员集合
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> queryMyFirstTeamList(int start, int count, String key, Long bossId);
|
| | |
|
| | | public long queryCountMyFirstTeamList(String key, Long bossId);
|
| | |
|
| | | /**
|
| | | * 查询二度队员集合
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> queryMySecondTeamList(int start, int count, String key, Long bossId);
|
| | |
|
| | | public long queryCountMySecondTeamList(String key, Long bossId);
|
| | |
|
| | | /**
|
| | | * 删除邀请关系id
|
| | |
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
| | | String endTime);
|
| | | String endTime, Integer validState);
|
| | |
|
| | | public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime);
|
| | | public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime, Integer validState);
|
| | |
|
| | | /**
|
| | | * 二级查询
|
| | |
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
| | | String endTime);
|
| | | String endTime, Integer validState);
|
| | |
|
| | | public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime);
|
| | | public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime, Integer validState);
|
| | |
|
| | | /**
|
| | | * 上级查询
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 根据枚举名称匹配
|
| | | * @param level
|
| | | * @return
|
| | | */
|
| | | public static UserLevelEnum getByEnumName(String level) {
|
| | | if (level == null)
|
| | | return null;
|
| | |
|
| | | for (UserLevelEnum levelEnum : UserLevelEnum.values()) {
|
| | | if (levelEnum.name().equalsIgnoreCase(level))
|
| | | return levelEnum;
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 根据等级数字
|
| | |
| | | // 剩余金币数量
|
| | | private int goldCoin;
|
| | | // 用户标识
|
| | | private String mark;
|
| | | private String mark;
|
| | | |
| | | // 用户VIP等级
|
| | | private String userLevel;
|
| | | |
| | | // 邀请码
|
| | | private String inviteCode;
|
| | | |
| | |
|
| | |
|
| | | public String getRankId() {
|
| | |
| | | public void setMark(String mark) {
|
| | | this.mark = mark;
|
| | | }
|
| | |
|
| | | public String getUserLevel() {
|
| | | return userLevel;
|
| | | }
|
| | |
|
| | | public void setUserLevel(String userLevel) {
|
| | | this.userLevel = userLevel;
|
| | | }
|
| | |
|
| | | public String getInviteCode() {
|
| | | return inviteCode;
|
| | | }
|
| | |
|
| | | public void setInviteCode(String inviteCode) {
|
| | | this.inviteCode = inviteCode;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private Integer noInvitationBonus;
|
| | | // 开启推广红包
|
| | | private Integer openSpreadHongBao;
|
| | | // 允许查看手机
|
| | | private Integer noDisplayPhoneNum;
|
| | |
|
| | |
|
| | |
|
| | |
| | | this.openSpreadHongBao = openSpreadHongBao;
|
| | | }
|
| | |
|
| | |
|
| | | public Integer getNoDisplayPhoneNum() {
|
| | | return noDisplayPhoneNum;
|
| | | }
|
| | |
|
| | | public void setNoDisplayPhoneNum(Integer noDisplayPhoneNum) {
|
| | | this.noDisplayPhoneNum = noDisplayPhoneNum;
|
| | | }
|
| | |
|
| | | }
|