package com.zd.app.controller;

import com.zd.common.core.domain.R;
import com.zd.system.api.laboratory.RemoteLaboratoryService;
import com.zd.system.api.laboratory.domain.LabGradeManageRecord;
import com.zd.system.api.laboratory.domain.vo.LabGradeManageWorkVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/lab/manage")
@Api(tags = {"分级管控"})
public class LabManageController {

    @Autowired
    private RemoteLaboratoryService laboratoryService;



    @ApiOperation(value = "查询分级管控未完成工作列表")
    @PostMapping("/havingList")
    public R<List<LabGradeManageWorkVO>> havingList(@RequestBody LabGradeManageRecord labGradeManageRecord) {
        return laboratoryService.havingList(labGradeManageRecord);
    }

    @ApiOperation(value = "查询分级管控已完成工作列表")
    @PostMapping("/finishList")
    public R<List<LabGradeManageWorkVO>> finishList(@RequestBody LabGradeManageRecord labGradeManageRecord) {
        return laboratoryService.finishList(labGradeManageRecord);
    }

    @ApiOperation(value = "完成分级管控工作")
    @PostMapping("/finish")
    public R<LabGradeManageRecord> finish(@RequestBody LabGradeManageRecord labGradeManageRecord) {
        return laboratoryService.finish(labGradeManageRecord);
    }

    @ApiOperation(value = "获取分级管控工作详细信息")
    @GetMapping("/getInfo/{id}")
    public R<LabGradeManageRecord> getInfo(@PathVariable("id") Long id) {
        return laboratoryService.getInfo(id);
    }

    @ApiOperation(value = "管控消息执行通知 - 处理工作信息查询")
    @PostMapping("/queryByMessage")
    public R<LabGradeManageWorkVO> queryByMessage(@RequestBody LabGradeManageRecord labGradeManageRecord) {
        return laboratoryService.queryByMessage(labGradeManageRecord);
    }

}
