package com.lyms.hospital.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.lyms.base.common.entity.region.Regions;
import com.lyms.base.common.service.region.RegionsService;
import com.lyms.hospital.entity.history.HistorySource;
import com.lyms.hospital.enums.ServiceStatusEnums;
import com.lyms.hospital.service.history.HistorySourceService;
import com.lyms.hospital.util.trans.OldDictionary;
import com.lyms.hospital.util.trans.XjhMapUtil;
import com.lyms.web.bean.AjaxResult;
import com.lyms.web.controller.BaseController;
/**
*
* 公用接口-前端控制器
*
*
* []查询病史配置
* 查询省市区数据
* 查询字典数据
*
* @author xujiahong
* @since 2017-04-21
*/
@Controller
@RequestMapping("/commonApi")
public class CommonApiController extends BaseController {
@Autowired
private RegionsService regionService;
@Autowired
private HistorySourceService historySourceService;
/**
* @Description:查询病史配置
* @return
* 创建人:xujiahong
* 创建时间:2017年4月28日
* 修改人:
* 修改时间:
*/
@RequestMapping(value = "/queryHistorySource", method = RequestMethod.GET)
@ResponseBody
public AjaxResult queryHistorySource() {
List list = historySourceService.selectStructureByType();
return AjaxResult.returnSuccess(list);
}
/**
* @Description:查询省市区数据
* @param parentId
* @return
* 创建人:xujiahong
* 创建时间:2017年4月24日
* 修改人:
* 修改时间:
*/
@RequestMapping(value = "/queryRegions", method = RequestMethod.GET)
@ResponseBody
public AjaxResult queryRegions(String parentId) {
List list = regionService.selectRegions(parentId);
return AjaxResult.returnSuccess(list);
}
/**
* @Description:查询字典数据
* @return
* 创建人:xujiahong
* 创建时间:2017年4月24日
* 修改人:
* 修改时间:
*/
@RequestMapping(value = "/queryDictionary", method = RequestMethod.GET)
@ResponseBody
public AjaxResult queryDictionary() {
// TODO 模拟查询数据字典的数据
Map dictionary = new HashMap<>();
/* 户口类型 */
List