package com.ruoyi.logistics.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.datascope.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.logistics.mapper.BizFinancialAdjustmentRecordMapper;
import com.ruoyi.logistics.domain.BizFinancialAdjustmentRecord;
import com.ruoyi.logistics.service.IBizFinancialAdjustmentRecordService;

/**
 * 调账流水记录Service业务层处理
 * 
 * @author RuiJing
 * @date 2026-01-29
 */
@Service
public class BizFinancialAdjustmentRecordServiceImpl implements IBizFinancialAdjustmentRecordService 
{
    @Autowired
    private BizFinancialAdjustmentRecordMapper bizFinancialAdjustmentRecordMapper;

    /**
     * 查询调账流水记录
     * 
     * @param financialAdjustId 调账流水记录主键
     * @return 调账流水记录
     */
    @Override
    public BizFinancialAdjustmentRecord selectBizFinancialAdjustmentRecordByFinancialAdjustId(Long financialAdjustId)
    {
        return bizFinancialAdjustmentRecordMapper.selectBizFinancialAdjustmentRecordByFinancialAdjustId(financialAdjustId);
    }

    /**
     * 查询调账流水记录列表
     * 
     * @param bizFinancialAdjustmentRecord 调账流水记录
     * @return 调账流水记录
     */
    @Override
    @DataScope(deptAlias = "d")
    public List<BizFinancialAdjustmentRecord> selectBizFinancialAdjustmentRecordList(BizFinancialAdjustmentRecord bizFinancialAdjustmentRecord)
    {
        return bizFinancialAdjustmentRecordMapper.selectBizFinancialAdjustmentRecordList(bizFinancialAdjustmentRecord);
    }

    /**
     * 新增调账流水记录
     * 
     * @param bizFinancialAdjustmentRecord 调账流水记录
     * @return 结果
     */
    @Override
    public int insertBizFinancialAdjustmentRecord(BizFinancialAdjustmentRecord bizFinancialAdjustmentRecord)
    {
        bizFinancialAdjustmentRecord.setCreateTime(DateUtils.getNowDate());
        return bizFinancialAdjustmentRecordMapper.insertBizFinancialAdjustmentRecord(bizFinancialAdjustmentRecord);
    }

    /**
     * 修改调账流水记录
     * 
     * @param bizFinancialAdjustmentRecord 调账流水记录
     * @return 结果
     */
    @Override
    public int updateBizFinancialAdjustmentRecord(BizFinancialAdjustmentRecord bizFinancialAdjustmentRecord)
    {
        bizFinancialAdjustmentRecord.setUpdateTime(DateUtils.getNowDate());
        return bizFinancialAdjustmentRecordMapper.updateBizFinancialAdjustmentRecord(bizFinancialAdjustmentRecord);
    }

    /**
     * 批量删除调账流水记录
     * 
     * @param financialAdjustIds 需要删除的调账流水记录主键
     * @return 结果
     */
    @Override
    public int deleteBizFinancialAdjustmentRecordByFinancialAdjustIds(Long[] financialAdjustIds)
    {
        return bizFinancialAdjustmentRecordMapper.deleteBizFinancialAdjustmentRecordByFinancialAdjustIds(financialAdjustIds);
    }

    /**
     * 删除调账流水记录信息
     * 
     * @param financialAdjustId 调账流水记录主键
     * @return 结果
     */
    @Override
    public int deleteBizFinancialAdjustmentRecordByFinancialAdjustId(Long financialAdjustId)
    {
        return bizFinancialAdjustmentRecordMapper.deleteBizFinancialAdjustmentRecordByFinancialAdjustId(financialAdjustId);
    }
}
