package com.unis.base.client;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import com.unis.common.utils.ResponseWrapper;
import com.unis.base.common.vo.DCfxxsjyVO;

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

/**
 * @author huangxing
 * @version 1.0
 * @Title DCfxxsjyFeign
 * @ProjectName 仓房信息 Feign
 * @Description
 * @date 2019/07/22 17点26分
 */
@FeignClient(name = "base-server")
@Component
@Api(value = "仓房信息", tags = "仓房信息维护")
public interface WarehouseFeign {

	@ApiOperation(value = "获取仓房信息", notes = "参数：仓房编号，仓房编码之一")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "cfbh", value = "仓房编号", dataType = "String", paramType = "header"),
			@ApiImplicitParam(name = "cfbm", value = "仓房编码", dataType = "String", paramType = "header")
	})
	@PostMapping(value = "/warehouse/selectById")
	public ResponseWrapper selectById(@RequestBody DCfxxsjyVO dCfxxsjyVO);


	/**
	 * @author huangxing
	 * @Description 获取仓房列表
	 * @return 仓房信息列表
	 */
	@ApiOperation(value = "获取仓房信息列表", notes = "参数：仓房编号，仓房名称，库点编号，库点名称，仓房类型，建筑类型，仓房状态")
	@PostMapping(value = "/warehouseList")
    public ResponseWrapper getDCfxxxsjyList(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	@ApiOperation(value = "获取仓房信息列表", notes = "参数：仓房编号，仓房名称，库点编号，库点名称，仓房类型，建筑类型，仓房状态")
	@PostMapping(value = "/warehouseListCbl")
	public ResponseWrapper getDCfxxxsjyListCbl(@RequestBody DCfxxsjyVO dCfxxsjyVO);


	/**
	 * @author huangxing
	 * @Description 获取仓房列表
	 * @return 仓房信息列表
	 */
	@ApiOperation(value = "获取成品粮仓房信息列表", notes = "参数：仓房编号，仓房名称，库点编号，库点名称，仓房类型，建筑类型，仓房状态")
	@PostMapping(value = "/warehouseChengPinList")
	public ResponseWrapper warehouseChengPinList(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	@ApiOperation(value = "获取原粮仓房信息列表", notes = "参数：仓房编号，仓房名称，库点编号，库点名称，仓房类型，建筑类型，仓房状态")
	@PostMapping(value = "/warehouseYuanLiangList")
	public ResponseWrapper warehouseYuanLiangList(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	/**
	 * @author huangxing
	 * @Description 获取企业信息列表
	 * @param 社会统一行政编码，企业名称，企业类型，企业性质，法定代表人
	 * @return 企业信息列表
	 */
	@ApiOperation(value = "分页获取仓房信息列表", notes = "参数：仓房编号，仓房名称，库点编号，库点名称，仓房类型，建筑类型，仓房状态")
	@PostMapping(value = "/warehousePage/{pageNum}/{pageSize}")
	public ResponseWrapper getDCfxxxsjyPage(@RequestBody DCfxxsjyVO dCfxxsjyVO,@PathVariable("pageNum")Integer pageNum,@PathVariable("pageSize") Integer pageSize);

	/**
	 * @author huangxing
	 * @Description 根据库点编码获取库点信息
	 * @return 库点信息
	 */
	@ApiOperation(value = "根据仓房编码获取仓房信息", notes = "参数：库点编号")
	@GetMapping(value = "/warehouse/{cfbh}")
	public ResponseWrapper getDCfxxxsjyInfoBycfbh(@PathVariable("cfbh")String cfbh);

	/**
	 * @author huangxing
	 * @Description 根据库点编码获取库点信息
	 * @return 库点信息
	 */
	@ApiOperation(value = "更新仓房信息", notes = "参数：仓房信息 models")
	@PutMapping(value = "/warehouse")
	public ResponseWrapper update(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	@ApiOperation(value = "仓房信息-带状态更新", notes = "参数：仓房编号")
	@PutMapping(value = "/warehouseUpdate")
	public ResponseWrapper warehouseUpdate(@RequestBody DCfxxsjyVO dCfxxsjyVO) ;

	/**
	 * @author huangxing
	 * @Description 删除企业信息
	 * @param 参数：社会行政代码
	 * @return 状态
	 */
	@DeleteMapping(value="/warehouse/{cfbh}")
	@ApiOperation(value = "根据仓房编号删除仓房信息", notes = "参数：仓房编号")
	public ResponseWrapper delete(@PathVariable("cfbh")String cfbh);

	/**
	 * @author huangxing
	 * @Description 新增仓房信息
	 * @param 仓房信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/warehouse")
	@ApiOperation(value = "新增仓房信息", notes = "参数：仓房信息实体 models")
    public ResponseWrapper insert(@RequestBody DCfxxsjyVO dAjxxsjyVO);

	@DeleteMapping(value="/warehouseList/{kddm}")
	@ApiOperation(value = "根据库点代码删除仓房信息列表", notes = "参数：库点代码")
	public ResponseWrapper deleteList(@PathVariable("kddm")String kddm) ;

	@ApiOperation(value = "仓房信息-根据库点代码获取仓房列表", notes = "参数：库点代码")
	@PostMapping(value = "/warehouseListByKddm/{kddm}")
	public ResponseWrapper getWarehouseListByKddm(@PathVariable("kddm")String kddm);

	@PostMapping(value = "/warehouseFiling")
	@ApiOperation(value = "仓房信息-备案主表状态", notes = "参数：仓房编号，是否备案")
	public ResponseWrapper updateFiling(@RequestBody DCfxxsjyVO dCfxxsjyVO) ;

	@PutMapping(value = "/warehouseBatch")
	public ResponseWrapper updateBatch(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	@PostMapping(value="/warehouse/selectByEntity")
	public ResponseWrapper selectByEntity(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	@ApiOperation(value = "获取仓房信息及货位信息" )
	@PostMapping(value = "/getWarehouseDetail")
	public ResponseWrapper getWarehouseDetail(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	@ApiOperation(value = "保存仓房信息下发结果")
	@PutMapping(value = "/warehouse/updateSendResult")
	public ResponseWrapper updateSendResult(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	@ApiOperation(value = "分页获取仓房及货位信息列表")
	@PostMapping(value = "/warehousePageNew/{pageNum}/{pageSize}")
	public ResponseWrapper getDCfxxxsjyPageNew(@RequestBody DCfxxsjyVO dCfxxsjyVO, @PathVariable("pageNum") Integer pageNum, @PathVariable("pageSize") Integer pageSize);

	@ApiOperation(value = "获取货位信息")
	@PostMapping(value = "/warehouse/selectCfxxsjy")
	public ResponseWrapper selectCfxxsjy(@RequestBody DCfxxsjyVO dCfxxsjyVO);

	@DeleteMapping(value = "/warehouse/{kddm}/{cfxh}")
	@ApiOperation(value = "根据仓房编号删除仓房信息", notes = "参数：仓房编号")
	public ResponseWrapper delete(@PathVariable("kddm") String kddm,@PathVariable("cfxh") String cfxh);
}
