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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuchen.saas.device.api.vo.NetImportResVo;
import com.yuchen.saas.park.api.dto.people.PmgBatParkPeopleQryDto;
import com.yuchen.saas.park.api.entity.park.PmgBatParkPeople;
import com.yuchen.saas.park.api.param.PmgBatParkPeoplePageParam;
import com.yuchen.saas.park.api.vo.park.PmgBatParkPeopleGroupPageVo;
import com.yuchen.saas.park.api.vo.park.PmgBatParkPeopleVo;
import com.yuchen.saas.park.api.vo.people.PmgBatParkPeoplePolyVo;
import org.nest.springwrap.core.mp.base.BaseService;
import org.nest.springwrap.core.mp.support.Query;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @author 刘通
 * @date 2020/12/8 10:15
 */
public interface PmgBatParkPeopleService extends BaseService<PmgBatParkPeople>{

    /**
     * 保存人员信息数据（包含人脸下发动作）
     * @param pmgBatParkPeople 人员信息数据
     * @return
     */
    R savePeople(PmgBatParkPeople pmgBatParkPeople);

    R savePeopleNew(PmgBatParkPeople pmgBatParkPeople);

    R savePeopleNewHouse(PmgBatParkPeople pmgBatParkPeople);

    /**
     * 删除人员信息
     * @param ids 人员ID
     * @return
     */
    R delPeople(String ids);

    /**
     * 人员信息分页查询
     * @param pmgBatParkPeople 人员信息查询条件
     * @param query 分页数据
     * @return
     */
    IPage<PmgBatParkPeopleVo> getPage(PmgBatParkPeople pmgBatParkPeople, Query query);

    /**
     * 分页 权限分组园内人员信息
     * @param pmgBatParkPeoplePageParam
     * @return
     */
    IPage<PmgBatParkPeopleGroupPageVo> pageByGroup(PmgBatParkPeoplePageParam pmgBatParkPeoplePageParam);

    /**
     * 获取默认的组织架构信息
     * @param regionIndexCode
     * @return
     */
    List<Map<String,Object>> peopleOrganizeList(String regionIndexCode);

    /**
     * 同步 hik isc 人员信息
     * @param parkId 园区ID
     */
    void syncPeopleInfo(Long parkId);

    /**
     * 根据手机号获取用户信息（访客处使用，其他模块慎用）
     * @param phone 手机号
     * @return
     */
    PmgBatParkPeople getByPhone(String phone);

    boolean updatePeople(PmgBatParkPeople pmgBatParkPeople);

    void exportExcel(PmgBatParkPeopleQryDto qryDto, HttpServletResponse response);

    NetImportResVo importExcel(MultipartFile file);

    Page<PmgBatParkPeople> selectPage(PmgBatParkPeopleQryDto qryDto);

    Page<PmgBatParkPeoplePolyVo> findParkPeople(PmgBatParkPeopleQryDto qryDto);

    Page<PmgBatParkPeople> findParkPeopleNew(PmgBatParkPeopleQryDto qryDto);
    /**
     * @description: 房产认证
     * @param pmgBatParkPeopleQryDto
     * @return: boolean
     * @author: 洪铭铭
     * @time: 2024/5/24 16:08
     */
    R propertyAuth(PmgBatParkPeopleQryDto pmgBatParkPeopleQryDto);
    /**
     * @description:
     * @param pmgBatParkPeopleQryDto
     * @return: boolean
     * @author: 洪铭铭
     * @time: 2024/5/29 15:11
     */
    boolean ownerConfirm(String ownerPhone, PmgBatParkPeopleQryDto pmgBatParkPeopleQryDto);
    /**
     * @description: 添加住户
     * @param pmgBatParkPeople
     * @return: org.nest.springwrap.core.tool.api.R
     * @author: 洪铭铭
     * @time: 2024/6/11 16:09
     */
    R saveTenant(PmgBatParkPeople pmgBatParkPeople);

    /**
     * @description: 
     * @param pmgBatParkPeople
     * @return: java.util.List<com.yuchen.saas.park.api.entity.park.PmgBatParkPeople>
     * @author: 洪铭铭
     * @time: 2024/6/24 11:47
     */
    List<PmgBatParkPeople> getBindedPeople(PmgBatParkPeople pmgBatParkPeople);

    /**
     * 同步电梯人员
     * @return
     */
    void syncElevatorPerson(Long parkId,Long personId);

    /**
     * 同步门禁人员
     * @param parkId
     */
    void syncDoorPerson(Long parkId,Long personId);
}
