package com.zhyc.module.dairyProducts.service.impl;

import java.util.List;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.dairyProducts.mapper.NpFreshMilkInspMapper;
import com.zhyc.module.dairyProducts.domain.NpFreshMilkInsp;
import com.zhyc.module.dairyProducts.service.INpFreshMilkInspService;

/**
 * 鲜奶生产，成品检验记录Service业务层处理
 * * @author ruoyi
 * @date 2025-07-18
 */
@Service
public class NpFreshMilkInspServiceImpl implements INpFreshMilkInspService
{
    @Autowired
    private NpFreshMilkInspMapper npFreshMilkInspMapper;

    /**
     * 查询鲜奶生产，成品检验记录
     * * @param id 鲜奶生产，成品检验记录主键
     * @return 鲜奶生产，成品检验记录
     */
    @Override
    public NpFreshMilkInsp selectNpFreshMilkInspById(Long id)
    {
        return npFreshMilkInspMapper.selectNpFreshMilkInspById(id);
    }

    /**
     * 查询鲜奶生产，成品检验记录列表
     * * @param npFreshMilkInsp 鲜奶生产，成品检验记录
     * @return 鲜奶生产，成品检验记录
     */
    @Override
    @DataScope(deptAlias = "a", userAlias = "a")
    public List<NpFreshMilkInsp> selectNpFreshMilkInspList(NpFreshMilkInsp npFreshMilkInsp)
    {
        return npFreshMilkInspMapper.selectNpFreshMilkInspList(npFreshMilkInsp);
    }

    /**
     * 新增鲜奶生产，成品检验记录
     * * @param npFreshMilkInsp 鲜奶生产，成品检验记录
     * @return 结果
     */
    @Override
    public int insertNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp)
    {
        npFreshMilkInsp.setCreateTime(DateUtils.getNowDate());
        return npFreshMilkInspMapper.insertNpFreshMilkInsp(npFreshMilkInsp);
    }

    /**
     * 修改鲜奶生产，成品检验记录
     * * @param npFreshMilkInsp 鲜奶生产，成品检验记录
     * @return 结果
     */
    @Override
    public int updateNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp)
    {
        return npFreshMilkInspMapper.updateNpFreshMilkInsp(npFreshMilkInsp);
    }

    /**
     * 批量删除鲜奶生产，成品检验记录
     * * @param ids 需要删除的鲜奶生产，成品检验记录主键
     * @return 结果
     */
    @Override
    public int deleteNpFreshMilkInspByIds(Long[] ids)
    {
        return npFreshMilkInspMapper.deleteNpFreshMilkInspByIds(ids);
    }

    /**
     * 删除鲜奶生产，成品检验记录信息
     * * @param id 鲜奶生产，成品检验记录主键
     * @return 结果
     */
    @Override
    public int deleteNpFreshMilkInspById(Long id)
    {
        return npFreshMilkInspMapper.deleteNpFreshMilkInspById(id);
    }
}