package com.dhcc.finance.main.controller;

import java.util.List;
import java.util.Map;

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.CwHsSubcodemap;
import com.dhcc.finance.main.service.CwHsSubcodemapService;
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 + CwHsSubcodemapController.API_PREFIX, produces = {
		MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "恒生估值科目对照controller", tags = { "恒生估值科目对照操作接口" })
public class CwHsSubcodemapController {
	public static final String API_PREFIX = "/cw_hs_subcodemap";
	
	@Autowired
	CwHsSubcodemapService cwHsSubcodemapService;
	
	
	@ApiOperation(value = "按照科目代码和估值系统科目代码查询财务估值导出科目对照表的信息", notes = "按照科目代码和估值系统科目代码查询财务估值导出科目对照表的信息", produces = MediaType.APPLICATION_JSON_UTF8_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 = "cwHsSubcodemap", value = "财务估值导出科目对照表实体类",required = false, dataType = "CwHsSubcodemap")
    }) 
	@RequestMapping(value = { "/searchCwHsSubcodemapAllData" }, method = RequestMethod.PUT)
	public RestfulResponse<PageInfo<CwHsSubcodemap>, CurrencyMeta> searchCwHsSubcodemapAllData(
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages,
    		@RequestBody CwHsSubcodemap cwHsSubcodemap){
		return cwHsSubcodemapService.searchCwHsSubcodemapAllData(pageNum, pageSize, navigatePages, cwHsSubcodemap);
	}
	/**
	 * Title: searchCwHsSubcodemapCodeAndCodeV <br/>  
	 * Description: TODO查询科目对照表的所有科目代码和估值科目代码 <br/>
	 * @author lipeng 
	 * @return RestfulResponse<Map<String,List<String>>,CurrencyMeta>
	 * @date 2019年7月27日 上午10:31:44
	 */
	@ApiOperation(value = "查询科目对照表的所有科目代码和估值科目代码", notes = "查询科目对照表的所有科目代码和估值科目代码", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@RequestMapping(value = { "/searchCwHsSubcodemapCodeAndCodeV" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public RestfulResponse<Map<String,List<String>>, CurrencyMeta> searchCwHsSubcodemapCodeAndCodeV(){
		return cwHsSubcodemapService.searchCwHsSubcodemapCodeAndCodeV();
	}

	/**
	 * Title: deleteCwHsSubcodemapInfo <br/>  
	 * Description: TODO按照科目id删除科目信息 <br/>
	 * @author lipeng 
	 * @return RestfulResponse<Map<String,List<String>>,CurrencyMeta>
	 * @date 2019年7月27日 上午10:31:44
	 */
	@ApiOperation(value = "按照科目id删除科目信息", notes = "按照科目id删除科目信息", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "IdList", required = true, dataType = "List")
	@RequestMapping(value = { "/deleteCwHsSubcodemapInfo" }, method = RequestMethod.PUT)
	public RestfulResponse<Object, CurrencyMeta> deleteCwHsSubcodemapInfo(@RequestBody List<String>  IdList){
		
		return cwHsSubcodemapService.deleteCwHsSubcodemapInfo(IdList);
	}
	/**
	 * Title: addCwHsSubcodemapInfo <br/>  
	 * Description: TODO 新增财务估值导出科目对照表信息<br/>
	 * @author lipeng 
	 * @param cwHsSubcodemap
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @date 2019年7月27日 下午3:31:00
	 */
	@ApiOperation(value = "新增财务估值导出科目对照表信息", notes = "新增财务估值导出科目对照表信息", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParam(name = "cwHsSubcodemap", value = "财务估值导出科目对照表实体类",required = false, dataType = "CwHsSubcodemap")
	@RequestMapping(value = { "/addCwHsSubcodemapInfo" }, method = RequestMethod.POST)
	public RestfulResponse<Object, CurrencyMeta> addCwHsSubcodemapInfo(@RequestBody CwHsSubcodemap cwHsSubcodemap){
		return cwHsSubcodemapService.addCwHsSubcodemapInfo(cwHsSubcodemap);
	}
	/**
	 * Title: addCwHsSubcodemapInfo <br/>  
	 * Description: TODO 修改财务估值导出科目对照表信息<br/>
	 * @author lipeng 
	 * @param cwHsSubcodemap
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @date 2019年7月27日 下午3:31:00
	 */
	@ApiOperation(value = "修改财务估值导出科目对照表信息", notes = "修改财务估值导出科目对照表信息", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParam(name = "cwHsSubcodemap", value = "财务估值导出科目对照表实体类",required = false, dataType = "CwHsSubcodemap")
	@RequestMapping(value = { "/updataCwHsSubcodemapInfo" }, method = RequestMethod.POST)
	public RestfulResponse<Object, CurrencyMeta> updataCwHsSubcodemapInfo(@RequestBody CwHsSubcodemap cwHsSubcodemap){
		return cwHsSubcodemapService.updataCwHsSubcodemapInfo(cwHsSubcodemap);
	}

}
