|
@ -9,6 +9,7 @@ import com.yihu.wlyy.repository.patient.PatientReservationDao;
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
import com.yihu.wlyy.service.app.consult.ConsultService;
|
|
import com.yihu.wlyy.service.app.consult.ConsultService;
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
|
|
import com.yihu.wlyy.service.third.httplog.LogService;
|
|
import com.yihu.wlyy.service.third.jw.JwSmjkService;
|
|
import com.yihu.wlyy.service.third.jw.JwSmjkService;
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
import com.yihu.wlyy.util.SOAPUtil;
|
|
import com.yihu.wlyy.util.SOAPUtil;
|
|
@ -54,6 +55,9 @@ public class GuahaoXMService implements IGuahaoService {
|
|
@Autowired
|
|
@Autowired
|
|
SignFamilyDao signFamilyDao;
|
|
SignFamilyDao signFamilyDao;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private LogService logService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ConsultService consultService;
|
|
private ConsultService consultService;
|
|
|
|
|
|
@ -192,6 +196,37 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
|
|
|
|
|
|
|
/***********************************************************************************************************************************************/
|
|
/***********************************************************************************************************************************************/
|
|
|
|
/**
|
|
|
|
* xml验证,并保存日志
|
|
|
|
* @param url
|
|
|
|
* @param content
|
|
|
|
* @param method
|
|
|
|
* @param msgBody
|
|
|
|
* @param res
|
|
|
|
*/
|
|
|
|
private void verificationXml(String xml,String title,String url,String content,String method,String msgBody,String res) throws Exception{
|
|
|
|
String error = "";
|
|
|
|
Boolean isSuccess = false;
|
|
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
//保存http日志
|
|
|
|
error = title;
|
|
|
|
logService.saveHttpLog(isSuccess,url,content,method,null,msgBody,res,error,"2");
|
|
|
|
throw new Exception(error);
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
//保存http日志
|
|
|
|
error = xml.substring(xml.indexOf(":") + 1, xml.length());
|
|
|
|
logService.saveHttpLog(isSuccess,url,content,method,null,msgBody,res,error,"2");
|
|
|
|
throw new Exception(error);
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
//保存http日志
|
|
|
|
error = xml.substring(xml.indexOf(":") + 1, xml.length());
|
|
|
|
logService.saveHttpLog(isSuccess,url,content,method,null,msgBody,res,error,"2");
|
|
|
|
throw new Exception(error);
|
|
|
|
}
|
|
|
|
}
|
|
/**
|
|
/**
|
|
* 获取医院列表
|
|
* 获取医院列表
|
|
*/
|
|
*/
|
|
@ -226,17 +261,18 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param3.put("value", values[2]);
|
|
param3.put("value", values[2]);
|
|
params.put(param3);
|
|
params.put(param3);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "获取医院列表";
|
|
|
|
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(ORG_LIST, params);
|
|
String xml = SOAPUtil.post(ORG_LIST, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("获取机构列表失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,"获取机构列表失败!",ORG_LIST,content,method,msgBody,res);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Element root = document.getRootElement();
|
|
Element root = document.getRootElement();
|
|
List<?> child = root.elements();
|
|
List<?> child = root.elements();
|
|
@ -254,6 +290,9 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
|
|
|
re.add(map);
|
|
re.add(map);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,ORG_LIST,content,method,null,msgBody,res,null,"2");
|
|
}
|
|
}
|
|
return re;
|
|
return re;
|
|
}
|
|
}
|
|
@ -270,17 +309,17 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param1.put("value", hospitalId);
|
|
param1.put("value", hospitalId);
|
|
params.put(param1);
|
|
params.put(param1);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "获取科室接口";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(DEP_LIST, params);
|
|
String xml = SOAPUtil.post(DEP_LIST, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("获取可预约科室列表失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,"获取可预约科室列表失败!",DEP_LIST,content,method,msgBody,res);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Element root = document.getRootElement();
|
|
Element root = document.getRootElement();
|
|
List<?> child = root.elements();
|
|
List<?> child = root.elements();
|
|
@ -296,6 +335,10 @@ public class GuahaoXMService implements IGuahaoService {
|
|
re.add(map);
|
|
re.add(map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,DEP_LIST,content,method,null,msgBody,res,null,"2");
|
|
|
|
|
|
return re;
|
|
return re;
|
|
}
|
|
}
|
|
|
|
|
|
@ -327,17 +370,17 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param4.put("value", DateUtil.getNextDay(nowDate, nextDays)); //一周后时间
|
|
param4.put("value", DateUtil.getNextDay(nowDate, nextDays)); //一周后时间
|
|
params.put(param4);
|
|
params.put(param4);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "获取医生列表接口";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(DOCTOR_LIST, params);
|
|
String xml = SOAPUtil.post(DOCTOR_LIST, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("获取医生列表失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,"获取医生列表失败!",DOCTOR_LIST,content,method,msgBody,res);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Element root = document.getRootElement();
|
|
Element root = document.getRootElement();
|
|
List<?> child = root.elements();
|
|
List<?> child = root.elements();
|
|
@ -385,6 +428,10 @@ public class GuahaoXMService implements IGuahaoService {
|
|
doctor.setHospitalName(orgname);
|
|
doctor.setHospitalName(orgname);
|
|
re.add(doctor);
|
|
re.add(doctor);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,DOCTOR_LIST,content,method,null,msgBody,res,null,"2");
|
|
|
|
|
|
return re;
|
|
return re;
|
|
}
|
|
}
|
|
|
|
|
|
@ -421,7 +468,19 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param5.put("value", DateUtil.getNextDay(nowDate, nextDays)); //一周后时间
|
|
param5.put("value", DateUtil.getNextDay(nowDate, nextDays)); //一周后时间
|
|
params.put(param5);
|
|
params.put(param5);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "获取医生排班接口(包含排班详细)";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(DOCTOR_ARRANGE, params);
|
|
String xml = SOAPUtil.post(DOCTOR_ARRANGE, params);
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,"获取医生排班表失败!",DOCTOR_ARRANGE,content,method,msgBody,res);
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,DOCTOR_ARRANGE,content,method,null,msgBody,res,null,"2");
|
|
|
|
|
|
return xmlToList(xml);
|
|
return xmlToList(xml);
|
|
}
|
|
}
|
|
@ -460,17 +519,17 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param5.put("value", DateUtil.getNextDay(nowDate, nextDays)); //一周后时间
|
|
param5.put("value", DateUtil.getNextDay(nowDate, nextDays)); //一周后时间
|
|
params.put(param5);
|
|
params.put(param5);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "获取医生排班接口(一级)";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(DOCTOR_ARRANGE_SIMPLE, params);
|
|
String xml = SOAPUtil.post(DOCTOR_ARRANGE_SIMPLE, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("获取医生排班表失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,"获取医生排班表失败!",DOCTOR_ARRANGE_SIMPLE,content,method,msgBody,res);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Element root = document.getRootElement();
|
|
Element root = document.getRootElement();
|
|
List<?> child = root.elements();
|
|
List<?> child = root.elements();
|
|
@ -495,6 +554,10 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
|
|
|
re.add(map);
|
|
re.add(map);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,DOCTOR_ARRANGE_SIMPLE,content,method,null,msgBody,res,null,"2");
|
|
|
|
|
|
return re;
|
|
return re;
|
|
}
|
|
}
|
|
|
|
|
|
@ -550,18 +613,18 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param3.put("value", values[2]);
|
|
param3.put("value", values[2]);
|
|
params.put(param3);
|
|
params.put(param3);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "创建挂号单";
|
|
|
|
Long startTimes = System.currentTimeMillis();
|
|
String response = SOAPUtil.post(ORDER_CREATE, params);
|
|
String response = SOAPUtil.post(ORDER_CREATE, params);
|
|
if (StringUtils.isEmpty(response)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("请求失败!");
|
|
|
|
} else if (StringUtils.startsWith(response, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(response.substring(response.indexOf(":") + 1, response.length()));
|
|
|
|
} else if (StringUtils.startsWith(response, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(response.substring(response.indexOf(":") + 1, response.length()));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTimes)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+response;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
//xml验证
|
|
|
|
verificationXml(response,"获取医生排班表失败!",ORDER_CREATE,content,method,msgBody,res);
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,ORDER_CREATE,content,method,null,msgBody,res,null,"2");
|
|
re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, null, null);
|
|
re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, null, null);
|
|
} else {
|
|
} else {
|
|
throw new Exception("该排班信息错误或者不存在!");
|
|
throw new Exception("该排班信息错误或者不存在!");
|
|
@ -599,23 +662,26 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param4.put("value", values[2]);
|
|
param4.put("value", values[2]);
|
|
params.put(param4);
|
|
params.put(param4);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "取消挂号单";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(ORDER_CANCEL, params);
|
|
String xml = SOAPUtil.post(ORDER_CANCEL, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("取消挂号失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
if (xml.toLowerCase().startsWith("ok")) {
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,"取消挂号失败!",ORDER_CANCEL,content,method,msgBody,res);
|
|
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
|
|
Boolean isOk = false;
|
|
|
|
if (xml.toLowerCase().startsWith("ok")) {
|
|
|
|
isOk = true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(isOk,ORDER_CANCEL,content,method,null,msgBody,res,null,"2");
|
|
|
|
|
|
|
|
return isOk;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@ -643,17 +709,17 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param4.put("value", DateUtil.getNextDay(nowDate, nextDays)); //一周后时间
|
|
param4.put("value", DateUtil.getNextDay(nowDate, nextDays)); //一周后时间
|
|
params.put(param4);
|
|
params.put(param4);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "获取医生信息";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(DOCTOR_LIST, params);
|
|
String xml = SOAPUtil.post(DOCTOR_LIST, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("获取医生列表失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,"获取医生列表失败!",DOCTOR_LIST,content,method,msgBody,res);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Element root = document.getRootElement();
|
|
Element root = document.getRootElement();
|
|
List<?> child = root.elements();
|
|
List<?> child = root.elements();
|
|
@ -704,6 +770,10 @@ public class GuahaoXMService implements IGuahaoService {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,DOCTOR_LIST,content,method,null,msgBody,res,null,"2");
|
|
|
|
|
|
return doctor;
|
|
return doctor;
|
|
}
|
|
}
|
|
|
|
|
|
@ -741,17 +811,17 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param3.put("value", values[2]);
|
|
param3.put("value", values[2]);
|
|
params.put(param3);
|
|
params.put(param3);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "获取预约状态";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(ORDER_INFO, params);
|
|
String xml = SOAPUtil.post(ORDER_INFO, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("获取预约状态失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
String errMsg = "获取预约状态失败!";
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,errMsg,ORDER_INFO,content,method,msgBody,res);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Element root = document.getRootElement();
|
|
Element root = document.getRootElement();
|
|
@ -778,8 +848,13 @@ public class GuahaoXMService implements IGuahaoService {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,ORDER_INFO,content,method,null,msgBody,res,null,"2");
|
|
} else {
|
|
} else {
|
|
throw new Exception("获取预约状态失败!");
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(false,ORDER_INFO,content,method,null,msgBody,res,errMsg,"2");
|
|
|
|
throw new Exception(errMsg);
|
|
}
|
|
}
|
|
} catch (Exception ex) {
|
|
} catch (Exception ex) {
|
|
ex.printStackTrace();
|
|
ex.printStackTrace();
|
|
@ -821,17 +896,19 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param5.put("key", "?strKey");
|
|
param5.put("key", "?strKey");
|
|
param5.put("value", values[2]); //一周后时间
|
|
param5.put("value", values[2]); //一周后时间
|
|
params.put(param5);
|
|
params.put(param5);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "根据患者医保卡获取近三个月的预约记录";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(REG_LIST, params);
|
|
String xml = SOAPUtil.post(REG_LIST, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("获取挂号信息失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
String errMsg = "获取挂号信息失败!";
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,errMsg,REG_LIST,content,method,msgBody,res);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Element root = document.getRootElement();
|
|
Element root = document.getRootElement();
|
|
List<?> child = root.elements();
|
|
List<?> child = root.elements();
|
|
@ -900,6 +977,10 @@ public class GuahaoXMService implements IGuahaoService {
|
|
patientRegList.add(patientReservation);
|
|
patientRegList.add(patientReservation);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,REG_LIST,content,method,null,msgBody,res,null,"2");
|
|
|
|
|
|
return patientRegList;
|
|
return patientRegList;
|
|
}
|
|
}
|
|
|
|
|
|
@ -909,6 +990,10 @@ public class GuahaoXMService implements IGuahaoService {
|
|
public PatientReservation getRegDetail(String patientCode, String orgCode, String regCode) throws Exception {
|
|
public PatientReservation getRegDetail(String patientCode, String orgCode, String regCode) throws Exception {
|
|
//获取签名信息
|
|
//获取签名信息
|
|
Patient patient = patientService.findByCode(patientCode);
|
|
Patient patient = patientService.findByCode(patientCode);
|
|
|
|
if (patient == null) {
|
|
|
|
throw new Exception("获取挂号人员信息失败!");
|
|
|
|
}
|
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
StringBuffer sb = new StringBuffer();
|
|
sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
|
sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
|
sb.append("<root>");
|
|
sb.append("<root>");
|
|
@ -933,25 +1018,22 @@ public class GuahaoXMService implements IGuahaoService {
|
|
param3.put("value", values[2]);
|
|
param3.put("value", values[2]);
|
|
params.put(param3);
|
|
params.put(param3);
|
|
|
|
|
|
|
|
//新增日志
|
|
|
|
String method = "POST";
|
|
|
|
String content = "获取单条记录预约记录";
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
String xml = SOAPUtil.post(ORDER_INFO, params);
|
|
String xml = SOAPUtil.post(ORDER_INFO, params);
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
|
// 请求失败
|
|
|
|
throw new Exception("获取挂号信息失败!");
|
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
|
// 调用失败
|
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
|
}
|
|
|
|
|
|
Long spendTime = (System.currentTimeMillis()-startTime)/1000;//计算请求时间
|
|
|
|
String res = "耗时:"+spendTime+"s,xml="+xml;
|
|
|
|
String msgBody = params.toString();
|
|
|
|
String errMsg = "获取挂号信息失败!";
|
|
|
|
//xml验证
|
|
|
|
verificationXml(xml,errMsg,ORDER_INFO,content,method,msgBody,res);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Document document = DocumentHelper.parseText(xml);
|
|
Element root = document.getRootElement();
|
|
Element root = document.getRootElement();
|
|
List<?> child = root.elements();
|
|
List<?> child = root.elements();
|
|
|
|
|
|
if (patient == null) {
|
|
|
|
throw new Exception("获取挂号人员信息失败!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (child.size() > 0) {
|
|
if (child.size() > 0) {
|
|
Element e = (Element) child.get(0);
|
|
Element e = (Element) child.get(0);
|
|
// 医生编码
|
|
// 医生编码
|
|
@ -1011,8 +1093,14 @@ public class GuahaoXMService implements IGuahaoService {
|
|
GuahaoDoctor guahaoDoctor = GetDoctorInfo(DoctorCode, OrgCode, DeptCode);
|
|
GuahaoDoctor guahaoDoctor = GetDoctorInfo(DoctorCode, OrgCode, DeptCode);
|
|
patientReservation.setDoctorPhoto(guahaoDoctor.getPhoto());//照片
|
|
patientReservation.setDoctorPhoto(guahaoDoctor.getPhoto());//照片
|
|
patientReservation.setDoctorJob(guahaoDoctor.getTitle());//职称
|
|
patientReservation.setDoctorJob(guahaoDoctor.getTitle());//职称
|
|
|
|
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(true,ORDER_INFO,content,method,null,msgBody,res,null,"2");
|
|
|
|
|
|
return patientReservation;
|
|
return patientReservation;
|
|
} else {
|
|
} else {
|
|
|
|
//保存http日志
|
|
|
|
logService.saveHttpLog(false,ORDER_INFO,content,method,null,msgBody,res,null,"2");
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|