lighter 7 місяців тому
батько
коміт
7ea82f2590
24 змінених файлів з 207 додано та 62 видалено
  1. 0 1
      thyy-archive/src/main/java/org/thyy/archive/data/Patient.java
  2. 12 0
      thyy-scheduled/src/main/java/org/thyy/scheduled/config/constant/Emr.java
  3. 13 0
      thyy-scheduled/src/main/java/org/thyy/scheduled/dao/MainBusinessDo.java
  4. 0 29
      thyy-scheduled/src/main/java/org/thyy/scheduled/service/MainHttp.java
  5. 31 0
      thyy-scheduled/src/main/java/org/thyy/scheduled/task/EmrTask.java
  6. 73 0
      thyy-scheduled/src/main/java/org/thyy/scheduled/task/MainBusinessTask.java
  7. 0 21
      thyy-scheduled/src/main/java/org/thyy/scheduled/task/SheetAutoSignTask.java
  8. 2 0
      thyy-scheduled/src/main/resources/application-prod.yml
  9. 8 1
      thyy-socket/src/main/java/org/thyy/socket/controller/PublicController.java
  10. 4 0
      thyy-socket/src/main/java/org/thyy/socket/service/Archive.java
  11. 2 0
      thyy-socket/src/main/java/org/thyy/socket/service/Business.java
  12. 5 0
      thyy-socket/src/main/java/org/thyy/socket/service/NursingRecordBoard.java
  13. 5 0
      thyy-socket/src/main/java/org/thyy/socket/service/callnumber/HelpDeskScreen.java
  14. 5 0
      thyy-socket/src/main/java/org/thyy/socket/service/callnumber/RoomScreen.java
  15. 1 1
      thyy-socket/src/main/java/org/thyy/socket/service/callnumber/ScreenSession.java
  16. 5 0
      thyy-socket/src/main/java/org/thyy/socket/service/emr/EmrDocument.java
  17. 5 0
      thyy-socket/src/main/java/org/thyy/socket/service/emr/EmrEditor.java
  18. 5 0
      thyy-socket/src/main/java/org/thyy/socket/service/emr/EmrRefresh.java
  19. 6 2
      thyy-socket/src/main/java/org/thyy/socket/service/mainbusiness/IntergrationPlatform.java
  20. 2 0
      thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/ThyyThirdpartApiApplication.java
  21. 1 0
      thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/tts/Tts.java
  22. 5 4
      thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/tts/TtsController.java
  23. 5 0
      thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/tts/ttsService/TtsTest.java
  24. 12 3
      thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/tts/ttsService/XfTtsApi.java

+ 0 - 1
thyy-archive/src/main/java/org/thyy/archive/data/Patient.java

@@ -79,7 +79,6 @@ public class Patient {
     private String latechbFlag; // 是否晚育
     private String pretFlag; // 是否早产
     private String mdtrtId;
-    private Integer injuryArea; // 工伤归属地:1-长沙,2-望城,3-省直
     private String injurySerialNo;
     private String actIptDays; // 入院时间
     private String revokeRemark;

+ 12 - 0
thyy-scheduled/src/main/java/org/thyy/scheduled/config/constant/Emr.java

@@ -0,0 +1,12 @@
+package org.thyy.scheduled.config.constant;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "thyy.emr")
+public class Emr {
+    private String api;
+}

+ 13 - 0
thyy-scheduled/src/main/java/org/thyy/scheduled/dao/MainBusinessDo.java

@@ -0,0 +1,13 @@
+package org.thyy.scheduled.dao;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Update;
+
+@Mapper
+public interface MainBusinessDo {
+    @Update("update yz_sequence set page_no=1 where 1=1")
+    void restDrugOrderNo();
+
+    @Update("update mzfz_zd_dept_room set patient_num=0 where patient_num!=0")
+    void resetPatientNum();
+}

+ 0 - 29
thyy-scheduled/src/main/java/org/thyy/scheduled/service/MainHttp.java

@@ -1,29 +0,0 @@
-package org.thyy.scheduled.service;
-
-import cn.hutool.core.util.StrUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.web.client.RestTemplate;
-import org.thyy.scheduled.config.constant.Thyy;
-import org.thyy.utils.exception.BizException;
-import org.thyy.utils.exception.ExceptionEnum;
-
-@Service
-public class MainHttp {
-    private final Thyy thyy;
-    private final RestTemplate restTemplate;
-
-    @Autowired
-    public MainHttp(Thyy thyy, RestTemplate restTemplate) {
-        this.thyy = thyy;
-        this.restTemplate = restTemplate;
-    }
-
-    public void executeAutoSign() {
-        if (StrUtil.isBlank(thyy.getMainAddress())) {
-            throw new BizException(ExceptionEnum.NO_CONFIGURATION);
-        }
-        String url = thyy.getMainAddress() + "/caseFrontSheet/autoSign";
-        restTemplate.getForObject(url, String.class);
-    }
-}

