增加BI重试,新增宜良福泰医院推送对接

master
zdnpc 4 weeks ago
parent 2390eeefe5
commit 9ef78a512f
  1. 35
      logs/info.log
  2. 3
      logs/info/info-2025-02-19.log
  3. 3
      src/main/java/com/ynxbd/push/config/IniConfig.java
  4. 5
      src/main/java/com/ynxbd/push/controller/ApiController.java
  5. 29
      src/main/java/com/ynxbd/push/controller/BI/BiController.java
  6. 6
      src/main/java/com/ynxbd/push/controller/BusinessController.java
  7. 1
      src/main/java/com/ynxbd/push/controller/MiddlePlatformController.java
  8. 2
      src/main/java/com/ynxbd/push/controller/SendMessageController.java
  9. 2
      src/main/java/com/ynxbd/push/helper/DesEncryptHelper.java
  10. 2
      src/main/java/com/ynxbd/push/helper/HisResultFormat.java
  11. 20
      src/main/java/com/ynxbd/push/helper/MessageApiHelper.java
  12. 4
      src/main/java/com/ynxbd/push/helper/RequestHelper.java
  13. 3
      src/main/java/com/ynxbd/push/helper/TemplateJsonStringHelper.java
  14. 3
      src/main/java/com/ynxbd/push/helper/TemplateSelectHelper.java
  15. 5
      src/main/java/com/ynxbd/push/httpRequest/xbd/his/HisRequest.java
  16. 35
      src/main/java/com/ynxbd/push/quartz/pushJob/BI/BiPush.java
  17. 2
      src/main/java/com/ynxbd/push/quartz/scheduler/AppQuartzScheduler.java
  18. 7
      src/main/java/com/ynxbd/push/rabbit/receive/RabbitReceiver.java
  19. 2
      src/main/java/com/ynxbd/push/rabbit/send/RabbitSender.java
  20. 6
      src/main/resources/application.yml
  21. 2
      src/main/resources/logback.xml
  22. 34
      src/main/resources/weChat.ini

@ -1,3 +1,32 @@
[16:51:28.500][org.quartz.core.QuartzScheduler - shutdown - 666] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.
[16:51:28.505][org.quartz.core.QuartzScheduler - standby - 585] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.
[16:51:28.506][org.quartz.core.QuartzScheduler - shutdown - 740] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.
[17:17:57.122][org.springframework.boot.StartupInfoLogger - logStarting - 55] Starting AppApplication v0.0.1 on LAPTOP-RQVAK2JK with PID 36224 (D:\ProgramCode\company\WxPush\wx_push\target\push-0.0.1.jar started by banality in D:\ProgramCode\company\WxPush\wx_push\target)
[17:17:57.133][org.springframework.boot.SpringApplication - logStartupProfileInfo - 651] No active profile set, falling back to default profiles: default
[17:18:00.535][org.apache.juli.logging.DirectJDKLog - log - 173] Initializing ProtocolHandler ["http-nio-8123"]
[17:18:00.536][org.apache.juli.logging.DirectJDKLog - log - 173] Starting service [Tomcat]
[17:18:00.536][org.apache.juli.logging.DirectJDKLog - log - 173] Starting Servlet engine: [Apache Tomcat/9.0.36]
[17:18:00.668][org.apache.juli.logging.DirectJDKLog - log - 173] Initializing Spring embedded WebApplicationContext
[17:18:02.340][org.quartz.impl.StdSchedulerFactory - instantiate - 1220] Using default implementation for ThreadExecutor
[17:18:02.364][org.quartz.simpl.SimpleThreadPool - initialize - 268] Job execution threads will use class loader of thread: main
[17:18:02.403][org.quartz.core.SchedulerSignalerImpl - <init> - 61] Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
[17:18:02.403][org.quartz.core.QuartzScheduler - <init> - 229] Quartz Scheduler v.2.3.2 created.
[17:18:02.405][org.quartz.simpl.RAMJobStore - initialize - 155] RAMJobStore initialized.
[17:18:02.407][org.quartz.core.QuartzScheduler - initialize - 294] Scheduler meta-data: Quartz Scheduler (v2.3.2) 'DefaultQuartzScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
[17:18:02.407][org.quartz.impl.StdSchedulerFactory - instantiate - 1374] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
[17:18:02.407][org.quartz.impl.StdSchedulerFactory - instantiate - 1378] Quartz scheduler version: 2.3.2
[17:18:03.550][org.apache.juli.logging.DirectJDKLog - log - 173] Starting ProtocolHandler ["http-nio-8123"]
[17:18:07.725][com.ynxbd.push.quartz.listener.AppStartQuartzJobListener - onApplicationEvent - 33] [<QUZRTZ DISPATCH>]Starting Quartz task ...
[17:18:07.740][org.quartz.core.QuartzScheduler - start - 547] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
[17:18:08.630][com.ynxbd.push.config.IniConfig - <clinit> - 40] IP:192.168.12.119
[17:18:08.633][com.ynxbd.push.quartz.scheduler.AppQuartzScheduler - startWorkLoadJob - 172] [定时任务]:BI领导推送未设置时间,功能未开启
[17:18:08.633][org.quartz.core.QuartzScheduler - start - 547] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
[17:18:08.634][com.ynxbd.push.quartz.scheduler.AppQuartzScheduler - startTodayRegJob - 154] [定时任务]:每日预约推送未设置时间,功能未开启,todayRegTimeMom-null,todayRegTimeNoon-null
[17:18:08.634][org.quartz.core.QuartzScheduler - start - 547] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
[17:18:08.639][org.springframework.boot.StartupInfoLogger - logStarted - 61] Started AppApplication in 12.403 seconds (JVM running for 13.654)
[17:18:08.641][com.ynxbd.push.AppApplication - main - 22] 启动医院为:null
[17:18:08.655][com.ynxbd.push.AppApplication - main - 23] token_url路径:http://127.0.0.1:8080/wx/api/getWxAccessToken.do

