/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.youchain.basicdata.service;

import com.youchain.basicdata.domain.Item;
import com.youchain.basicdata.domain.Point;
import com.youchain.basicdata.service.dto.ItemDto;
import com.youchain.basicdata.service.dto.PointDto;
import com.youchain.basicdata.service.dto.PointQueryCriteria;
import com.youchain.basicdata.service.dto.PointSmallDto;
import org.springframework.data.domain.Pageable;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;

/**
* @website https://eladmin.vip
* @description 服务接口
* @author liuxue
* @date 2023-07-26
**/
public interface PointService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(PointQueryCriteria criteria, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<PointDto>
    */
    List<PointDto> queryAll(PointQueryCriteria criteria);


    /**
     * 查询所有数据不分页
     * @return List<PointDto>
     */
    List<PointSmallDto> queryKyPointList();

    /**
     * 根据ID查询
     * @param id ID
     * @return PointDto
     */
    PointDto findById(Long id);

    /**
     * 根据ID查询
     * @param id ID
     * @return PointDto
     */
    Point findEntityById(Long id);

    /**
    * 创建
    * @param resources /
    * @return PointDto
    */
    PointDto create(Point resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(Point resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Long[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<PointDto> all, HttpServletResponse response) throws IOException;

    /**
     *dto转实体
     * @param pointDto
     * @return
     */
    Point toEntity(PointDto pointDto);


    void queryPoint(String pointCode);

    List<Point> getPoint(String type,String areaCode);


    List<Point> getPoint(String type,String areaCode,int page,int pageSize);

    /**
     * 根据code查找库区
     * @param code-编号
     * @param status-状态
     * @param type-类型
     * @param areaName-库区名称
     * @param goodType-存储类型
     * @return
     */
    Point findByCode(String code,String status,String type,String areaName,String goodType,Double itemHeight);

    /**
     * 得到指定点位
     * @param code
     * @param status
     * @param type
     * @param areaName
     * @return
     */
    Point getPoint(String code,String status,String type,String areaName);

    Map<String,Point> findByCodes(Set pointCodes);

    /**
     * 根据小库区编号查询点位集合
     * @param beat_code
     * @return
     */
    List<Point> getPointByBeat_code(String beat_code);

}
