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.CompanyProductStockMapper;
import com.fs.company.domain.CompanyProductStock;
import com.fs.company.service.ICompanyProductStockService;

/**
 * 产品库存Service业务层处理
 * 
 * @author fs
 * @date 2025-07-01
 */
@Service
public class CompanyProductStockServiceImpl implements ICompanyProductStockService 
{
    @Autowired
    private CompanyProductStockMapper companyProductStockMapper;

    /**
     * 查询产品库存
     * 
     * @param id 产品库存主键
     * @return 产品库存
     */
    @Override
    public CompanyProductStock selectCompanyProductStockById(Long id)
    {
        return companyProductStockMapper.selectCompanyProductStockById(id);
    }

    /**
     * 查询产品库存列表
     * 
     * @param companyProductStock 产品库存
     * @return 产品库存
     */
    @Override
    public List<CompanyProductStock> selectCompanyProductStockList(CompanyProductStock companyProductStock)
    {
        return companyProductStockMapper.selectCompanyProductStockList(companyProductStock);
    }

    /**
     * 新增产品库存
     * 
     * @param companyProductStock 产品库存
     * @return 结果
     */
    @Override
    public int insertCompanyProductStock(CompanyProductStock companyProductStock)
    {
        return companyProductStockMapper.insertCompanyProductStock(companyProductStock);
    }

    /**
     * 修改产品库存
     * 
     * @param companyProductStock 产品库存
     * @return 结果
     */
    @Override
    public int updateCompanyProductStock(CompanyProductStock companyProductStock)
    {
        companyProductStock.setUpdateTime(DateUtils.getNowDate());
        return companyProductStockMapper.updateCompanyProductStock(companyProductStock);
    }

    /**
     * 批量删除产品库存
     * 
     * @param ids 需要删除的产品库存主键
     * @return 结果
     */
    @Override
    public int deleteCompanyProductStockByIds(Long[] ids)
    {
        return companyProductStockMapper.deleteCompanyProductStockByIds(ids);
    }

    /**
     * 删除产品库存信息
     * 
     * @param id 产品库存主键
     * @return 结果
     */
    @Override
    public int deleteCompanyProductStockById(Long id)
    {
        return companyProductStockMapper.deleteCompanyProductStockById(id);
    }
}
