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.RepairOrderDetailVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
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);

    /**
     * 终止抢维修工单
     * @param orderId 工单id
     * @return
     */
    @GetMapping("/repairorder/terminationRepairOrder")
    ResultRespone<Boolean> terminationRepairOrder(@RequestParam("orderId") String orderId);

    @GetMapping("/repairorder/getAuxiliarySingle")
    ResultRespone<List<AuxiliarySingleVo>> getAuxiliarySingle(@RequestParam("deptIds") String deptIds);

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