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.ResponseBody;
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.model.CwBdAccassitemWeb;
import com.dhcc.finance.main.service.CwBdAccassitemService;
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;

/**
 * 功能描述：辅助核算项目
 * @author dml
 * @date 2019年4月4日 上午11:25:58
 * @修改日志：
 */
@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + CwBdAccassitemController.API_PREFIX, 
  	          produces = {MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "辅助核算项目controller", tags = { "辅助核算项目接口" })
public class CwBdAccassitemController {
	// 辅助核算项目接口地址前缀
	public static final String API_PREFIX = "/cw_bd_accassitem";
	
	@Autowired
	CwBdAccassitemService cwBdAccassitemService;
	
	/**
	 * 功能描述：获取全部辅助核算项目
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwBdAccassitem>,CurrencyMeta>
	 * @author dml
	 * @date 2019年4月4日 上午11:29:42
	 * @修改日志：
	 */
	@ApiOperation(value = "获取全部辅助核算项目", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@RequestMapping(value = { "/searchCwBdAccassitemAllData" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<List<CwBdAccassitem>, CurrencyMeta> searchCwBdAccassitemAllData(){
		return cwBdAccassitemService.searchCwBdAccassitemAllData();
	}
	/**
	 * 功能描述  批量获取全部辅助核算项目
	 * @param AccassitemPks
	 * @return RestfulResponse<List<CwBdAccassitem>,CurrencyMeta>
	 * @author huangpeng
	 * @date 2019年6月15日 上午11:06:58
	 * 修改日志
	 */
	@ApiOperation(value = "批量获取全部辅助核算项目", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@RequestMapping(value = { "/searchCwBdAccassitemForBatch" }, method = RequestMethod.PUT, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<List<CwBdAccassitem>, CurrencyMeta> searchCwBdAccassitemForBatch(@RequestBody List<String> AccassitemPks){
		return cwBdAccassitemService.searchCwBdAccassitemForBatch(AccassitemPks);
	}
	/**
	 * 功能描述 根据主键获取辅助项数据
	 * @param pkAccassitem
	 * @return RestfulResponse<CwBdAccassitem,CurrencyMeta>
	 * @author huangpeng
	 * @date 2019年6月15日 上午11:07:29
	 * 修改日志
	 */
	@ApiOperation(value = "根据主键获取辅助项数据", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@ApiImplicitParam(name = "pkAccassitem", value = "辅助项设置编号", required = true, dataType = "String")
    @RequestMapping(value = { "/searchCwBdAccassitemByPk" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
    RestfulResponse<CwBdAccassitem, CurrencyMeta> searchCwBdAccassitemByPk(@RequestParam("pkAccassitem") String pkAccassitem){
          return cwBdAccassitemService.searchCwBdAccassitemByPk(pkAccassitem);
    }
	/**
	 * 功能描述  根据科目版本和科目获取辅助项数据
	 * @param pkAccsubj
	 * @param pkSubjscheme
	 * @return RestfulResponse<List<CwBdAccassitem>,CurrencyMeta>
	 * @author huangpeng
	 * @date 2019年7月2日 下午9:54:12
	 * 修改日志
	 */
	@ApiOperation(value = "根据科目版本和科目获取辅助项数据", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@ApiImplicitParams({
	@ApiImplicitParam(name = "pkAccsubj", value = "科目主键", required = true, dataType = "String", paramType="query"),
	@ApiImplicitParam(name = "pkSubjscheme", value = "科目版本", required = true, dataType = "String", paramType="query")
	})
    @RequestMapping(value = { "/searchPkAccassitemList" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
    RestfulResponse<List<CwBdAccassitem>, CurrencyMeta> searchPkAccassitemList(@RequestParam("pkAccsubj") String pkAccsubj,@RequestParam("pkSubjscheme") String pkSubjscheme){
          return cwBdAccassitemService.searchPkAccassitemList(pkAccsubj,pkSubjscheme);
    }
	/**
	 * 功能描述 获取受益凭据信息
	 *@return RestfulResponse<List<CwBdAccassitemWeb>,CurrencyMeta>
	 *@author huangpeng
	 *@date 2019年10月30日 下午6:14:37
	 *修改日志:
	 */
	@ApiOperation(value = "获取受益凭据信息", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@ApiImplicitParam(name = "xtzxmbh", value = "信托子项目编号", required = true, dataType = "String")
	@RequestMapping(value = { "/searchCwBdAccassitemForSypj" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<List<CwBdAccassitemWeb>, CurrencyMeta> searchCwBdAccassitemForSypj(@RequestParam("xtzxmbh") String xtzxmbh){
		return cwBdAccassitemService.searchCwBdAccassitemForSypj(xtzxmbh);
	}
}
