package com.sptg.estate.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.FloorDto;
import com.sptg.estate.api.entity.Floor;
import com.sptg.estate.api.feigns.fallback.FloorFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * title: FloorFeign
 * package: com.sptg.estate.api.feigns.fallback
 * description: 楼层 服务接口
 *
 *
 *
 */
@FeignClient(value = "smart-house-estate",fallbackFactory = FloorFeignFallbackFactory.class)
public interface FloorFeign {

    /**
     * 功能描述:楼层列表查询（含分页）
     * @param floorDto 楼层业务对象（含分页及查询条件）
     * @return  ResultBean<Page<Floor>>
     *
     *
     */
    @PostMapping(value = "/floor/showFloorList")
    ResultBean<Page<Floor>> showFloorList(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:新增楼层
     * @param floorDto 楼层业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/floor/addFloor")
    ResultBean<FloorDto> addFloor(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:根据Id查找楼层
     * @param id 必填
     * @return Floor
     *
     *
     */
    @GetMapping(value = "/floor/findFloorById/{id}")
    Floor findFloorById(@PathVariable(value = "id") Long id);

    /**
     * 功能描述:编辑楼层
     * @param floorDto 楼层业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/floor/updateFloor")
    ResultBean<Boolean> updateFloor(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:删除楼层
     * @param floorDto 楼层业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/floor/deleteFloor")
    ResultBean<Boolean> deleteFloor(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:楼层放入垃圾箱
     * @param floorDto 楼层业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/floor/trashOrRecover")
    ResultBean<Boolean> trashOrRecover(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:批量删除楼层
     * @param floorDto 楼层业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/floor/deleteFloorList")
    ResultBean<Boolean> deleteFloorList(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:根据位置查找楼层
     * @param floorDto 楼层业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/floor/findListByPosition")
    ResultBean<Floor> findListByPosition(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:根据父节点查找楼层
     * @param floorDto 楼层业务对象
     * @return  List<Floor>
     *
     *
     */
    @PostMapping(value = "/floor/findListByPid")
    ResultBean<Floor> findListByPid(@RequestBody FloorDto floorDto);

    /**
     * 功能描述: 根据小区Id差楼层列表
     * @param xqId 小区Id,机构表的Id
     * @return List<Floor>
     *
     *
     */
    @GetMapping(value = "/floor/getListByXqId/{xqId}")
    List<Floor> getListByXqId(@PathVariable(value = "xqId") Long xqId);

    /**
     * 功能描述: 根据楼层Id列表 查询楼层信息
     * @param dyIdList 楼层Id列表
     * @return List<Floor>
     *
     *
     */
    @PostMapping(value = "/floor/getListByIdList")
    List<Floor> getListByIdList(@RequestBody List<Long> dyIdList);

    /**
     * 功能描述:导入楼层
     * @param floorDto 楼层业务传输对象集合
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/floor/importFloorList")
    ResultBean<Boolean> importFloorList(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:根据位置查询楼层数量
     * @param floorDto
     * {
     *    orgPosition : 位置信息
     * }
     * @return ResultBean<Map<String,Integer>>
     *
     *
     */
    @PostMapping(value = "/floor/getFloorAccount")
    ResultBean<Map<String,Integer>> getFloorAccount(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:根据位置查询楼层数量
     * @param floorDto
     * {
     *    orgPosition : 位置信息
     * }
     * @return int
     *
     *
     */
    @PostMapping(value = "/floor/getFloorCount")
    int getFloorCount(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:根据条件查询楼层数量
     * @param floorDto 楼层业务对象
     * @return int 数量
     *
     *
     */
    @PostMapping(value = "/floor/findFloorByCondition")
    int findFloorByCondition(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:根据楼层名称和编号查询楼层
     * @param floorDto 楼层业务对象
     * @return Floor
     *
     *
     */
    @PostMapping(value = "/floor/findFloorByNameAndNumber")
    Floor findFloorByNameAndNumber(@RequestBody FloorDto floorDto);

    /**
     * 功能描述:导入生成楼层
     * @param floor 楼层对象
     * @return Floor
     *
     *
     */
    @PostMapping(value = "/floor/addFloorByImport")
    Floor addFloorByImport(@RequestBody Floor floor);

    /**
     * 根据楼层编号获取楼层信息
     * @param xqId 小区Id
     * @param floorNumber 楼层编号
     * @return Floor
     */
    @GetMapping(value = "/floor/getByFloorNumberAndXqId")
    Floor getByFloorNumberAndXqId(
            @RequestParam(value = "xqId") Long xqId,
            @RequestParam(value = "floorNumber") String floorNumber);

    @PostMapping(value = "/floor/updateEntity")
    boolean updateEntity(@RequestBody Floor floor);

    @PostMapping(value = "/floor/updateFloorList")
    boolean updateFloorList(@RequestBody List<Floor> floorList);

    /**
     * 功能描述: 根据名称模糊查询
     * @param dto
     * @return List<Floor>
     *
     */
    @PostMapping(value = "/floor/getListByLikeName")
    List<Floor> getListByLikeName(@RequestBody FloorDto dto);

    /**
     * 根据原数据的Id获取楼层信息
     * @param oldId java.lang.String
     * @return com.sptg.estate.api.entity.Floor
     */
    @GetMapping(value = "/floor/getByOldId/{oldId}")
    Floor getByOldId(@PathVariable(value = "oldId") String oldId);

    /**
     * 功能描述: 根据楼层编号查询
     * @param floorNumber
     * @return List<Floor>
     *
     */
    @GetMapping(value = "/floor/getByFloorNumber/{floorNumber}")
    Floor getByFloorNumber(@PathVariable(value = "floorNumber") String floorNumber);

    @GetMapping(value = "/floor/addFloorSync")
    int addFloorSync(@RequestBody Floor floor);

    @GetMapping(value = "/floor/getFloorByUnitId")
    List<Floor> getFloorByUnitId(@RequestParam(value = "unitId") Long unitId);

    @PostMapping(value = "/floor/getListByCondition")
    List<Floor> getListByCondition(@RequestBody FloorDto floorDto);
}
