Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/commonlyUsedDoctor/controller/CommonlyUsedDoctorController.java =================================================================== diff -u --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/commonlyUsedDoctor/controller/CommonlyUsedDoctorController.java (revision 0) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/commonlyUsedDoctor/controller/CommonlyUsedDoctorController.java (revision 24928) @@ -0,0 +1,44 @@ +package com.forgon.disinfectsystem.basedatamanager.commonlyUsedDoctor.controller; + +import java.util.List; +import java.util.Map; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import com.forgon.disinfectsystem.basedatamanager.commonlyUsedDoctor.service.CommonlyUsedDoctorManager; +import com.forgon.tools.json.JSONUtil; + +/** + * 常用医生设置的方法 + * @author Simon 2018.11.15 + */ + +@RestController +@RequestMapping(value = "/disinfectSystem/baseData/CommonlyUsedDoctorController", produces = "application/json;charset=UTF-8") +public class CommonlyUsedDoctorController{ + + @Autowired + private CommonlyUsedDoctorManager commonlyUsedDoctorManager; + + /** + * 根据关键字搜索常用医生 + * return [totalCount:"结果条数",data:[{doctorName:"医生名称",pinYinCode:"医生拼音码"},{},{}...]] + */ + @ResponseBody + @RequestMapping("/getDoctorBykeyWord") + public String getDoctorBykeyWord(String spell){ + JSONObject result = new JSONObject(); + List> list = commonlyUsedDoctorManager.getDoctorBykeyWord(spell); + result.put(JSONUtil.JSON_KEY_TOTAL, list.size()); + result.put(JSONUtil.JSON_KEY_SUCCESS, true); + result.put(JSONUtil.JSON_KEY_ROWS, JSONArray.fromObject(list).toString()); + return result.toString(); + } + +}