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.CompanyProductInstockMapper;
import com.fs.company.domain.CompanyProductInstock;
import com.fs.company.service.ICompanyProductInstockService;

/**
 * 入库Service业务层处理
 * 
 * @author fs
 * @date 2025-07-01
 */
@Service
public class CompanyProductInstockServiceImpl implements ICompanyProductInstockService 
{
    @Autowired
    private CompanyProductInstockMapper companyProductInstockMapper;

    /**
     * 查询入库
     * 
     * @param id 入库主键
     * @return 入库
     */
    @Override
    public CompanyProductInstock selectCompanyProductInstockById(Long id)
    {
        return companyProductInstockMapper.selectCompanyProductInstockById(id);
    }

    /**
     * 查询入库列表
     * 
     * @param companyProductInstock 入库
     * @return 入库
     */
    @Override
    public List<CompanyProductInstock> selectCompanyProductInstockList(CompanyProductInstock companyProductInstock)
    {
        return companyProductInstockMapper.selectCompanyProductInstockList(companyProductInstock);
    }

    /**
     * 新增入库
     * 
     * @param companyProductInstock 入库
     * @return 结果
     */
    @Override
    public int insertCompanyProductInstock(CompanyProductInstock companyProductInstock)
    {
        companyProductInstock.setCreateTime(DateUtils.getNowDate());
        return companyProductInstockMapper.insertCompanyProductInstock(companyProductInstock);
    }

    /**
     * 修改入库
     * 
     * @param companyProductInstock 入库
     * @return 结果
     */
    @Override
    public int updateCompanyProductInstock(CompanyProductInstock companyProductInstock)
    {
        companyProductInstock.setUpdateTime(DateUtils.getNowDate());
        return companyProductInstockMapper.updateCompanyProductInstock(companyProductInstock);
    }

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

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