package com.diagbot.web;

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

import com.diagbot.vo.HosCodeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.LisConfigDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.TranLisConfigFacade;
import com.diagbot.vo.LisHospitalCodeVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @author wangfeng
 * @Description: 套餐字段映射公表 前端控制器
 * @date 2019年2月13日 上午11:29:43
 */
@RestController
@RequestMapping("/tranLisConfig")
@Api(value = "公表映射配置API[by:wangfeng]", tags = { "WF——公表映射配置API" })
@SuppressWarnings("unchecked")
public class TranLisConfigController {

	@Autowired
	TranLisConfigFacade tranLisConfigFacade;

	@ApiOperation(value = "根据医院编码查询公表映射配置:[by:wangfeng]", notes = "根据医院编码查询公表映射配置")
	@PostMapping("/getLisConfigByhospitalId")
	@SysLogger("getLisConfigByhospitalId")
	public RespDTO<List<LisConfigDTO>> getLisConfigByhospitalId(@RequestBody LisHospitalCodeVO lisHospitalCodeVO) {
		return RespDTO.onSuc(tranLisConfigFacade.getLisConfigByhospitalIds(lisHospitalCodeVO.getHospitalCode()));
	}

	@ApiOperation(value = "根据医院编码获取化验公表映射关系-itemName不为空:[by:zhaops]",
			notes = "hosCode: 医院编码，必填<br>")
	@PostMapping("/getLisConfigByHosCode_NotEmptyItemName")
	@SysLogger("getLisConfigByHosCode_NotEmptyItemName")
	public RespDTO<Map<String, Map<String, String>>> getLisConfigByHosCode_NotEmptyItemName(@RequestBody HosCodeVO hosCodeVO) {
		return RespDTO.onSuc(tranLisConfigFacade.getLisConfigByHosCode_NotEmptyItemName(hosCodeVO.getHosCode()));
	}

	@ApiOperation(value = "根据医院编码获取化验公表映射关系-itemName为空 :[by:zhaops]",
			notes = "hosCode: 医院编码，必填<br>")
	@PostMapping("/getLisConfigByHosCode_EmptyItemName")
	@SysLogger("getLisConfigByHosCode_EmptyItemName")
	public RespDTO<Map<String, String>> getLisConfigByHosCode_EmptyItemName(@RequestBody HosCodeVO hosCodeVO) {
		return RespDTO.onSuc(tranLisConfigFacade.getLisConfigByHosCode_EmptyItemName(hosCodeVO.getHosCode()));
	}
}
