package com.zt.plat.module.qms.business.bus.controller.admin;

import static com.zt.plat.framework.common.pojo.CommonResult.success;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson2.JSONObject;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService;
import com.zt.plat.module.qms.business.bus.service.SampleEntrustService;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;

/**
 * 报表数据查询接口，不继承BusinessControllerMarker
 */
@RestController
@RequestMapping("/qms/bus/sample/reporting-data-query")
@DeptDataPermissionIgnore(enable = "true")
public class SampleReportDataQueryController {
    
    @Resource
    private SampleEntrustService sampleEntrustService;
    
	@Resource
	private SampleAnalysisAuditService sampleAnalysisAuditService;

    @GetMapping("/entrust-report-detail")
    @Operation(summary = "委托单详情数据")
    public CommonResult<?> reportDetail(@RequestParam("id") Long id) {
    	JSONObject jsonObject = sampleEntrustService.reportDetail(id);
    	return success(jsonObject);
    	
    }

    @Operation(summary = "委托单详情数据")
	@GetMapping("/crossAuditByTaskId")
	public CommonResult<?> crossAuditByTaskId(Long businessAssayTaskId) {
		JSONObject result = sampleAnalysisAuditService.getCrossAuditDataByTaskId(businessAssayTaskId);
		return success(result);
	}
    
}
