|
@ -426,7 +426,7 @@ public class ConsultController extends WeixinBaseController {
|
|
}
|
|
}
|
|
|
|
|
|
// 判断名医是否在工作
|
|
// 判断名医是否在工作
|
|
JSONObject isWorking = doctorWorkTimeService.isFamousDoctorWorking(doctor.getCode());
|
|
|
|
|
|
JSONObject isWorking = doctorWorkTimeService.isDoctorWorking(doctor.getCode());
|
|
|
|
|
|
if (isWorking == null || !isWorking.getString("status").equals("1")) {
|
|
if (isWorking == null || !isWorking.getString("status").equals("1")) {
|
|
continue;
|
|
continue;
|
|
@ -654,7 +654,7 @@ public class ConsultController extends WeixinBaseController {
|
|
String url = SystemConf.getInstance().getSystemProperties().getProperty("im_list_get")
|
|
String url = SystemConf.getInstance().getSystemProperties().getProperty("im_list_get")
|
|
+ (group != null ? "api/v1/chats/gm" : "api/v1/chats/pm");
|
|
+ (group != null ? "api/v1/chats/gm" : "api/v1/chats/pm");
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
if(group == null) {
|
|
|
|
|
|
if (group == null) {
|
|
params.add(new BasicNameValuePair("from", getUID()));
|
|
params.add(new BasicNameValuePair("from", getUID()));
|
|
params.add(new BasicNameValuePair("to", consultModel.getDoctor()));
|
|
params.add(new BasicNameValuePair("to", consultModel.getDoctor()));
|
|
params.add(new BasicNameValuePair("content", log.getContent()));
|
|
params.add(new BasicNameValuePair("content", log.getContent()));
|
|
@ -700,6 +700,9 @@ public class ConsultController extends WeixinBaseController {
|
|
return error(-1, "咨询记录不存在!");
|
|
return error(-1, "咨询记录不存在!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Patient p = patientDao.findByCode(getUID());
|
|
|
|
Map<String, Doctor> map = new HashMap<>();
|
|
|
|
|
|
List<JSONObject> jsonArray = new ArrayList<>();
|
|
List<JSONObject> jsonArray = new ArrayList<>();
|
|
JSONObject group = talkGroupService.findConsultTalkGroup(consultModel.getConsult());
|
|
JSONObject group = talkGroupService.findConsultTalkGroup(consultModel.getConsult());
|
|
|
|
|
|
@ -725,13 +728,21 @@ public class ConsultController extends WeixinBaseController {
|
|
JSONObject json = new JSONObject();
|
|
JSONObject json = new JSONObject();
|
|
json.put("id", obj.getInt("id"));
|
|
json.put("id", obj.getInt("id"));
|
|
if (!obj.getString("from").equals(getUID())) {
|
|
if (!obj.getString("from").equals(getUID())) {
|
|
Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
|
|
|
|
|
|
Doctor doc = null;
|
|
|
|
|
|
|
|
if (map.containsKey(obj.getString("from"))) {
|
|
|
|
doc = map.get(obj.getString("from"));
|
|
|
|
} else {
|
|
|
|
doc = doctorService.findDoctorByCode(obj.getString("from"));
|
|
|
|
}
|
|
|
|
|
|
// 设置回复医生姓名
|
|
// 设置回复医生姓名
|
|
json.put("doctorName", doc.getName());
|
|
json.put("doctorName", doc.getName());
|
|
|
|
json.put("photo", doc.getPhoto());
|
|
} else {
|
|
} else {
|
|
Patient p = patientDao.findByCode(obj.getString("from"));
|
|
|
|
// 设置回复医生姓名
|
|
// 设置回复医生姓名
|
|
json.put("doctorName", p.getName());
|
|
json.put("doctorName", p.getName());
|
|
|
|
json.put("photo", p.getPhoto());
|
|
}
|
|
}
|
|
|
|
|
|
// 设置回复内容
|
|
// 设置回复内容
|
|
@ -774,13 +785,21 @@ public class ConsultController extends WeixinBaseController {
|
|
JSONObject json = new JSONObject();
|
|
JSONObject json = new JSONObject();
|
|
json.put("id", obj.getInt("id"));
|
|
json.put("id", obj.getInt("id"));
|
|
if (!obj.getString("from").equals(getUID())) {
|
|
if (!obj.getString("from").equals(getUID())) {
|
|
Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
|
|
|
|
|
|
Doctor doc = null;
|
|
|
|
|
|
|
|
if (map.containsKey(obj.getString("from"))) {
|
|
|
|
doc = map.get(obj.getString("from"));
|
|
|
|
} else {
|
|
|
|
doc = doctorService.findDoctorByCode(obj.getString("from"));
|
|
|
|
}
|
|
|
|
|
|
// 设置回复医生姓名
|
|
// 设置回复医生姓名
|
|
json.put("doctorName", doc.getName());
|
|
json.put("doctorName", doc.getName());
|
|
|
|
json.put("photo", doc.getPhoto());
|
|
} else {
|
|
} else {
|
|
Patient p = patientDao.findByCode(obj.getString("from"));
|
|
|
|
// 设置回复医生姓名
|
|
// 设置回复医生姓名
|
|
json.put("doctorName", p.getName());
|
|
json.put("doctorName", p.getName());
|
|
|
|
json.put("photo", p.getPhoto());
|
|
}
|
|
}
|
|
|
|
|
|
// 设置回复内容
|
|
// 设置回复内容
|
|
@ -802,9 +821,9 @@ public class ConsultController extends WeixinBaseController {
|
|
jsonArray.sort(new Comparator<JSONObject>() {
|
|
jsonArray.sort(new Comparator<JSONObject>() {
|
|
@Override
|
|
@Override
|
|
public int compare(JSONObject o1, JSONObject o2) {
|
|
public int compare(JSONObject o1, JSONObject o2) {
|
|
if(o1.getString("time").compareTo(o2.getString("time")) > 0){
|
|
|
|
|
|
if (o1.getString("time").compareTo(o2.getString("time")) > 0) {
|
|
return -1;
|
|
return -1;
|
|
} else if(o1.getString("time").compareTo(o2.getString("time")) < 0) {
|
|
|
|
|
|
} else if (o1.getString("time").compareTo(o2.getString("time")) < 0) {
|
|
return 1;
|
|
return 1;
|
|
} else {
|
|
} else {
|
|
return 0;
|
|
return 0;
|
|
@ -829,7 +848,7 @@ public class ConsultController extends WeixinBaseController {
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "oneLog")
|
|
@RequestMapping(value = "oneLog")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String oneLog(@RequestParam String consult, @RequestParam Long logId,@RequestParam int msgType) {
|
|
|
|
|
|
public String oneLog(@RequestParam String consult, @RequestParam Long logId, @RequestParam int msgType) {
|
|
try {
|
|
try {
|
|
ConsultTeam consultModel = consultTeamService.findByCode(consult);
|
|
ConsultTeam consultModel = consultTeamService.findByCode(consult);
|
|
if (consultModel == null) {
|
|
if (consultModel == null) {
|
|
@ -843,11 +862,11 @@ public class ConsultController extends WeixinBaseController {
|
|
if (!org.springframework.util.StringUtils.isEmpty(reG)) {
|
|
if (!org.springframework.util.StringUtils.isEmpty(reG)) {
|
|
obj = new JSONObject(new String(reG.getBytes(), "utf-8"));
|
|
obj = new JSONObject(new String(reG.getBytes(), "utf-8"));
|
|
} else {
|
|
} else {
|
|
return error(-1,"查询失败");
|
|
|
|
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
|
|
|
|
if(obj == null){
|
|
|
|
return error(-1,"查询失败");
|
|
|
|
|
|
if (obj == null) {
|
|
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
JSONObject json = new JSONObject();
|
|
@ -857,10 +876,12 @@ public class ConsultController extends WeixinBaseController {
|
|
Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
|
|
Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
|
|
// 设置回复医生姓名
|
|
// 设置回复医生姓名
|
|
json.put("doctorName", doc.getName());
|
|
json.put("doctorName", doc.getName());
|
|
|
|
json.put("photo", doc.getPhoto());
|
|
} else {
|
|
} else {
|
|
Patient p = patientDao.findByCode(obj.getString("from"));
|
|
Patient p = patientDao.findByCode(obj.getString("from"));
|
|
// 设置回复医生姓名
|
|
// 设置回复医生姓名
|
|
json.put("doctorName", p.getName());
|
|
json.put("doctorName", p.getName());
|
|
|
|
json.put("photo", p.getPhoto());
|
|
}
|
|
}
|
|
|
|
|
|
// 设置回复内容
|
|
// 设置回复内容
|