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

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

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.controller.vo.DeptEntrustDocAuditParam;
import com.zt.plat.module.qms.business.bus.service.SampleDeptEntrustDocAuditService;

import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;


@Tag(name = "管理后台 - 样品班组委托报告审核")
@RestController
@RequestMapping("/qms/bus/sample/dept-entrust-doc-audit")
@Validated
@DeptDataPermissionIgnore(enable = "true")
public class SampleDeptEntrustDocAuditController {
	
	@Resource
	private SampleDeptEntrustDocAuditService sampleDeptEntrustDocAuditService;
	
	
	@GetMapping("/getDeptEntrustDocAuditByBusSampleEntrustDeptId")
	public CommonResult<?> getDeptEntrustDocAuditByBusSampleEntrustDeptId(Long businessSampleEntrustDepartmentId) {
		JSONObject json = sampleDeptEntrustDocAuditService.getDeptEntrustDocAuditByBusSampleEntrustDeptId(businessSampleEntrustDepartmentId);
		return success(json);
	}
	
	@PostMapping("/auditDeptEntrustDocAudit")
	public CommonResult<?> auditDeptEntrustDocAudit(@RequestBody DeptEntrustDocAuditParam param) {
		sampleDeptEntrustDocAuditService.auditDeptEntrustDocAudit(param);
		return success("成功");
	}

}
