package com.ruoyi.app.service.impl;

import java.util.List;

import com.ruoyi.app.domain.AppStock;
import com.ruoyi.app.mapper.AppStockMapper;
import com.ruoyi.app.service.IAppStockService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-15
 */
@Service
public class AppStockServiceImpl implements IAppStockService
{
    @Autowired
    private AppStockMapper appStockMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param stockId 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public AppStock selectAppStockByStockId(String stockId)
    {
        return appStockMapper.selectAppStockByStockId(stockId);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param appStock 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<AppStock> selectAppStockList(AppStock appStock)
    {
        return appStockMapper.selectAppStockList(appStock);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param appStock 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertAppStock(AppStock appStock)
    {
        appStock.setCreateTime(DateUtils.getNowDate());
        return appStockMapper.insertAppStock(appStock);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param appStock 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateAppStock(AppStock appStock)
    {
        return appStockMapper.updateAppStock(appStock);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param stockIds 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteAppStockByStockIds(String[] stockIds)
    {
        return appStockMapper.deleteAppStockByStockIds(stockIds);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param stockId 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteAppStockByStockId(String stockId)
    {
        return appStockMapper.deleteAppStockByStockId(stockId);
    }

    @Override
    public int updateNewLocation(String oldLocation, String newLocation) {
        return appStockMapper.updateNewLocation(oldLocation,newLocation);
    }
    @Override
    public List<AppStock> selectStockByGoodsId(AppStock appStock) {
        return appStockMapper.selectStockByGoodsId(appStock);
    }

    @Override
    public int updateSts(AppStock appStock) {
        return appStockMapper.updateSts(appStock);
    }
}
