Просмотр исходного кода

Merge branch 'dev/20200522temp' into test

zhoutg 5 лет назад
Родитель
Сommit
c817cc260b

+ 3 - 1
doc/005.20200528v1.2.x/qc_init.sql

@@ -1013,4 +1013,6 @@ set map_keys=concat(map_keys,',rec_title=',rec_type)
 where map_keys NOT like '%rec_title=%';
 
 insert into med_record_analyze(hospital_id,name,mode_id,mode_name,rec_type,map_type) VALUE(1,'长兴病案首页模板',6,'病案首页','病案首页','1');
-insert into med_record_module(hospital_id,rec_type_detail,with_record_analyze_names,mode_id,mode_name) VALUE(1,'长兴病案首页模板','长兴病案首页模板',6,'病案首页');
+insert into med_record_module(hospital_id,rec_type_detail,with_record_analyze_names,mode_id,mode_name) VALUE(1,'长兴病案首页模板','长兴病案首页模板',6,'病案首页');
+insert into med_record_analyze(hospital_id,name,mode_id,mode_name,rec_type,map_type) VALUE(3,'台州病案首页模板',6,'病案首页','病案首页','1');
+insert into med_record_module(hospital_id,rec_type_detail,with_record_analyze_names,mode_id,mode_name) VALUE(3,'台州病案首页模板','台州病案首页模板',6,'病案首页');

+ 21 - 37
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -681,12 +681,16 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     }
 
     /**
-     * 执行未评分的病历
+     * 评分
      */
-    public void execute(String param) {
-        TaskVO taskVO = new TaskVO();
-        // 处理入参
+    public void execute(TaskVO taskVO, String param) {
+        // 处理医院信息
         dealTaskVO(param, taskVO);
+        // 处理时间过滤
+        if (taskVO.getType() != null && taskVO.getType() == 1) {
+            Date date = DateUtil.addDay(DateUtil.now(), -3);
+            taskVO.setLeaveDate(date);
+        }
         List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
         for (BehospitalInfo bean : behospitalInfoList) {
             AnalyzeVO analyzeVO = new AnalyzeVO();
@@ -695,42 +699,22 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             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++);
-        //            }
-        //        }
     }
 
 
-    /**
-     * 对出院日期之前3天的未评分的病历进行评分
-     */
-    public void execute2(String param) {
-        TaskVO taskVO = new TaskVO();
-        Date date = DateUtil.addDay(DateUtil.now(), -3);
-        taskVO.setLeaveDate(date);
-        dealTaskVO(param, taskVO);
-        List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
-        for (BehospitalInfo bean : behospitalInfoList) {
-            AnalyzeVO analyzeVO = new AnalyzeVO();
-            analyzeVO.setIsTask(true);
-            analyzeVO.setHospitalId(bean.getHospitalId());
-            analyzeVO.setBehospitalCode(bean.getBehospitalCode());
-            authServiceClient.analyze_rpc(analyzeVO);
-        }
-    }
+    // /**
+    //  * 对出院日期之前3天的未评分的病历进行评分
+    //  */
+    // public void execute2(TaskVO taskVO) {
+    //     List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
+    //     for (BehospitalInfo bean : behospitalInfoList) {
+    //         AnalyzeVO analyzeVO = new AnalyzeVO();
+    //         analyzeVO.setIsTask(true);
+    //         analyzeVO.setHospitalId(bean.getHospitalId());
+    //         analyzeVO.setBehospitalCode(bean.getBehospitalCode());
+    //         authServiceClient.analyze_rpc(analyzeVO);
+    //     }
+    // }
 
     /**
      * 评分api

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

@@ -6,6 +6,7 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.SysTaskCronFacade;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.TaskVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
@@ -51,7 +52,8 @@ public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
                         && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task001.getIsUsed().equals(1)) {
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
-                    behospitalInfoFacade.execute(param);
+                    TaskVO taskVO = new TaskVO();
+                    behospitalInfoFacade.execute(taskVO, param);
                 }
             }
         }, new Trigger() {

+ 4 - 1
src/main/java/com/diagbot/task/TASK_CX.java

@@ -6,6 +6,7 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.SysTaskCronFacade;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.TaskVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
@@ -51,7 +52,9 @@ public class TASK_CX implements SchedulingConfigurer {
                         && task.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task.getIsUsed().equals(1)) {
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
-                    behospitalInfoFacade.execute2(param);
+                    TaskVO taskVO = new TaskVO();
+                    taskVO.setType(1); // 类型过滤(1:出院时间比当前时间早3天前的病历(例如:长兴病历))
+                    behospitalInfoFacade.execute(taskVO, param);
                 }
             }
         }, new Trigger() {

+ 8 - 2
src/main/java/com/diagbot/vo/TaskVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
@@ -12,9 +13,14 @@ import java.util.List;
  */
 @Data
 public class TaskVO {
-
+    // 类型过滤(1:出院时间比当前时间早3天前的病历(例如:长兴病历))
+    private Integer type;
+    @ApiModelProperty(hidden = true)
     // 出院时间过滤
     private Date leaveDate;
-    // 医院
+    // 医院列表id,1:长兴,3:台州,2:邵逸夫
     private List<Long> hosptialIdList;
+    // 筛选病历数据:0:未评分的病历,推荐使用;1:全部病历,谨慎使用
+    private Integer filterFlag = 0;
+
 }

+ 9 - 4
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -14,6 +14,7 @@ import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.BehospitalPageVO;
 import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.QcresultVO;
+import com.diagbot.vo.TaskVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -145,12 +146,16 @@ public class BehospitalInfoController {
         return RespDTO.onSuc(qcresultInfoFacade.changeQcResult(qcresultVO));
     }
 
-    @ApiOperation(value = "将未评分的病历进行评分[by:zhoutg]",
-            notes = "")
+    @ApiOperation(value = "对病历进行评分[by:zhoutg]",
+            notes = "参数内容清空:【所有医院】【未评分】病历数据<br>" +
+                    "<br>" +
+                    "type:类型过滤(1:出院时间比当前时间早3天前的病历(例如:长兴病历))<br>" +
+                    "hosptialIdList:医院列表id,1:长兴,3:台州,2:邵逸夫<br>" +
+                    "filterFlag: 筛选病历数据:0:未评分的病历,【推荐使用】;1:全部病历,【谨慎使用】")
     @PostMapping("/execule")
     @SysLogger("execule")
-    public RespDTO<Boolean> execule(){
-        behospitalInfoFacade.execute("");
+    public RespDTO<Boolean> execule(@RequestBody TaskVO taskVO){
+        behospitalInfoFacade.execute(taskVO, "");
         return RespDTO.onSuc(true);
     }
 

+ 5 - 3
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -394,10 +394,12 @@
         </if>
     </select>
 
-    <!--获取未评分病历-->
+    <!--获取病历-->
     <select id="getNoGrade" resultMap="BaseResultMap">
          select * from med_behospital_info a
-            where a.is_deleted = 'N'
+         where a.is_deleted = 'N'
+         and a.qc_type_id != 0
+         <if test="filterFlag != null and filterFlag == 0">
             and
             not EXISTS (
             SELECT
@@ -409,7 +411,7 @@
             AND a.hospital_id = b.hospital_id
             AND a.behospital_code = b.behospital_code
             )
-         and a.qc_type_id != 0
+         </if>
          <if test="leaveDate != null">
              <![CDATA[ and a.leave_hospital_date < #{leaveDate}]]>
          </if>