|
@ -12,6 +12,7 @@ import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
|
import com.yihu.wlyy.util.http.HttpResponse;
|
|
|
import com.yihu.wlyy.util.http.HttpUtils;
|
|
@ -75,11 +76,13 @@ public class RehabilitationManageService extends BaseService {
|
|
|
private String serviceDoctorList = "/svr-specialist/serviceDoctorList";//康复管理-医生端居民详情服务医生列表
|
|
|
private String appCalendarPlanDetailList = "/svr-specialist/appCalendarPlanDetailList";//康复管理-app端、微信端计划的服务项目列表
|
|
|
private String dailyJob = "/svr-specialist/dailyJob";//每日康复服务通知
|
|
|
private String dailyJobReserve = "/svr-specialist/dailyJobReserve";//10天、7天、5天、当天康复服务预约复诊通知
|
|
|
private String saveRehabilitationOperateRecord ="/svr-specialist/saveRehabilitationOperateRecord";//新增operateRecodr
|
|
|
private String updateNoteAndImageRehabilitationOperate ="/svr-specialist/updateNoteAndImageRehabilitationOperate";//康复计划完成时更新服务完成笔记和图片接口;
|
|
|
private String updatePlanDetailStatusById = "/svr-specialist/updatePlanDetailStatusById";//康复管理-更新康复计划服务项目状态
|
|
|
private String planSchedule = "/svr-specialist/planSchedule";//康复管理-计划总进度
|
|
|
private String planListByPatient = "/svr-specialist/planListByPatient";//康复管理-根据居民获取康复计划
|
|
|
private String patientCount = "/svr-specialist/patientCount";//康复管理-医生已计划数,已完成计划数(居民数)
|
|
|
/************************************************************* end ************************************************************************/
|
|
|
|
|
|
/**
|
|
@ -488,6 +491,18 @@ public class RehabilitationManageService extends BaseService {
|
|
|
throw new Exception("请求微服务失败!");
|
|
|
}
|
|
|
|
|
|
public JSONArray dailyJobReserve(String startTime, String endTime) throws Exception{
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
param.put("startTime", startTime);
|
|
|
param.put("endTime", endTime);
|
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + dailyJobReserve, param);
|
|
|
JSONObject result = new JSONObject(response.getContent());
|
|
|
if(result.getInt("status")==200){
|
|
|
return result.getJSONArray("obj");
|
|
|
}
|
|
|
throw new Exception("请求微服务失败!");
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject saveRehabilitationOperateRecord(String dataJson) throws Exception{
|
|
|
Map<String, Object> param = new HashedMap();
|
|
@ -649,4 +664,40 @@ public class RehabilitationManageService extends BaseService {
|
|
|
}
|
|
|
throw new Exception("请求微服务失败!");
|
|
|
}
|
|
|
|
|
|
public JSONObject patientCount(String doctorCode) throws Exception{
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
param.put("doctorCode", doctorCode);
|
|
|
HttpResponse response = HttpUtils.doGet(specialistUrl + patientCount, param);
|
|
|
JSONObject result = new JSONObject(response.getContent());
|
|
|
if(result.getInt("status")==200){
|
|
|
return result.getJSONObject("obj");
|
|
|
}
|
|
|
throw new Exception("请求微服务失败!");
|
|
|
}
|
|
|
|
|
|
public void dailyJobReserve(Integer num,Integer type) throws Exception{
|
|
|
Long time = num*24*60*60*1000L;
|
|
|
String startTime = DateUtil.dateToStrShort(new Date(new Date().getTime()+time))+" "+"00:00:00";
|
|
|
String endTime = DateUtil.dateToStrShort(new Date(new Date().getTime()+time))+" "+"23:59:59";
|
|
|
JSONArray jsonArray = dailyJobReserve(startTime,endTime);
|
|
|
JSONObject jsonObject = null;
|
|
|
String doctor = "";
|
|
|
String patient ="";
|
|
|
String hospital ="";
|
|
|
String planDetailIds = null;
|
|
|
for(int i=0;i<jsonArray.length();i++){
|
|
|
jsonObject = jsonArray.getJSONObject(i);
|
|
|
doctor = jsonObject.get("doctor")+"";//执行的医生(接收的医生)
|
|
|
patient = jsonObject.get("patient")+"";//执行的居民
|
|
|
hospital = jsonObject.get("hospital")+"";//医院
|
|
|
planDetailIds = jsonObject.get("planDetailIds")+"";
|
|
|
Message message1 = new Message();
|
|
|
// message1.setSender(patient);
|
|
|
message1.setType(type);
|
|
|
message1.setReceiver(doctor);
|
|
|
message1.setRelationCode(planDetailIds);
|
|
|
specialistEvaluateSevice.sendMessage(message1,hospital,patient,num);
|
|
|
}
|
|
|
}
|
|
|
}
|