فهرست منبع

完成消息推送

xiaochan 3 سال پیش
والد
کامیت
8cd85c0980

+ 7 - 4
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.ListUtils;
 import org.jetbrains.annotations.NotNull;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import thyyxxk.webserver.config.exception.BizException;
@@ -22,6 +23,7 @@ import thyyxxk.webserver.entity.yibao.ZyActpatient;
 import thyyxxk.webserver.entity.zhuyuanyisheng.caoyaoyizhu.YzActOrderCy;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.YshYjReq;
 import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.OpRecord;
+import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.XinZhenYiZhu;
 import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.YaoPinXiangMu;
 import thyyxxk.webserver.utils.*;
 import thyyxxk.webserver.websocket.WebSocketServer;
@@ -527,15 +529,15 @@ public class PublicServer {
                 "<span style='color:red'>" + xinXi + "</span><br>";
     }
 
-
     /**
      * @param wardCode 患者病房
      * @param content  内容
      * @param title    标题
      * @param patId    患者组合id(住院号_住院次数)
      */
-    public void faSongXiaoXi(String wardCode, List<String> content, String title, String patId, String userCode) {
-        List<String> huShiBianMa = dao.huoQuHuanZheBingFangDeHuShi(wardCode);
+    @Async
+    public void faSongXiaoXi(XinZhenYiZhu huanZheXinXi, List<String> content, String title, String userCode) {
+        List<String> huShiBianMa = dao.huoQuHuanZheBingFangDeHuShi(huanZheXinXi.getDeptCode());
         JSONObject obj = new JSONObject();
         obj.put("name", "systemNotification");
         obj.put("type", "error");
@@ -550,7 +552,7 @@ public class PublicServer {
             faSongNeiRong.setContent(s);
             // 雪花算法
             faSongNeiRong.setId(SnowFlakeId.instance().nextId());
-            faSongNeiRong.setPatId(patId);
+            faSongNeiRong.setPatId(huanZheXinXi.getInpatientNo() + "_" + huanZheXinXi.getAdmissTimes());
             faSongNeiRong.setTitle(title);
             socketMessage1.add(faSongNeiRong);
             for (String huShi : huShiBianMa) {
@@ -573,5 +575,6 @@ public class PublicServer {
 
     }
 
+
 }
 

+ 12 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/CaoYaoYiZhuServer.java

@@ -23,6 +23,7 @@ import thyyxxk.webserver.service.PublicServer;
 import thyyxxk.webserver.utils.*;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -153,6 +154,17 @@ public class CaoYaoYiZhuServer {
         dao.chaRuCaoYaoYiZhu(param, huanZheXinXi.getDeptCode(), huanZheXinXi.getDeptCode(), huanZheXinXi.getSmallDept());
         dao.chaRuCaoYaoXiangQing(param.getList(), param.getOrderNo());
         dao.chaRuYiZhu(param, "草药医嘱:" + param.getOrderName() + param.getQuantity() + "剂", huanZheXinXi.getDeptCode(), huanZheXinXi.getDeptCode(), huanZheXinXi.getSmallDept(), publicServer.getInfantFlag(huanZheXinXi.getInpatientNo()));
+        List<String> content = new ArrayList<String>() {
+            private static final long serialVersionUID = -6513395725018337268L;
+
+            {
+                add(String.format("草药医嘱名:<span style='color:#409eff'>【%s】</span><br>" +
+                        "剂数:<span style='color:#409eff'>【%s】</span><br>" +
+                        "患者名:<span style='color:#409eff'>【%s】<br></span>" +
+                        "床位:<span style='color:#409eff'>【%s】</span>", param.getOrderName(), param.getQuantity().toString(), huanZheXinXi.getName(), huanZheXinXi.getBedNo()));
+            }
+        };
+        publicServer.faSongXiaoXi(huanZheXinXi, content, "新增草药医嘱", TokenUtil.getTokenUserId());
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
     }
 

+ 7 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/JianYanJianChaShenQingServer.java

@@ -361,6 +361,7 @@ public class JianYanJianChaShenQingServer {
         publicServer.huanZheJieSuan(param.getInpatientNo(), param.getAdmissTimes());
         List<String> xm = new ArrayList<>();
         int index = 1;
+        List<String> content = new ArrayList<>();
         StringBuilder cuoWuXinXi = new StringBuilder();
         for (YshYjReq item : param.getList()) {
             if (StringUtil.isBlank(item.getOrderCode())) {
@@ -403,6 +404,9 @@ public class JianYanJianChaShenQingServer {
                 item.setReqNo(publicServer.getReqPageNo());
             }
             xm.add(item.getOrderCode().trim());
+            content.add(String.format("%s:<span style='color:#409eff'>【%s】</span><br>" +
+                    "患者姓名:<span style='color:#409eff'>【%s】</span><br>" +
+                    "床位:<span style='color:#409eff'>【%s】</span>", param.getReqType().equals("2") ? "检查名" : "检验名", item.getOrderName(), huanZheXinXi.getName(), huanZheXinXi.getBedNo()));
             index++;
         }
         String tingYong = publicServer.xiangMuXianZhi(xm, true);
@@ -418,6 +422,9 @@ public class JianYanJianChaShenQingServer {
                 param.getBedNo(), userCode, huanZheXinXi.getDeptCode(), huanZheXinXi.getDeptCode(), param.getReqType());
         dao.chaRuShenQingYiZhu(param.getList(), param.getInpatientNo(), param.getAdmissTimes(), userCode, huanZheXinXi.getDeptCode(), huanZheXinXi.getDeptCode(),
                 publicServer.getInfantFlag(param.getInpatientNo()));
+
+        publicServer.faSongXiaoXi(huanZheXinXi, content, param.getReqType().equals("2") ? "新增检查" : "新增检验", TokenUtil.getTokenUserId());
+
         log.info("数据:{}", param.getList());
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
     }

+ 4 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/ShouShuShenQingServer.java

@@ -114,6 +114,7 @@ public class ShouShuShenQingServer {
         String userCode = TokenUtil.getTokenUserId();
         Integer shenQingCiShu = dao.shouShuShenQingCiShu(param.getInpatientNo(), param.getAdmissTimes());
         List<OpRecord> shenChengYiZhu = new ArrayList<>();
+        List<String> content = new ArrayList<>();
         for (OpRecord item : param.getList()) {
             item.setRecordId(publicServer.huoQuShouShuHao());
             item.setActOrderNo(BigDecimal.valueOf(publicServer.getActOrderNo()));
@@ -122,6 +123,8 @@ public class ShouShuShenQingServer {
             if (item.getSsyzFlag().equals("1")) {
                 shenChengYiZhu.add(item);
             }
+            content.add(String.format("手术名称:<span style='color:#409eff'>【%s】</span><br>" +
+                    "手术时间:<span style='color:#409eff'>【%tF %<tT】</span><br>", item.getOpName(), item.getOpDatetime()));
         }
         XinZhenYiZhu huanZheXinXi = yiZhuLuRuDao.huoQuHuanZheXinXi(param.getInpatientNo(), param.getAdmissTimes());
         dao.chaRuShouShuYiSheng(param.getList());
@@ -132,6 +135,7 @@ public class ShouShuShenQingServer {
             dao.chaRuYiZhu(shenChengYiZhu, publicServer.getInfantFlag(param.getInpatientNo()),
                     userCode, param.getInpatientNo(), param.getAdmissTimes(), huanZheXinXi.getDeptCode(), huanZheXinXi.getDeptCode(), param.getExecDept());
         }
+        publicServer.faSongXiaoXi(huanZheXinXi, content, "新增手术", TokenUtil.getTokenUserId());
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
     }
 

+ 6 - 20
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -517,11 +517,14 @@ public class YiZhuLuRuServer {
         dao.chaRuYiZhu(huanZheXinXi.getInpatientNo(), huanZheXinXi.getAdmissTimes(), inputCode, huanZheXinXi.getInfantFlag(), publicServer.getGroupNo(),
                 huanZheXinXi.getDeptCode(), huanZheXinXi.getDeptCode(), huanZheXinXi.getReferPhysician(), param.getList());
         for (XinZhenYzActOrder item : param.getList()) {
-            content.add(String.format("医嘱名:<span style='color:#409eff'>【%s】</span><br>医嘱时间:<span style='color:#409eff'>【%tF %<tT】</span><br>患者姓名:<span style='color:#409eff'>【%s】</span><br>床位:<span style='color:#409eff'>【%s】</span><br>频次:<span style='color:#409eff'>【%s】</span>",
+            content.add(String.format("医嘱名:<span style='color:#409eff'>【%s】</span><br>" +
+                            "医嘱时间:<span style='color:#409eff'>【%tF %<tT】</span><br>" +
+                            "患者姓名:<span style='color:#409eff'>【%s】</span><br>" +
+                            "床位:<span style='color:#409eff'>【%s】</span><br>" +
+                            "频次:<span style='color:#409eff'>【%s】</span>",
                     item.getOrderName(), item.getOrderTime(), huanZheXinXi.getName(), huanZheXinXi.getBedNo(), item.getFrequCode()));
         }
-        FaSongXiaoXi faSongXiaoXi = new FaSongXiaoXi(content, huanZheXinXi, inputCode);
-        new Thread(faSongXiaoXi).start();
+        publicServer.faSongXiaoXi(huanZheXinXi, content, "新增医嘱", inputCode);
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "医嘱保存成功。");
     }
 
@@ -814,22 +817,5 @@ public class YiZhuLuRuServer {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
     }
 
-    class FaSongXiaoXi implements Runnable {
-        private final List<String> content;
-        private final XinZhenYiZhu yiZhu;
-        private final String userCode;
-
-        public FaSongXiaoXi(List<String> content, XinZhenYiZhu yiZhu, String userCode) {
-            this.content = content;
-            this.yiZhu = yiZhu;
-            this.userCode = userCode;
-        }
-
-        @Override
-        public void run() {
-            publicServer.faSongXiaoXi(yiZhu.getDeptCode(), content, "新增医嘱", yiZhu.getInpatientNo() + "_" + yiZhu.getAdmissTimes(), userCode);
-        }
-    }
-
 
 }