| | |
| | | import com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserLotteryRecord;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.exception.user.UserLotteryRecordException;
|
| | | import com.yeshi.fanli.exception.user.UserSystemCouponException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserLotteryRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponRecordVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponVO;
|
| | |
| | | @Resource
|
| | | private UserLotteryRecordService userLotteryRecordService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | |
|
| | | /**
|
| | | * 用户券列表查询
|
| | |
| | | // 福利中心图片
|
| | | String topPicture = null;
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> listswiper = swiperPictureService.getByBannerCard("welfare_top");
|
| | | List<SwiperPicture> listswiper = swiperPictureService.getByBannerCardAndVersion("welfare_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (listswiper != null && listswiper.size() > 0) {
|
| | | topPicture = listswiper.get(0).getSrc();
|
| | | }
|
| | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | // 未读券是否大于0
|
| | | if (userInfoExtra != null && userInfoExtra.getCouponNews() > 0) {
|
| | | userInfoExtra.setCouponNews(0);
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(userInfoExtra);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setCouponNews(0);
|
| | | userInfoExtraService.updateByPrimaryKeySelective(extra);
|
| | | }
|
| | |
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | JSONObject dataTip = new JSONObject();
|
| | | dataTip.put("content", configService.get("free_coupon_tip"));
|
| | | dataTip.put("content", configService.get(ConfigKeyEnum.freeCouponTip.getKey()));
|
| | | dataTip.put("fontColor", "#F14242");
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("helpLink", configService.get("free_coupon_help"));
|
| | | data.put("helpLink", configService.get(ConfigKeyEnum.freeCouponHelp.getKey()));
|
| | | data.put("tip", dataTip);
|
| | | data.put("count", resultList.size());
|
| | | data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
|
| | |
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("helpLink", configService.get("reward_coupon_help"));
|
| | | data.put("helpLink", configService.get(ConfigKeyEnum.rewardCouponHelp.getKey()));
|
| | | data.put("count", resultList.size());
|
| | | data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (userVIPInfoService.isVIP(uid)) {
|
| | | out.print(JsonUtil.loadFalseResult("超级会员不可使用奖励券"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (goodsType == null || goodsType > 3 || goodsType < 1) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | |
|
| | | try {
|
| | | UserSystemCouponService.useOrderCoupon(uid, cid, orderNo, goodsType);
|
| | | JSONObject data = commonOrderService.getRewardJumpInfo(orderNo);
|
| | | UserSystemCouponService.useOrderCoupon(uid, cid, orderNo, goodsType, acceptData);
|
| | | JSONObject data = commonOrderService.getRewardJumpInfo(orderNo, goodsType);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserSystemCouponException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getLotteryCount")
|
| | | // @RequestMapping(value = "getLotteryCount")
|
| | | public void getLotteryCount(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | // 1、已登录系统
|
| | |
| | | count = count - list.size();
|
| | | }
|
| | | // 抽奖规则
|
| | | String lotteryRule = configService.get("lottery_rule_newbies");
|
| | | String lotteryRule = configService.get(ConfigKeyEnum.lotteryRuleNewbies.getKey());
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getLotteryResult")
|
| | | // @RequestMapping(value = "getLotteryResult")
|
| | | public void getLotteryResult(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getDailyCount")
|
| | | // @RequestMapping(value = "getDailyCount")
|
| | | public void getDailyCount(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(userLotteryRecordService.getLotteryCountDaily(uid)));
|
| | |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getDailyResult")
|
| | | // @RequestMapping(value = "getDailyResult")
|
| | | public void getDailyResult(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(userLotteryRecordService.executeLotteryDaily(uid)));
|