+ 31 - 0
thyy-scheduled/src/main/java/org/thyy/scheduled/task/EmrTask.java

@@ -0,0 +1,31 @@
+package org.thyy.scheduled.task;
+
+import cn.hutool.core.util.StrUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+import org.thyy.scheduled.config.constant.Emr;
+
+@Slf4j
+@Component
+public class EmrTask {
+    private final Emr emr;
+    private final RestTemplate restTemplate;
+
+    @Autowired
+    public EmrTask(Emr emr, RestTemplate restTemplate) {
+        this.emr = emr;
+        this.restTemplate = restTemplate;
+    }
+
+    @Scheduled(cron = "0 30 23 * * ?")
+    public void historyDelete() {
+        if (StrUtil.isNotBlank(emr.getApi())) {
+            String url = emr.getApi() + "/emr/runtime/api/v1/document/history/destroy/7";
+            restTemplate.getForObject(url, String.class);
+            log.info("删除电子病历历史记录");
+        }
+    }
+}

+ 73 - 0
thyy-scheduled/src/main/java/org/thyy/scheduled/task/MainBusinessTask.java

@@ -0,0 +1,73 @@
+package org.thyy.scheduled.task;
+
+import cn.hutool.core.util.StrUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+import org.thyy.scheduled.config.constant.Thyy;
+import org.thyy.scheduled.dao.MainBusinessDo;
+
+@Component
+public class MainBusinessTask {
+    private final MainBusinessDo dao;
+    private final Thyy thyy;
+    private final RestTemplate restTemplate;
+
+    @Autowired
+    public MainBusinessTask(MainBusinessDo dao, Thyy thyy, RestTemplate restTemplate) {
+        this.dao = dao;
+        this.thyy = thyy;
+        this.restTemplate = restTemplate;
+    }
+
+    @Scheduled(cron = "0 40 3 * * ?")
+    public void executeAutoSign() {
+        if (StrUtil.isNotBlank(thyy.getMainAddress())) {
+            String url = thyy.getMainAddress() + "/caseFrontSheet/autoSign";
+            restTemplate.getForObject(url, String.class);
+        }
+    }
+
+    @Scheduled(cron = "0 0 3 * * ?")
+    public void analyzeSetlData() {
+        if (StrUtil.isNotBlank(thyy.getMainAddress())) {
+            String url = thyy.getMainAddress() + "/analyzeSiPatientCharges/analyzeSetlData";
+            restTemplate.getForObject(url, String.class);
+        }
+    }
+
+    @Scheduled(cron = "0 30 21 * * ?")
+    public void uploadBillingList() {
+        if (StrUtil.isNotBlank(thyy.getMainAddress())) {
+            String url = thyy.getMainAddress() + "/setlListUpld/tasks";
+            restTemplate.getForObject(url, String.class);
+        }
+    }
+
+    @Scheduled(cron = "0 20 2 * * ?")
+    private void uploadFrontSheet() {
+        if (StrUtil.isNotBlank(thyy.getMainAddress())) {
+            String url = thyy.getMainAddress() + "/uploadFrontSheet/startUploadStatistics";
+            restTemplate.getForObject(url, String.class);
+        }
+    }
+
+    @Scheduled(cron = "0 0 6 * * ?")
+    public void notifyDailyCount() {
+        if (StrUtil.isNotBlank(thyy.getMainAddress())) {
+            String url = thyy.getMainAddress() + "/dailyPatientCount/notifyDailyCount";
+            restTemplate.getForObject(url, String.class);
+        }
+    }
+
+    @Scheduled(cron = "59 59 23 * * ?")
+    public void restDrugOrderNo() {
+        dao.restDrugOrderNo();
+    }
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void resetPatientNum() {
+        dao.resetPatientNum();
+    }
+}

+ 0 - 21
thyy-scheduled/src/main/java/org/thyy/scheduled/task/SheetAutoSignTask.java

@@ -1,21 +0,0 @@
-package org.thyy.scheduled.task;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-import org.thyy.scheduled.service.MainHttp;
-
-@Component
-public class SheetAutoSignTask {
-    private final MainHttp mainHttp;
-
-    @Autowired
-    public SheetAutoSignTask(MainHttp mainHttp) {
-        this.mainHttp = mainHttp;
-    }
-
-    @Scheduled(cron = "0 40 3 * * ?")
-    public void autoSign() {
-        mainHttp.executeAutoSign();
-    }
-}

