|
@ -355,8 +355,8 @@ public class PatientController extends WeixinBaseController {
|
|
|
token = tokenDao.findByPatient(getUID(), 3);
|
|
|
}
|
|
|
|
|
|
if(token == null){
|
|
|
return error(-1,"用户未登录");
|
|
|
if (token == null) {
|
|
|
return error(-1, "用户未登录");
|
|
|
}
|
|
|
|
|
|
token.setDel("0");
|
|
@ -558,50 +558,40 @@ public class PatientController extends WeixinBaseController {
|
|
|
String id = getUID();
|
|
|
//查询家庭签约
|
|
|
SignFamily jt = familyContractService.findByPatientYes(id);
|
|
|
Map<String,Object> docMap = new HashMap<>();
|
|
|
Map<String, Object> docMap = new HashMap<>();
|
|
|
if (jt != null) {
|
|
|
List<Doctor> doctors = doctorTeamService.findJiatingTeamDoctors(id);
|
|
|
List<Object> doctors = doctorTeamService.findJiatingTeamDoctorsObj(id);
|
|
|
if (doctors != null) {
|
|
|
for (Doctor doctor : doctors) {
|
|
|
for (Object doctor : doctors) {
|
|
|
if (doctor == null) {
|
|
|
continue;
|
|
|
}
|
|
|
Object[] docArray = (Object[]) doctor;
|
|
|
JSONObject doctorJson = new JSONObject();
|
|
|
doctorJson.put("code", doctor.getCode());
|
|
|
doctorJson.put("name", doctor.getName());
|
|
|
doctorJson.put("level", doctor.getLevel());
|
|
|
List<DoctorTeamMember> oc = new ArrayList<>();
|
|
|
if(docMap.get(doctor.getCode())!=null){//不为空证明全科,建管同一个
|
|
|
oc = (List<DoctorTeamMember>)docMap.get(doctor.getCode());
|
|
|
doctorJson.put("teamlevel",2);
|
|
|
}else{//为空证明建管和全科不一致,或者第一次进入
|
|
|
oc = doctorTeamService.findTeamType(id,doctor.getCode());
|
|
|
if(oc!=null&&oc.size()==1){//找出只有一条直接返回团队所属职位
|
|
|
doctorJson.put("teamlevel",oc.get(0).getType());
|
|
|
}
|
|
|
if(oc!=null&&oc.size()==2){//两条数据证明专科全科一致
|
|
|
docMap.put(doctor.getCode(),oc);
|
|
|
doctorJson.put("teamlevel",3);
|
|
|
}
|
|
|
}
|
|
|
familyDoctors.put(doctor.getCode(), doctorJson);
|
|
|
doctorJson.put("code", docArray[0]);
|
|
|
doctorJson.put("name", docArray[1]);
|
|
|
doctorJson.put("level", docArray[2]);
|
|
|
doctorJson.put("teamlevel", docArray[3]);
|
|
|
familyDoctors.put(docArray[0].toString(), doctorJson);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// 查询三师医生
|
|
|
SignFamily ss = familyContractService.findBySanshiPatientYes(id);
|
|
|
if (ss != null) {
|
|
|
List<Doctor> doctors = doctorTeamService.findSanshiTeamDoctors(id);
|
|
|
List<Object> doctors = doctorTeamService.findSanshiTeamDoctorsObj(id);
|
|
|
if (doctors != null) {
|
|
|
for (Doctor doctor : doctors) {
|
|
|
for (Object doctor : doctors) {
|
|
|
if (doctor == null) {
|
|
|
continue;
|
|
|
}
|
|
|
Object[] docArray = (Object[]) doctor;
|
|
|
JSONObject doctorJson = new JSONObject();
|
|
|
doctorJson.put("code", doctor.getCode());
|
|
|
doctorJson.put("name", doctor.getName());
|
|
|
doctorJson.put("level", doctor.getLevel());
|
|
|
teamDoctors.put(doctor.getCode(), doctorJson);
|
|
|
doctorJson.put("code", docArray[0]);
|
|
|
doctorJson.put("name", docArray[1]);
|
|
|
doctorJson.put("level", docArray[2]);
|
|
|
doctorJson.put("teamlevel", docArray[3]);
|
|
|
teamDoctors.put(docArray[0].toString(), doctorJson);
|
|
|
}
|
|
|
}
|
|
|
}
|