package com.yuchen.saas.park.service.service.pldoor;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuchen.saas.park.api.dto.pldoor.PlPropertyPassDTO;
import com.yuchen.saas.park.api.entity.pldoor.PlPropertyPass;
import com.yuchen.saas.park.api.vo.pldoor.PlPropertyPassVO;
import com.yuchen.saas.park.api.vo.request.PlPropertyPassReq;

import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;

/**
 * <p>
 * 物品放行 服务类
 * </p>
 *
 * @author miaoqs
 * @since 2024-07-03
 */
public interface PlPropertyPassService extends IService<PlPropertyPass> {

    /**
     * 新增或修改
     * @param plPropertyPassDTO
     * @return
     */
    boolean saveOrUpdateByParam(PlPropertyPassDTO plPropertyPassDTO);

    /**
     * 详情
     * @param id
     * @return
     */
    PlPropertyPassVO detailById(Long id);

    /**
     * 移除
     * @param id
     * @return
     */
    boolean deleteById(Long id);

    /**
     * 分页
     * @param page
     * @param req
     * @return
     */
    IPage<PlPropertyPassVO> pageByParam(Page<PlPropertyPassReq> page, PlPropertyPassReq req);

    /**
     * 导出
     * @param req
     * @param response
     */
    void exportPropertyPass(PlPropertyPassReq req, HttpServletResponse response);

    boolean updateState(PlPropertyPass plPropertyPass);

    /**
     * 获取物品放行详情二维码
     * @param propertyPassId
     * @return
     */
    String getPropertyPassQrcode(Long propertyPassId) throws UnsupportedEncodingException;

    /**
     * 通过二维码获取物品放行详情
     * @param plPropertyPassVO
     * @return
     */
    PlPropertyPassVO getPropertyPassByQrcode(PlPropertyPassVO plPropertyPassVO) throws Exception;

    IPage<PlPropertyPassVO> pageOpenDoorLog(Page<PlPropertyPassReq> page, PlPropertyPassReq req);
}
