package com.ruoyi.ss.reconciliation.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ss.reconciliation.mapper.ReconciliationMapper;
import com.ruoyi.ss.reconciliation.domain.Reconciliation;
import com.ruoyi.ss.reconciliation.domain.ReconciliationVO;
import com.ruoyi.ss.reconciliation.domain.ReconciliationQuery;
import com.ruoyi.ss.reconciliation.service.IReconciliationService;

/**
 * 平台对账Service业务层处理
 *
 * @author qzz
 * @date 2025-03-11
 */
@Service
public class ReconciliationServiceImpl implements IReconciliationService
{
    @Autowired
    private ReconciliationMapper reconciliationMapper;

    /**
     * 查询平台对账
     *
     * @param reconciliationId 平台对账主键
     * @return 平台对账
     */
    @Override
    public ReconciliationVO selectSsReconciliationByReconciliationId(Long reconciliationId)
    {
        return reconciliationMapper.selectSsReconciliationByReconciliationId(reconciliationId);
    }

    /**
     * 查询平台对账列表
     *
     * @param ssReconciliation 平台对账
     * @return 平台对账
     */
    @Override
    public List<ReconciliationVO> selectSsReconciliationList(ReconciliationQuery ssReconciliation)
    {
        return reconciliationMapper.selectSsReconciliationList(ssReconciliation);
    }

    /**
     * 查询平台对账列表
     *
     * @param ssReconciliation 平台对账
     * @return 平台对账
     */
    @Override
    public List<ReconciliationVO> selectReconciliationListGroupBy(ReconciliationQuery ssReconciliation)
    {
        return reconciliationMapper.selectReconciliationListGroupBy(ssReconciliation);
    }

    /**
     * 新增平台对账
     *
     * @param ssReconciliation 平台对账
     * @return 结果
     */
    @Override
    public int insertSsReconciliation(Reconciliation ssReconciliation)
    {
        ssReconciliation.setCreateTime(DateUtils.getNowDate());
        return reconciliationMapper.insertSsReconciliation(ssReconciliation);
    }

    /**
     * 修改平台对账
     *
     * @param ssReconciliation 平台对账
     * @return 结果
     */
    @Override
    public int updateSsReconciliation(Reconciliation ssReconciliation)
    {
        return reconciliationMapper.updateSsReconciliation(ssReconciliation);
    }

    /**
     * 批量删除平台对账
     *
     * @param reconciliationIds 需要删除的平台对账主键
     * @return 结果
     */
    @Override
    public int deleteSsReconciliationByReconciliationIds(Long[] reconciliationIds)
    {
        return reconciliationMapper.deleteSsReconciliationByReconciliationIds(reconciliationIds);
    }

    /**
     * 删除平台对账信息
     *
     * @param reconciliationId 平台对账主键
     * @return 结果
     */
    @Override
    public int deleteSsReconciliationByReconciliationId(Long reconciliationId)
    {
        return reconciliationMapper.deleteSsReconciliationByReconciliationId(reconciliationId);
    }
}
