| | |
| | | if (hongBao.getState() == HongBaoV2.STATE_SHIXIAO) {
|
| | | if (mianDan) {
|
| | | try {
|
| | | userSystemCouponService.updateStateByDrawback(commonOrder.getOrderNo());
|
| | | userSystemCouponService.updateStateByDrawback(commonOrder.getOrderNo(),commonOrder.getSourceType());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | throw new HongBaoException(12, "免单券退款出错");
|
| | |
| | | if (goods != null) {
|
| | | try {
|
| | | if (userSystemCouponService.updateCouponRecordUsed(commonOrder.getUserInfo().getId(),
|
| | | commonOrder.getOrderNo(), payMent, Long.parseLong(goods.getGoodsId())))
|
| | | commonOrder.getOrderNo(), payMent, Long.parseLong(goods.getGoodsId()),commonOrder.getSourceType()))
|
| | | mianDanMoney = payMent;
|
| | | } catch (NumberFormatException e) {
|
| | | throw new HongBaoException(10, "免单商品处理出错");
|
| | |
| | | } else if (commonOrder.getState() == CommonOrder.STATE_SX) {// 设置免单券失效
|
| | | commonOrder.setPayment(new BigDecimal(0));// 订单失效后的付款金额设置为0
|
| | | try {
|
| | | userSystemCouponService.updateStateByDrawback(commonOrder.getOrderNo());
|
| | | userSystemCouponService.updateStateByDrawback(commonOrder.getOrderNo(),commonOrder.getSourceType());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
|
| | | commonOrder.getCreateTime().getTime());
|
| | |
|
| | | UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
|
| | |
|
| | | // 判断订单分享活动是否开启
|
| | | if ("1".equalsIgnoreCase(configService.get(ConfigKeyEnum.shareGoodsActivityOpen.getKey()))) {
|
| | | if ("1".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.shareGoodsActivityOpen.getKey(),user.getSystem()))) {
|
| | | // 没有订单,并且是渠道ID来的,并且
|
| | | UserExtraTaoBaoInfo taoBaoExtraInfo = userExtraTaoBaoInfoService
|
| | | .getByUid(commonOrder.getUserInfo().getId());
|
| | |
| | | hongBao.setPreGetTime(new Date(TimeUtil.convertToTimeTemp(
|
| | | calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-25", "yyyy-M-dd")));
|
| | | }
|
| | | UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
|
| | |
|
| | | if (user == null)
|
| | | throw new UserAccountException(1001, "用户不存在/被封禁");
|
| | | hongBao.setUrank(user.getRank());
|
| | |
| | | return hongBaoV2Mapper.listByOrderTradeId(tradeId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Integer getDirectBossUrankByPid(Long pid) {
|
| | | return hongBaoV2Mapper.getDirectBossUrankByPid(pid);
|
| | | }
|
| | |
|
| | | |
| | | }
|