| | |
| | | @Autowired |
| | | private GoodsorderMapper goodsorderMapper; |
| | | @Autowired |
| | | private NoticeMapper noticeMapper; |
| | | @Autowired |
| | | private ShopMapper shopMapper; |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | |
| | | param.setDealType(Constants.ZERO); |
| | | param.setIntegralNum(integral); |
| | | param.setIntegralObjType(Constants.IntegralObjType.AFTERSALE_BACK); |
| | | integralService.dealIntegral(param); |
| | | integralService.dealIntegral(param,null); |
| | | } |
| | | |
| | | private void isBackMoneyValid(BigDecimal actmoney, BigDecimal perPrice, Integer goodsNum, BigDecimal orderPrice,BigDecimal orderIntegral, BigDecimal orderCouponPrice) { |
| | |
| | | aftersale.setCode(getNextInCode()); |
| | | |
| | | //订单退回返回给经销商的积分 |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())&&goodsorder.getReturnCustomerIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())){ |
| | | Shop shop = shopMapper.selectById(goodsorder.getDistributionShopId()); |
| | | //经销商存在剩余积分 |
| | | if(Objects.nonNull(shop)&&shop.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER_REFUND_INTEGRAL); |
| | | integralService.dealShopIntegral(dealIntegralRequest); |
| | | integralService.dealShopIntegral(dealIntegralRequest,null); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //订单退回 经销商结算余额 |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())&&goodsorder.getShopSettlement().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())){ |
| | | Shop shop = shopMapper.selectById(goodsorder.getDistributionShopId()); |
| | | //经销商存在剩余积分 |
| | | if(Objects.nonNull(shop)&&shop.getAmount().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | |
| | | } |
| | | |
| | | //订单退回 返还给客户的积分 |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())&&goodsorder.getReturnMemberIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())){ |
| | | Member member = memberMapper.selectById(goodsorder.getMemberId()); |
| | | //客户存在剩余积分 |
| | | if(Objects.nonNull(member)&&member.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.MEMBER_ORDER_REFUND_RETURN); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | integralService.dealIntegral(dealIntegralRequest,null); |
| | | } |
| | | } |
| | | } |
| | |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.MEMBER_ORDER_REFUND); |
| | | dealIntegralRequest.setParam1(goodsorder.getCode().toString()); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | integralService.dealIntegral(dealIntegralRequest,null); |
| | | } |
| | | |
| | | //订单退款 退回客户使用的优惠券 |
| | |
| | | .eq(Goodsorder::getId, goodsorder.getId()) |
| | | ); |
| | | |
| | | //释放核销码 |
| | | if(Constants.equalsInteger(goodsorder.getReceiveType(),Constants.ONE)&&StringUtils.isNotBlank(goodsorder.getExchangeCode())){ |
| | | RedisUtil.deleteObject(redisTemplate,Constants.RedisKeys.EXCHANGE_KEY+goodsorder.getExchangeCode()); |
| | | } |
| | | |
| | | |
| | | //发送订单退款站内信 |
| | | Notice notice = Notice.getNotice( |
| | | Constants.NoticeType.NOTICE_ORDER_REFUND, |
| | | goodsorder.getMemberId(), |
| | | goodsorder.getId() |
| | | ); |
| | | notice.setContent(notice.getContent().replace("{param}",goodsorder.getCode().toString())); |
| | | noticeMapper.insert(notice); |
| | | |
| | | |
| | | } |
| | | |
| | | |