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.CwBdScenariorelation;
import com.dhcc.finance.main.service.CwBdScenariorelationService;
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 lipeng
 * Description: 交易场景凭证模板对应关系Controller  
 * @date 2019年6月27日 上午11:00:40
 * @path com.dhcc.finance.main.controller.CwBdScenariorelationController
 */
@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + CwBdScenariorelationController.API_PREFIX, produces = {
		MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "交易场景凭证模板对应关系controller", tags = { "交易场景凭证模板对应关系操作接口" })
public class CwBdScenariorelationController {
	// 交易场景凭证模板对应关系操作接口地址前缀
	public static final String API_PREFIX = "/cw_bd_scenariorelation";
	
	@Autowired
	CwBdScenariorelationService cwBdScenariorelationService;
	/**
	 * 功能描述：查询全部交易场景凭证模板对应关系信息
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwBdScenariorelation>,CurrencyMeta>
	 * @author lipeng
	 * @date 2019年6月27日 上午11:00:40
	 * @修改日志：
	 */
	@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"),
        @ApiImplicitParam(name = "ywlx", value = "业务类型", required = true, dataType = "String", paramType="query"),
        @ApiImplicitParam(name = "jym", value = "交易码", required = true, dataType = "String", paramType="query"),
        @ApiImplicitParam(name = "jycjmc", value = "交易场景名称", required = true, dataType = "String", paramType="query"),
      
    }) 
	@RequestMapping(value = { "/searchcwBdScenariorelationAllData" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<PageInfo<CwBdScenariorelation>, CurrencyMeta> searchCwBdVouchtempAllData(
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages,
    		@RequestParam(value="ywlx",required=false) String   ywlx,
    		@RequestParam(value="jym",required=false) String jym,
    		@RequestParam(value="jycjmc",required=false) String jycjmc){
		return cwBdScenariorelationService.searchcwBdScenariorelationAllData(pageNum, pageSize, navigatePages, ywlx, jym, jycjmc);
	}
	
	/**
	 * 功能描述：新增交易场景凭证模板对应关系信息
	 * @param cwBdScenariorelation
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author lipeng
	 * @date 019年6月27日 上午11:00:40
	 * @修改日志：
	 */
	@ApiOperation(value = "新增交易场景凭证模板对应关系信息", notes = "新增交易场景凭证模板对应关系信息", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwBdScenariorelation", value = "信息筛选实体类",required = false, dataType = "CwBdScenariorelation")
	@RequestMapping(value = "/addCwBdScenariorelation", method = RequestMethod.POST)
	public RestfulResponse<Object, CurrencyMeta> addCwBdScenariorelation(@RequestBody CwBdScenariorelation cwBdScenariorelation){
		return cwBdScenariorelationService.addCwBdScenariorelation(cwBdScenariorelation);
	}
	
	/**
	 * 功能描述：删除交易场景凭证模板对应关系信息
	 * @param id
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author lipeng
	 * @date 019年6月27日 上午11:00:40
	 * @修改日志：
	 */
	@ApiOperation(value = "删除交易场景凭证模板对应关系信息", notes = "删除交易场景凭证模板对应关系信息", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "id", value = "交易场景凭证模板对应关系主键", required = true, dataType = "String", paramType="query")
	@RequestMapping(value = "/DeleteCwBdScenariorelation", method = RequestMethod.DELETE)
	public RestfulResponse<Object, CurrencyMeta> DeleteCwBdScenariorelation(@RequestParam("id")  String  id){
		return cwBdScenariorelationService.deleteCwBdScenariorelation(id);
	}
	
	/**
	 * 功能描述：修改交易场景凭证模板对应关系信息
	 * @param id
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author lipeng
	 * @date 019年6月27日 上午11:00:40
	 * @修改日志：
	 */
	@ApiOperation(value = "修改交易场景凭证模板对应关系信息", notes = "修改交易场景凭证模板对应关系信息", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwBdScenariorelation", value = "信息筛选实体类",required = false, dataType = "CwBdScenariorelation")
	@RequestMapping(value = "/UpdateCwBdScenariorelation", method = RequestMethod.POST)
	public RestfulResponse<Object, CurrencyMeta> UpdateCwBdScenariorelation(@RequestBody CwBdScenariorelation cwBdScenariorelation){
		return cwBdScenariorelationService.updateCwBdScenariorelation(cwBdScenariorelation);
	}
	/**
	 * Title: selectScenarioreName <br/>  
	 * Description: TODO查询全部交易场景名称 和交易码<br/>
	 * @author lipeng 
	 * @return RestfulResponse<List<String>,CurrencyMeta>
	 * @date 2019年8月3日 下午4:15:43
	 */
	@ApiOperation(value = "查询全部交易场景名称 和交易码", notes = "查询全部交易场景名称 和交易码", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@RequestMapping(value = "/selectScenarioreName", method = RequestMethod.GET,consumes = MediaType.ALL_VALUE)
	public RestfulResponse<Map<String,List<String>>, CurrencyMeta> selectScenarioreName(){
		
		return cwBdScenariorelationService.selectScenarioreName();
	}


}
