zhoutg %!s(int64=5) %!d(string=hai) anos
pai
achega
841ab1e047

+ 23 - 22
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -531,28 +531,29 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * 执行未评分的病历
      */
     public void execute() {
-//        List<BehospitalInfo> behospitalInfoList = getNoGrade();
-//        for (BehospitalInfo bean : behospitalInfoList) {
-//            AnalyzeVO analyzeVO = new AnalyzeVO();
-//            analyzeVO.setHospitalId(bean.getHospitalId());
-//            analyzeVO.setBehospitalCode(bean.getBehospitalCode());
-//            mrqcsysServiceClient.analyze(analyzeVO);
-//        }
-
-        List<BehospitalInfo> behospitalInfoList = this.list(new QueryWrapper<BehospitalInfo>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-        );
-
-        int i = 1;
-        while(i < 100) {
-            for (BehospitalInfo bean : behospitalInfoList) {
-                AnalyzeVO analyzeVO = new AnalyzeVO();
-                analyzeVO.setIsTask(true);
-                analyzeVO.setHospitalId(bean.getHospitalId());
-                analyzeVO.setBehospitalCode(bean.getBehospitalCode());
-                authServiceClient.analyze_rpc(analyzeVO);
-                System.out.println(i++);
-            }
+        List<BehospitalInfo> behospitalInfoList = getNoGrade();
+        for (BehospitalInfo bean : behospitalInfoList) {
+            AnalyzeVO analyzeVO = new AnalyzeVO();
+            analyzeVO.setIsTask(true);
+            analyzeVO.setHospitalId(bean.getHospitalId());
+            analyzeVO.setBehospitalCode(bean.getBehospitalCode());
+            authServiceClient.analyze_rpc(analyzeVO);
         }
+
+//        List<BehospitalInfo> behospitalInfoList = this.list(new QueryWrapper<BehospitalInfo>()
+//                .eq("is_deleted", IsDeleteEnum.N.getKey())
+//        );
+//
+//        int i = 1;
+//        while(i < 100) {
+//            for (BehospitalInfo bean : behospitalInfoList) {
+//                AnalyzeVO analyzeVO = new AnalyzeVO();
+//                analyzeVO.setIsTask(true);
+//                analyzeVO.setHospitalId(bean.getHospitalId());
+//                analyzeVO.setBehospitalCode(bean.getBehospitalCode());
+//                authServiceClient.analyze_rpc(analyzeVO);
+//                System.out.println(i++);
+//            }
+//        }
     }
 }

+ 9 - 3
src/main/java/com/diagbot/task/BehospitalInfoAnalyzeTask.java

@@ -3,11 +3,14 @@ package com.diagbot.task;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.entity.SysTaskCron;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.SysTaskCronFacade;
 import com.diagbot.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.Trigger;
 import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.SchedulingConfigurer;
 import org.springframework.scheduling.config.ScheduledTaskRegistrar;
 import org.springframework.scheduling.support.CronTrigger;
@@ -20,15 +23,17 @@ import java.util.Date;
  * @author: gaodm
  * @time: 2020/4/15 17:45
  */
-//@Component
-//@Configuration      //1.主要用于标记配置类,兼备Component的效果。
-//@EnableScheduling   // 2.开启定时任务
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
 public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
     @Autowired
     private SysTaskCronFacade sysTaskCronFacade;
 
     private SysTaskCron task001 = new SysTaskCron();
 
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
     /**
      * 执行定时任务.
      */
@@ -42,6 +47,7 @@ public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
                         && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task001.getIsUsed().equals(1)) {
                     System.out.println("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    behospitalInfoFacade.execute();
                 }
             }
         }, new Trigger() {

+ 2 - 2
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -201,8 +201,8 @@
     </select>
 
 
-    <select id="getNoGrade">
-        select * from select * from med_behospital_info a
+    <select id="getNoGrade" resultMap="BaseResultMap">
+         select * from med_behospital_info a
             where a.is_deleted = 'N'
             and
             not EXISTS (