| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackBalance;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackExchange;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackWinInvite.RedPackWinInviteTypeEnum;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackExchangeException;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | |
| | | import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackExchangeService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackForbidService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackWinInviteService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackWinNewUserService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | |
| | | @Resource
|
| | | private RedPackForbidService redPackForbidService;
|
| | |
|
| | | /**
|
| | | * 统计
|
| | |
| | | BigDecimal yesterdayUse = zero;
|
| | | BigDecimal thisMonthUse = zero;
|
| | | BigDecimal lastMonthUse = zero;
|
| | | BigDecimal balance = null;
|
| | | try {
|
| | | balance = redPackBalanceService.getBalance(uid);
|
| | | } catch (RedPackBalanceException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | return;
|
| | | }
|
| | | |
| | | BigDecimal balance = redPackBalanceService.getBalance(uid);;
|
| | | if (balance == null) {
|
| | | balance = zero;
|
| | | } else {
|
| | |
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | try {
|
| | | data.put("balance", redPackBalanceService.getBalance(uid));
|
| | | } catch (RedPackBalanceException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | return;
|
| | | }
|
| | | data.put("balance", redPackBalanceService.getBalance(uid));
|
| | | data.put("ruleLink", redPackConfigService.getValueByKey("invite_reward_rule_link"));
|
| | | data.put("shareLink", UserInviteUtil.getShareUrl(uid));
|
| | |
|
| | | RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
|
| | | if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) {
|
| | | data.put("redPackLock", true);
|
| | | } else {
|
| | | data.put("redPackLock", false);
|
| | | }
|
| | | data.put("redPackLock", redPackForbidService.verifyForbid(uid));
|
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | |
| | | } else {
|
| | | data.put("inviteCode", "");
|
| | | }
|
| | | |
| | | //
|
| | | long freeCouponCount= userSystemCouponService.countUsableFreeCouponForBuy(uid);
|
| | | long rewardCouponCount= userSystemCouponService.countUsableRewardCoupon(uid);
|
| | | |
| | | data.put("freeCouponCount", freeCouponCount);
|
| | | data.put("rewardCouponCount", rewardCouponCount);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|