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.enums.ServiceStatusEnums; 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; /** *
  • @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> censusType = new ArrayList<>(); censusType.add(XjhMapUtil.transBean2Map(new OldDictionary("001", "非农业户口"))); censusType.add(XjhMapUtil.transBean2Map(new OldDictionary("002", "农业户口"))); /*证件类型*/ List> certeType = new ArrayList<>(); certeType.add(XjhMapUtil.transBean2Map(new OldDictionary("003", "身份证"))); certeType.add(XjhMapUtil.transBean2Map(new OldDictionary("004", "手机号"))); /*国家*/ List> country = new ArrayList<>(); country.add(XjhMapUtil.transBean2Map(new OldDictionary("005", "中国"))); country.add(XjhMapUtil.transBean2Map(new OldDictionary("006", "美国"))); /*vip体验类型*/ List> expYunEnums = new ArrayList<>(); expYunEnums.add(XjhMapUtil.transBean2Map(new OldDictionary("007", "vip体验类型1"))); expYunEnums.add(XjhMapUtil.transBean2Map(new OldDictionary("008", "vip体验类型2"))); /*居住类型*/ List> liveType = new ArrayList<>(); liveType.add(XjhMapUtil.transBean2Map(new OldDictionary("009", "本地"))); liveType.add(XjhMapUtil.transBean2Map(new OldDictionary("010", "非本地"))); /*民族*/ List> nation = new ArrayList<>(); nation.add(XjhMapUtil.transBean2Map(new OldDictionary("011", "汉族"))); nation.add(XjhMapUtil.transBean2Map(new OldDictionary("012", "白族"))); /*职业类型*/ List> professionType = new ArrayList<>(); professionType.add(XjhMapUtil.transBean2Map(new OldDictionary("013", "医生"))); professionType.add(XjhMapUtil.transBean2Map(new OldDictionary("014", "教师"))); /*服务状态*/ List> serviceStatus = ServiceStatusEnums.getServiceStatusList(); /*服务类型*/ List> serviceType = ServiceStatusEnums.getServiceTypeList(); dictionary.put("censusType", censusType); dictionary.put("certeType", certeType); dictionary.put("country", country); dictionary.put("expYunEnums", expYunEnums); dictionary.put("liveType", liveType); dictionary.put("nation", nation); dictionary.put("professionType", professionType); dictionary.put("serviceStatus", serviceStatus); dictionary.put("serviceType", serviceType); return AjaxResult.returnSuccess(dictionary); } }