|
|
|
@ -7,6 +7,7 @@ import com.ynxbd.common.bean.pay.Register; |
|
|
|
|
import com.ynxbd.common.dao.PatientDao; |
|
|
|
|
import com.ynxbd.common.helper.ProperHelper; |
|
|
|
|
import com.ynxbd.common.helper.http.OkHttpHelper; |
|
|
|
|
import com.ynxbd.wx.pwe.PWEHelper; |
|
|
|
|
import com.ynxbd.wx.utils.DesEncryptHelper; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import okhttp3.FormBody; |
|
|
|
@ -20,6 +21,8 @@ public class MessagePushConfig { |
|
|
|
|
private MessagePushConfig() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static final String ORGANIZENAME; |
|
|
|
|
|
|
|
|
|
// 挂号导航是否开启功能=====================================
|
|
|
|
|
public static final boolean REG_NAVIGATE_IS_ENABLE; |
|
|
|
|
// 挂号导航请求链接
|
|
|
|
@ -40,6 +43,9 @@ public class MessagePushConfig { |
|
|
|
|
// 是否开启功能============================================
|
|
|
|
|
public static final boolean RECIPE_IS_ENABLE; |
|
|
|
|
|
|
|
|
|
public static final String REG_AI_URL; |
|
|
|
|
public static final boolean REG_AI_IS_ENABLE; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 消息推送主链接 |
|
|
|
|
*/ |
|
|
|
@ -51,6 +57,8 @@ public class MessagePushConfig { |
|
|
|
|
static { |
|
|
|
|
ProperHelper config = new ProperHelper().read("message-push.properties"); |
|
|
|
|
|
|
|
|
|
ORGANIZENAME = "4B80803106B38A5F"; |
|
|
|
|
|
|
|
|
|
REG_NAVIGATE_IS_ENABLE = config.getBoolean("msg.reg.navigate.is_enable", false); |
|
|
|
|
REG_NAVIGATE_URL = config.getString("msg.reg.navigate.url"); |
|
|
|
|
//
|
|
|
|
@ -65,6 +73,9 @@ public class MessagePushConfig { |
|
|
|
|
RECIPE_IS_ENABLE = config.getBoolean("msg.recipe.is_enable", false); |
|
|
|
|
RECIPE_URL = config.getString("msg.recipe.url"); |
|
|
|
|
|
|
|
|
|
REG_AI_IS_ENABLE = config.getBoolean("msg.ai.is_enable",false); |
|
|
|
|
REG_AI_URL = config.getString("msg.ai.url"); |
|
|
|
|
|
|
|
|
|
if (REG_CANCEL_URL == null) { |
|
|
|
|
log.error("【消息推送】配置文件message-push.properties读取失败"); |
|
|
|
|
} |
|
|
|
@ -167,6 +178,73 @@ public class MessagePushConfig { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* AI诊疗推送 |
|
|
|
|
* @param merchantEnum |
|
|
|
|
* @param reg |
|
|
|
|
*/ |
|
|
|
|
public static void regAI(MerchantEnum merchantEnum,Register reg){ |
|
|
|
|
try { |
|
|
|
|
if (!merchantEnum.equals(MerchantEnum.WX) |
|
|
|
|
|| !REG_AI_IS_ENABLE || reg == null || ObjectUtils.isEmpty(REG_AI_URL)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.info("[推送]AI智能问诊推送..."); |
|
|
|
|
String patientId = reg.getPatientId(); |
|
|
|
|
if ( patientId == null) { |
|
|
|
|
log.warn("[推送]AI智能问诊推送通知失败,参数缺失~ patientId= null"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RequestBody requestBody = new FormBody.Builder() |
|
|
|
|
.add("patientId",patientId) |
|
|
|
|
.add("content","为了帮助医生更全面地了解您的身体情况,请花2分钟时间填写病情信息,以便医生提前了解病症,为您提供更好的诊疗服务。") |
|
|
|
|
.add("url", PWEHelper.getH5PWEUrl(patientId)) |
|
|
|
|
.add("organizeName",ORGANIZENAME) |
|
|
|
|
.build(); |
|
|
|
|
OkHttpHelper.post(OBS_DOCUMENT, requestBody); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.warn("[推送]AI智能问诊推送通知错误-{}", e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* AI诊疗推送 |
|
|
|
|
* @param patientId |
|
|
|
|
*/ |
|
|
|
|
public static void regAIReport(String patientId){ |
|
|
|
|
try { |
|
|
|
|
if (!REG_AI_IS_ENABLE || ObjectUtils.isEmpty(REG_AI_URL)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
log.info("[推送]AI问诊报告推送..."); |
|
|
|
|
if ( patientId == null) { |
|
|
|
|
log.warn("[推送]AI问诊报告推送通知失败,参数缺失~ patientId= null"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RequestBody requestBody = new FormBody.Builder() |
|
|
|
|
.add("patientId",patientId) |
|
|
|
|
.add("content","您好,您的预问诊报告可以查看啦") |
|
|
|
|
.add("url", PWEHelper.getH5PWEUrl(patientId)) |
|
|
|
|
.add("organizeName",ORGANIZENAME) |
|
|
|
|
.build(); |
|
|
|
|
OkHttpHelper.post(OBS_DOCUMENT, requestBody); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.warn("[推送]AI问诊报告推送通知错误-{}", e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 红河州医院产科建党推送 |
|
|
|
|
* @param merchantEnum |
|
|
|
|
* @param reg |
|
|
|
|
*/ |
|
|
|
|
public static void regObsDocument(MerchantEnum merchantEnum, Register reg){ |
|
|
|
|
try { |
|
|
|
|
if (!merchantEnum.equals(MerchantEnum.WX) |
|
|
|
@ -185,7 +263,7 @@ public class MessagePushConfig { |
|
|
|
|
.add("patientId",patientId) |
|
|
|
|
.add("content","[孕产建档提示]尊敬的孕妈妈您好!为了向您提供更好的服务,请点击下方链接完成孕产建档,若您已建档请忽略!") |
|
|
|
|
.add("url","https://zhck.hhzyy.com:10082/wxapp/") |
|
|
|
|
.add("organizeName","4B80803106B38A5F") |
|
|
|
|
.add("organizeName",ORGANIZENAME) |
|
|
|
|
.add("buttonName","进入产科建档系统") |
|
|
|
|
.build(); |
|
|
|
|
OkHttpHelper.post(OBS_DOCUMENT, requestBody); |
|
|
|
|