import request from '@/utils/request';
/**
 * 查询仓库列表
 * @param query
 * @returns {*}
 */
export const listWarehouse = (query) => {
    return request({
        url: '/jdyw/warehouse/list',
        method: 'get',
        params: query
    });
};
/**
 * 查询仓库信息详细
 * @param id
 */
export const getWarehouse = (id) => {
    return request({
        url: '/jdyw/warehouse/' + id,
        method: 'get'
    });
};

/**
 * 新增仓库信息
 * @param data
 */
export const addWarehouse = (data) => {
    return request({
        url: '/jdyw/warehouse',
        method: 'post',
        data: data
    });
};

/**
 * 修改仓库信息
 * @param data
 */
export const updateWarehouse = (data) => {
    return request({
        url: '/jdyw/warehouse',
        method: 'put',
        data: data
    });
};

/**
 * 删除仓库信息
 * @param id
 */
export const delWarehouse = (id: string | number | Array<string | number>) => {
    return request({
        url: '/jdyw/warehouse/' + id,
        method: 'delete'
    });
};

/**
 * 查询入库列表
 * @param query
 * @returns {*}
 */
export const listDeviceInWarehouse = (query) => {
  return request({
      url: '/jdyw/deviceInWarehouse/list',
      method: 'get',
      params: query
  });
};
/**
 * 新增入库信息
 * @param data
 */
export const addDeviceInWarehouse = (data) => {
  return request({
      url: '/jdyw/deviceInWarehouse',
      method: 'post',
      data: data
  });
};
/**
 * 查询实时库存列表
 * @param query
 * @returns {*}
 */
export const getRealStorelist = (query) => {
  return request({
      url: '/jdyw/deviceInWarehouse/realStorelist',
      method: 'get',
      params: query
  });
};
/**
 * 根据设备查询入库列表
 * @param query
 * @returns {*}
 */
export const getInWarehouseListByDevice = (deviceTypeDetailId) => {
  return request({
      url: '/jdyw/deviceInWarehouse/getInWarehouseListByDevice',
      method: 'get',
      params: {
        deviceTypeDetailId
      }
  });
};

/**
 * 新增出库信息
 * @param data
 */
export const addDeviceOutWarehouse = (data) => {
  return request({
      url: '/jdyw/deviceOutWarehouse',
      method: 'post',
      data: data
  });
};
/**
 * 出库列表
 * @param data
 */
export const listDeviceOutWarehouse = (query) => {
  return request({
      url: '/jdyw/deviceOutWarehouse/list',
      method: 'get',
      params: query
  });
};
