package com.unis.base.app.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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.FumigationHisFeign;
import com.unis.base.common.vo.TyXzzyxxHisQueryVO;
import com.unis.base.common.vo.TyXzzyxxHisVO;
import com.unis.common.utils.ResponseWrapper;

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

/**
 * @author 张琪
 * @date 2019年9月18日 下午6:23:56
 * @description
 * @
 */
@RestController
@Slf4j
@Api(value = "熏蒸作业信息历史记录 ", tags = "熏蒸作业信息历史记录 维护")
public class FumigationHisController {
	@Autowired
	private FumigationHisFeign fumigationHisFeign;

	/**
	 *  分页列表查询
	 * @param pageNum
	 * @param pageSize
	 * @param tyXzzyxxHisQueryVO
	 * @return
	 */
	@ApiOperation(value = "熏蒸作业信息历史记录列表 根据条件【分页查询】",notes = "参数：方案编号/作业单编号")
	@PostMapping(value = "/fumigationHisPageList/{pageNum}/{pageSize}")
	public ResponseWrapper getTfzyxxHisList(@PathVariable(value = "pageNum") Integer pageNum,
			  @PathVariable(value = "pageSize") Integer pageSize,@RequestBody TyXzzyxxHisQueryVO tyXzzyxxHisQueryVO) {
		return fumigationHisFeign.getTfzyxxHisList(pageNum, pageSize, tyXzzyxxHisQueryVO);
	}
	/**
	 * 根据主键ID获取熏蒸作业历史信息
	 * @param lsId
	 * @return
	 */
	@ApiOperation(value = "根据主键编码获取熏蒸作业历史信息", notes = "参数：主键ID")
	@GetMapping(value = "/fumigationHisInfo/{lsId}")
	public ResponseWrapper getFumigationHisInfoByLsId(@PathVariable("lsId")String lsId) {
		return fumigationHisFeign.getFumigationHisInfoByLsId(lsId);
	}

	/**
	 * @author 张琪
	 * @Description 新增通风作业信息
	 * @param 通风作业信息对象 models
	 * @return 新增状态
	 */
	@ApiOperation(value = "新增熏蒸作业信息", notes = "参数：备案类型【0_未备案，1_待提交，2_待审核，3_已驳回，4_已备案】")
	@PostMapping(value = "/fumigationHisInfoSave")
    public ResponseWrapper insert(@RequestBody TyXzzyxxHisVO tyXzzyxxHisVO) {
		return fumigationHisFeign.insert(tyXzzyxxHisVO);
	}
}
