| | |
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.PreviewInfo.PreviewEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.TeamEincomeRecord;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.OrderMoneyDailyCountService;
|
| | | import com.yeshi.fanli.service.inter.user.PreviewInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | import com.yeshi.fanli.vo.money.MoneyPredictVO;
|
| | | import com.yeshi.fanli.vo.money.MoneyStatisticVO;
|
| | | import com.yeshi.fanli.vo.money.TeamPredictVO;
|
| | | import com.yeshi.fanli.vo.order.OrderRankingVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private OrderMoneyDailyCountService orderMoneyDailyCountService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TeamEincomeRecordService teamEincomeRecordService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private PreviewInfoService previewInfoService;
|
| | | |
| | |
|
| | | private Gson getGson() {
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
|
| | |
| | | });
|
| | | return builder.create();
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 用户资金统计
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | // VIP数据预览
|
| | | MoneyStatisticVO vo = null;
|
| | | String redisContent = previewInfoService.getRedisContent(uid, PreviewEnum.moneyInfo);
|
| | | if (!StringUtil.isNullOrEmpty(redisContent)) {
|
| | | vo = new Gson().fromJson(redisContent, MoneyStatisticVO.class);
|
| | | if (vo != null) {
|
| | | vo.setLink(configService.get(ConfigKeyEnum.autoExtractHelpUrl.getKey()));
|
| | | vo.setExtractDesc("提现金额就是已成功提现到支付宝的资金");
|
| | | vo.setMoneyArrivalDesc("订单已到账后提现时间和金额均不受限制");
|
| | | }
|
| | | }
|
| | | |
| | | if (vo == null) {
|
| | | vo = createMoneyStatistic(uid);
|
| | | }
|
| | | |
| | | Gson gson = getGson();
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(vo)));
|
| | | }
|
| | | |
| | | |
| | | public MoneyStatisticVO createMoneyStatistic(Long uid) {
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | |
|
| | | MoneyStatisticVO vo = new MoneyStatisticVO();
|
| | | vo.setLink(configService.get(ConfigKeyEnum.autoExtractHelpUrl.getKey()));
|
| | | vo.setBalanceMoney(user.getMyHongBao());
|
| | | vo.setExtractDesc("提现金额就是已成功转账到提现支付宝的资金。");
|
| | | vo.setMoneyArrivalDesc("资金已到账后提现时间不受限制、金额受限制。");
|
| | | vo.setExtractDesc("提现金额就是已成功提现到支付宝的资金");
|
| | | vo.setMoneyArrivalDesc("订单已到账后提现时间和金额均不受限制");
|
| | |
|
| | | // 获取提现中的信息
|
| | | BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
|
| | |
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | vo.setMonthPredict(cratePredictVO(orderMoneyDailyCountService.query(uid, minDate, maxDate)));
|
| | |
|
| | | Gson gson = getGson();
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(vo)));
|
| | | return vo;
|
| | | }
|
| | |
|
| | |
|
| | | |
| | |
|
| | | @RequestMapping(value = "getUserMoneyInfo")
|
| | | public void getUserMoneyInfo(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | |
|
| | | MoneyStatisticVO vo = new MoneyStatisticVO();
|
| | | vo.setLink(configService.get(ConfigKeyEnum.autoExtractHelpUrl.getKey()));
|
| | | vo.setBalanceMoney(user.getMyHongBao());
|
| | | // 获取提现中的信息
|
| | | BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
|
| | | if (extractingMoney.compareTo(new BigDecimal(0)) > 0)
|
| | | vo.setExtractingMoneyInfo("提现中:¥" + extractingMoney.setScale(2, RoundingMode.HALF_UP));
|
| | | Gson gson = getGson();
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(vo)));
|
| | | }
|
| | |
|
| | | private MoneyPredictVO cratePredictVO(List<OrderMoneyDailyCount> list) {
|
| | | MoneyPredictVO predictVO = new MoneyPredictVO();
|
| | |
| | | if (dailyCount.getOrderNumTeam() != null)
|
| | | predictVO.setTeamNum(predictVO.getTeamNum() + dailyCount.getOrderNumTeam());
|
| | | if (dailyCount.getIncome() != null)
|
| | | predictVO.setMineMoney(predictVO.getMineMoney().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | predictVO.setMineMoney(predictVO.getMineMoney()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | if (dailyCount.getIncomeTeam() != null)
|
| | | predictVO.setTeamMoney(predictVO.getTeamMoney().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred)));
|
| | | predictVO.setTeamMoney(predictVO.getTeamMoney()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred)));
|
| | | }
|
| | | }
|
| | | predictVO.setTotalNum(predictVO.getTeamNum() + predictVO.getMineNum());
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | List<Extract> list = extractService.getExtractSucceedRecord(page, Constant.PAGE_SIZE, uid);
|
| | | if (list == null) {
|
| | | list = new ArrayList<>();
|
| | | List<Extract> list = null;
|
| | | String redisContent = previewInfoService.getRedisContent(uid, PreviewEnum.extractRecord);
|
| | | if (!StringUtil.isNullOrEmpty(redisContent)) {
|
| | | Gson gson = new Gson();
|
| | | list = gson.fromJson(redisContent, new TypeToken<ArrayList<Extract>>() {}.getType());
|
| | | }
|
| | | |
| | | // 查询真实
|
| | | long count = 0;
|
| | | if (list == null) {
|
| | | list = extractService.getExtractSucceedRecord(page, Constant.PAGE_SIZE, uid);
|
| | | count = extractService.countExtractSucceedRecord(uid);
|
| | | }
|
| | | |
| | | if (list == null)
|
| | | list = new ArrayList<>();
|
| | |
|
| | | JSONArray JSONArray = new JSONArray();
|
| | | for (Extract extract : list) {
|
| | |
| | | }
|
| | |
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("count", extractService.countExtractSucceedRecord(uid));
|
| | | json.put("count", count == 0 ? list.size() : 0);
|
| | | json.put("list", JSONArray);
|
| | | out.print(JsonUtil.loadTrueResult(json));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 历史详情
|
| | | *
|
| | |
| | | Date countDay = dailyCount.getCountDay();
|
| | | if (datetype == 1 && countDay != null && countDate.equals(formatDay.format(countDay))) {
|
| | | predictVO.setMineNum(dailyCount.getOrderNum());
|
| | | predictVO.setMineMoney(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred));
|
| | | predictVO.setMineMoney(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred));
|
| | | predictVO.setTeamNum(dailyCount.getOrderNumTeam());
|
| | | predictVO.setTeamMoney(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred));
|
| | | predictVO.setTeamMoney(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred));
|
| | | break;
|
| | | }
|
| | |
|
| | | String yearMonth = dailyCount.getYearMonth();
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth)
|
| | | && countDate.equals(formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth) && countDate.equals(
|
| | | formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | predictVO.setMineNum(dailyCount.getOrderNum());
|
| | | predictVO.setMineMoney(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred));
|
| | | predictVO.setMineMoney(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred));
|
| | | predictVO.setTeamNum(dailyCount.getOrderNumTeam());
|
| | | predictVO.setTeamMoney(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred));
|
| | | predictVO.setTeamMoney(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred));
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | for (OrderMoneyDailyCount dailyCount : listDailyCount) {
|
| | | if (dailyCount.getSourceType() == typeEnum) {
|
| | | detail.setNum(detail.getNum() + dailyCount.getOrderNum());
|
| | | detail.setMoney(detail.getMoney().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | detail.setMoney(detail.getMoney()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadTrueResult(object));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 团队分红
|
| | | * @param acceptData
|
| | |
| | | BigDecimal subsidy = teamEincomeRecordService.sumRecieveByType(uid, TeamEincomeRecord.TYPE_TEAM_SUBSIDY);
|
| | | BigDecimal reward = teamEincomeRecordService.sumRecieveByType(uid, TeamEincomeRecord.TYPE_TEAM_DIVIDENTS);
|
| | |
|
| | | |
| | | Gson gson = getGson();
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("total", subsidy.add(reward).setScale(2).toString());
|
| | |
| | | object.put("month", gson.toJson(monthVO));
|
| | | out.print(JsonUtil.loadTrueResult(object));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | private TeamPredictVO crateTeamPredictVO(List<OrderMoneyDailyCount> list) {
|
| | | TeamPredictVO predictVO = new TeamPredictVO(BigDecimal.ZERO,0,BigDecimal.ZERO,0);
|
| | | TeamPredictVO predictVO = new TeamPredictVO(BigDecimal.ZERO, 0, BigDecimal.ZERO, 0);
|
| | | if (list != null && list.size() > 0) {
|
| | | BigDecimal hundred = BigDecimal.valueOf(100);
|
| | | for (OrderMoneyDailyCount dailyCount : list) {
|
| | |
| | | if (dailyCount.getTeamSubsidyNum() != null)
|
| | | predictVO.setSubsidyNum(predictVO.getSubsidyNum() + dailyCount.getTeamSubsidyNum());
|
| | | if (dailyCount.getTeamReward() != null)
|
| | | predictVO.setReward(predictVO.getReward().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred)));
|
| | | predictVO.setReward(predictVO.getReward()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred)));
|
| | | if (dailyCount.getTeamSubsidy() != null)
|
| | | predictVO.setSubsidy(predictVO.getSubsidy().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred)));
|
| | | |
| | | |
| | | predictVO.setSubsidy(predictVO.getSubsidy()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred)));
|
| | |
|
| | | }
|
| | | }
|
| | | predictVO.setTotalNum(predictVO.getRewardNum() + predictVO.getSubsidyNum());
|
| | | predictVO.setTotalMoney(predictVO.getReward().add(predictVO.getSubsidy()));
|
| | | return predictVO;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 历史详情
|
| | | *
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTeamDividendHistory")
|
| | | public void getTeamDividendHistory(AcceptData acceptData, Long uid, String date, Integer datetype, PrintWriter out) {
|
| | | public void getTeamDividendHistory(AcceptData acceptData, Long uid, String date, Integer datetype,
|
| | | PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | Date countDay = dailyCount.getCountDay();
|
| | | if (datetype == 1 && countDay != null && countDate.equals(formatDay.format(countDay))) {
|
| | | predictVO.setRewardNum(dailyCount.getTeamRewardNum());
|
| | | predictVO.setReward(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred));
|
| | | predictVO.setReward(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred));
|
| | | predictVO.setSubsidyNum(dailyCount.getTeamSubsidyNum());
|
| | | predictVO.setSubsidy(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred));
|
| | | predictVO.setSubsidy(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred));
|
| | | break;
|
| | | }
|
| | |
|
| | | String yearMonth = dailyCount.getYearMonth();
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth)
|
| | | && countDate.equals(formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth) && countDate.equals(
|
| | | formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | predictVO.setRewardNum(dailyCount.getTeamRewardNum());
|
| | | predictVO.setReward(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred));
|
| | | predictVO.setReward(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred));
|
| | | predictVO.setSubsidyNum(dailyCount.getTeamSubsidyNum());
|
| | | predictVO.setSubsidy(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred));
|
| | | predictVO.setSubsidy(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred));
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | |
| | | /**
|
| | | * 订单统计-h5
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countTeamOrderNum")
|
| | | public void countTeamOrderNum(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | |
| | | Date minDate = null;
|
| | | Date maxDate = null;
|
| | | long timeStamp = System.currentTimeMillis();
|
| | | |
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTimeInMillis(timeStamp);
|
| | | |
| | | // 今日预估
|
| | | calendar.add(Calendar.DAY_OF_YEAR, -1);
|
| | | minDate = new Date(TimeUtil.convertDateToTemp(TimeUtil.getGernalTime(timeStamp)));
|
| | | OrderMoneyDailyCount todayRecord = createVO(orderMoneyDailyCountService.sumTeamOrderNumGroupByCountDay(uid, minDate, null));
|
| | |
|
| | | // 昨日预估
|
| | | calendar.add(Calendar.DAY_OF_YEAR, -1);
|
| | | maxDate = new Date(TimeUtil.convertDateToTemp(TimeUtil.getGernalTime(timeStamp)));
|
| | | minDate = DateUtil.reduceDay(1, maxDate);
|
| | | OrderMoneyDailyCount yesterdayRecord = createVO(orderMoneyDailyCountService.sumTeamOrderNumGroupByCountDay(uid, minDate, maxDate));
|
| | |
|
| | | // 本月预估
|
| | | maxDate = new Date(timeStamp);
|
| | | calendar = Calendar.getInstance();
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | OrderMoneyDailyCount monthRecord = createVO(orderMoneyDailyCountService.sumTeamOrderNumGroupByYearMonth(uid, minDate, maxDate));
|
| | | |
| | | // 累计
|
| | | OrderMoneyDailyCount totalityRecord = createVO(orderMoneyDailyCountService.sumTeamOrderNumGroupByUid(uid, null, null));
|
| | | |
| | | JSONObject today = new JSONObject();
|
| | | today.put("direct", todayRecord.getDirectOrderNum());
|
| | | today.put("indirect", todayRecord.getInDirectOrderNum());
|
| | | today.put("beyond", todayRecord.getBeyondOrderNum());
|
| | | |
| | | JSONObject yesterday = new JSONObject();
|
| | | yesterday.put("direct", yesterdayRecord.getDirectOrderNum());
|
| | | yesterday.put("indirect", yesterdayRecord.getInDirectOrderNum());
|
| | | yesterday.put("beyond", yesterdayRecord.getBeyondOrderNum());
|
| | | |
| | | JSONObject month = new JSONObject();
|
| | | month.put("direct", monthRecord.getDirectOrderNum());
|
| | | month.put("indirect", monthRecord.getInDirectOrderNum());
|
| | | month.put("beyond", monthRecord.getBeyondOrderNum());
|
| | | |
| | | JSONObject totality = new JSONObject();
|
| | | totality.put("direct", totalityRecord.getDirectOrderNum());
|
| | | totality.put("indirect", totalityRecord.getInDirectOrderNum());
|
| | | totality.put("beyond", totalityRecord.getBeyondOrderNum());
|
| | | |
| | | |
| | | JSONObject json = new JSONObject();
|
| | | json.put("today", today);
|
| | | json.put("yesterday", yesterday);
|
| | | json.put("month", month);
|
| | | json.put("totality", totality);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(json));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | private OrderMoneyDailyCount createVO(List<OrderMoneyDailyCount> list) {
|
| | | OrderMoneyDailyCount totalityRecord = new OrderMoneyDailyCount(0,0,0);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (OrderMoneyDailyCount record: list) {
|
| | | totalityRecord.setDirectOrderNum(totalityRecord.getDirectOrderNum() + record.getDirectOrderNum());
|
| | | totalityRecord.setInDirectOrderNum(totalityRecord.getInDirectOrderNum() + record.getInDirectOrderNum());
|
| | | totalityRecord.setBeyondOrderNum(totalityRecord.getBeyondOrderNum() + record.getBeyondOrderNum());
|
| | | }
|
| | | } |
| | | return totalityRecord;
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 订单排行榜
|
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param dateType
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getRanking")
|
| | | public void getRanking(String callback, AcceptData acceptData, Long uid, Integer dateType, PrintWriter out) {
|
| | | if (uid == null || dateType == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数缺失"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | Date minDate = null;
|
| | | Date maxDate = null;
|
| | | long timeStamp = System.currentTimeMillis();
|
| | | |
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTimeInMillis(timeStamp);
|
| | | |
| | | if (dateType == 1) {
|
| | | // 今日
|
| | | calendar.add(Calendar.DAY_OF_YEAR, -1);
|
| | | minDate = new Date(TimeUtil.convertDateToTemp(TimeUtil.getGernalTime(timeStamp)));
|
| | | } else if (dateType == 2) {
|
| | | // 昨日
|
| | | calendar.add(Calendar.DAY_OF_YEAR, -1);
|
| | | maxDate = new Date(TimeUtil.convertDateToTemp(TimeUtil.getGernalTime(timeStamp)));
|
| | | minDate = DateUtil.reduceDay(1, maxDate);
|
| | | } else {
|
| | | // 本月
|
| | | maxDate = new Date(timeStamp);
|
| | | calendar = Calendar.getInstance();
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | }
|
| | | |
| | | List<OrderRankingVO> list = orderMoneyDailyCountService.getRankingByOrderNum(uid, minDate, maxDate);
|
| | | if (list.size() > 0) {
|
| | | for (OrderRankingVO vo: list) {
|
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(vo.getUid());
|
| | | vo.setNickName(user.getNickName());
|
| | | vo.setPortrait(user.getPortrait());
|
| | | }
|
| | | }
|
| | | |
| | | JSONObject json = new JSONObject();
|
| | | json.put("list", list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(json));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|