package com.junmp.jyzb.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.junmp.jyzb.api.bean.dto.EqsBriefDto;
import com.junmp.jyzb.api.bean.dto.EqsSumDto;
import com.junmp.jyzb.api.bean.dto.InventoryDto;
import com.junmp.jyzb.api.bean.dto.PeriodAndDateDto;
import com.junmp.jyzb.api.bean.dto.fetchingDataDto.EquipmentDto;
import com.junmp.jyzb.api.bean.query.*;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.entity.*;
import com.junmp.v2.db.api.page.PageResult;

import java.util.List;

public interface InventoryService extends IService<Inventory> {

    //根据装备id查询出装备的详细信息
    InventoryDto getInventoryDetail(InventoryReq msg);

    boolean UpdateWarehouseInsNum(WarehouseReq req);

    boolean UpdateCabinetInsNum(CabinetReq req);

    List<InventoryDto> GetInvInfoByEpc(List<String> epcList);


    //查询箱门（cabinetBox下）所有装备简要信息列表（传递cabinetBoxId）
    List<EqsBriefDto> searchEqsByBoxId(CabinetBoxReq req);


    //通过货架id查询装备信息汇总
    List<InventorySummary> ShelfInventoryList(ShelfReq req);

    //根据货架id查询装备信息汇总 (page)
    PageResult<InventorySummary> ShelfInventoryPage(ShelfReq req);

    //通过货架id查询装备简要信息
    List<EqsBriefDto> ShelfInventoryDetail(InventoryReq req);
    PageResult<EqsBriefDto> ShelfInventoryPage(InventoryReq req);

    //通过区域id查询装备信息汇总(list)
    List<InventorySummary> AreaInventoryList(WarehouseAreaReq req);

    //通过区域id查询装备信息汇总(page)
    PageResult<InventorySummary> AreaInventoryPage(WarehouseAreaReq req);

    //通过装备id判断装备是否存在
    Inventory InventoryExist(String id);

    //通过单警柜箱门id获取箱门下的装备汇总信息(list)
    List<InventorySummary> EqsByCabinetBoxId(CabinetBoxReq req);

    //通过单警柜箱门id获取箱门下的装备汇总信息(page)
    PageResult<InventorySummary> EqsByCabinetBoxIdPage(CabinetBoxReq req);

    //通过组织机构id对该组织机构下的装备进行导出
    void ExportInventoryExcel(InventoryReq req);


    //通过条件查询装备数量报表
    List<EqsSumDto> GetListEquipment(InventoryReq req);

    //查询箱门（cabinetBox下）所有装备简要信息列表page（传递cabinetBoxId）
    PageResult<EqsBriefDto> searchEqsByBoxIdPage(CabinetBoxReq req);

    //根据条件查询仓库下的所有装备信息
    PageResult<InventoryDto> GetDetailByTerms(InventoryReq req);

    //批量信息修改
    boolean BatchEditingInvsInfo(BatchEditingInvsReq req);

    //判断epc是否存在
    List<String> checkEPCList(EpcCheckReq req);

    List<EquipmentDto> alignInventoryInfo(InventoryReq req);

    Boolean EqsImport(InventoryReq req);

    PageResult<InventoryDto> EqsByState(InventoryReq req);

    List<PeriodAndDateDto> GetByPeriodAndDate(InventoryReq req);

    List<Inventory> selectSum(List<Object[]> searchItem,Integer epctype);


    String EqsBindOrUnbindCabinet(PoliceEquipmentDetailReq req);

    List<Inventory> EqsBindOrUnBind(List<String> epcList, Cabinet cabinet, PubOrg pubOrg, CabinetBox cabinetBox,Policeman policeman);

    //获取绑定装备的最新出入库状态以及更新库存汇总数量
    Boolean getEqsState(PoliceEquipmentDetailReq req);
}
