| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.DeviceLotteryRecordService;
|
| | |
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | // 最大抽奖次数
|
| | | private static int MAX_COUNT = 5;
|
| | |
| | | if (hasPrize.equals(prize)) {
|
| | | prize = null;
|
| | | } else {
|
| | | |
| | | SystemCoupon coupon= systemCouponService.getCouponByType(prize);
|
| | | |
| | | String endDay = DateUtil.plusDay(coupon.getExpiryDay(), new Date());
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
| | | Date endTime = format.parse(endDay);
|
| | | |
| | | int stateActivated = 1;
|
| | | if (coupon.getType() == CouponTypeEnum.welfareFreeCoupon) {
|
| | | stateActivated = 0;
|
| | | }
|
| | | |
| | | UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | userCoupon.setUid(uid);
|
| | | userCoupon.setSource(UserSystemCoupon.SOURCE_CHOUJIANG);
|
| | | userCoupon.setSystemCoupon(coupon);
|
| | | userCoupon.setState(UserSystemCoupon.STATE_CAN_USE);
|
| | | userCoupon.setStateActivated(stateActivated);
|
| | | userCoupon.setStartTime(new Date());
|
| | | userCoupon.setEndTime(endTime);
|
| | | userCoupon.setCreateTime(new Date());
|
| | | userCoupon.setUpdateTime(new Date());
|
| | | userSystemCouponService.insertSelective(userCoupon);
|
| | | // 插入券信息
|
| | | userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_CHOUJIANG);
|
| | | }
|
| | | }
|
| | |
|