package com.unis.base.app.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.unis.base.client.QualityInfoController;
import com.unis.base.client.QualityMainFeign;
import com.unis.base.client.SampleFeign;
import com.unis.base.common.vo.SampleVO;
import com.unis.base.common.vo.TyZjxxmxbVO;
import com.unis.base.common.vo.TyZjxxzbVO;
import com.unis.common.utils.ResponseWrapper;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zhengbodang
 * @version 1.0
 * @Title DAjxxsjyController
 * @ProjectName 质检信息主表 Controller
 * @Description
 * @date 2019/07/22 17点26分
 */
@RestController
@Api(value = "质检信息、样品信息 ", tags = "质检信息、样品信息 维护")
@Slf4j
public class QualityMainController {

	@Autowired
	private QualityMainFeign  qualityMainFeign;

	@Autowired
	private QualityInfoController qualityInfoController;
	@Autowired
	private SampleFeign sampleFeign;


	/**
	 * @author zhengbodang
	 * @Description 新增出入库结算信息
	 * @param 廒间信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/batchQualityMain")
	@ApiOperation(value = "批量新增质检信息主表", notes = "参数：质检单编号，质检单名称")
    public ResponseWrapper batchInserts(@RequestBody List<TyZjxxzbVO> tyZjxxzbVO) {
		return qualityMainFeign.batchInserts(tyZjxxzbVO);
    }

	/**
	 * @author zhengbodang
	 * @Description 新增质检信息
	 * @param 廒间信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/batchQualityInfo")
	@ApiOperation(value = "批量新增质检明细信息", notes = "参数：质检信息id，检验单号")
    public ResponseWrapper batchInsertsInfo(@RequestBody List<TyZjxxmxbVO> tyZjxxmxbVO) {
		return qualityInfoController.batchInserts(tyZjxxmxbVO);
	}

	/**
	 * @author WangZL
	 * @Description 新增样品信息
	 * @param 样品信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/batchSample")
	@ApiOperation(value = "批量新增样品信息", notes = "参数：样品编号，样品单编号")
    public ResponseWrapper batchInsertsSample(@RequestBody List<SampleVO> sampleVO) {
		return sampleFeign.batchInserts(sampleVO);
	}

}
