| | |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserLevelManager userLevelManager;
|
| | |
|
| | | /**
|
| | | * 添加红包信息
|
| | |
| | | UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
|
| | | if (user == null)
|
| | | throw new UserAccountException(1001, "用户不存在/被封禁");
|
| | | if (isVIP) {
|
| | | hongBao.setUrank(HongBaoV2.RANK_VIP);// VIP的等级设置为100
|
| | | } else {
|
| | | UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(),
|
| | | commonOrder.getThirdCreateTime());
|
| | | if (userLevel != null)
|
| | | hongBao.setUrank(userLevel.getOrderRank());
|
| | | else {
|
| | | hongBao.setUrank(user.getRank());
|
| | | }
|
| | | hongBao.setOrderType(commonOrder.getSourceType());
|
| | |
| | | UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
|
| | | if (user == null)
|
| | | throw new UserAccountException(1001, "用户不存在/被封禁");
|
| | | if (isVip)
|
| | | hongBao.setUrank(HongBaoV2.RANK_VIP);
|
| | | UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(),
|
| | | commonOrder.getThirdCreateTime());
|
| | | if (userLevel != null)
|
| | | hongBao.setUrank(userLevel.getOrderRank());
|
| | | else
|
| | | hongBao.setUrank(user.getRank());
|
| | | hongBao.setUserInfo(user);
|