class MemberCouponExecute implements OrderStatusChangeEvent, AfterSaleStatusChangeEvent {

    /**
     * 订单
     */
    @Autowired
    private OrderService orderService;

    @Autowired
    private MemberCouponService memberCouponService;

    @Override
    public void orderChange(OrderMessage orderMessage) {<FILL_FUNCTION_BODY>}


    @Override
    public void afterSaleStatusChange(AfterSale afterSale) {
        // 售后完成返还优惠券
        if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) {
            this.refundCoupon(afterSale.getOrderSn());
        }
    }

    /**
     * 退款返还优惠券
     * @param orderSn 订单编号
     */
    private void refundCoupon(String orderSn) {
        Order order = orderService.getBySn(orderSn);
        if (CharSequenceUtil.isNotEmpty(order.getUseStoreMemberCouponIds())) {
            memberCouponService.recoveryMemberCoupon(ListUtil.toList(order.getUseStoreMemberCouponIds().split(",")));
        }
        if (CharSequenceUtil.isNotEmpty(order.getUsePlatformMemberCouponId())) {
            memberCouponService.recoveryMemberCoupon(ListUtil.toList(order.getUsePlatformMemberCouponId().split(",")));
        }
    }
}

        // 订单取消返还优惠券
        if (orderMessage.getNewStatus() == OrderStatusEnum.CANCELLED) {
            this.refundCoupon(orderMessage.getOrderSn());
        }
    
<no_super_class>