package com.dxhy.manage.thread;

import com.dxhy.common.utils.SpringContextUtils;
import com.dxhy.manage.entity.SysDeptEntity;
import com.dxhy.manage.model.BlocDataModel;
import com.dxhy.manage.service.SellersStatService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author futianhao
 */

@Component
@Slf4j
public class BlocThread {

    public SysDeptEntity sysDeptEntity;
    public Map<String, String> params;

    @Autowired
    private SellersStatService sellersStatService;

    public BlocThread(SysDeptEntity sysDeptEntity, Map<String, String> params) {
        this.sysDeptEntity = sysDeptEntity;
        this.params = params;
    }

    public BlocThread() {}

    public BlocDataModel start() {
        sellersStatService = (SellersStatService)SpringContextUtils.getBean("sellersStatService");
        return sellersStatService.getBlocData(sysDeptEntity, params);
    }
}
