package com.ruoyi.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.TBaseStorageAreaLocation;
import com.ruoyi.business.mapper.TBaseStorageAreaLocationMapper;
import com.ruoyi.business.service.ITBaseStorageAreaLocationService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 库位资料Service业务层处理
 * 
 * @author wms
 * @date 2022-12-24
 */
@Service
public class TBaseStorageAreaLocationServiceImpl extends ServiceImpl<TBaseStorageAreaLocationMapper, TBaseStorageAreaLocation> implements ITBaseStorageAreaLocationService
{
    @Autowired
    private TBaseStorageAreaLocationMapper tBaseStorageAreaLocationMapper;

    /**
     * 库位预警
     * @return
     */
    @Override
    public String outOfRemainingWarning() {
        return tBaseStorageAreaLocationMapper.outOfRemainingWarning();
    }

    /**
     * 库位爆仓预警
     * @return
     */
    @Override
    public int outOfStockWarning() {
        return tBaseStorageAreaLocationMapper.outOfStockWarning();
    }

    /**
     * 查询库位资料
     * 
     * @param locationId 库位资料主键
     * @return 库位资料
     */
    @Override
    public TBaseStorageAreaLocation selectTBaseStorageAreaLocationByLocationId(String locationId)
    {
        return tBaseStorageAreaLocationMapper.selectTBaseStorageAreaLocationByLocationId(locationId);
    }

    /**
     * 查询库位资料列表
     * 
     * @param tBaseStorageAreaLocation 库位资料
     * @return 库位资料
     */
    @Override
    public List<TBaseStorageAreaLocation> selectTBaseStorageAreaLocationList(TBaseStorageAreaLocation tBaseStorageAreaLocation)
    {
        return tBaseStorageAreaLocationMapper.selectTBaseStorageAreaLocationList(tBaseStorageAreaLocation);
    }

    /**
     * 新增库位资料
     * 
     * @param tBaseStorageAreaLocation 库位资料
     * @return 结果
     */
    @Override
    public int insertTBaseStorageAreaLocation(TBaseStorageAreaLocation tBaseStorageAreaLocation)
    {
        return tBaseStorageAreaLocationMapper.insertTBaseStorageAreaLocation(tBaseStorageAreaLocation);
    }

    /**
     * 修改库位资料
     * 
     * @param tBaseStorageAreaLocation 库位资料
     * @return 结果
     */
    @Override
    public int updateTBaseStorageAreaLocation(TBaseStorageAreaLocation tBaseStorageAreaLocation)
    {
        return tBaseStorageAreaLocationMapper.updateTBaseStorageAreaLocation(tBaseStorageAreaLocation);
    }

    /**
     * 批量删除库位资料
     * 
     * @param locationIds 需要删除的库位资料主键
     * @return 结果
     */
    @Override
    public int deleteTBaseStorageAreaLocationByLocationIds(String locationIds)
    {
        return tBaseStorageAreaLocationMapper.deleteTBaseStorageAreaLocationByLocationIds(Convert.toStrArray(locationIds));
    }

    /**
     * 删除库位资料信息
     * 
     * @param locationId 库位资料主键
     * @return 结果
     */
    @Override
    public int deleteTBaseStorageAreaLocationByLocationId(String locationId)
    {
        return tBaseStorageAreaLocationMapper.deleteTBaseStorageAreaLocationByLocationId(locationId);
    }
}
