package com.zehong.system.service.impl.track;

import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.track.TProductStoreLogMapper;
import com.zehong.system.domain.track.TProductStoreLog;
import com.zehong.system.service.track.ITProductStoreLogService;

/**
 * 配件入库记录Service业务层处理
 * 
 * @author zehong
 * @date 2024-08-22
 */
@Service
public class TProductStoreLogServiceImpl implements ITProductStoreLogService 
{
    @Autowired
    private TProductStoreLogMapper tProductStoreLogMapper;

    /**
     * 查询配件入库记录
     * 
     * @param id 配件入库记录ID
     * @return 配件入库记录
     */
    @Override
    public TProductStoreLog selectTProductStoreLogById(Long id)
    {
        return tProductStoreLogMapper.selectTProductStoreLogById(id);
    }

    /**
     * 查询配件入库记录列表
     * 
     * @param tProductStoreLog 配件入库记录
     * @return 配件入库记录
     */
    @Override
    public List<TProductStoreLog> selectTProductStoreLogList(TProductStoreLog tProductStoreLog)
    {
        return tProductStoreLogMapper.selectTProductStoreLogList(tProductStoreLog);
    }

    /**
     * 新增配件入库记录
     * 
     * @param tProductStoreLog 配件入库记录
     * @return 结果
     */
    @Override
    public int insertTProductStoreLog(TProductStoreLog tProductStoreLog)
    {
        tProductStoreLog.setCreateTime(DateUtils.getNowDate());
        tProductStoreLog.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
        return tProductStoreLogMapper.insertTProductStoreLog(tProductStoreLog);
    }

    /**
     * 修改配件入库记录
     * 
     * @param tProductStoreLog 配件入库记录
     * @return 结果
     */
    @Override
    public int updateTProductStoreLog(TProductStoreLog tProductStoreLog)
    {
        return tProductStoreLogMapper.updateTProductStoreLog(tProductStoreLog);
    }

    /**
     * 批量删除配件入库记录
     * 
     * @param ids 需要删除的配件入库记录ID
     * @return 结果
     */
    @Override
    public int deleteTProductStoreLogByIds(Long[] ids)
    {
        return tProductStoreLogMapper.deleteTProductStoreLogByIds(ids);
    }

    /**
     * 删除配件入库记录信息
     * 
     * @param id 配件入库记录ID
     * @return 结果
     */
    @Override
    public int deleteTProductStoreLogById(Long id)
    {
        return tProductStoreLogMapper.deleteTProductStoreLogById(id);
    }
}
