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.RecordInMapper;
import com.ruoyi.manage.domain.RecordIn;
import com.ruoyi.manage.service.IRecordInService;
import com.ruoyi.common.core.text.Convert;

/**
 * 轮挡入库记录Service业务层处理
 *
 * @author wangh
 * @date 2024-01-17
 */
@Service
public class RecordInServiceImpl implements IRecordInService {
    @Autowired
    private RecordInMapper recordInMapper;

    /**
     * 查询轮挡入库记录
     *
     * @param objid 轮挡入库记录主键
     * @return 轮挡入库记录
     */
    @Override
    public RecordIn selectRecordInByObjid(Long objid) {
        return recordInMapper.selectRecordInByObjid(objid);
    }

    /**
     * 查询轮挡入库记录列表
     *
     * @param recordIn 轮挡入库记录
     * @return 轮挡入库记录
     */
    @Override
    public List<RecordIn> selectRecordInList(RecordIn recordIn) {
        return recordInMapper.selectRecordInList(recordIn);
    }

    /**
     * 新增轮挡入库记录
     *
     * @param recordIn 轮挡入库记录
     * @return 结果
     */
    @Override
    public int insertRecordIn(RecordIn recordIn) {
        recordIn.setCreateBy(ShiroUtils.getLoginName());
        recordIn.setCreateTime(DateUtils.getNowDate());
        return recordInMapper.insertRecordIn(recordIn);
    }

    /**
     * 修改轮挡入库记录
     *
     * @param recordIn 轮挡入库记录
     * @return 结果
     */
    @Override
    public int updateRecordIn(RecordIn recordIn) {
        return recordInMapper.updateRecordIn(recordIn);
    }

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

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