package com.bohuikeji.delivery.backstage.listener.pay;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.bohuikeji.delivery.backstage.entity.TOrderArrears;
import com.bohuikeji.delivery.backstage.service.ITOrderArrearsService;
import com.bohuikeji.frame.module.admin.base.MqListener;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 第三方补充支付成功处理
 * @author sjh
 */
@Service
@Slf4j
@RequiredArgsConstructor
public class TpsPayListener extends MqListener<String> {
    final ITOrderArrearsService arrearsService;
    @Override
    public boolean onReceive(String msg) {
        arrearsService.update(new UpdateWrapper<TOrderArrears>().eq("order_num",msg).set("arrears_status","结清"));
        return true;
    }

    @Override
    public void onError(String msg, Exception e) {

    }
}
