|
@ -1,12 +1,14 @@
|
|
|
package com.yihu.wlyy.service.specialist.rehabilitation;
|
|
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.message.Message;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
|
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
|
import com.yihu.wlyy.util.http.HttpResponse;
|
|
|
import com.yihu.wlyy.util.http.HttpUtils;
|
|
@ -38,6 +40,8 @@ public class RehabilitationManageService extends BaseService {
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
@Autowired
|
|
|
private SpecialistEvaluateSevice specialistEvaluateSevice;
|
|
|
|
|
|
/************************************************************* start ************************************************************************/
|
|
|
private String findRehabilitationPlanList = "/svr-specialist/findRehabilitationPlanList";//康复管理-康复计划列表
|
|
@ -202,7 +206,7 @@ public class RehabilitationManageService extends BaseService {
|
|
|
*/
|
|
|
public JSONObject serviceItem(String planDetailId) throws Exception{
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
param.put("planDetailIds", planDetailId);
|
|
|
param.put("planDetailId", planDetailId);
|
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + serviceItem, param);
|
|
|
JSONObject result = new JSONObject(response.getContent());
|
|
|
if(result.getInt("status")==200){
|
|
@ -386,7 +390,15 @@ public class RehabilitationManageService extends BaseService {
|
|
|
param.put("generalDoctorName", generalDoctorName);
|
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + serviceDoctorList, param);
|
|
|
JSONObject result = new JSONObject(response.getContent());
|
|
|
String doctorCode ="";
|
|
|
Doctor doctor = null;
|
|
|
if(result.getInt("status")==200){
|
|
|
JSONArray jsonArray = result.getJSONArray("obj");
|
|
|
for(int i=0;i<jsonArray.length();i++){
|
|
|
doctorCode = jsonArray.getJSONObject(i).get("doctorCode")+"";
|
|
|
doctor = doctorDao.findByCode(doctorCode);
|
|
|
jsonArray.getJSONObject(i).put("doctorPhoto",doctor!=null?doctor.getPhoto():"");
|
|
|
}
|
|
|
return result.getJSONArray("obj");
|
|
|
}
|
|
|
throw new Exception("请求微服务失败!");
|
|
@ -417,15 +429,55 @@ public class RehabilitationManageService extends BaseService {
|
|
|
throw new Exception("请求微服务失败!");
|
|
|
}
|
|
|
|
|
|
public JSONObject dailyJob(String executeStartTime, String executeEndTime, String planId, Integer searchTask, Integer status) throws Exception{
|
|
|
public JSONArray dailyJob(String startTime,String endTime) throws Exception{
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
param.put("executeStartTime", executeStartTime);
|
|
|
param.put("executeEndTime", executeEndTime);
|
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + appCalendarPlanDetailList, param);
|
|
|
param.put("startTime", startTime);
|
|
|
param.put("endTime", endTime);
|
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + dailyJob, param);
|
|
|
JSONObject result = new JSONObject(response.getContent());
|
|
|
if(result.getInt("status")==200){
|
|
|
return result.getJSONObject("obj");
|
|
|
return result.getJSONArray("obj");
|
|
|
}
|
|
|
throw new Exception("请求微服务失败!");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 每天8点,16点的job
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void dailyJobSendMessage(String startTime,String endTime,Integer type) throws Exception{
|
|
|
JSONArray jsonArray = dailyJob(startTime,endTime);
|
|
|
JSONObject jsonObject = null;
|
|
|
String doctor = "";
|
|
|
String patient ="";
|
|
|
Integer num = null;
|
|
|
for(int i=0;i<jsonArray.length();i++){
|
|
|
jsonObject = jsonArray.getJSONObject(i);
|
|
|
doctor = jsonObject.get("doctor")+"";//执行的医生(接收的医生)
|
|
|
patient = jsonObject.get("patient")+"";//执行的居民
|
|
|
num = (Integer)jsonObject.get("num");//需要今日需要执行的项目数
|
|
|
Message message1 = new Message();
|
|
|
message1.setSender(null);
|
|
|
message1.setType(type);
|
|
|
message1.setReceiver(doctor);
|
|
|
specialistEvaluateSevice.sendMessage(message1,null,patient,num);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 每天十六点的job
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void sixteenDailyJob(String startTime,String endTime) throws Exception{
|
|
|
JSONArray jsonArray = dailyJob(startTime,endTime);
|
|
|
JSONObject jsonObject = null;
|
|
|
for(int i=0;i<jsonArray.length();i++){
|
|
|
jsonObject = jsonArray.getJSONObject(i);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|