package com.unis.base.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import com.unis.common.utils.ResponseWrapper;
import com.unis.base.common.vo.OiltankQueryVO;
import com.unis.base.common.vo.OiltankVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @author huangxing
 * @version 1.0
 * @Title: DYgxxsjyFeign
 * @ProjectName DYgxxsjyFeign
 * @Description:油罐fegin接口
 * @date 2019/7/7 18:05
 */
@FeignClient(name = "base-server")
@Component
@Api(value = "油罐信息", tags = "油罐信息维护")
public interface OiltankFeign {

	/**
	 * @author huangxing
	 * @Description 获取油罐列表
	 * @param 油罐编号，油罐名称，库点编号，库点名称，油罐类型，油罐状态
	 * @return 油罐信息列表
	 */
	@ApiOperation(value = "获取油罐信息列表", notes = "参数：油罐编号，油罐名称，库点编号，库点名称，建设年代开始时间，建设年代结束时间")
	@PostMapping(value = "/oiltankList")
    public ResponseWrapper getOiltankList(@RequestBody OiltankQueryVO oiltankVO);
	
	/**
	 * @author huangxing
	 * @Description 获取油罐信息列表
	 * @param 油罐编号，油罐名称，库点编号，库点名称，油罐类型，油罐状态
	 * @return 油罐信息列表
	 */
	@ApiOperation(value = "分页获取油罐信息列表", notes = "参数：油罐编号，油罐名称，库点编号，库点名称，油罐类型，建筑类型，油罐状态")
	@PostMapping(value = "/oiltankPage/{pageNum}/{pageSize}")
	public ResponseWrapper getOiltankPage(@RequestBody OiltankQueryVO oiltankVO,@PathVariable("pageNum")Integer pageNum,@PathVariable("pageSize") Integer pageSize);
	
	/**
	 * @author huangxing
	 * @Description 根据油罐编码获取油罐信息
	 * @return 库点信息
	 */
	@ApiOperation(value = "根据油罐编码获取油罐信息", notes = "参数：油罐编号")
	@GetMapping(value = "/oiltank/{ygbh}")
	public ResponseWrapper getOiltankInfoByygbh(@PathVariable("ygbh")String ygbh);
	

	/**
	 * @author huangxing
	 * @Description 根据库点编码获取油罐信息
	 * @return 库点信息
	 */
	@ApiOperation(value = "更新油罐信息", notes = "参数：油罐信息 models")
	@PutMapping(value = "/update")
	public ResponseWrapper update(@RequestBody OiltankVO oiltankVO);
	
	/**
	 * @author huangxing
	 * @Description 删除油罐信息
	 * @param 参数：社会行政代码
	 * @return 状态
	 */
	@DeleteMapping(value="/oiltank/{id}")
	@ApiOperation(value = "根据油罐编号删除油罐信息", notes = "参数：油罐编号")
	public ResponseWrapper delete(@PathVariable("id")String id);
	
	/**
	 * @author huangxing
	 * @Description 新增油罐信息
	 * @param 油罐信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/insert")
	@ApiOperation(value = "新增油罐信息", notes = "参数：油罐信息对象 models")
    public ResponseWrapper insert(@RequestBody OiltankVO oiltankVO);


	/**
	 * @author huangxing
	 * @Description 根据油罐编号处理申请状态
	 * @param ygbh 参数：油罐编号
	 * @return 状态
	 */
	@PostMapping(value="/oiltank/updateSqzt")
	@ApiOperation(value = "根据油罐编号处理申请状态（0 可编辑 1 不可编辑【当申请状态不是驳回时】）", notes = "参数：油罐编号，状态")
	public ResponseWrapper updateSqzt(@RequestParam(name = "ygbh", required = true)String ygbh, @RequestParam(name = "sqzt", required = true)String sqzt);

	@PostMapping(value = "/oiltank/getOilTankInfoList")
	@ApiOperation(value = "根据参数获取油罐信息集合", notes = "根据参数获取油罐信息集合")
	public ResponseWrapper getOilTankInfoList(@RequestBody OiltankQueryVO oiltankQueryVO);

	@ApiOperation(value = "保存油罐信息下发结果")
	@PutMapping(value = "/updateSendResult")
	public ResponseWrapper updateSendResult(@RequestBody OiltankVO oiltankVO);

	@ApiOperation(value = "批量更新油罐信息")
	@PutMapping(value = "/oiltankBatch")
	public ResponseWrapper oiltankBatch(@RequestBody OiltankVO oiltankVO);
}
