| | |
| | | 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;
|
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private TeamEincomeRecordService teamEincomeRecordService;
|
| | | |
| | | @Resource
|
| | | private PreviewInfoService previewInfoService;
|
| | | |
| | |
|
| | | private Gson getGson() {
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | |
| | | 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();
|
| | |
| | | .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) {
|
| | |
| | | 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));
|
| | | }
|