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.RecordWasteOutMapper;
import com.ruoyi.manage.domain.RecordWasteOut;
import com.ruoyi.manage.service.IRecordWasteOutService;
import com.ruoyi.common.core.text.Convert;

/**
 * 废品处理出库Service业务层处理
 *
 * @author wangh
 * @date 2024-02-21
 */
@Service
public class RecordWasteOutServiceImpl implements IRecordWasteOutService {
    @Autowired
    private RecordWasteOutMapper recordWasteOutMapper;

    /**
     * 查询废品处理出库
     *
     * @param objid 废品处理出库主键
     * @return 废品处理出库
     */
    @Override
    public RecordWasteOut selectRecordWasteOutByObjid(Long objid) {
        return recordWasteOutMapper.selectRecordWasteOutByObjid(objid);
    }

    /**
     * 查询废品处理出库列表
     *
     * @param recordWasteOut 废品处理出库
     * @return 废品处理出库
     */
    @Override
    public List<RecordWasteOut> selectRecordWasteOutList(RecordWasteOut recordWasteOut) {
        return recordWasteOutMapper.selectRecordWasteOutList(recordWasteOut);
    }

    /**
     * 新增废品处理出库
     *
     * @param recordWasteOut 废品处理出库
     * @return 结果
     */
    @Override
    public int insertRecordWasteOut(RecordWasteOut recordWasteOut) {
        recordWasteOut.setCreateBy(ShiroUtils.getLoginName());
        recordWasteOut.setCreateTime(DateUtils.getNowDate());
        return recordWasteOutMapper.insertRecordWasteOut(recordWasteOut);
    }

    /**
     * 修改废品处理出库
     *
     * @param recordWasteOut 废品处理出库
     * @return 结果
     */
    @Override
    public int updateRecordWasteOut(RecordWasteOut recordWasteOut) {
        return recordWasteOutMapper.updateRecordWasteOut(recordWasteOut);
    }

    /**
     * 批量删除废品处理出库
     *
     * @param objids 需要删除的废品处理出库主键
     * @return 结果
     */
    @Override
    public int deleteRecordWasteOutByObjids(String objids) {
        return recordWasteOutMapper.deleteRecordWasteOutByObjids(Convert.toStrArray(objids));
    }

    /**
     * 删除废品处理出库信息
     *
     * @param objid 废品处理出库主键
     * @return 结果
     */
    @Override
    public int deleteRecordWasteOutByObjid(Long objid) {
        return recordWasteOutMapper.deleteRecordWasteOutByObjid(objid);
    }
}
