package com.tofly.api.order;

import com.tofly.common.core.entity.ResultRespone;
import com.tofly.pojo.maintain.dto.RepairorderDto;
import com.tofly.pojo.maintain.vo.AuxiliarySingleVo;
import com.tofly.pojo.maintain.vo.datail.RepairOrderDetailNewVo;
import com.tofly.pojo.maintain.vo.datail.RepairOrderDetailVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author BZ-DJJ
 */
@FeignClient(name = "tofly-xrty-gps",contextId="OrderClient")
public interface OrderClient {
    /**
     * 新增抢维修工单
     * @param parDto
     * @return
     */
    @PostMapping("/repairorder/saveFeign")
    ResultRespone<Object> saveRepairOrderFeign(@RequestBody RepairorderDto parDto);

    /**
     * 通过ID查询抢维修工单详情
     * @param id   工单id
     * @param flag 是否展示部门下所有数据 是则填1 个人不填为空
     * @return
     */
    @GetMapping("/repairorder/getPlanRepairOrderDetail")
    ResultRespone<RepairOrderDetailVo> getPlanRepairOrderDetail(@RequestParam(value = "id") Long id,@RequestParam(value = "flag",required = false)String flag);

    /**
     * 通过ID查询抢维修工单详情(跨部门),获取当前工单所有信息
     * @param orderId   工单id
     * @return
     */
    @GetMapping("/repairorder/getNewRepairOrderDetail")
    ResultRespone<RepairOrderDetailNewVo> getNewRepairOrderDetail(@RequestParam(value = "orderId") Long orderId);
    /**
     * 终止抢维修工单
     * @param orderId 工单id
     * @return
     */
    @GetMapping("/repairorder/terminationRepairOrder")
    ResultRespone<Boolean> terminationRepairOrder(@RequestParam("orderId") String orderId);

    /**
     * 获取用户部门今天已签到的所有用户最新位置信息列表
     * @param deptIds 部门id部门id（多个用,分隔）
     * @param flag 是否获取所有用户(所有部门) 1为是
     * @return
     */
    @GetMapping("/repairorder/getAuxiliarySingle")
    ResultRespone<List<AuxiliarySingleVo>> getAuxiliarySingle(@RequestParam(value = "deptIds",required = false)String deptIds,
                                                              @RequestParam(value = "flag",required = false)String flag);
}
