package com.hzya.frame.plugin.cinvoice.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportBDao;
import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity;
import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportBService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description 发票批量导入有度税务 表体service
 * @Author xiangerlin
 * @Date 2025/4/18 15:39
 **/
@Service()
public class CInvoiceImportBServiceImpl extends BaseService<CInvoiceImportBEntity, String> implements ICInvoiceImportBService {
    Logger logger = LogManager.getLogger(getClass());

    private ICInvoiceImportBDao cInvoiceImportBDao;

    @Autowired
    public void setcInvoiceImportBDao(ICInvoiceImportBDao dao) {
        this.cInvoiceImportBDao = dao;
        this.dao = dao;
    }

    /***
     * 查询子表数据
     * @param entity
     * @return
     */
    @DS("#entity.dataSourceCode")
    @Override
    public List<CInvoiceImportBEntity> queryInvoiceDetails(CInvoiceImportBEntity entity) throws Exception {
        List<CInvoiceImportBEntity> list = cInvoiceImportBDao.queryList(entity, "com.hzya.frame.plugin.cinvoice.dao.impl.CInvoiceImportBDaoImpl.entity_list_base");
        return list;
    }
}
