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

import java.util.List;

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

    /**
     * 功能描述:分页查询设备检测
     * @param dto
     * @return ResultBean<Page<DeviceTest>>
     *                
     *                      
     */
    @PostMapping("/implement/device/test/showList")
    ResultBean<Page<DeviceTest>> showList(@RequestBody DeviceTestDto dto);

    /**
     * 功能描述:根据id获取设备检测信息
     * @param id
     * @return
     *                
     *                      
     */
    @PostMapping("/implement/device/test/findById")
    ResultBean<DeviceTest> findById(@RequestBody Long id);

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

    /**
     * 功能描述:根据位置统计定位记录数量
     * @param orgPosition
     * @return ResultBean<Integer>
     *               
     *                      
     */
    @PostMapping("/implement/device/test/countByOrgPosition")
    ResultBean<Integer> countByOrgPosition(@RequestBody String orgPosition);

    /**
     * 功能描述:根据位置查询所属设备检测
     * @param dto{
     *         orgPosition : 位置 必填
     * }
     * @return ResultBean<DeviceTest>
     *             
     *                      
     */
    @PostMapping("/implement/device/test/findListByPosition")
    ResultBean<DeviceTest> findListByPosition(@RequestBody DeviceTestDto dto);
    /**
     * 功能描述:根据位置统计定位记录数量
     * @param serialNumber
     * @return ResultBean<DeviceTest>
     *               
     *                      
     */
    @PostMapping("/implement/device/test/findBySerialNumber")
    ResultBean<DeviceTest> findBySerialNumber(@RequestBody String serialNumber);
    /**
     * 功能描述:新增
     * @param deviceTest
     * @return ResultBean<DeviceTest>
     *               
     *                     
     */
    @PostMapping("/implement/device/test/insertEntity")
    ResultBean<Boolean> insertEntity(@RequestBody DeviceTest deviceTest);
    /**
     * 功能描述:根据设备安装记录id获取设备检测审核通过记录
     * @param deviceInstallationIds
     * @return ResultBean<DeviceTest>
     *               
     *                      
     */
    @PostMapping("/implement/device/test/findByDeviceInstallationIds")
    ResultBean<DeviceTest> findByDeviceInstallationIds(@RequestBody List<Long> deviceInstallationIds);
}
