package com.zt.plat.module.qms.thirdpartyapi.controller.admin;

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

import java.util.List;

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.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.ThirdpartyXntSampleEntrustReqVO;
import com.zt.plat.module.qms.thirdpartyapi.service.ThirdpartyXntSampleEntrustService;

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

/**
 * 西南铜样品委托
 */
@Tag(name = "西南铜样品委托接口")
@RestController
@RequestMapping("/qms/thirdpartyapi/xnt-sample-entrust")
@DeptDataPermissionIgnore(enable = "true")
public class ThirdpartyXntSampleEntrustController {
	
	@Resource
	private ThirdpartyXntSampleEntrustService thirdpartySampleEntrustService;
	
    @PostMapping("/create-raw-material")
    @Operation(summary = "创建原料委托登记")
    public CommonResult<?> createRawMaterial(@Valid @RequestBody List<ThirdpartyXntSampleEntrustReqVO> sampleEntrustReqVOList) {
    	thirdpartySampleEntrustService.createRawMaterial(sampleEntrustReqVOList);
    	return success("");
    }
	
    @PostMapping("/create-supplier")
    @Operation(summary = "创建委供方托登记")
    public CommonResult<?> createSupplier(@Valid @RequestBody List<ThirdpartyXntSampleEntrustReqVO> sampleEntrustReqVOList) {
    	thirdpartySampleEntrustService.createSupplier(sampleEntrustReqVOList);
    	return success("");
    }
	
    @PostMapping("/create-product")
    @Operation(summary = "创建产品委托登记")
    public CommonResult<?> createProduct(@Valid @RequestBody List<ThirdpartyXntSampleEntrustReqVO> sampleEntrustReqVOList) {
    	thirdpartySampleEntrustService.createProduct(sampleEntrustReqVOList);
    	return success("");
    }
	
    @PostMapping("/create-ipc")
    @Operation(summary = "创建中控委托登记")
    public CommonResult<?> createInProcessControl(@Valid @RequestBody List<ThirdpartyXntSampleEntrustReqVO> sampleEntrustReqVOList) {
    	thirdpartySampleEntrustService.createInProcessControl(sampleEntrustReqVOList);
    	return success("");
    }
	
    @PostMapping("/create-retest")
    @Operation(summary = "创建复测委托登记")
    public CommonResult<?> createReTest(@Valid @RequestBody List<ThirdpartyXntSampleEntrustReqVO> sampleEntrustReqVOList) {
    	thirdpartySampleEntrustService.createReTest(sampleEntrustReqVOList);
    	return success("");
    }
	
    @PostMapping("/create-product-retest")
    @Operation(summary = "创建产品复测委托登记")
    public CommonResult<?> createProductReTest(@Valid @RequestBody List<ThirdpartyXntSampleEntrustReqVO> sampleEntrustReqVOList) {
    	thirdpartySampleEntrustService.createProductReTest(sampleEntrustReqVOList);
    	return success("");
    }
	
    @PostMapping("/create-central-retentin-retest")
    @Operation(summary = "创建中心留样委托登记")
    public CommonResult<?> createCentralRetentionReTest(@Valid @RequestBody List<ThirdpartyXntSampleEntrustReqVO> sampleEntrustReqVOList) {
    	thirdpartySampleEntrustService.createCentralRetentionReTest(sampleEntrustReqVOList);
    	return success("");
    }
	
    @PostMapping("/create-temporary")
    @Operation(summary = "创建临时委托委托登记")
    public CommonResult<?> createTemporary(@Valid @RequestBody List<ThirdpartyXntSampleEntrustReqVO> sampleEntrustReqVOList) {
    	thirdpartySampleEntrustService.createTemporary(sampleEntrustReqVOList);
    	return success("");
    }

}
