package com.dxhy.core.job.thread;

import com.dxhy.common.utils.SpringContextUtils;
import com.dxhy.core.job.service.PoolPushService;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.util.List;

/**
* @Description 票池推送业务
* @Author wangruwei
* @Date 2024/10/29 10:59
**/
@Slf4j
public class PoolPushHandle extends Thread {
    @Resource
    private PoolPushService poolPushService;


    private final List<String> uuids;

    private final String sjlx;

    private final String bglx;

    /**
     * 是否全量标志，true，推送底账pool_push未0的，false，推送pool_log表的增量数据
     **/
    private final boolean isRecordFlag;

    /**
     * 入参，执行接口方法
     *
     * @param uuids
     */
    public PoolPushHandle(List<String> uuids,String sjlx,String bglx,boolean isRecordFlag) {
        this.uuids = uuids;
        this.sjlx = sjlx;
        this.bglx = bglx;
        this.isRecordFlag = isRecordFlag;
    }

    @Override
    public void run() {
        poolPushService = (PoolPushService)SpringContextUtils.getBean("PoolPushService");
        try {
            poolPushService.pushDataToPool(uuids,sjlx,bglx,isRecordFlag);
        } catch (Exception e) {
           log.info("业务处理异常：{}", e);
        }
    }

}
