package com.ruoyi.manage.service.impl;

import java.util.List;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.RecordOutMapper;
import com.ruoyi.manage.domain.RecordOut;
import com.ruoyi.manage.service.IRecordOutService;
import com.ruoyi.common.core.text.Convert;

/**
 * 轮挡出库记录Service业务层处理
 *
 * @author wangh
 * @date 2024-01-18
 */
@Service
public class RecordOutServiceImpl implements IRecordOutService {
    @Autowired
    private RecordOutMapper recordOutMapper;

    /**
     * 查询轮挡出库记录
     *
     * @param objid 轮挡出库记录主键
     * @return 轮挡出库记录
     */
    @Override
    public RecordOut selectRecordOutByObjid(Long objid) {
        return recordOutMapper.selectRecordOutByObjid(objid);
    }

    /**
     * 查询轮挡出库记录列表
     *
     * @param recordOut 轮挡出库记录
     * @return 轮挡出库记录
     */
    @Override
    public List<RecordOut> selectRecordOutList(RecordOut recordOut) {
        return recordOutMapper.selectRecordOutList(recordOut);
    }

    /**
     * 新增轮挡出库记录
     *
     * @param recordOut 轮挡出库记录
     * @return 结果
     */
    @Override
    public int insertRecordOut(RecordOut recordOut) {
        recordOut.setCreateBy(ShiroUtils.getLoginName());
        recordOut.setCreateTime(DateUtils.getNowDate());
        return recordOutMapper.insertRecordOut(recordOut);
    }

    /**
     * 修改轮挡出库记录
     *
     * @param recordOut 轮挡出库记录
     * @return 结果
     */
    @Override
    public int updateRecordOut(RecordOut recordOut) {
        return recordOutMapper.updateRecordOut(recordOut);
    }

    /**
     * 批量删除轮挡出库记录
     *
     * @param objids 需要删除的轮挡出库记录主键
     * @return 结果
     */
    @Override
    public int deleteRecordOutByObjids(String objids) {
        return recordOutMapper.deleteRecordOutByObjids(Convert.toStrArray(objids));
    }

    /**
     * 删除轮挡出库记录信息
     *
     * @param objid 轮挡出库记录主键
     * @return 结果
     */
    @Override
    public int deleteRecordOutByObjid(Long objid) {
        return recordOutMapper.deleteRecordOutByObjid(objid);
    }
}
