package com.bonus.material.settlement.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.settlement.mapper.SltProjectMonthCostsMapper;
import com.bonus.material.settlement.domain.SltProjectMonthCosts;
import com.bonus.material.settlement.service.ISltProjectMonthCostsService;

/**
 * 月结算费用Service业务层处理
 * 
 * @author xsheng
 * @date 2024-10-16
 */
@Service
public class SltProjectMonthCostsServiceImpl implements ISltProjectMonthCostsService {
    @Autowired
    private SltProjectMonthCostsMapper sltProjectMonthCostsMapper;

    /**
     * 查询月结算费用
     * 
     * @param id 月结算费用主键
     * @return 月结算费用
     */
    @Override
    public SltProjectMonthCosts selectSltProjectMonthCostsById(Long id) {
        return sltProjectMonthCostsMapper.selectSltProjectMonthCostsById(id);
    }

    /**
     * 查询月结算费用列表
     * 
     * @param sltProjectMonthCosts 月结算费用
     * @return 月结算费用
     */
    @Override
    public List<SltProjectMonthCosts> selectSltProjectMonthCostsList(SltProjectMonthCosts sltProjectMonthCosts) {
        return sltProjectMonthCostsMapper.selectSltProjectMonthCostsList(sltProjectMonthCosts);
    }

    /**
     * 新增月结算费用
     * 
     * @param sltProjectMonthCosts 月结算费用
     * @return 结果
     */
    @Override
    public int insertSltProjectMonthCosts(SltProjectMonthCosts sltProjectMonthCosts) {
        sltProjectMonthCosts.setCreateTime(DateUtils.getNowDate());
        try {
            return sltProjectMonthCostsMapper.insertSltProjectMonthCosts(sltProjectMonthCosts);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 修改月结算费用
     * 
     * @param sltProjectMonthCosts 月结算费用
     * @return 结果
     */
    @Override
    public int updateSltProjectMonthCosts(SltProjectMonthCosts sltProjectMonthCosts) {
        sltProjectMonthCosts.setUpdateTime(DateUtils.getNowDate());
        try {
            return sltProjectMonthCostsMapper.updateSltProjectMonthCosts(sltProjectMonthCosts);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 批量删除月结算费用
     * 
     * @param ids 需要删除的月结算费用主键
     * @return 结果
     */
    @Override
    public int deleteSltProjectMonthCostsByIds(Long[] ids) {
        return sltProjectMonthCostsMapper.deleteSltProjectMonthCostsByIds(ids);
    }

    /**
     * 删除月结算费用信息
     * 
     * @param id 月结算费用主键
     * @return 结果
     */
    @Override
    public int deleteSltProjectMonthCostsById(Long id) {
        return sltProjectMonthCostsMapper.deleteSltProjectMonthCostsById(id);
    }
}