+ 2 - 0
thyy-scheduled/src/main/resources/application-prod.yml

@@ -79,4 +79,6 @@ thyy:
     check-url: https://manage.national-dpcc.com/api/sino-common/access-client/uploadHisCheckData
     drug-url: https://manage.national-dpcc.com/api/sino-common/access-client/uploadHisDrugData
     jy-api: http://localhost:21701/thyy/thirdpart/api/inspection
+  emr:
+    api: http://172.16.32.125:8001
 

+ 8 - 1
thyy-socket/src/main/java/org/thyy/socket/controller/PublicController.java

@@ -44,5 +44,12 @@ public class PublicController {
         return R.ok();
     }
 
-
+    @GetMapping("/getOnlineCount")
+    public ResultVo<Integer> getOnlineCount(@RequestParam("business") String business) {
+        Business business1 = businessMap.get(business);
+        if (business1 == null) {
+            return R.ok(0);
+        }
+        return R.ok(business1.getOnlineCount());
+    }
 }

+ 4 - 0
thyy-socket/src/main/java/org/thyy/socket/service/Archive.java

@@ -68,4 +68,8 @@ public class Archive implements Business {
         }
     }
 
+    @Override
+    public Integer getOnlineCount() {
+        return room.size();
+    }
 }

+ 2 - 0
thyy-socket/src/main/java/org/thyy/socket/service/Business.java

@@ -16,6 +16,8 @@ public interface Business {
 
     void onClose(WebSocketSession session, String sid);
 
+    Integer getOnlineCount();
+
     default void onMessage(WebSocketSession session, String sid, String data) {
     }
 

+ 5 - 0
thyy-socket/src/main/java/org/thyy/socket/service/NursingRecordBoard.java

@@ -51,6 +51,11 @@ public class NursingRecordBoard implements Business {
         });
     }
 
+    @Override
+    public Integer getOnlineCount() {
+        return rooms.size();
+    }
+
     public static void main(String[] args) {
         System.out.println(IdUtil.fastSimpleUUID());
     }

+ 5 - 0
thyy-socket/src/main/java/org/thyy/socket/service/callnumber/HelpDeskScreen.java

@@ -25,6 +25,11 @@ public class HelpDeskScreen implements Business {
         log.info("有一连接关闭:{},当前在线人数为:{}", sid, sessionContainer.size());
     }
 
+    @Override
+    public Integer getOnlineCount() {
+        return sessionContainer.size();
+    }
+
     @Override
     public void onMessage(WebSocketSession session, String sid, String data) {
         log.info("有{}发送的新消息:{}", sid, data);

+ 5 - 0
thyy-socket/src/main/java/org/thyy/socket/service/callnumber/RoomScreen.java

@@ -40,4 +40,9 @@ public class RoomScreen implements Business {
         ScreenSession.instance().sendMessage(json, session);
         log.info("向诊室小屏发送消息:{}", json);
     }
+
+    @Override
+    public Integer getOnlineCount() {
+        return sessionContainer.size();
+    }
 }

+ 1 - 1
thyy-socket/src/main/java/org/thyy/socket/service/callnumber/ScreenSession.java

@@ -7,7 +7,7 @@ import org.thyy.socket.service.Business;
 
 import java.util.concurrent.ConcurrentHashMap;
 
-import static org.thyy.socket.service.IntergrationPlatform.IntergrationPlatform.SINGLE_LOGIN;
+import static org.thyy.socket.service.mainbusiness.IntergrationPlatform.SINGLE_LOGIN;
 
 public class ScreenSession {
     private static ScreenSession INSTANCE;

+ 5 - 0
thyy-socket/src/main/java/org/thyy/socket/service/emr/EmrDocument.java

@@ -62,4 +62,9 @@ public class EmrDocument implements Business {
             Business.send(kicked, data);
         }
     }
+
+    @Override
+    public Integer getOnlineCount() {
+        return mapCenter.getRoomList().size();
+    }
 }

+ 5 - 0
thyy-socket/src/main/java/org/thyy/socket/service/emr/EmrEditor.java

@@ -136,5 +136,10 @@ public class EmrEditor implements Business {
             log.error(e.getMessage());
         }
     }
+
+    @Override
+    public Integer getOnlineCount() {
+        return center.getRoomList().size();
+    }
 }
 

+ 5 - 0
thyy-socket/src/main/java/org/thyy/socket/service/emr/EmrRefresh.java

