package com.unis.base.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

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

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

/**
 * @author huangxing
 * @version 1.0
 * @Title DRyxxsjyController
 * @ProjectName 人员信息 Controller
 * @Description
 * @date 2019/07/22 17点26分
 */
@FeignClient(name = "base-server")
@Component
@Api(value = "人员信息", tags = "人员信息维护")
public interface PersonnelFegin {

	/**
	 * @author huangxing
	 * @Description 获取人员列表
	 * @param 人员编号，人员名称，库点编号，库点名称，岗位代码
	 * @return 人员信息列表
	 */
	@ApiOperation(value = "获取人员信息列表", notes = "参数：人员编号，人员名称，库点编号，库点名称，岗位代码")
	@PostMapping(value = "/personnelList")
    public ResponseWrapper getDRyxxsjyList(@RequestBody DRyxxsjyVO dRyxxsjyVO);

	/**
	 * @author huangxing
	 * @Description 获取人员信息列表
	 * @param 人员编号，人员名称，库点编号，库点名称，岗位代码
	 * @return 人员信息列表
	 */
	@ApiOperation(value = "分页获取人员信息列表", notes = "参数：人员编号，人员名称，库点编号，库点名称，岗位代码")
	@PostMapping(value = "/personnelPage/{pageNum}/{pageSize}")
	public ResponseWrapper getDRyxxsjyPage(@RequestBody DRyxxsjyVO dRyxxsjyVO,@PathVariable("pageNum")Integer pageNum,@PathVariable("pageSize") Integer pageSize);


	/**
	 * @author huangxing
	 * @Description 根据人员编码获取人员信息
	 * @return 库点信息
	 */
	@ApiOperation(value = "根据人员编码获取人员信息", notes = "参数：库点编号")
	@GetMapping(value = "/personnel/{rybh}")
	public ResponseWrapper getDRyxxsjyInfoByrybh(@PathVariable("rybh")String rybh);

	/**
	 * @author huangxing
	 * @Description 根据库点编码获取库点信息
	 * @return 库点信息
	 */
	@ApiOperation(value = "更新人员信息", notes = "参数：人员信息 models")
	@PutMapping(value = "/personnel")
	public ResponseWrapper update(@RequestBody DRyxxsjyVO dRyxxsjyVO);

	@ApiOperation(value = "人员信息-带状态更新", notes = "参数：人员姓名，所属库点代码")
	@PutMapping(value = "/personnelUpdate")
	public ResponseWrapper personnelUpdate(@RequestBody DRyxxsjyVO dRyxxsjyVO) ;

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

	/**
	 * @author huangxing
	 * @Description 新增人员信息
	 * @param 人员信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/personnel")
	@ApiOperation(value = "新增人员信息", notes = "参数：人员信息实体 models")
    public ResponseWrapper insert(@RequestBody DRyxxsjyVO dRyxxsjyVO);

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

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

	@PostMapping(value = "/personnelFiling")
	@ApiOperation(value = "人员信息-备案主表状态", notes = "参数：人员编号，是否备案")
	public ResponseWrapper updateFiling(@RequestBody DRyxxsjyVO dRyxxsjyVO) ;

	@PostMapping(value = "/personnelEnabled")
	@ApiOperation(value = "人员信息-更改启用状态", notes = "参数：人员编号，启用状态")
	public ResponseWrapper updateEnabled(@RequestBody DRyxxsjyVO dRyxxsjyVO) ;
}
