package com.dhcc.finance.main.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.dhcc.common.model.CurrencyMeta;
import com.dhcc.common.model.response.RestfulResponse;
import com.dhcc.finance.constant.MsConfigConsts;
import com.dhcc.finance.main.domain.CwBdVouchtempF;
import com.dhcc.finance.main.service.CwBdVouchtempFService;
import com.github.pagehelper.PageInfo;

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

/**
 * 功能描述：凭证模板分录辅助配置Controller
 * @author dml
 * @date 2019年3月27日 下午3:15:31
 * @修改日志：
 */
@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + CwBdVouchtempFController.API_PREFIX, 
  	          produces = {MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "凭证模板分录辅助配置Controller", tags = { "凭证模板分录辅助配置操作接口" })
public class CwBdVouchtempFController {
	
	// 凭证模板分录辅助配置操作接口地址前缀
	public static final String API_PREFIX = "/cw_bd_vouchtemp_f";
	
	@Autowired
	CwBdVouchtempFService cwBdVouchtempFService;
	
	/**
	 * 功能描述：查询全部凭证模板分录辅助配置
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwBdVouchtempF>,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月27日 下午3:21:08
	 * @修改日志：
	 */
	@ApiOperation(value = "获取全部凭证模板分录辅助配置", notes = "获取全部凭证模板分录辅助配置", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@ApiImplicitParams({
        @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "String", paramType="query"),
        @ApiImplicitParam(name = "pageSize", value = "每页显示数量", required = true, dataType = "String", paramType="query"),
        @ApiImplicitParam(name = "navigatePages", value = "需要连续显示的页码数量", required = true, dataType = "String", paramType="query"),
        @ApiImplicitParam(name = "pkVouchtempB", value = "分录主键", required = true, dataType = "String", paramType="query")
    }) 
	@RequestMapping(value = { "/searchCwBdVouchtempFAllData" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<PageInfo<CwBdVouchtempF>, CurrencyMeta> searchCwBdVouchtempFAllData(
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages,
    		@RequestParam("pkVouchtempB") String pkVouchtempB){
		return cwBdVouchtempFService.searchCwBdVouchtempFAllData(pageNum, pageSize, navigatePages,pkVouchtempB);
	}

	/**
	 * 功能描述：新增凭证模板分录辅助配置
	 * @param cwBdVouchtempF
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月27日 下午3:25:51
	 * @修改日志：
	 */
	@ApiOperation(value = "新增凭证模板分录辅助配置-传递复杂对象", notes = "新增凭证模板分录辅助配置", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwBdVouchtempF", value = "凭证模板分录辅助配置对象实体", required = true, dataType = "CwBdVouchtempF")
	@RequestMapping(value = "/addCwBdVouchtempF", method = RequestMethod.POST)
	public RestfulResponse<Object, CurrencyMeta> addCwBdVouchtempF(@RequestBody CwBdVouchtempF cwBdVouchtempF){
		return cwBdVouchtempFService.addCwBdVouchtempF(cwBdVouchtempF);
	}
	
	/**
	 * 功能描述：修改凭证模板分录辅助配置
	 * @param cwBdVouchtempF
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月27日 下午3:27:54
	 * @修改日志：
	 */
	@ApiOperation(value = "修改凭证模板分录辅助配置-传递复杂对象", notes = "修改凭证模板分录辅助配置", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwBdVouchtempF", value = "凭证模板分录辅助配置对象实体", required = true, dataType = "CwBdVouchtempF")
	@RequestMapping(value = "/updateCwBdVouchtempFByPk", method = RequestMethod.PUT)
	public RestfulResponse<Object, CurrencyMeta> updateCwBdVouchtempFByPk(@RequestBody CwBdVouchtempF cwBdVouchtempF){
		return cwBdVouchtempFService.updateCwBdVouchtempFByPk(cwBdVouchtempF);
	}
	
	/**
	 * 功能描述：逻辑删除凭证模板分录辅助配置
	 * @param pkVouchtempF
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月27日 下午3:35:34
	 * @修改日志：
	 */
	@ApiOperation(value = "逻辑删除凭证模板分录辅助配置本", notes = "删除凭证模板分录辅助配置", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "pkVouchtempF", value = "凭证模板分录辅助配置主键", required = true, dataType = "String")
	@RequestMapping(value = "/deleteCwBdVouchtempFByPk", method = RequestMethod.DELETE , consumes = MediaType.ALL_VALUE)
	public RestfulResponse<Object, CurrencyMeta> deleteCwBdVouchtempFByPk(@RequestParam("pkVouchtempF") String pkVouchtempF){
		return cwBdVouchtempFService.deleteCwBdVouchtempFByPk(pkVouchtempF);
	}
}
