Переглянути джерело

护理看板发布了就同步更新页面

xiaochan 4 місяців тому
батько
коміт
02440897fe

+ 8 - 0
src/main/java/thyyxxk/webserver/service/dashboardEditor/DashboardEditorService.java

@@ -1,6 +1,7 @@
 package thyyxxk.webserver.service.dashboardEditor;
 
 import cn.hutool.core.util.IdUtil;
+import cn.hutool.json.JSONObject;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.config.exception.BizException;
@@ -9,6 +10,7 @@ import thyyxxk.webserver.dao.his.dashboardEditor.DashboardEditorDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.dashboardEditor.TDashboardTemplate;
 import thyyxxk.webserver.entity.login.UserInfo;
+import thyyxxk.webserver.http.websocket.SocketV2;
 import thyyxxk.webserver.service.PublicServer;
 import thyyxxk.webserver.service.hutoolcache.UserCache;
 import thyyxxk.webserver.utils.ResultVoUtil;
@@ -19,6 +21,7 @@ public class DashboardEditorService {
     private final DashboardEditorDao dao;
     private final PublicServer publicServer;
     private final UserCache userCache;
+    private final SocketV2 socketV2;
 
     public ResultVo<TDashboardTemplate> getDashboardTemplateByWardCode(String wardCode) {
         return ResultVoUtil.success(dao.selectOne(TDashboardTemplate.lambdaQueryWrapper().eq(TDashboardTemplate::getWardCode, wardCode)));
@@ -52,6 +55,11 @@ public class DashboardEditorService {
                 .htmlData(tDashboardTemplate.getHtmlDataTemp())
                 .id(tDashboardTemplate.getId())
                 .build();
+        JSONObject entries = new JSONObject();
+        entries.putOnce("release", tDashboardTemplate.getWardCode());
+        socketV2.getPostApi("/nursingRecordBoard")
+                .body(entries.toJSONString(0))
+                .executeAsync();
         dao.updateById(tmp);
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
     }