@@ -79,4 +79,9 @@ public class EmrRefresh implements Business {
         } catch (Exception ignored) {
         }
     }
+
+    @Override
+    public Integer getOnlineCount() {
+        return mapCenter.getRoomList().size();
+    }
 }

+ 6 - 2
thyy-socket/src/main/java/org/thyy/socket/service/IntergrationPlatform/IntergrationPlatform.java → thyy-socket/src/main/java/org/thyy/socket/service/mainbusiness/IntergrationPlatform.java

@@ -1,11 +1,10 @@
-package org.thyy.socket.service.IntergrationPlatform;
+package org.thyy.socket.service.mainbusiness;
 
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
-import org.springframework.web.socket.TextMessage;
 import org.springframework.web.socket.WebSocketSession;
 import org.thyy.socket.service.Business;
 
@@ -64,6 +63,11 @@ public class IntergrationPlatform implements Business {
         });
     }
 
+    @Override
+    public Integer getOnlineCount() {
+        return sessionContainer.size();
+    }
+
     @Override
     public void sendMessage(JSONObject json) {
         String mode = json.getString("mode");

+ 2 - 0
thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/ThyyThirdpartApiApplication.java

@@ -4,7 +4,9 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
+@EnableScheduling
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
 @ComponentScan("org.thyy.*")
 public class ThyyThirdpartApiApplication {

+ 1 - 0
thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/tts/Tts.java

@@ -7,4 +7,5 @@ public interface Tts {
 
     ResultVo<String> textToSpeech(TtsRequest request);
 
+    ResultVo<String> clearAudioDirectory();
 }

+ 5 - 4
thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/tts/TtsController.java

@@ -1,10 +1,7 @@
 package org.thyy.thirdpartapi.tts;
 
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.thyy.utils.result.ResultVo;
 
 
@@ -25,4 +22,8 @@ public class TtsController {
         return ttsService.textToSpeech(request);
     }
 
+    @GetMapping("/clearAudioDirectory")
+    public ResultVo<String> clearAudioDirectory() {
+        return ttsService.clearAudioDirectory();
+    }
 }

+ 5 - 0
thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/tts/ttsService/TtsTest.java

@@ -18,4 +18,9 @@ public class TtsTest implements Tts {
     public ResultVo<String> textToSpeech(TtsRequest request) {
         return R.fail(ExceptionEnum.NOT_SERVICE);
     }
+
+    @Override
+    public ResultVo<String> clearAudioDirectory() {
+        return R.fail(ExceptionEnum.NOT_SERVICE);
+    }
 }

+ 12 - 3
thyy-thirdpart-api/src/main/java/org/thyy/thirdpartapi/tts/ttsService/XfTtsApi.java

@@ -10,6 +10,7 @@ import okhttp3.Response;
 import okhttp3.WebSocket;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.thyy.thirdpartapi.tts.Tts;
 import org.thyy.thirdpartapi.tts.TtsConfig;
 import org.thyy.thirdpartapi.tts.TtsRequest;
@@ -36,6 +37,7 @@ public class XfTtsApi implements Tts {
 
     public void init() {
         try {
+            FileUtil.mkdir(cfg.getDirectory());
             if (StrUtil.isBlank(cfg.getDirectory())) {
                 cfg.setDirectory(System.getProperty("user.dir"));
             }
@@ -48,11 +50,10 @@ public class XfTtsApi implements Tts {
         }
     }
 
-
+    @Override
     public ResultVo<String> textToSpeech(TtsRequest request) {
         String filePath = cfg.getDirectory() + File.separator + request.getId() + ".mp3";
         FileUtil.del(filePath);
-
         CompletableFuture<Void> future = new CompletableFuture<>();
 
         try {
@@ -89,7 +90,6 @@ public class XfTtsApi implements Tts {
             future.completeExceptionally(e);
         }
 
-
         String voiceUrl = cfg.getSpeechUrl() + "/" + request.getId() + ".mp3";
         AtomicReference<ResultVo<String>> resultVo = new AtomicReference<>(R.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, ""));
 
@@ -109,4 +109,13 @@ public class XfTtsApi implements Tts {
         return resultVo.get();
     }
 
+    @Override
+    @Scheduled(cron = "0 0 0 * * ?")
+    public ResultVo<String> clearAudioDirectory() {
+        FileUtil.del(cfg.getDirectory() + File.separator);
+        String msg = "已清空文件夹 >>> " + cfg.getDirectory();
+        log.info("{}", msg);
+        FileUtil.mkdir(cfg.getDirectory());
+        return R.ok(msg);
+    }
 }