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.CwGlVouchermaxno;
import com.dhcc.finance.main.service.CwGlVouchermaxnoService;
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月28日 下午8:25:05
 * @修改日志：
 */
@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + CwGlVouchermaxnoController.API_PREFIX, produces = {
		MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "最大凭证号controller", tags = { "最大凭证号操作接口" })
public class CwGlVouchermaxnoController {
	
	// 最大凭证号操作接口地址前缀
	public static final String API_PREFIX = "/cw_gl_vouchermaxno";
	
	@Autowired
	CwGlVouchermaxnoService cwGlVouchermaxnoService;
	
	/**
	 * 功能描述：获取全部最大凭证号
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwGlVouchermaxno>,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月28日 下午8:28:21
	 * @修改日志：
	 */
	@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 = { "/searchCwGlVouchermaxnoAllData" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<PageInfo<CwGlVouchermaxno>, CurrencyMeta> searchCwGlVouchermaxnoAllData(
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages){
		return cwGlVouchermaxnoService.searchCwGlVouchermaxnoAllData(pageNum, pageSize, navigatePages);
	}

	/**
	 * 功能描述：新增最大凭证号
	 * @param cwGlVouchermaxno
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月28日 下午8:29:47
	 * @修改日志：
	 */
	@ApiOperation(value = "新增最大凭证号-传递复杂对象", notes = "新增最大凭证号", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwGlVouchermaxno", value = "最大凭证号对象实体", required = true, dataType = "CwGlVouchermaxno")
	@RequestMapping(value = "/addCwGlVouchermaxno", method = RequestMethod.POST)
	public RestfulResponse<Object, CurrencyMeta> addCwGlVouchermaxno(@RequestBody CwGlVouchermaxno cwGlVouchermaxno){
		return cwGlVouchermaxnoService.addCwGlVouchermaxno(cwGlVouchermaxno);
	}

	/**
	 * 功能描述：修改最大凭证号
	 * @param cwGlVouchermaxno
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月28日 下午8:31:07
	 * @修改日志：
	 */
	@ApiOperation(value = "修改最大凭证号-传递复杂对象", notes = "修改最大凭证号", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwGlVouchermaxno", value = "最大凭证号对象实体", required = true, dataType = "CwGlVouchermaxno")
	@RequestMapping(value = "/updateCwGlVouchermaxnoByPk", method = RequestMethod.PUT)
	public 	RestfulResponse<Object, CurrencyMeta> updateCwGlVouchermaxnoByPk(@RequestBody CwGlVouchermaxno cwGlVouchermaxno){
		return cwGlVouchermaxnoService.updateCwGlVouchermaxnoByPk(cwGlVouchermaxno);
	}
	
	/**
	 * 功能描述：逻辑删除最大凭证号
	 * @param pkVouchermaxno
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月28日 下午8:32:32
	 * @修改日志：
	 */
	@ApiOperation(value = "逻辑删除凭证信息", notes = "删除凭证信息", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "pkVouchermaxno", value = "凭证信息主键", required = true, dataType = "String")
	@RequestMapping(value = "/deleteCwGlVouchermaxnoByPk", method = RequestMethod.DELETE , consumes = MediaType.ALL_VALUE)
	public RestfulResponse<Object, CurrencyMeta> deleteCwGlVouchermaxnoByPk(@RequestParam("pkVouchermaxno") String pkVouchermaxno){
		return cwGlVouchermaxnoService.deleteCwGlVouchermaxnoByPk(pkVouchermaxno);
	}
	/**
	 * 获取最大凭证号
	 * @param pkGlorgbook
	 * @param period
	 * @param pkVouchertype
	 * @return RestfulResponse<List<CwGlVouchermaxno>,CurrencyMeta>
	 *@author huangpeng
	 *@date 2019年4月12日 下午4:01:31
	 *@修改日志：
	 */
	@ApiOperation(value = "获取最大凭证号",notes = "",produces = MediaType.APPLICATION_JSON_UTF8_VALUE,consumes = MediaType.ALL_VALUE)
	@ApiImplicitParams({
        @ApiImplicitParam(name = "pkGlorgbook", value = "账套主键", required = true, dataType = "String", paramType="query"),
        @ApiImplicitParam(name = "period", value = "会计期间", required = true, dataType = "String", paramType="query"),
    })
	@RequestMapping(value = "/searchCwGlVouchermaxnoMaxNo", method = RequestMethod.GET,consumes = MediaType.ALL_VALUE)
	public RestfulResponse<CwGlVouchermaxno, CurrencyMeta> searchCwGlVouchermaxnoMaxNo(
			@RequestParam("pkGlorgbook") String pkGlorgbook,
    		@RequestParam("period") String period){
		return cwGlVouchermaxnoService.searchCwGlVouchermaxnoMaxNo(pkGlorgbook,period);
	}
	

}
