package com.repair.api;

import com.repair.model.pojo.RepairConsumables;
import com.repair.model.request.MaintenanceConsumeablesRequest;
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 javax.servlet.http.HttpServletResponse;
import java.lang.reflect.InvocationTargetException;

@RequestMapping("/api/repairConsumables")
@Api(tags = {"repairConsumablesController"}, value = "耗材记录")
public interface RepairConsumablesControllerAPI {

    @PostMapping(value = "/insertRepairConsumables")
    @ApiOperation(value = "添加耗材记录", notes = "添加耗材记录数据", httpMethod = "POST")
    CommonResult InsertRepairConsumables(@Validated @RequestBody RepairConsumables rc, BindingResult bindingResult);

    @PostMapping(value = "/updateRepairConsumablesById")
    @ApiOperation(value = "编辑耗材记录数据", notes = "编辑耗材记录数据", httpMethod = "POST")
    CommonResult updateRepairConsumablesById(@Validated @RequestBody RepairConsumables rc, BindingResult bindingResult);

    @GetMapping(value = "/queryPageRepairConsumables")
    @ApiOperation(value = "耗材记录分页数据", notes = "耗材记录分页数据", httpMethod = "GET")
    CommonResult queryPageRepairConsumabless(@RequestParam int currentPage, @RequestParam int pageCount, String name);

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

    @GetMapping(value = "/queryRepairConsumablePageList")
    @ApiOperation(value = "耗材记录数据", notes = "耗材记录数据", httpMethod = "GET")
    CommonResult queryRepairConsumablePageList(@RequestParam int currentPage, @RequestParam int pageCount, String keyWord,String startTime,String endTime);

    @GetMapping(value = "/downloadRepairConsumableExcel")
    @ApiOperation(value = "导出耗材记录数据", notes = "导出耗材记录数据", httpMethod = "GET")
    void downloadRepairConsumableExcel(String keyWord, String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException;

    @PostMapping(value = "/insertMaintenanceConsumables")
    @ApiOperation(value = "维修师傅报价", notes = "维修师傅报价", httpMethod = "POST")
    CommonResult InsertMaintenanceConsumables(@Validated @RequestBody MaintenanceConsumeablesRequest data, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/queryChangePriceConsumables")
    @ApiOperation(value = "获取改价耗材集合数据", notes = "获取改价耗材集合数据", httpMethod = "GET")
    CommonResult queryChangePriceConsumables(@RequestParam Integer recordId);

    @PostMapping(value = "/changeMaintenanceConsumables")
    @ApiOperation(value = "后勤人员改价", notes = "后勤人员改价", httpMethod = "POST")
    CommonResult changeMaintenanceConsumables(@Validated @RequestBody MaintenanceConsumeablesRequest data, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;

}
