| | |
| | | import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TokenUtil;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOtherSystemGiveDTOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | |
| | | @Resource
|
| | | private TokenRecordService tokenRecordService;
|
| | |
|
| | | |
| | | @Override
|
| | | public int insertSelective(UserSystemCoupon record) {
|
| | | return userSystemCouponMapper.insertSelective(record);
|
| | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public UserSystemCoupon insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent)
|
| | | throws UserSystemCouponException, Exception {
|
| | | public UserSystemCoupon insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent,
|
| | | Boolean needNotify) throws UserSystemCouponException, Exception {
|
| | |
|
| | | if (couponType == null || uid == null) {
|
| | | throw new UserSystemCouponException(1, "参数不正确");
|
| | | }
|
| | |
|
| | | SystemCoupon coupon = null;
|
| | | if (couponType.equals(CouponTypeEnum.welfareFreeCoupon.name()) || couponType.equals(CouponTypeEnum.freeCoupon.name())
|
| | | if (couponType.equals(CouponTypeEnum.welfareFreeCoupon.name())
|
| | | || couponType.equals(CouponTypeEnum.freeCoupon.name())
|
| | | | couponType.equals(CouponTypeEnum.freeCouponBuy.name())) {
|
| | | // 免单券
|
| | | coupon = systemCouponService.getCouponByType(couponType);
|
| | |
| | | });
|
| | |
|
| | | // 消息推送
|
| | | if (needNotify) {
|
| | | try {
|
| | | if (coupon.getType() == CouponTypeEnum.welfareFreeCoupon) {
|
| | | userOtherMsgNotificationService.welfareCouponGet(userCoupon);
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return listVO;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 是否存在奖励券
|
| | | *
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long countUsableFreeCouponForBuy (Long uid) {
|
| | | if (uid == null)
|
| | |
| | |
|
| | | return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public long countUsableRewardCoupon (Long uid) {
|
| | |
| | | return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
|
| | | }
|
| | |
|
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public void useGoodsCoupon(Long uid, Long id, Long goodId, Integer sourceType) throws UserSystemCouponException, Exception {
|
| | | public void useGoodsCoupon(Long uid, Long id, Long goodId, Integer sourceType)
|
| | | throws UserSystemCouponException, Exception {
|
| | | if (uid == null) {
|
| | | throw new UserSystemCouponException(1, "用户未登录");
|
| | | }
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void useOrderCoupon(Long uid, Long id, String orderNo, Integer sourceType) throws UserSystemCouponException, Exception {
|
| | | public void useOrderCoupon(Long uid, Long id, String orderNo, Integer sourceType)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
|
| | | if (id == null) {
|
| | | throw new UserSystemCouponException(1, "券id不存在");
|
| | |
| | | }
|
| | |
|
| | | // 订单
|
| | | CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(uid, orderNo, CommonOrder.STATE_JS, sourceType);
|
| | | CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(uid, orderNo, CommonOrder.STATE_JS,
|
| | | sourceType);
|
| | | if (orderVO == null) {
|
| | | throw new UserSystemCouponException(1, "订单信息获取失败");
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public UserSystemCouponRecordVO getRewardCouponRecord(String orderNo, Integer sourceType) throws UserSystemCouponException, Exception {
|
| | | public UserSystemCouponRecordVO getRewardCouponRecord(String orderNo, Integer sourceType)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
|
| | | if (orderNo == null || orderNo.trim().length() == 0) {
|
| | | throw new UserSystemCouponException(1, "订单号不存在");
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public UserSystemCouponRecordVO getFreeCouponRecord(String orderNo, Integer sourceType) throws UserSystemCouponException, Exception {
|
| | | public UserSystemCouponRecordVO getFreeCouponRecord(String orderNo, Integer sourceType)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
|
| | | if (orderNo == null || orderNo.trim().length() == 0) {
|
| | | throw new UserSystemCouponException(1, "订单号不存在");
|
| | |
| | | }
|
| | |
|
| | | // 订单
|
| | | CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(userSystemCoupon.getUid(), orderNo, null, sourceType);
|
| | | CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(userSystemCoupon.getUid(), orderNo, null,
|
| | | sourceType);
|
| | | if (orderVO == null) {
|
| | | throw new UserSystemCouponException(1, "订单信息获取失败");
|
| | | }
|
| | |
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())) {
|
| | | userOtherMsgNotificationService.freeSheetCouponUsed(record.getUserSystemCoupon(), orderNo);
|
| | | } else if (CouponTypeEnum.freeCouponBuy.name().equals(record.getCouponType())) {
|
| | | userOtherMsgNotificationService.couponUsedFreeSheet(record.getUserSystemCoupon(), orderNo, MsgTypeOtherTypeEnum.freeCouponBuy);
|
| | | userOtherMsgNotificationService.couponUsedFreeSheet(record.getUserSystemCoupon(), orderNo,
|
| | | MsgTypeOtherTypeEnum.freeCouponBuy);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public List<UserSystemCoupon> getCounponNowInvalid(int count) {
|
| | | return userSystemCouponMapper.getCounponNowInvalid(count);
|
| | | }
|
| | | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | |
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(couponType)) {
|
| | | userOtherMsgNotificationService.freeSheetCouponUsing(userSystemCoupon, orderNo, payment);
|
| | | } else if (CouponTypeEnum.freeCouponBuy.name().equals(couponType)) {
|
| | | userOtherMsgNotificationService.couponUsingFreeSheet(userSystemCoupon, orderNo, payment, MsgTypeOtherTypeEnum.freeCouponBuy);
|
| | | userOtherMsgNotificationService.couponUsingFreeSheet(userSystemCoupon, orderNo, payment,
|
| | | MsgTypeOtherTypeEnum.freeCouponBuy);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return isfree;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | * if (uid == null || device == null) { return; }
|
| | | *
|
| | | * // 未登陆之前抽奖记录 List<DeviceLotteryRecord> list =
|
| | | * deviceLotteryRecordService.listByPlatformAndDevice(platform, device); if
|
| | | * (list == null || list.size() == 0) { return; }
|
| | | * deviceLotteryRecordService.listByPlatformAndDevice(platform, device);
|
| | | * if (list == null || list.size() == 0) { return; }
|
| | | *
|
| | | * // 获取额外信息 UserInfoExtra userInfoExtra =
|
| | | * userInfoExtraService.getUserInfoExtra(uid);
|
| | |
| | | * for (DeviceLotteryRecord reviceLotteryRecord : list) {
|
| | | *
|
| | | * // 删除记录
|
| | | * deviceLotteryRecordService.deleteByPrimaryKey(reviceLotteryRecord.getId());
|
| | | * deviceLotteryRecordService.deleteByPrimaryKey(reviceLotteryRecord.
|
| | | * getId());
|
| | | *
|
| | | * Long systemCouponId = reviceLotteryRecord.getSystemCouponId(); if
|
| | | * (systemCouponId == null) { continue; } SystemCoupon systemCoupon =
|
| | | * systemCouponService.selectByPrimaryKey(systemCouponId); if (systemCoupon ==
|
| | | * null) { continue; }
|
| | | * systemCouponService.selectByPrimaryKey(systemCouponId); if
|
| | | * (systemCoupon == null) { continue; }
|
| | | *
|
| | | * int stateActivated = 1; if (systemCoupon.getType() ==
|
| | | * CouponTypeEnum.welfareFreeCoupon) { // 福利券状态 long countSuccess =
|
| | | * threeSaleSerivce.countSuccessFirstTeam(uid); // 没有下级队员 --待激活 if (countSuccess
|
| | | * == 0) { stateActivated = 0; } }
|
| | | * threeSaleSerivce.countSuccessFirstTeam(uid); // 没有下级队员 --待激活 if
|
| | | * (countSuccess == 0) { stateActivated = 0; } }
|
| | | *
|
| | | * // 结束日期 // 今天在内 减去一天 String endDay =
|
| | | * DateUtil.plusDay(systemCoupon.getExpiryDay() - 1, new Date());
|
| | | * SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if
|
| | | * (endDay != null && endDay.trim().length() > 0) { endDay += " 23:59:59"; }
|
| | | * Date endTime = format.parse(endDay);
|
| | | * SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"
|
| | | * ); if (endDay != null && endDay.trim().length() > 0) { endDay +=
|
| | | * " 23:59:59"; } Date endTime = format.parse(endDay);
|
| | | *
|
| | | * UserSystemCoupon userCoupon = new UserSystemCoupon(); userCoupon.setUid(uid);
|
| | | * UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | * userCoupon.setUid(uid);
|
| | | * userCoupon.setSource(UserSystemCoupon.SOURCE_NEWBIES);
|
| | | * userCoupon.setSystemCoupon(systemCoupon);
|
| | | * userCoupon.setState(UserSystemCoupon.STATE_CAN_USE);
|
| | | * userCoupon.setStateActivated(stateActivated); userCoupon.setStartTime(new
|
| | | * Date()); userCoupon.setEndTime(endTime); userCoupon.setCreateTime(new
|
| | | * Date()); userCoupon.setUpdateTime(new Date()); // 插入数据库
|
| | | * insertSelective(userCoupon);
|
| | | * userCoupon.setStateActivated(stateActivated);
|
| | | * userCoupon.setStartTime(new Date()); userCoupon.setEndTime(endTime);
|
| | | * userCoupon.setCreateTime(new Date()); userCoupon.setUpdateTime(new
|
| | | * Date()); // 插入数据库 insertSelective(userCoupon);
|
| | | *
|
| | | * // 券数量 coupon++;
|
| | | *
|
| | | * // 消息推送 try { if (systemCoupon.getType() == CouponTypeEnum.welfareFreeCoupon)
|
| | | * { userOtherMsgNotificationService.welfareCouponGet(userCoupon); } else if
|
| | | * (systemCoupon.getType() == CouponTypeEnum.freeCoupon) {
|
| | | * userOtherMsgNotificationService.freeSheetCouponGet(userCoupon); } else if
|
| | | * (systemCoupon.getType() == CouponTypeEnum.rebatePercentCoupon) {
|
| | | * // 消息推送 try { if (systemCoupon.getType() ==
|
| | | * CouponTypeEnum.welfareFreeCoupon) {
|
| | | * userOtherMsgNotificationService.welfareCouponGet(userCoupon); } else
|
| | | * if (systemCoupon.getType() == CouponTypeEnum.freeCoupon) {
|
| | | * userOtherMsgNotificationService.freeSheetCouponGet(userCoupon); }
|
| | | * else if (systemCoupon.getType() ==
|
| | | * CouponTypeEnum.rebatePercentCoupon) {
|
| | | * userOtherMsgNotificationService.rewardCouponGet(userCoupon,
|
| | | * systemCoupon.getPercent().intValue()); }
|
| | | *
|
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public void randomRewardCoupon(int num, Long uid, String source) throws Exception {
|
| | |
| | | // 返利比-随机
|
| | | BigDecimal percent = new BigDecimal(randomNum());
|
| | | // 查询奖励券
|
| | | SystemCoupon systemCoupon = systemCouponService.getCouponByTypeAndPercent(
|
| | | CouponTypeEnum.rebatePercentCoupon.name(),percent);
|
| | | SystemCoupon systemCoupon = systemCouponService
|
| | | .getCouponByTypeAndPercent(CouponTypeEnum.rebatePercentCoupon.name(), percent);
|
| | | if (systemCoupon == null) {
|
| | | return;
|
| | | }
|
| | |
| | | userInfoExtraService.saveUserInfoExtra(userInfoExtra);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void systemGiveRewardCoupon(Long uid, int num, String orderId, Integer orderType, String reason)
|
| | | throws Exception {
|
| | | // 添加奖励券
|
| | | insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(), "系统赠送",
|
| | | new BigDecimal(configService.get("exchange_rebate_percent")),false);
|
| | | // 添加奖励券消息
|
| | | userOtherMsgNotificationService.systemGiveRewardCoupon(uid, null, MsgOtherSystemGiveDTOFactory
|
| | | .createRewardCouponGive(num, "请按照返利奖励券规则使用", "返利奖励券", orderId, orderType, reason));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 随机券比例
|
| | | * |
| | | * @return
|
| | | */
|
| | | public int randomNum() {
|
| | |
| | | public int num;//券值
|
| | | public int probability; // 概率
|
| | |
|
| | | RandomProportion () {}
|
| | | RandomProportion() {
|
| | | }
|
| | |
|
| | | RandomProportion (int num, int probability) {
|
| | | this.num = num;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent) throws UserSystemCouponException, Exception {
|
| | | public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent)
|
| | | throws UserSystemCouponException, Exception {
|
| | | if (couponType == null || uid == null) {
|
| | | throw new UserSystemCouponException(1, "参数不正确");
|
| | | }
|
| | |
| | | int stateActivated = 1;
|
| | | if (couponType == CouponTypeEnum.freeCoupon.name()) {
|
| | | stateActivated = 0; //
|
| | | } else if (couponType == CouponTypeEnum.welfareFreeCoupon.name() && threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
|
| | | } else if (couponType == CouponTypeEnum.welfareFreeCoupon.name()
|
| | | && threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
|
| | | stateActivated = 0; // 无下级队员 --待激活
|
| | | }
|
| | | |
| | |
|
| | | Integer expiryDay = null;
|
| | | if (stateActivated == 0)
|
| | |
| | |
|
| | | if (expiryDay == null || expiryDay == 0)
|
| | | expiryDay = coupon.getExpiryDay();
|
| | | |
| | |
|
| | | // 计算结束日期:今天在内 减去一天
|
| | | String endDay = DateUtil.plusDay(expiryDay - 1, new Date());
|
| | |
| | | insertSelective(userCoupon);
|
| | | }
|
| | |
|
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getCouponList(long start, int count, Long uid)
|
| | |
| | |
|
| | | // 赠送的退回
|
| | | sendBackGiveUser(uid);
|
| | | |
| | |
|
| | | List<UserSystemCouponVO> listVO = userSystemCouponMapper.getUserCouponVOList(start, count, uid);
|
| | | if (listVO == null || listVO.size() == 0) {
|
| | |
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(tips) && tokenType != null) {
|
| | | UserSystemCouponGiveRecord record = userSystemCouponGiveRecordService.getRecordByUidAndCouponId(uid, userCouponVO.getId());
|
| | | UserSystemCouponGiveRecord record = userSystemCouponGiveRecordService.getRecordByUidAndCouponId(uid,
|
| | | userCouponVO.getId());
|
| | | if (record != null) {
|
| | | TokenRecord tokenRecord = tokenRecordService.getNearByTypeAndIdentify(tokenType.name(), record.getId().toString());
|
| | | TokenRecord tokenRecord = tokenRecordService.getNearByTypeAndIdentify(tokenType.name(),
|
| | | record.getId().toString());
|
| | | if (tokenRecord != null && !StringUtil.isNullOrEmpty(tokenRecord.getToken())) {
|
| | | String projectChineseName = Constant.systemCommonConfig.getProjectChineseName();
|
| | | while(tips.contains("{APP名称}")) {
|
| | | tips = tips.replace("{APP名称}", projectChineseName);
|
| | | }
|
| | | tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}", configService.get("app_down_link"));
|
| | | tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}",
|
| | | configService.get("app_down_link"));
|
| | | userCouponVO.setGiveTips(tips);
|
| | | }
|
| | |
|
| | |
| | | return listVO;
|
| | | }
|
| | |
|
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public UserSystemCouponVO giveCoupon(Long uid, Long id) throws UserSystemCouponException {
|
| | |
| | | if (StringUtil.isNullOrEmpty(tips))
|
| | | throw new UserSystemCouponException(1, "tips数据缺失");
|
| | |
|
| | | |
| | | // 是否最近生成口令有效
|
| | | UserSystemCouponGiveRecord record = userSystemCouponGiveRecordService.getRecordByUidAndCouponId(uid, id);
|
| | | if (record != null) {
|
| | |
| | | while(tips.contains("{APP名称}")) {
|
| | | tips = tips.replace("{APP名称}", projectChineseName);
|
| | | }
|
| | | tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}", configService.get("app_down_link"));
|
| | | tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}",
|
| | | configService.get("app_down_link"));
|
| | |
|
| | | return createUserCouponVOo(userSystemCoupon, systemCoupon, record, tips);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | Date nowDate = new Date();
|
| | | // 插入赠送记录
|
| | |
| | | return createUserCouponVOo(userSystemCoupon, systemCoupon, giveRecord, tips);
|
| | | }
|
| | |
|
| | | |
| | | private UserSystemCouponVO createUserCouponVOo(UserSystemCoupon userSystemCoupon, SystemCoupon systemCoupon,
|
| | | UserSystemCouponGiveRecord record, String tips) {
|
| | | UserSystemCouponVO userCouponVO = new UserSystemCouponVO();
|
| | |
| | | return userCouponVO;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 免单券激活
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public void freeCouponActivate(Long id,Long uid, Date date) {
|
| | |
| | | if (endTime2 != null && endTime2.getTime() <= nowDate.getTime())
|
| | | return;
|
| | |
|
| | | |
| | | SystemCoupon systemCoupon = coupon.getSystemCoupon();
|
| | | if (systemCoupon == null)
|
| | | return;
|
| | |
| | | systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
|
| | | if (systemCoupon == null || systemCoupon.getType() != CouponTypeEnum.freeCoupon)
|
| | | return;
|
| | | |
| | |
|
| | | try {
|
| | | Integer expiryDay = systemCoupon.getExpiryDay();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public void updateInvalidSate(Long uid) {
|
| | |
| | | }
|
| | | updateCounponInvalid(list);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void updateCounponInvalid(List<UserSystemCoupon> list) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 退回券 初始数据
|
| | | *
|
| | |
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())) {
|
| | | userOtherMsgNotificationService.freeSheetCouponDrawBack(userSystemCoupon, record.getOrderNo());
|
| | | } else if (CouponTypeEnum.freeCouponBuy.name().equals(record.getCouponType())) {
|
| | | userOtherMsgNotificationService.couponDrawBack(userSystemCoupon, record.getOrderNo(), MsgTypeOtherTypeEnum.freeCouponBuy);
|
| | | userOtherMsgNotificationService.couponDrawBack(userSystemCoupon, record.getOrderNo(),
|
| | | MsgTypeOtherTypeEnum.freeCouponBuy);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Async()
|
| | | @Transactional
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | |
| | | if (systemCoupon == null)
|
| | | continue;
|
| | |
|
| | | |
| | | // 退回消息
|
| | | String couponName = systemCoupon.getName();
|
| | | if (CouponTypeEnum.freeCouponGive == systemCoupon.getType()) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public boolean getIncludeExchange(Long uid) {
|
| | | // 过期券
|
| | |
| | | String percent = configService.get("exchange_rebate_percent");
|
| | | if (StringUtil.isNullOrEmpty(percent))
|
| | | percent = "35";
|
| | | List<UserSystemCoupon> listCoupon = userSystemCouponMapper.getIncludeExchange(uid, Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
|
| | | List<UserSystemCoupon> listCoupon = userSystemCouponMapper.getIncludeExchange(uid, Integer.parseInt(percent),
|
| | | CouponTypeEnum.rebatePercentCoupon.name());
|
| | | if (listCoupon == null || listCoupon.size() == 0)
|
| | | return false;
|
| | | return true;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public boolean getIncludeNotExchange(Long uid) {
|
| | |
| | | String percent = configService.get("exchange_rebate_percent");
|
| | | if (StringUtil.isNullOrEmpty(percent))
|
| | | percent = "35";
|
| | | List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid, Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
|
| | | List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid,
|
| | | Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
|
| | | if (listCoupon == null || listCoupon.size() == 0)
|
| | | return false;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<UserSystemCouponVO> listIncludeNotExchange(Long uid) throws Exception{
|
| | |
| | | if (StringUtil.isNullOrEmpty(percent))
|
| | | percent = "35";
|
| | |
|
| | | List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid, Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
|
| | | List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid,
|
| | | Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
|
| | | if (listCoupon == null || listCoupon.size() == 0)
|
| | | return null;
|
| | |
|
| | |
| | | return listCoupon;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<UserSystemCoupon> getFreeCouponByType(Long uid, String type) {
|
| | | return userSystemCouponMapper.getFreeCouponByType(uid, type);
|
| | | }
|
| | |
|
| | | }
|