package digital.laboratory.platform.inspection.controller;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.inspection.service.IdentifyBookDataService;
import digital.laboratory.platform.inspetion.api.entity.IdentificationBookDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xy
 * @version 1.0
 * @title 鉴定文书数据接口，主要为文书系统提供接口
 * @description
 * @create 2024/3/13 11:01
 */
@RestController
@RequestMapping("/identifyBookData")
@Api(tags = "16-鉴定报告数据提供服务接口", description = "鉴定报告数据提供服务接口")
public class IdentifyBookController {
    @Resource
    private IdentifyBookDataService identifyBookDataService;

    //对文书系统提供获取实验数据
    @GetMapping("/getIdentifyBookDataByBusinessId")
    @ApiOperation(value = "获取检验数据")
    public R<IdentificationBookDTO> getIdentifyBookDataByBusinessId(String businessId) {
        try {
            return R.ok(identifyBookDataService.getIdentifyBookDataByBusinessId(businessId), "构建数据成功");
        } catch (Exception e) {
            e.printStackTrace();
            return R.failed("获取检验数据失败！");
        }

    }

    @PostMapping("/getTestFinishBusinessData")
    @ApiOperation(value = "获取待制作文书列表")
    public R getTestFinishBusinessData(@RequestBody List<String> synedIdList) {
        return identifyBookDataService.getTestFinishBusinessData(synedIdList);
    }
}
