package com.dhcc.finance.main.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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.CwBdRecordSerial;
import com.dhcc.finance.main.service.CwBdRecordSerialService;
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;

@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + CwBdRecordSerialController.API_PREFIX, 
  	          produces = {MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "自动生成凭证流水号记录表controller", tags = { "自动生成凭证流水号记录表" })
public class CwBdRecordSerialController {
	// 会计科目版本操作接口地址前缀
	public static final String API_PREFIX = "/cw_bd_record_serial";
	
	@Autowired
	CwBdRecordSerialService cwBdRecordSerialService;
	/**
	 * 功能描述   查询所有批次流水信息
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwBdRecordBatch>,CurrencyMeta>
	 * @author huangpeng
	 * @date 2019年7月16日 上午9:19:08
	 * 修改日志
	 */
	@ApiOperation(value = "查询所有批次流水信息", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@ApiImplicitParams({
		@ApiImplicitParam(name = "batchNo", value = "批次号", required = true, dataType = "String", paramType="query"),
		@ApiImplicitParam(name = "tradeCode", value = "交易码", required = true, dataType = "String", paramType="query"),
        @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 = { "/searchCwBdRecordSerialAll" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	RestfulResponse<PageInfo<CwBdRecordSerial>, CurrencyMeta> searchCwBdRecordSerialAll(
			@RequestParam("batchNo") String batchNo,
			@RequestParam("tradeCode") String tradeCode,
			@RequestParam("pageNum") int pageNum,
			@RequestParam("pageSize") int pageSize,
			@RequestParam("navigatePages") int navigatePages){
		return cwBdRecordSerialService.searchCwBdRecordSerialAll(batchNo,tradeCode,pageNum, pageSize, navigatePages);
	}
}
