package com.dhcc.finance.main.controller;

import java.util.List;

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.CwBdAccassitem;
import com.dhcc.finance.main.domain.CwBdVouchtemp;
import com.dhcc.finance.main.model.CwBdVouchtempAdd;
import com.dhcc.finance.main.service.CwBdVouchtempService;
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:38:56 
 * @修改日志：
 */
@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + CwBdVouchtempController.API_PREFIX, produces = {
		MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "凭证模板配置controller", tags = { "凭证模板配置操作接口" })
public class CwBdVouchtempController {
	
	// 凭证模板配置操作接口地址前缀
	public static final String API_PREFIX = "/cw_bd_vouchtemp";
	
	@Autowired
	CwBdVouchtempService cwBdVouchtempService;
	/**
	 * 功能描述:查询凭证模板所有数据
	 * @return RestfulResponse<List<CwBdVouchtemp>,CurrencyMeta>
	 *@author baiyc
	 *@date 2019年4月8日 下午7:45:44
	 *@修改日志:
	 */
	@ApiOperation(value = "获取凭证模板全部数据", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@RequestMapping(value = { "/searchCwBdVouchtemp" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<List<CwBdVouchtemp>, CurrencyMeta> searchCwBdVouchtemp(){
		return cwBdVouchtempService.searchCwBdVouchtemp();
	}
	
	/**
	 * 功能描述：查询凭证模板配置
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwBdVouchtemp>,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月27日 下午3:44:23
	 * @修改日志：
	 */
	@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 = "nameLike", value = "查询条件", required = false, dataType = "String", paramType="query"),
    	@ApiImplicitParam(name = "code", value = "凭证模板编码", required = true, dataType = "String", paramType="query"),
    }) 
	@RequestMapping(value = { "/searchCwBdVouchtempAllData" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<PageInfo<CwBdVouchtemp>, CurrencyMeta> searchCwBdVouchtempAllData(
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages,
    		@RequestParam(value="nameLike",required=false) String nameLike,
    		@RequestParam(value="Ismanual",required=false) String Ismanual,
    		@RequestParam(value="CODE",required=false) String CODE){
		return cwBdVouchtempService.searchCwBdVouchtempAllData(pageNum, pageSize, navigatePages, nameLike, Ismanual, CODE);
	}
	/**
	 * 功能描述：查询凭证模板配置（手工凭模板）
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwBdVouchtemp>,CurrencyMeta>
	 * @author lipeng
	 * @date 2019年7月25日 下午3:44:23
	 * @修改日志：
	 */
	@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"),
    }) 
	@RequestMapping(value = { "/searchCwBdVouchtempAllDataForISMANUAL" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<PageInfo<CwBdVouchtemp>, CurrencyMeta> searchCwBdVouchtempAllDataForISMANUAL(
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages){
		return cwBdVouchtempService.searchCwBdVouchtempAllDataForISMANUAL(pageNum, pageSize, navigatePages);
	}

	/**
	 * 功能描述：新增凭证模板配置
	 * @param cwBdVouchtemp
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月27日 下午3:46:28
	 * @修改日志：
	 */
	@ApiOperation(value = "新增凭证模板配置-传递复杂对象", notes = "新增凭证模板配置", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwBdVouchtempAdd", value = "凭证模板配置对象实体", required = true, dataType = "CwBdVouchtempAdd")
	@RequestMapping(value = "/addCwBdVouchtemp", method = RequestMethod.POST)
	public RestfulResponse<Object, CurrencyMeta> addCwBdVouchtemp(@RequestBody CwBdVouchtempAdd cwBdVouchtempAdd){
		return cwBdVouchtempService.addCwBdVouchtemp(cwBdVouchtempAdd);
	}
	
	/**
	 * 功能描述：修改凭证模板配置
	 * @param cwBdVouchtemp
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月27日 下午3:48:20
	 * @修改日志：
	 */
	@ApiOperation(value = "修改凭证模板配置-传递复杂对象", notes = "修改凭证模板配置", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwBdVouchtemp", value = "凭证模板配置对象实体", required = true, dataType = "CwBdVouchtemp")
	@RequestMapping(value = "/updateCwBdVouchtempByPk", method = RequestMethod.PUT)
	public RestfulResponse<Object, CurrencyMeta> updateCwBdVouchtempByPk(@RequestBody CwBdVouchtemp cwBdVouchtemp){
		return cwBdVouchtempService.updateCwBdVouchtempByPk(cwBdVouchtemp);
	}
	
	/**
	 * 功能描述：删除凭证模板配置
	 * @param pkVouchtemp
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月27日 下午3:50:05
	 * @修改日志：
	 */
	@ApiOperation(value = "逻辑删除凭证模板配置", notes = "删除凭证模板配置", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "pkVouchtemp", value = "凭证模板配置主键", required = true, dataType = "String")
	@RequestMapping(value = "/deleteCwBdVouchtempByPk", method = RequestMethod.DELETE , consumes = MediaType.ALL_VALUE)
	public RestfulResponse<Object, CurrencyMeta> deleteCwBdVouchtempByPk(@RequestParam("pkVouchtemp") String pkVouchtemp){
		return cwBdVouchtempService.deleteCwBdVouchtempByPk(pkVouchtemp);
	}

}
