package com.unis.base.app.controller;

import com.unis.base.client.EnterpriseQualificationInformationHisFeign;
import com.unis.base.common.vo.EnterpriseQualificationInformationHisqueryVO;
import com.unis.base.common.vo.QyzgQyzgxxVO;
import com.unis.common.utils.CurrentUtil;
import com.unis.common.utils.ResponseWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



@RestController
@Api(value = "企业历史信息", tags = "企业历史信息")
@Slf4j
public class EnterpriseQualificationInformationHisController {
	
	@Autowired
	private EnterpriseQualificationInformationHisFeign qyzgQyzgxxHisFeign;


	/**
	 * 企业历史信息列表
	 * @param companyQueryVO
	 * @return
	 */
	@ApiOperation(value = "企业历史信息列表", notes = "参数：企业历史")
	@PostMapping(value = "/getPageList/{pageNum}/{pageSize}")
    public ResponseWrapper getPageList(@RequestBody EnterpriseQualificationInformationHisqueryVO qyzgQyzgxxHisqueryVO,@PathVariable("pageNum")Integer pageNum,@PathVariable("pageSize")Integer pageSize){
		return qyzgQyzgxxHisFeign.getPageList(qyzgQyzgxxHisqueryVO, pageNum, pageSize);
	}

	
	
	/**
	 * 新增企业历史信息
	 * @param qyzgQyzgxxVO
	 * @return
	 */
	@ApiOperation(value = "新增企业历史信息", notes = "参数：企业历史")
	@PostMapping(value = "/QyzgQyzgxxHis")
    public ResponseWrapper getQyzgQyzgxxHis(@RequestBody QyzgQyzgxxVO qyzgQyzgxxVO ){
		
		qyzgQyzgxxVO.setStatus(1);
		qyzgQyzgxxVO.setCreateDate(new Date());
		qyzgQyzgxxVO.setCreator(CurrentUtil.getUserName());
		qyzgQyzgxxVO.setRefresher(CurrentUtil.getUserName());
		qyzgQyzgxxVO.setRefreshTime(new Date());
		
		return qyzgQyzgxxHisFeign.insertQyzgQyzgxxHis(qyzgQyzgxxVO);
		
	}

	
	
	/**
	 * 查看企业资格历史
	 * @param id
	 * @return
	 */
	@ApiOperation(value = "查看企业资格历史", notes = "参数：企业历史id")
	@PostMapping(value = "/QyzgQyzgxxHis/{id}")
    public ResponseWrapper getEnterpriseQualificationInformationHisVO(@PathVariable String id ){
		return qyzgQyzgxxHisFeign.getEnterpriseQualificationInformationHisVO(id);
	}
	
	
	
	
}
