|
@ -74,14 +74,10 @@ public class DoctorController extends BaseController {
|
|
|
@Autowired
|
|
|
private PatientInfoService patientInfoService;
|
|
|
@Autowired
|
|
|
private PatientService patientService;
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
@Autowired
|
|
|
private TblBasicDao tblBasicDao;
|
|
|
@Autowired
|
|
|
private HospitalDeptService hospitalDeptService;
|
|
|
@Autowired
|
|
|
private HospitalDeptService deptService;
|
|
|
@Autowired
|
|
|
private DoctorWorkTimeService workTimeService;
|
|
|
|
|
|
/**
|
|
@ -240,6 +236,101 @@ public class DoctorController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询存在医生的医院列表
|
|
|
*
|
|
|
* @param type 类型 1:医院 2社区
|
|
|
* @param province 省份
|
|
|
* @param city 城市
|
|
|
* @param town 城镇
|
|
|
* @param key 名字搜索
|
|
|
* @param page 第几页
|
|
|
* @param pagesize 页大小
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "hospital_list")
|
|
|
@ResponseBody
|
|
|
public String hospitals(@RequestParam(required = true) int type,
|
|
|
@RequestParam(required = false) String province,
|
|
|
@RequestParam(required = false) String city,
|
|
|
@RequestParam(required = false) String town,
|
|
|
@RequestParam(required = false) String key,
|
|
|
@RequestParam(required = true) int page,
|
|
|
@RequestParam(required = true) int pagesize) {
|
|
|
try {
|
|
|
if (type != 1 || type != 2) {
|
|
|
return error(-1, "医院类型错误");
|
|
|
}
|
|
|
|
|
|
List<Hospital> hos = hospitalService.getHospitals(type, province, city, town, key, page, pagesize);
|
|
|
|
|
|
return write(200, "查询成功", "data", hos);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询某个医院存在医生科室列表
|
|
|
*
|
|
|
* @param hospital 医院
|
|
|
* @param key 科室名字搜索
|
|
|
* @param page 第几页
|
|
|
* @param pagesize 页大小
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/dept_list")
|
|
|
@ResponseBody
|
|
|
public String deptList(@RequestParam(required = true) String hospital,
|
|
|
@RequestParam(required = false) String key,
|
|
|
@RequestParam(required = true) int page,
|
|
|
@RequestParam(required = true) int pagesize) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(hospital)) {
|
|
|
return error(-1, "医院不能为空");
|
|
|
}
|
|
|
List<HospitalDept> dept = deptService.getHospitalDept(hospital, key, page, pagesize);
|
|
|
|
|
|
return write(200, "查询成功", "data", dept);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据科室查询当前在工作医生
|
|
|
*
|
|
|
* @param dept
|
|
|
* @param hospital
|
|
|
* @param level
|
|
|
* @param key
|
|
|
* @param page
|
|
|
* @param pagesize
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/doctor_list")
|
|
|
@ResponseBody
|
|
|
public String findWorkingDoctorByDept(@RequestParam(required = false) String dept,
|
|
|
@RequestParam(required = false) String hospital,
|
|
|
@RequestParam(required = false, defaultValue = "") String level,
|
|
|
@RequestParam(required = false, defaultValue = "") String key,
|
|
|
@RequestParam(required = false, defaultValue = "-1") int page,
|
|
|
@RequestParam(required = false, defaultValue = "15") int pagesize) {
|
|
|
try {
|
|
|
if(page > 1){
|
|
|
page = page - 1;
|
|
|
}
|
|
|
JSONArray doctors = doctorInfoService.findWorkingDoctorListByDept(dept, hospital, level, key, page, pagesize);
|
|
|
return write(200, "查询成功", "data", doctors);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据机构查找科室
|
|
|
*
|
|
@ -334,37 +425,6 @@ public class DoctorController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据科室查询当前在工作医生
|
|
|
*
|
|
|
* @param dept
|
|
|
* @param hospital
|
|
|
* @param level
|
|
|
* @param key
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/findDoctorByDeptAndName")
|
|
|
@ResponseBody
|
|
|
public String findWorkingDoctorByDept(@RequestParam(required = true) String dept,
|
|
|
@RequestParam(required = true) String hospital,
|
|
|
@RequestParam(required = false, defaultValue = "") String level,
|
|
|
@RequestParam(required = false, defaultValue = "") String key) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(dept)) {
|
|
|
return error(-1, "科室不能为空");
|
|
|
}
|
|
|
if (StringUtils.isEmpty(hospital)) {
|
|
|
return error(-1, "医院不能为空");
|
|
|
}
|
|
|
|
|
|
JSONArray doctors = doctorInfoService.findWorkingDoctorListByDept(dept, hospital, level, key);
|
|
|
return write(200, "查询成功", "data", doctors);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 名医列表
|
|
|
*
|