package com.bonus.material.scrap.service.impl;

import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.scrap.mapper.ScrapAuditorSetMapper;
import com.bonus.material.scrap.domain.ScrapAuditorSet;
import com.bonus.material.scrap.service.IScrapAuditorSetService;

/**
 * 报废审核人员配置Service业务层处理
 * 
 * @author xsheng
 * @date 2024-10-16
 */
@Service
public class ScrapAuditorSetServiceImpl implements IScrapAuditorSetService {
    @Autowired
    private ScrapAuditorSetMapper scrapAuditorSetMapper;

    /**
     * 查询报废审核人员配置
     * 
     * @param id 报废审核人员配置主键
     * @return 报废审核人员配置
     */
    @Override
    public ScrapAuditorSet selectScrapAuditorSetById(Long id) {
        return scrapAuditorSetMapper.selectScrapAuditorSetById(id);
    }

    /**
     * 查询报废审核人员配置列表
     * 
     * @param scrapAuditorSet 报废审核人员配置
     * @return 报废审核人员配置
     */
    @Override
    public List<ScrapAuditorSet> selectScrapAuditorSetList(ScrapAuditorSet scrapAuditorSet) {
        return scrapAuditorSetMapper.selectScrapAuditorSetList(scrapAuditorSet);
    }

    /**
     * 新增报废审核人员配置
     * 
     * @param scrapAuditorSet 报废审核人员配置
     * @return 结果
     */
    @Override
    public int insertScrapAuditorSet(ScrapAuditorSet scrapAuditorSet) {
        scrapAuditorSet.setCreateTime(DateUtils.getNowDate());
        try {
            return scrapAuditorSetMapper.insertScrapAuditorSet(scrapAuditorSet);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 修改报废审核人员配置
     * 
     * @param scrapAuditorSet 报废审核人员配置
     * @return 结果
     */
    @Override
    public int updateScrapAuditorSet(ScrapAuditorSet scrapAuditorSet) {
        scrapAuditorSet.setUpdateTime(DateUtils.getNowDate());
        try {
            return scrapAuditorSetMapper.updateScrapAuditorSet(scrapAuditorSet);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 批量删除报废审核人员配置
     * 
     * @param ids 需要删除的报废审核人员配置主键
     * @return 结果
     */
    @Override
    public int deleteScrapAuditorSetByIds(Long[] ids) {
        return scrapAuditorSetMapper.deleteScrapAuditorSetByIds(ids);
    }

    /**
     * 删除报废审核人员配置信息
     * 
     * @param id 报废审核人员配置主键
     * @return 结果
     */
    @Override
    public int deleteScrapAuditorSetById(Long id) {
        return scrapAuditorSetMapper.deleteScrapAuditorSetById(id);
    }
}
