/**
 * 
 */
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.CwGlInitbuild;
import com.dhcc.finance.main.domain.CwGlVoucher;
import com.dhcc.finance.main.model.FileUploadRequest;
import com.dhcc.finance.main.service.CwGlInitbuildService;
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 + CwGlInitbuildController.API_PREFIX, 
  	          produces = {MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "期初余额信息controller", tags = { "期初余额信息操作接口" })
public class CwGlInitbuildController {
	// 期初余额信息操作接口地址前缀
	public static final String API_PREFIX = "/cw_gl_initbuild";
	@Autowired
	CwGlInitbuildService cwGlInitbuildService;
	/**
	 * 
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwGlVoucher>,CurrencyMeta>
	 *@author huangpeng
	 *@date 2019年4月3日 下午3:44:45
	 *@修改日志：
	 */
	@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 = { "/searchCwGlInitbuildAllData" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public RestfulResponse<PageInfo<CwGlInitbuild>, CurrencyMeta> searchCwGlInitbuildAllData(
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages){
		return cwGlInitbuildService.searchCwGlInitbuildAllData(pageNum, pageSize, navigatePages);
	}
	/**
     * 功能描述：导入期初余额
     * @param fileUploadRequest
     * @param type
     * @return RestfulResponse<String,CurrencyMeta>
     * @author dml
     * @date 2019年4月24日 下午3:53:20
     * @修改日志：
     */
    //@ApiOperation(value = "导入期初余额", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    //@RequestMapping(value = "/uploadCwGlBalance", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    //RestfulResponse<String,CurrencyMeta> uploadCwGlBalance( FileUploadRequest fileUploadRequest, String  type){
	@RequestMapping(value = { "/uploadCwGlBalance" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public RestfulResponse<Object, CurrencyMeta> searchCwGlInitbuildAllData(String pkGlorgbook, String period){
       return cwGlInitbuildService.uploadCwGlBalance( pkGlorgbook,  period);
    }
}
