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

import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.contract.dao.IContractAuditDao;
import com.hzya.frame.plugin.contract.entity.ContractAuditEntity;
import com.hzya.frame.plugin.contract.service.IContractAuditService;
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 合同评审
 * @Author xiangerlin
 * @Date 2025/3/31 11:16
 **/
@Service()
public class ContractAuditServiceImpl extends BaseService<ContractAuditEntity,String> implements IContractAuditService {

    Logger logger = LogManager.getLogger(getClass());

    private IContractAuditDao contractAuditDao;

    @Autowired
    public void setContractAuditDao(IContractAuditDao dao) {
        this.contractAuditDao = dao;
        this.dao = dao;
    }

    /**
     * 查询超过60天还没审批的逾期合同
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @DS("#entity.dataSourceCode")
    @Override
    public List<ContractAuditEntity> queryOverdueList(ContractAuditEntity entity) throws Exception {
        List<ContractAuditEntity> query = contractAuditDao.query(entity);
        return query;
    }
}
