| | |
| | | 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;
|
| | | import com.yeshi.fanli.util.UserInviteUtil;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackDetailVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackWinDetailVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackWinInviteVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedPackWinInviteService redPackWinInviteService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private RedPackWinNewUserService redPackWinNewUserService;
|
| | |
|
| | | @Resource
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | |
| | | @Resource
|
| | | private RedPackForbidService redPackForbidService;
|
| | |
|
| | | /**
|
| | | * 统计
|
| | |
| | | BigDecimal yesterdayUse = zero;
|
| | | BigDecimal thisMonthUse = zero;
|
| | | BigDecimal lastMonthUse = zero;
|
| | | BigDecimal balance = redPackBalanceService.getBalance(uid);
|
| | | BigDecimal balance = redPackBalanceService.getBalance(uid);;
|
| | | if (balance == null) {
|
| | | balance = zero;
|
| | | } else {
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("balance", redPackBalanceService.getBalance(uid));
|
| | | data.put("ruleLink", redPackConfigService.getValueByKey("invite_reward_rule_link"));
|
| | | data.put("shareLink", UserInviteUtil.getShareUrl(uid));
|
| | | data.put("redPackLock", redPackForbidService.verifyForbid(uid));
|
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | data.put("inviteCode", 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)));
|
| | | } else
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 新人红包详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | RedPackWinDetailVO winDetail = redPackWinNewUserService.receiveReward(uid);
|
| | | if (winDetail == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "红包已被抢光"));
|
| | | return;
|
| | | }
|
| | | |
| | | winDetail.setLogo(Constant.systemCommonConfig.getDefaultPortrait());
|
| | | winDetail.setLogoLight(Constant.systemCommonConfig.getDefaultPortrait());
|
| | |
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", redPackConfigService.getValueByKey("goods_shop_link_h5"));
|
| | | winDetail.setParams(params.toString());
|
| | |
| | | winDetail.setTips(redPackConfigService.getValueByKey("new_user_win_tips"));
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCard("index_top");
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCard("redpack_win_detail_banner");
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("detail", JsonUtil.getApiCommonGson().toJson(winDetail));
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "红包已被抢光啦"));
|
| | | }
|