|
@ -1,8 +1,10 @@
|
|
|
package com.yihu.wlyy.web.doctor.team;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -159,4 +161,55 @@ public class SignTeamController extends BaseController {
|
|
|
return invalidUserException(e, -1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 求助页面需要的医生查找
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "teamDoctorsAndAdminTeamDoctors", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public String getTeamDoctorsAndAdminTeamDoctors(Long teamId) {
|
|
|
try {
|
|
|
Map<String,List<Doctor>> doctors = drHealthTeamService.getTeamDoctorsAndAdminTeamDoctors("64de930c-5b15-11e6-8344-fa163e8aee56",teamId);
|
|
|
JSONObject jo=new JSONObject();
|
|
|
jo.put("zr", addDoctor(doctors.get("zr")));
|
|
|
jo.put("team", addDoctor(doctors.get("team")));
|
|
|
return write(200, "查询成功!", "data",jo );
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private JSONArray addDoctor(List<Doctor> zr) {
|
|
|
JSONArray array=new JSONArray();
|
|
|
for (Doctor doctor : zr) {
|
|
|
if (doctor == null) {
|
|
|
continue;
|
|
|
}
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id", doctor.getId());
|
|
|
// 医生标识
|
|
|
json.put("code", doctor.getCode());
|
|
|
// 医生姓名
|
|
|
json.put("name", doctor.getName());
|
|
|
// 所在医院名称
|
|
|
json.put("hospital_name", doctor.getHosptialName());
|
|
|
// 科室名称
|
|
|
json.put("dept_name", StringUtils.isEmpty(doctor.getDeptName()) ? " " : doctor.getDeptName());
|
|
|
// 职称名称
|
|
|
json.put("job_name", StringUtils.isEmpty(doctor.getJobName()) ? " " : doctor.getJobName());
|
|
|
// 头像
|
|
|
json.put("photo", doctor.getPhoto());
|
|
|
// 简介
|
|
|
json.put("introduce", doctor.getIntroduce());
|
|
|
// 专长
|
|
|
json.put("expertise", doctor.getExpertise());
|
|
|
// 是否求出
|
|
|
json.put("isHelp", doctor.getIsHelp());
|
|
|
array.put(json);
|
|
|
}
|
|
|
|
|
|
return array;
|
|
|
}
|
|
|
}
|