class OrderStatusHandlerExecute implements TradeEvent, AfterSaleStatusChangeEvent {


    @Autowired
    private TradeService tradeService;
    @Autowired
    private OrderItemService orderItemService;
    @Autowired
    private OrderService orderService;

    @Override
    public void orderCreate(TradeDTO tradeDTO) {
        //如果订单需要支付金额为0，则将订单步入到下一个流程
        if (tradeDTO.getPriceDetailDTO().getFlowPrice() <= 0) {
            tradeService.payTrade(tradeDTO.getSn(), PaymentMethodEnum.BANK_TRANSFER.name(), "-1");
        }

    }

    @Override
    public void afterSaleStatusChange(AfterSale afterSale) {<FILL_FUNCTION_BODY>}
}

        Order order = orderService.getBySn(afterSale.getOrderSn());
        OrderItem orderItem = orderItemService.getBySn(afterSale.getOrderItemSn());

        if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) {
            if (orderItem.getReturnGoodsNumber().equals(orderItem.getNum())) {
                orderItem.setIsRefund(RefundStatusEnum.ALL_REFUND.name());
            } else {
                orderItem.setIsRefund(RefundStatusEnum.PART_REFUND.name());
            }
            orderItem.setRefundPrice(CurrencyUtil.add(afterSale.getActualRefundPrice(), orderItem.getRefundPrice()));
            orderItemService.updateByAfterSale(orderItem);

            //循环订单货物，判断是否已经全部售后
            List<OrderItem> orderItems = orderItemService.getByOrderSn(afterSale.getOrderSn());
            // 总退货数量
            int returnCount = 0;
            // 总购买数量
            int deliverCount = 0;
            for (OrderItem item : orderItems) {
                returnCount += item.getReturnGoodsNumber();
                deliverCount += item.getNum();
            }
            if (returnCount == deliverCount) {
                orderService.systemCancel(afterSale.getOrderSn(),"订单货物全部退款",false);
            }

        }
    
<no_super_class>