|
@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.util.HashSet;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@ -134,7 +135,7 @@ public class RehabilitationPlanService extends BaseService {
|
|
return rs.getString("message");
|
|
return rs.getString("message");
|
|
}
|
|
}
|
|
|
|
|
|
public String createRehabilitationPlan(String json, Doctor doctor) {
|
|
|
|
|
|
public String createRehabilitationPlan(String json, Doctor doctor) throws Exception {
|
|
JSONObject object = new JSONObject(json);
|
|
JSONObject object = new JSONObject(json);
|
|
String patient = object.getString("patient");
|
|
String patient = object.getString("patient");
|
|
object.put("createUser", doctor.getCode());
|
|
object.put("createUser", doctor.getCode());
|
|
@ -148,18 +149,26 @@ public class RehabilitationPlanService extends BaseService {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
JSONArray detailModelList = (JSONArray) rs.get("detailModelList");
|
|
|
|
//康复计划创建完给执行者发送消息
|
|
|
|
for (Object obj : detailModelList){
|
|
|
|
JSONObject detail = (JSONObject) obj;
|
|
|
|
Message message = new Message();
|
|
|
|
message.setSender(doctor.getCode());
|
|
|
|
message.setType(19);
|
|
|
|
message.setRelationCode(detail.getString("planId"));
|
|
|
|
message.setReceiver(detail.getString("doctor"));
|
|
|
|
specialistEvaluateSevice.sendMessage(message, detail.getString("hospital"), patient,null);
|
|
|
|
|
|
if(rs.getInt("status") == 200) {
|
|
|
|
HashSet set = new HashSet();
|
|
|
|
JSONArray detailModelList = (JSONArray) rs.get("detailModelList");
|
|
|
|
//康复计划创建完给执行者发送消息
|
|
|
|
for (Object obj : detailModelList) {
|
|
|
|
JSONObject detail = (JSONObject) obj;
|
|
|
|
if (!set.contains(detail.getString("doctor"))) {
|
|
|
|
set.add(detail.getString("doctor"));
|
|
|
|
Message message = new Message();
|
|
|
|
message.setSender(doctor.getCode());
|
|
|
|
message.setType(19);
|
|
|
|
message.setRelationCode(detail.getString("planId"));
|
|
|
|
message.setReceiver(detail.getString("doctor"));
|
|
|
|
specialistEvaluateSevice.sendMessage(message, detail.getString("hospital"), patient, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return rs.getString("message");
|
|
|
|
}else {
|
|
|
|
throw new Exception("请求微服务失败!");
|
|
}
|
|
}
|
|
return rs.getString("message");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public String deleteTemplate(String templateId) {
|
|
public String deleteTemplate(String templateId) {
|