package com.bonus.sgzb.base.controller;

import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.base.domain.RepairTask;
import com.bonus.sgzb.base.domain.RepairTaskDetails;
import com.bonus.sgzb.base.service.RepairService;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author c liu
 * @date 2023/12/11
 */
@RestController
@RequestMapping("/repair")
public class RepairController extends BaseController {
    @Autowired
    private RepairService service;

    /**
     * 获取维修任务列表
     */
    @ApiOperation(value = "获取维修任务列表")
    @Log(title = "维修任务列表", businessType = BusinessType.QUERY)
    @GetMapping("/getRepairTaskList")
    public TableDataInfo getRepairTaskList(RepairTask bean)
    {
        startPage();
        List<RepairTask> list = service.getRepairTaskList(bean);
        return getDataTable(list);
    }

    /**
     * 获取维修任务机具列表
     */
    @ApiOperation(value = "获取维修任务机具列表")
    @Log(title = "维修任务机具列表", businessType = BusinessType.QUERY)
    @GetMapping("/getRepairMaTypeList")
    public TableDataInfo getRepairMaTypeList(RepairTask bean)
    {
        startPage();
        List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
        return getDataTable(list);
    }

}
