package com.zbf.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbf.common.utils.DateUtils;
import com.zbf.system.domain.TStockCheck;
import com.zbf.system.mapper.TStockCheckMapper;
import com.zbf.system.service.ITStockCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 盘点库存数据Service业务层处理
 *
 * @author tony
 * @date 2024-10-31
 */
@Service
public class TStockCheckServiceImpl extends ServiceImpl<TStockCheckMapper, TStockCheck> implements ITStockCheckService //修改
{
    @Autowired
    private TStockCheckMapper tStockCheckMapper;

    /**
     * 查询盘点库存数据
     *
     * @param id 盘点库存数据主键
     * @return 盘点库存数据
     */
    @Override
    public TStockCheck selectTStockCheckById(String checkId)
    {
        return tStockCheckMapper.selectTStockCheckById(checkId);
    }

    /**
     * 查询盘点库存数据列表
     *
     * @param tStockCheck 盘点库存数据
     * @return 盘点库存数据
     */
    @Override
    public List<TStockCheck> selectTStockCheckList(TStockCheck tStockCheck)
    {
        return tStockCheckMapper.selectTStockCheckList(tStockCheck);
    }

    /**
     * 新增盘点库存数据
     *
     * @param tStockCheck 盘点库存数据
     * @return 结果
     */
    @Override
    public int insertTStockCheck(TStockCheck tStockCheck)
    {
        tStockCheck.setCreateTime(DateUtils.getNowDate());
        return tStockCheckMapper.insertTStockCheck(tStockCheck);
    }

    /**
     * 修改盘点库存数据
     *
     * @param tStockCheck 盘点库存数据
     * @return 结果
     */
    @Override
    public int updateTStockCheck(TStockCheck tStockCheck)
    {
        tStockCheck.setUpdateTime(DateUtils.getNowDate());
        return tStockCheckMapper.updateTStockCheck(tStockCheck);
    }

    /**
     * 批量删除盘点库存数据
     *
     * @param ids 需要删除的盘点库存数据主键
     * @return 结果
     */
    @Override
    public int deleteTStockCheckByIds(String[] ids)
    {
        return tStockCheckMapper.deleteTStockCheckByIds(ids);
    }

    /**
     * 删除盘点库存数据信息
     *
     * @param id 盘点库存数据主键
     * @return 结果
     */
    @Override
    public int deleteTStockCheckById(String id)
    {
        return tStockCheckMapper.deleteTStockCheckById(id);
    }


    /**
     * 批量禁用
     *
     * @param id 盘点库存数据主键
     * @return 结果
     */
    @Override
    public int disabledTStockCheckByIds(String[] ids) {
        return tStockCheckMapper.disabledTStockCheckByIds(ids);
    }

    /**
     * 批量启用
     *
     * @param id 盘点库存数据主键
     * @return 结果
     */
    @Override
    public int enableTStockCheckByIds(String[] ids) {
        return tStockCheckMapper.enableTStockCheckByIds(ids);
    }

    /**
     * 修改状态
     *
     * @param tStockCheck 工序管理主键
     * @return 结果
     */
    @Override
    public int updateStatus(TStockCheck tStockCheck) {
        return tStockCheckMapper.updateTStockCheck(tStockCheck);
    }

    @Override
    public void save(List<TStockCheck> list) {
        this.saveBatch(list);
    }

}
