瀏覽代碼

fix(评价信息):

his配置更新后,没有自动拉取更新病人信息
18339543638 2 年之前
父節點
當前提交
478fbadb21
共有 1 個文件被更改,包括 10 次插入18 次删除
  1. 10 18
      nb-service/web-service/src/main/java/com/nb/web/service/bus/hospital/HospitalManager.java

+ 10 - 18
nb-service/web-service/src/main/java/com/nb/web/service/bus/hospital/HospitalManager.java

@@ -248,17 +248,16 @@ public class HospitalManager {
      * @return void
      */
     public void refreshUpdateConfig(HisUpdateEntity updateConfig){
-//        if(Objects.equals(updateConfig,this.updateConfig)
-//                ||updateConfig==null
-//                ||!Boolean.TRUE.equals(updateConfig.getEnable())
-//                ||null==updateConfig.getInterval()
-//                ||updateConfig.getInterval()<0){
-//            if(hisSchedule !=null&&!hisSchedule.isCancelled()){
-//                //如果有定时任务正在运行,则关闭
-//                hisSchedule.cancel(true);
-//            }
-//            return;
-//        }
+        if(updateConfig==null
+                ||!Boolean.TRUE.equals(updateConfig.getEnable())
+                ||null==updateConfig.getInterval()
+                ||updateConfig.getInterval()<0){
+            if(hisSchedule !=null&&!hisSchedule.isCancelled()){
+                //如果有定时任务正在运行,则关闭
+                hisSchedule.cancel(true);
+            }
+            return;
+        }
         hisSchedule = singleHisExecutor.schedule(() -> {
             scheduleHis();
             singleHisExecutor.schedule(this::scheduleHis, updateConfig.getInterval(), TimeUnit.MINUTES);
@@ -274,13 +273,6 @@ public class HospitalManager {
      * @return void
      */
     private void scheduleHis(){
-        if(Objects.equals(updateConfig,this.updateConfig)
-                ||updateConfig==null
-                ||!Boolean.TRUE.equals(updateConfig.getEnable())
-                ||null==updateConfig.getInterval()
-                ||updateConfig.getInterval()<0){
-            return;
-        }
         //拉取最新的50条输注信息,更新病人数据
         Page<BusInfusionHistoryEntity> infusionHistoryPage = new Page<>(0,50,false);
         infusionHistoryPage= infusionHistoryService.page(infusionHistoryPage, new QueryWrapper<BusInfusionHistoryEntity>().lambda().eq(BusInfusionHistoryEntity::getTenantId, hospitalId)