package com.repair.api;

import com.repair.model.pojo.RepairRecord;
import com.repair.model.request.*;
import com.repair.model.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@RequestMapping("/api/repairRecord")
@Api(tags = {"RepairRecordController"}, value = "报修记录")
public interface RepairRecordControllerAPI {

    @PostMapping(value = "/pay")
    @ApiOperation(value = "微信支付", notes = "微信支付", httpMethod = "POST")
    CommonResult pay(@Validated @RequestBody WxPayRequest wpr, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/returnPay")
    @ApiOperation(value = "微信支付回调", notes = "微信支付回调", httpMethod = "POST")
    void returnPay(HttpServletRequest request, HttpServletResponse response) throws Exception;

    @PostMapping(value = "/insertRepairRecord")
    @ApiOperation(value = "提交报修订单", notes = "提交报修订单", httpMethod = "POST")
    CommonResult InsertRepairRecord(@Validated @RequestBody repairRecordRequest rrr, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/updateRepairRecordById")
    @ApiOperation(value = "编辑报修记录数据", notes = "编辑报修记录数据", httpMethod = "POST")
    CommonResult updateRepairRecordById(@Validated @RequestBody RepairRecord ra, BindingResult bindingResult);

    @GetMapping(value = "/queryPageRepairRecord")
    @ApiOperation(value = "报修记录分页数据", notes = "报修记录分页数据", httpMethod = "GET")
    CommonResult queryPageRepairRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);

    @GetMapping(value = "/deleteRepairRecordById")
    @ApiOperation(value = "根据ID删除指定报修记录", notes = "根据ID删除指定报修记录", httpMethod = "GET")
    CommonResult deleteRepairRecordById(@RequestParam int id);

    @PostMapping(value = "/uploadFile")
    @ApiOperation(value = "文件上传", notes = "文件上传", httpMethod = "POST")
    CommonResult uploadFile(@RequestParam("file") MultipartFile file) throws Exception;

    @GetMapping(value = "/revokeRepairRecordById")
    @ApiOperation(value = "根据ID撤销指定报修记录", notes = "根据ID撤销指定报修记录", httpMethod = "GET")
    CommonResult revokeRepairRecordById(@RequestParam int id) throws Exception;

    @GetMapping(value = "/getRepairRecordsByUserId")
    @ApiOperation(value = "根据用户ID获取报修记录", notes = "根据用户ID获取报修记录", httpMethod = "GET")
    CommonResult getRepairRecordsByUserId(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int userId, @RequestParam int state);

    @GetMapping(value = "/getRepairRecordCountByUserId")
    @ApiOperation(value = "根据用户ID获取报修报修数量", notes = "根据用户ID获取报修报修数量", httpMethod = "GET")
    CommonResult getRepairRecordCountByUserId(@RequestParam int userId);

    @GetMapping(value = "/getTechnicianCountByUserId")
    @ApiOperation(value = "根据用户ID获取维修师傅端工单报修数量", notes = "根据用户ID获取维修师傅端工单报修数量", httpMethod = "GET")
    CommonResult getTechnicianCountByUserId(@RequestParam int userId);

    @GetMapping(value = "/getTechniciansByUserId")
    @ApiOperation(value = "根据用户ID获取维修师傅报修工单数据", notes = "根据用户ID获取维修师傅报修工单数据", httpMethod = "GET")
    CommonResult getTechniciansByUserId(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int userId, @RequestParam int state);

    @GetMapping(value = "/repairRecordReminder")
    @ApiOperation(value = "催单接口", notes = "催单接口", httpMethod = "GET")
    CommonResult repairRecordReminder(@RequestParam int recordId) throws Exception;

    @GetMapping(value = "/queryManageCount")
    @ApiOperation(value = "工单状态数量", notes = "工单状态数量", httpMethod = "GET")
    CommonResult queryManageCount(Integer schoolId, @RequestHeader("user_head") String userhead, String keyWord, String startTime, String endTime, String maintenanceName);

    @GetMapping(value = "/queryManagePage")
    @ApiOperation(value = "工单管理工单数据", notes = "工单管理工单数据", httpMethod = "GET")
    CommonResult queryManagePage(@RequestParam int currentPage, @RequestParam int pageCount, @RequestHeader("user_head") String userhead, @RequestParam int state, String keyWord, String startTime, String endTime, Integer schoolId, String maintenanceName);

    @GetMapping(value = "/queryPendingOrder")
    @ApiOperation(value = "待处理池分页数据", notes = "待处理池分页数据", httpMethod = "GET")
    CommonResult queryPendingOrder(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int schoolId);

    @GetMapping(value = "/receiveOrders")
    @ApiOperation(value = "待处理池接单", notes = "待处理池接单", httpMethod = "GET")
    CommonResult receiveOrders(@RequestParam int recordId, @RequestParam int userId) throws Exception;

    @GetMapping(value = "/receiveOwnOrders")
    @ApiOperation(value = "维修师傅接单", notes = "维修师傅接单", httpMethod = "GET")
    CommonResult receiveOwnOrders(@RequestParam int recordId, @RequestParam int userId) throws Exception;

    @GetMapping(value = "/closeOrder")
    @ApiOperation(value = "关单", notes = "关单", httpMethod = "GET")
    CommonResult closeOrders(@RequestParam int recordId, @RequestParam String userId, @RequestParam String reason, @RequestParam String remark, Integer voiceLength) throws Exception;

    @GetMapping(value = "/closePCOrder")
    @ApiOperation(value = "管理端关单", notes = "管理端关单", httpMethod = "GET")
    CommonResult closePCOrder(@RequestParam int recordId, @RequestHeader("user_head") String userhead, @RequestParam String reason, @RequestParam String remark) throws Exception;

    @PostMapping(value = "/finishOrder")
    @ApiOperation(value = "维修完成", notes = "维修完成", httpMethod = "POST")
    CommonResult finishOrder(@Validated @RequestBody finishOrderRequest data, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/transferApply")
    @ApiOperation(value = "转单申请", notes = "转单申请", httpMethod = "POST")
    CommonResult transferApply(@Validated @RequestBody transferApplyRequest data, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/offlineApply")
    @ApiOperation(value = "转线下申请", notes = "转线下申请", httpMethod = "POST")
    CommonResult offlineApply(@Validated @RequestBody offlineApplyRequest data, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/collaborateApply")
    @ApiOperation(value = "协作申请", notes = "协作申请", httpMethod = "POST")
    CommonResult collaborateApply(@Validated @RequestBody collaborateApplyRequest data, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/queryTeamWorkCount")
    @ApiOperation(value = "根据校区ID获取团队工单报修数量", notes = "根据校区ID获取团队工单报修数量", httpMethod = "GET")
    CommonResult queryTeamWorkCount(@RequestParam int schoolId);

    @GetMapping(value = "/queryTeamWorkPage")
    @ApiOperation(value = "根据校区ID获取团队工单报修分页数据", notes = "根据校区ID获取团队工单报修分页数据", httpMethod = "GET")
    CommonResult queryTeamWorkPage(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int state, @RequestParam int schoolId);

    @PostMapping(value = "/receiveSendOrders")
    @ApiOperation(value = "派单", notes = "派单", httpMethod = "POST")
    CommonResult receiveSendOrders(@RequestBody ReceiveSendOrdersRequest rsor, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/dropDown")
    @ApiOperation(value = "下拉框", notes = "下拉框", httpMethod = "GET")
    CommonResult dropDown(@RequestParam Integer recordId);

    @GetMapping(value = "/details")
    @ApiOperation(value = "详情", notes = "详情", httpMethod = "GET")
    CommonResult details(@RequestParam int recordId) throws Exception;

    @PostMapping(value = "/cooperationOrders")
    @ApiOperation(value = "协作审核", notes = "协作审核", httpMethod = "POST")
    CommonResult cooperationOrders(@RequestBody cooperationOrdersRequest cor, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/transfer")
    @ApiOperation(value = "转单审核", notes = "转单审核", httpMethod = "POST")
    CommonResult transfer(@RequestBody transferRequest transferRequest, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/offline")
    @ApiOperation(value = "转线下审核", notes = "转线下审核", httpMethod = "POST")
    CommonResult offline(@RequestBody transferRequest transferRequest, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/cooperationDetail")
    @ApiOperation(value = "获取协作审核数据", notes = "获取协作审核数据", httpMethod = "GET")
    CommonResult cooperationDetail(@RequestParam int recordId);

    @GetMapping(value = "/transferDetail")
    @ApiOperation(value = "获取转单审核数据", notes = "获取转单审核数据", httpMethod = "GET")
    CommonResult transferDetail(@RequestParam int recordId);

    @GetMapping(value = "/offlineDetail")
    @ApiOperation(value = "获取转线下审核数据", notes = "获取转线下审核数据", httpMethod = "GET")
    CommonResult offlineDetail(@RequestParam int recordId);

    @GetMapping(value = "/alterPriceShow")
    @ApiOperation(value = "改价显示", notes = "改价显示", httpMethod = "GET")
    CommonResult alterPriceShow(@RequestParam int recordId) throws Exception;

    @GetMapping(value = "/alterPriceGoodsType")
    @ApiOperation(value = "改价物品种类下拉框", notes = "改价物品种类下拉框", httpMethod = "GET")
    CommonResult alterPriceGoodsType(@RequestParam int schoolId) throws Exception;

    @GetMapping(value = "/alterPriceGoodsName")
    @ApiOperation(value = "改价耗材名称下拉框", notes = "改价耗材名称下拉框", httpMethod = "GET")
    CommonResult alterPriceGoodsName(@RequestParam int schoolId, @RequestParam int articleId);

    @PostMapping(value = "/alterPrice")
    @ApiOperation(value = "改价", notes = "改价", httpMethod = "POST")
    CommonResult alterPrice(@RequestBody AlterPriceRequest apr, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/delayed")
    @ApiOperation(value = "延时", notes = "延时", httpMethod = "POST")
    CommonResult delayed(@RequestBody DelayedRequest dr, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/revert")
    @ApiOperation(value = "回复", notes = "回复", httpMethod = "POST")
    CommonResult revert(@RequestBody RevertRequest rr, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/mobileReply")
    @ApiOperation(value = "移动端回复", notes = "移动端回复", httpMethod = "POST")
    CommonResult mobileReply(@RequestBody MobileRevertRequest mrr, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/reportExport")
    @ApiOperation(value = "报表导出", notes = "报表导出", httpMethod = "GET")
    void reportExport(HttpServletResponse response, String keyWord, String startTime, String endTime, Integer schoolId, @RequestParam Integer state, @RequestHeader("user_head") String userhead);

    @GetMapping(value = "/queryMasterHomeCount")
    @ApiOperation(value = "维修师傅首页头部数量", notes = "维修师傅首页头部数量", httpMethod = "GET")
    CommonResult queryMasterHomeCount(@RequestParam int userId);

    @GetMapping(value = "/queryLogisticHomeCount")
    @ApiOperation(value = "郭师傅和后勤首页头部数量", notes = "郭师傅和后勤首页头部数量", httpMethod = "GET")
    CommonResult queryLogisticHomeCount(@RequestParam int schoolId);

    @GetMapping(value = "/repairCampus")
    @ApiOperation(value = "报修校区统计", notes = "报修校区统计", httpMethod = "GET")
    CommonResult repairCampus(@RequestParam int state);

    @GetMapping(value = "/repairArea")
    @ApiOperation(value = "报修区域统计", notes = "报修区域统计", httpMethod = "GET")
    CommonResult repairArea(@RequestParam int state, @RequestParam int currentPage, @RequestParam int pageCount) throws Exception;

    @GetMapping(value = "/repairAreaExport")
    @ApiOperation(value = "报修区域统计导出", notes = "报修区域统计导出", httpMethod = "GET")
    void repairAreaExport(HttpServletResponse response, @RequestParam int state);

    @GetMapping(value = "/maintenanceGoods")
    @ApiOperation(value = "维修物品统计", notes = "维修物品统计", httpMethod = "GET")
    CommonResult maintenanceGoods(@RequestParam int state, @RequestParam int currentPage, @RequestParam int pageCount);

    @GetMapping(value = "/maintenanceGoodsExport")
    @ApiOperation(value = "维修物品统计导出", notes = "维修物品统计导出", httpMethod = "GET")
    void maintenanceGoodsExport(HttpServletResponse response, @RequestParam int state);

    @GetMapping(value = "/maintenanceWorker")
    @ApiOperation(value = "维修师傅效率统计", notes = "维修师傅效率统计", httpMethod = "GET")
    CommonResult maintenanceWorker(@RequestParam int state, @RequestParam int currentPage, @RequestParam int pageCount, @RequestParam Integer schoolId, String keyWord);

    @GetMapping(value = "/maintenanceWorkerExport")
    @ApiOperation(value = "维修师傅效率统计导出", notes = "维修师傅效率统计导出", httpMethod = "GET")
    void maintenanceWorkerExport(HttpServletResponse response, @RequestParam int state, @RequestParam Integer schoolId, String keyWord);

    @GetMapping(value = "/repairAnalysis")
    @ApiOperation(value = "报修分析统计", notes = "报修分析统计", httpMethod = "GET")
    CommonResult repairAnalysis(@RequestParam int state);

    @GetMapping(value = "/repairTrend")
    @ApiOperation(value = "报修趋势统计", notes = "报修趋势统计", httpMethod = "GET")
    CommonResult repairTrend(@RequestParam int state);

    @GetMapping(value = "/repairSummarizing")
    @ApiOperation(value = "总数据汇总统计", notes = "总数据汇总统计", httpMethod = "GET")
    CommonResult repairSummarizing();

    @GetMapping(value = "/repairTotalData")
    @ApiOperation(value = "总数据分析", notes = "总数据分析", httpMethod = "GET")
    CommonResult repairTotalData();

    @GetMapping(value = "/queryPrintData")
    @ApiOperation(value = "获取打印数据", notes = "获取打印数据", httpMethod = "GET")
    CommonResult queryPrintData(@RequestParam int recordId,@RequestHeader("user_head") String userhead);

}