@ -0,0 +1,3 @@
[16:51:28.500][org.quartz.core.QuartzScheduler - shutdown - 666] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.
[16:51:28.505][org.quartz.core.QuartzScheduler - standby - 585] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.
[16:51:28.506][org.quartz.core.QuartzScheduler - shutdown - 740] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.

@ -32,6 +32,7 @@ public class IniConfig {
public static final String LEADER_TIME;
public static final String TODAY_REG_TIME_MOM;
public static final String TODAY_REG_TIME_NOON;
public static final String NAME;
// 静态内部类保证Wini只实例化一次
static {
@ -45,7 +46,7 @@ public class IniConfig {
LEADER_TIME = getInstance("leaderTime");
TODAY_REG_TIME_MOM = getInstance("todayRegTimeMom");
TODAY_REG_TIME_NOON = getInstance("todayRegTimeNoon");
NAME = getInstance("name");
}
/**

@ -19,6 +19,11 @@ public class ApiController {
return "success";
}
/**
* 获取redis数据
* @param name 日期20250101
* @return
*/
@PostMapping("getRedis")
public JSONObject getRedis(String name) {
log.info("name-{}",name);

@ -1,11 +1,20 @@
package com.ynxbd.push.controller.BI;
import com.ynxbd.push.entity.xbd.his.HIsWorkLoad;
import com.ynxbd.push.helper.HisResultFormat;
import com.ynxbd.push.helper.RedisHelper;
import com.ynxbd.push.httpRequest.xbd.his.HisRequest;
import com.ynxbd.push.quartz.pushJob.BI.BiPush;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author 李进才
* @ClassName BiController
@ -19,10 +28,30 @@ public class BiController {
@GetMapping("workLoadPush")
public String workLoadPush(String openId) {
try {
// Date date = new Date();
// SimpleDateFormat formatter = new SimpleDateFormat();
// formatter.applyPattern("yyyyMMdd");
// String redisKeyDate = formatter.format(date);
// Thread.sleep(10000);
// List<HIsWorkLoad> targetList = new ArrayList<>();
// System.out.println("sssssssss----1");
// if (targetList.isEmpty()) {
// System.out.println("sssssssss----2");
// if (openId == null) {
// System.out.println("sssssssss----3");
// if (RedisHelper.getRedis().get(redisKeyDate + "_Count") == null || Integer.parseInt(RedisHelper.getRedis().get(redisKeyDate + "_Count")) < 2) {
// int count = RedisHelper.getRedis().get(redisKeyDate + "_Count") == null ? 0 : Integer.parseInt(RedisHelper.getRedis().get(redisKeyDate + "_Count")) + 1;
// RedisHelper.getRedis().set(redisKeyDate + "_Count", String.valueOf(count), 60 * 10);
// System.out.println("sssssssss----4");
// workLoadPush(null);
// }
// }
// }
BiPush.runJob(openId);
return "Success";
}
catch (Exception e){
e.printStackTrace();
log.error(e.toString());
return e.getMessage();
}

@ -8,6 +8,7 @@ import com.ynxbd.push.helper.BusinessHelper;
import com.ynxbd.push.rabbit.send.RabbitSender;
import com.ynxbd.push.service.HisUniversalService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -82,8 +83,8 @@ public class BusinessController {
@PostMapping("medicalRecord")
@ResponseBody
public MessageSendResult medicalRecord(String organizeName, String patientId, String applyId) {
log.info("进入接口-[病历复印] 病历复印可付费通知(医院通知)organizeName-{}, patientId-{} , applyId-{}", organizeName, patientId, applyId);
public MessageSendResult medicalRecord(String organizeName, String patientId, String applyId, String content) {
log.info("进入接口-[病历复印] 病历复印可付费通知(医院通知)organizeName-{}, patientId-{} , applyId-{}, content-{}", organizeName, patientId, applyId, content);
MessageSendResult check = BusinessHelper.ParamsCheck(organizeName, patientId, null, null);
if (!check.getErrcode().equals("0")) {
return check;
@ -93,6 +94,7 @@ public class BusinessController {
message.put("organizeName", organizeName);
message.put("patientId", patientId);
message.put("applyId", applyId);
message.put("content", content);
rabbitSender.TipSend(message);
return ResponseResult.JOIN_QUEUE.toMessResult();
}

@ -45,7 +45,6 @@ public class MiddlePlatformController {
.pagePath(new StringBuilder().append("pages/index?id=").append(daoYiXunHospitalId)
.append("&poi=").append(deptCode).append("&appKey=").append(daoYiXunSecret).toString())
.build();
return MessageApiHelper.templateMessageSend(sendMessageTemplate);
}
}

@ -130,7 +130,7 @@ public class SendMessageController {
}
/**
*
*
*
* @param openId
* @return

@ -73,6 +73,8 @@ public class DesEncryptHelper {
public static void main(String[] args) {
System.out.println(DesEncryptHelper.enCode("rui_mei", KEY));
System.out.println(DesEncryptHelper.enCode("XBD-CRM", KEY));
System.out.println(DesEncryptHelper.deCode("3D48C80227DC4D7E8B30ED3C73F48031", KEY));
System.out.println(DesEncryptHelper.deCode("14C8AD5516ED32E5", KEY));
}
}

@ -717,7 +717,7 @@ public class HisResultFormat {
JSONObject jsonResp = JSON.parseObject(respData);
String code = jsonResp.getString("Code");
String message = jsonResp.getString("Msg");
if ("200".equals(code) && "SUCCESS".equals(message)) {
if ("200".equals(code)) {
String data = jsonResp.getString("Data");
return "".equals(data) ? null : data;
}

@ -8,6 +8,7 @@ import com.ynxbd.push.entity.*;
import com.ynxbd.push.entity.enums.MsgParamEnum;
import com.ynxbd.push.entity.response.ResponseResult;
import com.ynxbd.push.entity.tencent.*;
import com.ynxbd.push.entity.type.MessageTypeEnum;
import com.ynxbd.push.httpRequest.tencent.WeChatDataRequest;
import com.ynxbd.push.httpRequest.xbd.wx.WxCacheRequest;
import com.ynxbd.push.thread.ThreadConfig;
@ -189,6 +190,7 @@ public class MessageApiHelper {
if (reportTemplateId == null) {
log.error("获取模版Id失败,messageId-{},title-{}", messageId, title);
}
MessageTypeEnum msgTypeEnum = MessageTypeEnum.toEnum(code);
if (!IniConfig.TEMPLATE_VERSION) { // 老版本默认参数用keyword关键字
code = "";
}
@ -230,13 +232,12 @@ public class MessageApiHelper {
.addParameter(patientId != null ? "patientId" : "cardNo", patientId != null ? patientId : idCard)
.addParameter("algorithm", "des")
.addParameter("isEncryptComma", "false")
.addParameter("isLastBind", "true")
.addParameter("isLastBind", msgTypeEnum != null && "MedicalRecord".equals(msgTypeEnum.CODE) ? "false" : "true")
.build();
WeChatResponse weChatResponse = LocalHttpClient.executeJsonResult(httpUriRequest, WeChatResponse.class);
if (weChatResponse.getData() == null) {
return ResponseResult.NOT_FIND_DATA.toMessResult();
}
String openId = DesEncryptHelper.deCode(weChatResponse.getData().get(0));
SendMessageTemplate sendMessageTemplate = SendMessageTemplate.builder()
.template_id(reportTemplateId)
.first(first)
@ -248,9 +249,21 @@ public class MessageApiHelper {
.keyword4(keyword4)
.keyword5(keyword5)
.remark(remark)
.openId(openId)
.url(url)
.build();
if (msgTypeEnum != null && "MedicalRecord".equals(msgTypeEnum.CODE)) {
for (String enOpenId : weChatResponse.getData().get(0).split(",")) {
String openId = DesEncryptHelper.deCode(enOpenId);
sendMessageTemplate.setOpenId("");
sendMessageTemplate.setOpenId(openId);
MessageSendResult messageSendResult = templateMessageSend(sendMessageTemplate);
log.info("[{}]{}患者消息推送,推送结果代码-{},推送结果-{}", title, DesEncryptHelper.deCode(organizeName), messageSendResult.getErrcode(), messageSendResult.getErrmsg());
}
return ResponseResult.JOIN_QUEUE.toMessResult();
}
String openId = DesEncryptHelper.deCode(weChatResponse.getData().get(0));
sendMessageTemplate.setOpenId("");
sendMessageTemplate.setOpenId(openId);
MessageSendResult messageSendResult = templateMessageSend(sendMessageTemplate);
log.info("[{}]{}患者消息推送,推送结果代码-{},推送结果-{}", title, DesEncryptHelper.deCode(organizeName), messageSendResult.getErrcode(), messageSendResult.getErrmsg());
return ResponseResult.JOIN_QUEUE.toMessResult();
@ -645,6 +658,7 @@ public class MessageApiHelper {
return templateMessageSend(JSONObject.toJSONString(sendTemplate));
} catch (Exception e) {
log.error("失败:{}", e.getMessage());
return ResponseResult.NOT_FIND_DATA.toMessResult();
}
}

@ -113,6 +113,10 @@ public class RequestHelper extends SimpleClientHttpRequestFactory {
* @return ResultVO
*/
public static String get(String url, Map<String, String> params) {
// SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
// factory.setConnectTimeout(5000); // 连接超时:5秒
// factory.setReadTimeout(60000); // 读取超时:60秒
// RestTemplate client = new RestTemplate(factory);
RestTemplate client = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/x-www-form-urlencoded");

@ -371,6 +371,9 @@ public class TemplateJsonStringHelper {
public static String getUniversal(SendMessageTemplate key) {
return "{\"data\":{\"time13\":{\"color\":\"#173177\",\"value\":\"" + key.getKeyword1() + "\"},\"thing16\":{\"color\":\"#173177\",\"value\":\"" + key.getKeyword2() + "\"},\"first\":{\"color\":\"#173177\",\"value\":\"" + key.getFirst() + "\"},\"remark\":{\"color\":\"#173177\",\"value\":\"" + key.getRemark() + "\"}},\"template_id\":\"" + key.getTemplate_id() + "\",\"touser\":\"" + key.getOpenId() + "\",\"url\":\"" + key.getUrl() + "\"}";
}
public static String get17(SendMessageTemplate key) {
return "{\"data\":{\"time5\":{\"color\":\"#173177\",\"value\":\"" + key.getKeyword1() + "\"},\"thing3\":{\"color\":\"#173177\",\"value\":\"" + key.getKeyword2() + "\"}},\"template_id\":\"" + key.getTemplate_id() + "\",\"touser\":\"" + key.getOpenId() + "\",\"url\":\"" + key.getUrl() + "\"}";
}

@ -67,6 +67,9 @@ public class TemplateSelectHelper {
case "Universal":
jsonString = TemplateJsonStringHelper.getUniversal(sendMessageTemplate);
break;
case "17":
jsonString = TemplateJsonStringHelper.get17(sendMessageTemplate);
break;
default:
jsonString = TemplateJsonStringHelper.get(sendMessageTemplate);
}

@ -1,13 +1,8 @@
package com.ynxbd.push.httpRequest.xbd.his;
import com.alibaba.fastjson.JSONObject;
import com.ynxbd.push.config.IniConfig;
import com.ynxbd.push.entity.tencent.WeChatResponse;
import com.ynxbd.push.helper.RequestHelper;
import java.util.HashMap;
import java.util.Map;
/**
* @author 李进才
* @ClassName WorkLoadRequest

@ -29,25 +29,37 @@ import static com.ynxbd.push.entity.type.MessageTypeEnum.UNIVERSAL;
*/
@Slf4j
public class BiPush {
public static void runJob(String openId) {
if(IniConfig.getInstance("leaderTemplateId")==null&&WeChatDataRequest.getTemplateId("工单处理提醒")==null){
String template_id = WeChatDataRequest.getTemplateId("工单处理提醒");
if (IniConfig.getInstance("leaderTemplateId") == null && template_id == null) {
return;
}
Boolean isTest = false;
if(IniConfig.getInstance("leaderTest")!=null){
isTest = true;
}
String leaderTemplateId = WeChatDataRequest.getTemplateId("工单处理提醒")==null?IniConfig.getInstance("leaderTemplateId"):WeChatDataRequest.getTemplateId("工单处理提醒");
boolean isTest = IniConfig.getInstance("leaderTest") != null;
String leaderTemplateId = template_id == null ? IniConfig.getInstance("leaderTemplateId") : template_id;
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern("yyyy-MM-dd");
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat();
formatter.applyPattern("yyyyMMdd");
String redisKeyDate = formatter.format(date);
List<HIsWorkLoad> targetList = HisResultFormat.jsonToList(HisResultFormat.getRespData(HisRequest.getWorkLoad()), HIsWorkLoad.class);
if (targetList.isEmpty()) {
log.info("[领导推送工作量]无数据");
if (openId == null) {
if (RedisHelper.getRedis().get(redisKeyDate + "_Count") == null || Integer.parseInt(RedisHelper.getRedis().get(redisKeyDate + "_Count")) < 2) {
int count = RedisHelper.getRedis().get(redisKeyDate + "_Count") == null ? 0 : Integer.parseInt(RedisHelper.getRedis().get(redisKeyDate + "_Count")) + 1;
RedisHelper.getRedis().set(redisKeyDate + "_Count", String.valueOf(count), 60 * 10);
runJob(null);
log.info("[领导推送工作量]重试第{}次", count + 1);
}
}
return;
}
List<AllDoctorCode> allDoctorCodeList = WeChatDataRequest.getAllOpenIdForDoctorCode().getData();
Map<String, String> params = new HashMap<>();
params.put("description", targetList.get(0).getDescription());
SimpleDateFormat formatter = new SimpleDateFormat();
formatter.applyPattern("yyyyMMdd");
RedisHelper.getRedis().set(formatter.format(date),JSONObject.toJSONString(params),86400);
RedisHelper.getRedis().set(redisKeyDate, JSONObject.toJSONString(params), 86400 * 7);
for (HIsWorkLoad target : targetList) {
Optional<AllDoctorCode> allDoctorCodeStream = allDoctorCodeList.stream().filter(item -> item.getDoctCode().equals(target.getDoc_code())).findFirst();
if (!allDoctorCodeStream.isPresent()) {
@ -60,13 +72,14 @@ public class BiPush {
}
SendMessageTemplate sendMessageTemplate = SendMessageTemplate.builder()
.template_id(leaderTemplateId)
.code(Boolean.FALSE.equals(IniConfig.TEMPLATE_VERSION) ?"":UNIVERSAL.CODE)
.code(Boolean.FALSE.equals(IniConfig.TEMPLATE_VERSION) ? "" : IniConfig.NAME.equals("宜良福泰医院") ? "17" : UNIVERSAL.CODE)
.keyword1(Objects.equals(IniConfig.getInstance("leaderTemplateMode"), "2") ? target.getDescription() : sdf.format(date))
.keyword2(Objects.equals(IniConfig.getInstance("leaderTemplateMode"), "2") ? sdf.format(date) : target.getDescription())
// .first(new StringBuilder().append("尊敬的").append(target.getDoc_name()).append("您好").toString())
.url(IniConfig.DOMAIN+"wx/"+IniConfig.WECHAT_UI_PATH+"push-info.html#/bi-info")
.url(IniConfig.DOMAIN + "wx/" + IniConfig.WECHAT_UI_PATH + "push-info.html?date=" + redisKeyDate)
// .openId(replenish.getOpenid())
.build();
if (isTest) {
for (String testOpenId : IniConfig.getInstance("leaderTest").split(";")) {
sendMessageTemplate.setOpenId("");

@ -172,7 +172,7 @@ public class AppQuartzScheduler {
log.info("[定时任务]:BI领导推送未设置时间,功能未开启");
return;
}
log.info("[定时任务]:BI领导推送设置时间,功能已经开启,推送时间-{}",IniConfig.LEADER_TIME);
log.info("[定时任务]:BI领导推送设置时间,功能已经开启,推送时间-{}", IniConfig.LEADER_TIME);
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(IniConfig.LEADER_TIME);
CronTrigger cronTrigger = TriggerBuilder.newTrigger().withIdentity("WorkLoad", "WorkLog").withSchedule(cronScheduleBuilder).build();
scheduler.scheduleJob(jobDetail, cronTrigger);

@ -7,6 +7,7 @@ import com.ynxbd.push.entity.type.MessageTypeEnum;
import com.ynxbd.push.helper.MessageApiHelper;
import com.ynxbd.push.rabbit.send.RabbitSender;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
@ -139,11 +140,13 @@ public class RabbitReceiver {
String messageId = receiveMessage.get("message_id");
String code = receiveMessage.get("tip");
String patientId = receiveMessage.get("patientId");
String content = receiveMessage.get("content");
content = StringUtils.isBlank(content) ? "病历复印申请通知,请点击跳转查看" : content; // 病历复印申请已通过,请点击跳转付费
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern("yyyy-MM-dd");
Date date = new Date();
String url = IniConfig.DOMAIN + "wx/" + IniConfig.WECHAT_UI_PATH + "medical-record.html#/medical-record-history";
retry(MessageApiHelper.TemplateMessageForCode(organizeName, code, null, "医院通知", patientId, null, "病历复印申请已通过", sdf.format(date), "病历复印申请已通过,请点击跳转付费", null, null, null, "查看详情", url, messageId), receiveMessage);
retry(MessageApiHelper.TemplateMessageForCode(organizeName, code, null, "医院通知", patientId, null, "病历复印申请已通过", sdf.format(date), content, null, null, null, "查看详情", url, messageId), receiveMessage);
}
private void treatPlan(Map<String, String> receiveMessage) {
@ -198,7 +201,7 @@ public class RabbitReceiver {
viewUrl = IniConfig.DOMAIN + "wx/" + IniConfig.WECHAT_UI_PATH + "push-universal.html?patientId=" + ("".equals(patientId)||patientId==null ? "": Base64.getEncoder().encodeToString(patientId.getBytes())) + "&content=" + Base64.getEncoder().encodeToString(UriUtils.encode(content, StandardCharsets.UTF_8.toString()).getBytes()) + "&time=" + Base64.getEncoder().encodeToString(sdf.format(date).getBytes()) + "&url=" + ("".equals(url)||url==null?"":Base64.getEncoder().encodeToString(UriUtils.encode(url, StandardCharsets.UTF_8.toString()).getBytes())) + "&buttonName=" + ("".equals(buttonName)||buttonName==null?"":Base64.getEncoder().encodeToString(UriUtils.encode(buttonName, StandardCharsets.UTF_8.toString()).getBytes()));
}
log.info("[通用消息推送] 转换链接打印 messageId-{}, url-{}",messageId, viewUrl);
if (IniConfig.TEMPLATE_VERSION) {
if (IniConfig.TEMPLATE_VERSION && content.length() > 16) {
content = content.substring(0, 16) + "……";
}
retry(MessageApiHelper.TemplateMessageForCode(organizeName, code, IdCard, Boolean.FALSE.equals(IniConfig.TEMPLATE_VERSION) ? "绑定通知" : "工单处理提醒", patientId, doctorCode, null, sdf.format(date), content, null, null, null, null, viewUrl, messageId), receiveMessage);

@ -1,6 +1,7 @@
package com.ynxbd.push.rabbit.send;
import com.ynxbd.push.helper.MapHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,6 +17,7 @@ import java.util.UUID;
* @date 2024/01/23 13:53:00
*/
@Component
@Slf4j
public class RabbitSender {
@Autowired
private RabbitTemplate rabbitTemplate;

@ -13,9 +13,9 @@ spring:
time-zone: GMT+8
rabbitmq:
host: 127.0.0.1
port: 5672
username: wxPush
password: wx.push.rabbit
port: 5672 # 石林县医院15672,其他5672
username: wxPush # 石林县医院guest,其他wxPush
password: wx.push.rabbit # 石林县医院guest,其他wx.push.rabbit
virtual-host: /
# 支持发布返回
publisher-returns: true

@ -6,7 +6,7 @@
<property name="log.days" value="36500"/>
<!-- 日志输出格式 -->
<property name="log.pattern"
value="[%d{HH:mm:ss.SSS}][%class - %method - %line] %msg%n"/>
value="[%d{HH:mm:ss.SSS}][%class - %method - %line] %msg%n%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">

@ -1,7 +1,7 @@

[192.168.1.125]
[192.168.12.117]
name=本地
#leaderUrl = 200.200.200.70:01
leaderUrl = 10.20.10.41:8082
# 领导层BI推送 模版id
#leaderTemplateId = iTgXzpqIre-0lFw2nq0iDCDAlVl0d2NhIT9X77dS5WY
# 测试账号 openid
@ -122,7 +122,7 @@ weChatUIPath = web/
[192.168.33.40]
name = 玉龙县人民医院
leaderUrl = 172.16.24.4:
leaderUrl = 172.16.24.4:8080
# 领导层BI推送 模版id
leaderTemplateId = a775Q5ikmGLDuX7rWcT8sRfU5IZZ4cvmjWYNJ36I5e4
# 绑定通知 的模版
@ -132,7 +132,7 @@ leaderTemplateMode = 2
# 推送时间 每天「倒数第三位」点「倒数第四位」分触发
leaderTime = 0 30 07 * * ?
domain = http://www.ljylxrmyy.com/
weChatUIPath =
weChatUIPath = web/
[192.168.11.7]
@ -159,14 +159,14 @@ templateVersion = new
weChatUIPath =
[192.168.10.8]
[192.167.100.56]
name = 宁蒗县人民医院
leaderTemplateId = X0iIY4uKZC_feYKD1RfrgIwXM9E0ryHdqs4xVrC00DY
leaderUrl = 192.168.10.43:8080
leaderTime = 0 00 06 * * ?
domain = http://www.nlxrmyy.cn/
templateVersion = new
weChatUIPath =
weChatUIPath = web/
[192.168.104.201]
@ -186,3 +186,25 @@ domain = http://www.msrmyy.com.cn/
templateVersion = new
weChatUIPath = web/
[192.168.197.250]
name = 景洪中傣医医院
leaderTemplateId = eBCXIDhdHiOD46RykuOIkwUAzT4YXb0AM9306_zMjtg
leaderUrl = 192.168.197.206:8087
leaderTime = 0 0 8 * * ?
#leaderTest = o5cEv5lKltTX76w6P4PzEDKuB1aQ
domain = https://www.jhszdyyy.cn/
templateVersion = new
weChatUIPath = web/
[200.200.200.13]
name = 宜良福泰医院
leaderTemplateId = 5717L3NsG6snWV1Rq9nWIZr1Oulgt4i8xLw6tVDb0Tc
leaderUrl = 200.200.200.10:8080
leaderTime = 0 0 8 * * ?
leaderTest = ogEHwv8VpNJf_y8j3HMy1nQ1CejM
domain = https://wx.ylftyy.top/
templateVersion = new
weChatUIPath = web/

Loading…
Cancel
Save