| | |
| | | }
|
| | |
|
| | | BigDecimal hongBao = orderVO.getHongBao();
|
| | | |
| | | // 红包状态
|
| | | Integer hongBaoState = orderVO.getHongBaoState();
|
| | | // 红包类型
|
| | |
| | | if (order == null)
|
| | | throw new UserSystemCouponException(1, "该订单不存在");
|
| | |
|
| | | // 使用奖励券 金额额限制
|
| | | if (hongBao.compareTo(Constant.REWARD_COUPON_LIMIT_MONEY) > 0){
|
| | | throw new UserSystemCouponException(1, "该订单不能使用奖励券");
|
| | | }
|
| | | |
| | | /* 奖金计算 以及相关红包信息处理 */
|
| | |
|
| | | // 转换成小数点
|
| | |
| | | couponRecord.setUpdateTime(date);
|
| | | userSystemCouponRecordService.insertSelective(couponRecord);
|
| | |
|
| | | // 消息推送
|
| | | int goodsCount = 0;
|
| | | String orderId = order.getOrderId();
|
| | | Integer orderType = order.getOrderType();
|
| | | List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(orderType, orderId);
|
| | | if (orderList != null && orderList.size() > 0) {
|
| | | for (CommonOrder co : orderList) {
|
| | | goodsCount += co.getCount();
|
| | | }
|
| | | }
|
| | | |
| | | // 资金消息
|
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | userMoneyMsgNotificationService.rewardCounponReceived(uid, orderId, orderType, goodsCount,
|
| | | money, userInfo.getMyHongBao(), order.getThirdCreateTime());
|
| | | |
| | | // 券使用成功消息
|
| | | try {
|
| | | userOtherMsgNotificationService.rewardCouponEndMsg(uid, userSystemCoupon.getSource(), 1, "使用成功");
|
| | | } catch (Exception e) {
|
| | |
| | | if (couponType == CouponTypeEnum.freeCoupon.name()) {
|
| | | stateActivated = 0; //
|
| | | } else if (couponType == CouponTypeEnum.welfareFreeCoupon.name()
|
| | | && threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
|
| | | && threeSaleSerivce.countFirstTeam(uid) <= 0) {
|
| | | stateActivated = 0; // 无下级队员 --待激活
|
| | | }
|
| | |
|