package com.bonus.gs.sub.evaluate.evaluate.service;

import com.bonus.gs.sub.evaluate.evaluate.beans.EvalSummaryBean;
import com.bonus.gs.sub.evaluate.evaluate.beans.OutSourceBean;
import com.bonus.gs.sub.evaluate.evaluate.beans.auditOutsourcerBean;
import com.bonus.gs.sub.evaluate.evaluate.dao.AuditOfOutsourcerDao;
import com.bonus.gs.sub.evaluate.evaluate.dao.EvalSummaryDao;
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author xliu
 * @date 2024/12/19 10:19
 */
@Service("EvalSummaryService")
public class EvalSummaryServiceImpl implements EvalSummaryService {

    @Autowired
    private EvalSummaryDao dao;

    /**
     * 新增评价汇总
     *
     * @param pathname      文件路径
     * @param date          评价时间
     * @param evaluateTitle 评价标题
     * @return AjaxRes
     */
    @Override
    public int addEvalSummary(String pathname, String date, String evaluateTitle, String evaluateDept) {
        EvalSummaryBean bean = new EvalSummaryBean();
        bean.setEvaluateMonth(date);
        bean.setEvaluateTitle(evaluateTitle);
        bean.setEvaluateDept(evaluateDept);
        bean.setPathName(pathname);
        return dao.addEvalSummary(bean);
    }

    /**
     * 线下评价汇总列表
     *
     * @param bean 查询条件
     * @return AjaxRes
     */
    @Override
    public List<OutSourceBean> getEvalSummaryList(EvalSummaryBean bean) {
        return dao.getEvalSummaryList(bean);
    }

    @Override
    public List<OutSourceBean> getOfflineSummaryList(EvalSummaryBean bean) {
        return dao.getOfflineSummaryList(bean);
    }

    @Override
    public int deleteOffEvaluateById(String id) {
        return dao.deleteOffEvaluateById(id);
    }

    @Override
    public List<OutSourceBean> dedicatedEvalSummaryList(EvalSummaryBean bean) {
        return dao.dedicatedEvalSummaryList(bean);
    }
}
