package com.fs.company.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.company.mapper.CompanyProductOutstockMapper;
import com.fs.company.domain.CompanyProductOutstock;
import com.fs.company.service.ICompanyProductOutstockService;

/**
 * 出库Service业务层处理
 * 
 * @author fs
 * @date 2025-07-01
 */
@Service
public class CompanyProductOutstockServiceImpl implements ICompanyProductOutstockService 
{
    @Autowired
    private CompanyProductOutstockMapper companyProductOutstockMapper;

    /**
     * 查询出库
     * 
     * @param id 出库主键
     * @return 出库
     */
    @Override
    public CompanyProductOutstock selectCompanyProductOutstockById(Long id)
    {
        return companyProductOutstockMapper.selectCompanyProductOutstockById(id);
    }

    /**
     * 查询出库列表
     * 
     * @param companyProductOutstock 出库
     * @return 出库
     */
    @Override
    public List<CompanyProductOutstock> selectCompanyProductOutstockList(CompanyProductOutstock companyProductOutstock)
    {
        return companyProductOutstockMapper.selectCompanyProductOutstockList(companyProductOutstock);
    }

    /**
     * 新增出库
     * 
     * @param companyProductOutstock 出库
     * @return 结果
     */
    @Override
    public int insertCompanyProductOutstock(CompanyProductOutstock companyProductOutstock)
    {
        companyProductOutstock.setCreateTime(DateUtils.getNowDate());
        return companyProductOutstockMapper.insertCompanyProductOutstock(companyProductOutstock);
    }

    /**
     * 修改出库
     * 
     * @param companyProductOutstock 出库
     * @return 结果
     */
    @Override
    public int updateCompanyProductOutstock(CompanyProductOutstock companyProductOutstock)
    {
        companyProductOutstock.setUpdateTime(DateUtils.getNowDate());
        return companyProductOutstockMapper.updateCompanyProductOutstock(companyProductOutstock);
    }

    /**
     * 批量删除出库
     * 
     * @param ids 需要删除的出库主键
     * @return 结果
     */
    @Override
    public int deleteCompanyProductOutstockByIds(Long[] ids)
    {
        return companyProductOutstockMapper.deleteCompanyProductOutstockByIds(ids);
    }

    /**
     * 删除出库信息
     * 
     * @param id 出库主键
     * @return 结果
     */
    @Override
    public int deleteCompanyProductOutstockById(Long id)
    {
        return companyProductOutstockMapper.deleteCompanyProductOutstockById(id);
    }
}
