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.DeviceInstallationDto;
import com.sptg.estate.api.entity.DeviceInstallation;
import com.sptg.estate.api.feigns.fallback.DeviceInstallationFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * title: PositionFeign
 * package: com.sptg.estate.api.feigns
 * description: 设备安装-服务接口
 *
 *               
 *                
 */
@FeignClient(value= "smart-house-estate",fallbackFactory= DeviceInstallationFeignFallbackFactory.class)
public interface DeviceInstallationFeign {

    /**
     * 功能描述:分页查询设备安装信息
     * @param dto
     * @return ResultBean<Page<DeviceInstallation>>
     *                
     *                      
     */
    @PostMapping("/implement/device/installation/showList")
    ResultBean<Page<DeviceInstallation>> showList(@RequestBody DeviceInstallationDto dto);

    /**
     * 功能描述:根据id查询设备安装信息
     * @param id
     * @return ResultBean<DeviceInstallation>
     *                
     *                      
     */
    @PostMapping("/implement/device/installation/findById")
    ResultBean<DeviceInstallation> findById(@RequestBody Long id);

    /**
     * 功能描述:审核状态
     * @param dto
     * {
     *     id:设备安装id
     *     checkState:工单审核状态：0-待审核 1-审核通过 2-审核不通过
     *     checkOpinion:审核不通过原因，当checkState = 2有值
     *     checkDate:审核时间
     *     checkAccountId:审核人id
     *     CheckName:审核人
     *
     * }
     * @return
     *                
     *                      
     */
    @PostMapping("/implement/device/installation/checkState")
    ResultBean<Boolean> checkState(@RequestBody DeviceInstallationDto dto);

    /**
     * 功能描述:根据位置统计定位记录数量
     * @param orgPosition
     * @return ResultBean<Project>
     *               
     *                      
     */
    @PostMapping("/implement/device/installation/countByOrgPosition")
    ResultBean<Integer> countByOrgPosition(@RequestBody String orgPosition);
    
    /**
     * 功能描述:根据位置查询所属设备安装
     * @param dto{
     *         orgPosition : 位置 必填
     * }
     * @return ResultBean<DeviceInstallation>
     *             
     *                      
     */
    @PostMapping("/implement/device/installation/findListByPosition")
    ResultBean<DeviceInstallation> findListByPosition(@RequestBody DeviceInstallationDto dto);
    /**
     * 功能描述:查询设备是否已经安装
     * @param serialNumber
     * @return ResultBean<Boolean>
     *               
     *                     
     */
    @PostMapping("/implement/device/installation/countBySerialNumber")
    ResultBean<Boolean> countBySerialNumber(@RequestBody String serialNumber);
    /**
     * 功能描述:添加
     * @param deviceInstallation
     * @return ResultBean<Boolean>
     *               
     *                     
     */
    @PostMapping("/implement/device/installation/insertEntity")
    ResultBean<Boolean> insertEntity(@RequestBody DeviceInstallation deviceInstallation);
    /**
     * 功能描述:添加
     * @param serialNumber
     * @return ResultBean<Boolean>
     *               
     *                     
     */
    @PostMapping("/implement/device/installation/findBySerialNumber")
    ResultBean<DeviceInstallation> findBySerialNumber(@RequestBody String serialNumber);
    /**
     * 功能描述:根据id查询设备安装信息
     * @param id
     * @return ResultBean<DeviceInstallation>
     *                
     *                      
     */
    @PostMapping("/implement/device/installation/findEntityById")
    ResultBean<DeviceInstallation> findEntityById(@RequestBody Long id);
    /**
     * 功能描述:修改
     * @param deviceInstallation
     * @return ResultBean<DeviceInstallation>
     *                
     *                      
     */
    @PostMapping("/implement/device/installation/edit")
    ResultBean<Boolean> edit(@RequestBody DeviceInstallation deviceInstallation);
    /**
     * 功能描述:检测安装环境评审记录是否已经安装设备
     * @param installationReviewId
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping("/implement/device/installation/countByInstallationReviewId")
    ResultBean<Boolean> countByInstallationReviewId(@RequestBody Long installationReviewId);
    /**
     * 功能描述:根据条件查询安装记录
     * @param deviceInstallation
     * @return ResultBean<DeviceInstallation>
     *               
     *                      
     */
    @PostMapping("/implement/device/installation/findByCondition")
    ResultBean<DeviceInstallation> findByCondition(@RequestBody DeviceInstallation deviceInstallation);
    /**
     * 功能描述:软删除
     * @param id
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping("/implement/device/installation/delete")
    ResultBean<Boolean> delete(@RequestBody Long id);
}
