|
@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
|
|
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
|
|
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
|
|
import com.yihu.wlyy.entity.message.Message;
|
|
import com.yihu.wlyy.entity.message.Message;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
import com.yihu.wlyy.entity.specialist.PatientDiseaseServer;
|
|
import com.yihu.wlyy.entity.specialist.PatientDiseaseServer;
|
|
import com.yihu.wlyy.entity.specialist.SpecialDisease;
|
|
import com.yihu.wlyy.entity.specialist.SpecialDisease;
|
|
import com.yihu.wlyy.entity.specialist.TeamDiseaseRelation;
|
|
import com.yihu.wlyy.entity.specialist.TeamDiseaseRelation;
|
|
@ -73,6 +74,8 @@ public class SpecialistService extends BaseService {
|
|
private SpecialDiseaseDao specialDiseaseDao;
|
|
private SpecialDiseaseDao specialDiseaseDao;
|
|
@Autowired
|
|
@Autowired
|
|
private MessageDao messageDao;
|
|
private MessageDao messageDao;
|
|
|
|
@Autowired
|
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
|
|
|
public String setPatientLabelInfo(List<SignPatientLabelInfo> list) {
|
|
public String setPatientLabelInfo(List<SignPatientLabelInfo> list) {
|
|
if (list != null && list.size() > 0) {
|
|
if (list != null && list.size() > 0) {
|
|
@ -480,6 +483,17 @@ public class SpecialistService extends BaseService {
|
|
message.setOver("1");//未处理
|
|
message.setOver("1");//未处理
|
|
message.setRelationCode(rs.getString("obj"));
|
|
message.setRelationCode(rs.getString("obj"));
|
|
message.setDel("1");
|
|
message.setDel("1");
|
|
|
|
|
|
|
|
JSONObject dataJson = new JSONObject();
|
|
|
|
|
|
|
|
dataJson.put("doctor",d.getCode());
|
|
|
|
dataJson.put("doctorName",d.getName());
|
|
|
|
dataJson.put("hospital",d.getHospital());
|
|
|
|
dataJson.put("hospitalName",d.getHospitalName());
|
|
|
|
dataJson.put("dept",d.getDept());
|
|
|
|
dataJson.put("deptName",d.getDeptName());
|
|
|
|
|
|
|
|
message.setReason(dataJson.toString());
|
|
message.setState(1);
|
|
message.setState(1);
|
|
messageDao.save(message);
|
|
messageDao.save(message);
|
|
|
|
|
|
@ -489,14 +503,20 @@ public class SpecialistService extends BaseService {
|
|
mes.put("data", "");
|
|
mes.put("data", "");
|
|
return mes;
|
|
return mes;
|
|
} else if ("doctor_exist".equals(rs.getString("message"))) {
|
|
} else if ("doctor_exist".equals(rs.getString("message"))) {
|
|
|
|
JSONObject obj = rs.getJSONObject("obj");
|
|
mes.put("code", -1);
|
|
mes.put("code", -1);
|
|
mes.put("mes", "医生与患者已经签约");
|
|
mes.put("mes", "医生与患者已经签约");
|
|
mes.put("data", rs.getJSONObject("obj").toString());
|
|
|
|
|
|
String relationCode = obj.getString("relationCode");
|
|
|
|
obj.put("server",patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(relationCode,"1"));
|
|
|
|
mes.put("data", obj.toString());
|
|
return mes;
|
|
return mes;
|
|
} else if ("team_exist".equals(rs.getString("message"))) {
|
|
} else if ("team_exist".equals(rs.getString("message"))) {
|
|
|
|
JSONObject obj = rs.getJSONObject("obj");
|
|
mes.put("code", -2);
|
|
mes.put("code", -2);
|
|
mes.put("mes", "团队与患者已经签约");
|
|
mes.put("mes", "团队与患者已经签约");
|
|
mes.put("data", rs.getJSONObject("obj").toString());
|
|
|
|
|
|
String relationCode = obj.getString("relationCode");
|
|
|
|
obj.put("server",patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(relationCode,"1"));
|
|
|
|
mes.put("data", obj.toString());
|
|
return mes;
|
|
return mes;
|
|
} else {
|
|
} else {
|
|
logger.info(response.getContent());
|
|
logger.info(response.getContent());
|
|
@ -523,6 +543,42 @@ public class SpecialistService extends BaseService {
|
|
m.setRead(0);
|
|
m.setRead(0);
|
|
messageDao.save(m);
|
|
messageDao.save(m);
|
|
}
|
|
}
|
|
|
|
JSONObject josn = rs.getJSONObject("obj");
|
|
|
|
SignFamily sign = signFamilyDao.findByPatient(josn.getString("patient"));
|
|
|
|
Patient p = patientDao.findByCode(josn.getString("patient"));
|
|
|
|
Doctor d = doctorDao.findByCode(josn.getString("doctor"));
|
|
|
|
// 添加签约申请消息
|
|
|
|
Message message = new Message();
|
|
|
|
message.setCzrq(new Date());
|
|
|
|
message.setCreateTime(new Date());
|
|
|
|
message.setContent("您有一个居民开通共管服务!");
|
|
|
|
message.setRead(1);//设置未读
|
|
|
|
message.setReceiver(sign.getDoctor());//设置接受医生的code
|
|
|
|
message.setSender(p.getCode());//设置发送的用户
|
|
|
|
message.setSenderName(p.getName());
|
|
|
|
message.setCode(getCode());
|
|
|
|
message.setTitle("专科医生共管通知");
|
|
|
|
message.setType(18);//家庭签约取消信息
|
|
|
|
message.setReadonly(0);//是否只读消息
|
|
|
|
message.setSex(p.getSex());
|
|
|
|
message.setOver("1");//未处理
|
|
|
|
message.setRelationCode(relationCode);
|
|
|
|
message.setDel("1");
|
|
|
|
message.setState(1);
|
|
|
|
|
|
|
|
JSONObject dataJson = new JSONObject();
|
|
|
|
|
|
|
|
dataJson.put("doctor",d.getCode());
|
|
|
|
dataJson.put("doctorName",d.getName());
|
|
|
|
dataJson.put("hospital",d.getHospital());
|
|
|
|
dataJson.put("hospitalName",d.getHospitalName());
|
|
|
|
dataJson.put("dept",d.getDept());
|
|
|
|
dataJson.put("deptName",d.getDeptName());
|
|
|
|
|
|
|
|
message.setReason(dataJson.toString());
|
|
|
|
|
|
|
|
messageDao.save(message);
|
|
|
|
|
|
return "1";
|
|
return "1";
|
|
}
|
|
}
|
|
return "0";
|
|
return "0";
|
|
@ -531,10 +587,13 @@ public class SpecialistService extends BaseService {
|
|
public JSONObject findPatientSigninfo(String code) throws Exception {
|
|
public JSONObject findPatientSigninfo(String code) throws Exception {
|
|
Map<String, Object> param = new HashedMap();
|
|
Map<String, Object> param = new HashedMap();
|
|
param.put("code", code);
|
|
param.put("code", code);
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/agreeSpecialistTeam", param);
|
|
|
|
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientSigninfo", param);
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
if ("succes".equals(rs.getString("message"))) {
|
|
if ("succes".equals(rs.getString("message"))) {
|
|
return rs.getJSONObject("obj");
|
|
|
|
|
|
JSONObject json = rs.getJSONObject("obj");
|
|
|
|
List<PatientDiseaseServer> patientDiseaseServers = patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(code,"1");
|
|
|
|
json.put("diseaseServer",patientDiseaseServers);
|
|
|
|
return json;
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@ -545,7 +604,13 @@ public class SpecialistService extends BaseService {
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientTeamList", param);
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientTeamList", param);
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
if ("succes".equals(rs.getString("message"))) {
|
|
if ("succes".equals(rs.getString("message"))) {
|
|
return rs.getJSONArray("obj");
|
|
|
|
|
|
JSONArray jr = rs.getJSONArray("obj");
|
|
|
|
for(int i=0;i<rs.getJSONArray("obj").length();i++){
|
|
|
|
JSONObject j = jr.getJSONObject(i);
|
|
|
|
String relationCode = j.getString("relationCode");
|
|
|
|
j.put("server",patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(relationCode,"1"));
|
|
|
|
}
|
|
|
|
return jr;
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|