|
@@ -273,12 +273,16 @@ public class ThmzService {
|
|
|
: "http://172.16.32.160:8088/thmz/api/v1/payChargeDetailFormHaiCi";
|
|
|
String des = request.isNormalClinic() ? "门诊" : "医美";
|
|
|
RestTemplate template = new RestTemplate();
|
|
|
- SaveMzFeeResponse mzFeeResponse = template.postForObject(url, request, SaveMzFeeResponse.class);
|
|
|
- log.info("第{}次尝试保存{}缴费信息:\n参数:{},\n结果:{}", times, des,
|
|
|
- JSON.toJSON(request), JSON.toJSON(mzFeeResponse));
|
|
|
+ SaveMzFeeResponse mzFeeResponse = null;
|
|
|
+ try {
|
|
|
+ mzFeeResponse = template.postForObject(url, request, SaveMzFeeResponse.class);
|
|
|
+ log.info("第{}次尝试保存{}缴费信息:\n参数:{},\n结果:{}", times, des,
|
|
|
+ JSON.toJSON(request), JSON.toJSON(mzFeeResponse));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("网络连接失败,保存门诊缴费信息失败:", e);
|
|
|
+ }
|
|
|
mzFeeResponse = null == mzFeeResponse ? new SaveMzFeeResponse() : mzFeeResponse;
|
|
|
if (mzFeeResponse.getResultCode() == 0) {
|
|
|
-
|
|
|
return ExceptionEnum.SUCCESS;
|
|
|
}
|
|
|
if (mzFeeResponse.getResultMessage().contains("获取缴费流水号失败")) {
|
|
@@ -291,9 +295,14 @@ public class ThmzService {
|
|
|
|
|
|
public String saveAppointment(SaveAppointmentRequest request) {
|
|
|
RestTemplate template = new RestTemplate();
|
|
|
- SaveGhFeeResponse response = template.postForObject(thmzApi + "/payRegistrationFormHaiCi",
|
|
|
- request, SaveGhFeeResponse.class);
|
|
|
- log.info("保存挂号信息: \n参数:{},\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
+ SaveGhFeeResponse response = null;
|
|
|
+ try {
|
|
|
+ response = template.postForObject(thmzApi + "/payRegistrationFormHaiCi",
|
|
|
+ request, SaveGhFeeResponse.class);
|
|
|
+ log.info("保存挂号信息: \n参数:{},\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("网络连接失败,保存挂号信息失败:", e);
|
|
|
+ }
|
|
|
if (null == response) {
|
|
|
return "ERROR:网络异常。";
|
|
|
}
|
|
@@ -304,9 +313,14 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public String saveClinicRegister(SaveClinicRegisterRequest request) {
|
|
|
- SaveGhFeeResponse response = new RestTemplate()
|
|
|
- .postForObject(thmzApi + "/payRegistration", request, SaveGhFeeResponse.class);
|
|
|
- log.info("保存诊间挂号信息: \n参数:{},\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
+ SaveGhFeeResponse response = null;
|
|
|
+ try {
|
|
|
+ response = new RestTemplate()
|
|
|
+ .postForObject(thmzApi + "/payRegistration", request, SaveGhFeeResponse.class);
|
|
|
+ log.info("保存诊间挂号信息: \n参数:{},\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("网络连接失败,保存诊间挂号信息失败:", e);
|
|
|
+ }
|
|
|
if (null == response) {
|
|
|
return "ERROR:保存诊间挂号信息失败,门诊接口返回空。";
|
|
|
}
|
|
@@ -317,9 +331,14 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public String saveTemplate(SaveTemplateRequest request) {
|
|
|
- HrgCommonResponse response = new RestTemplate().
|
|
|
- postForObject(thmzApi + "/saveTcPrescription", request, HrgCommonResponse.class);
|
|
|
- log.info("保存套餐缴费:\n参数:{}\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
+ HrgCommonResponse response = null;
|
|
|
+ try {
|
|
|
+ response = new RestTemplate().
|
|
|
+ postForObject(thmzApi + "/saveTcPrescription", request, HrgCommonResponse.class);
|
|
|
+ log.info("保存套餐缴费:\n参数:{}\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("网络连接失败,保存套餐缴费信息失败:", e);
|
|
|
+ }
|
|
|
if (null == response) {
|
|
|
return "ERROR:保存套餐缴费失败,门诊接口返回空。";
|
|
|
}
|