浏览代码

长兴评分规则提前上,添加过滤is_placefile = 1

zhoutg 5 年之前
父节点
当前提交
79d77d166a

+ 8 - 1
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -697,11 +697,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     public void execute(TaskVO taskVO, String param) {
         // 处理医院信息
         dealTaskVO(param, taskVO);
-        // 处理时间过滤
+        // 类型过滤(1:出院时间比当前时间早3天前的病历(例如:长兴病历))
         if (taskVO.getType() != null && taskVO.getType() == 1) {
             Date date = DateUtil.addDay(DateUtil.now(), -3);
             taskVO.setLeaveDate(date);
         }
+        // 近3天不含当天的病历强制评分更新
+        if (taskVO != null && ListUtil.isNotEmpty(taskVO.getIndividuation()) && taskVO.getIndividuation().contains(1)) {
+            // 3天前最早时间
+            taskVO.setStartLeaveDate(DateUtil.getFirstTimeOfDay(DateUtil.addDay(DateUtil.now(), -3)));
+            // 昨天最迟时间
+            taskVO.setEndLeaveDate(DateUtil.getLastTimeOfDay(DateUtil.addDay(DateUtil.now(), -1)));
+        }
         List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
         for (BehospitalInfo bean : behospitalInfoList) {
             AnalyzeVO analyzeVO = new AnalyzeVO();

+ 2 - 0
src/main/java/com/diagbot/task/TASK_CX.java

@@ -18,6 +18,7 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar;
 import org.springframework.scheduling.support.CronTrigger;
 
 import java.time.LocalDateTime;
+import java.util.Arrays;
 import java.util.Date;
 
 /**
@@ -54,6 +55,7 @@ public class TASK_CX implements SchedulingConfigurer {
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
                     TaskVO taskVO = new TaskVO();
                     taskVO.setType(1); // 类型过滤(1:出院时间比当前时间早3天前的病历(例如:长兴病历))
+                    taskVO.setIndividuation(Arrays.asList(1)); //个性化需求【1:近3天不含当天的病历强制评分更新】
                     behospitalInfoFacade.execute(taskVO, param);
                 }
             }

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

@@ -22,5 +22,12 @@ public class TaskVO {
     private List<Long> hosptialIdList;
     // 筛选病历数据:0:未评分的病历,推荐使用;1:全部病历,谨慎使用
     private Integer filterFlag = 0;
-
+    // 个性化需求【1:近3天不含当天的病历强制评分更新】
+    private List<Integer> individuation;
+    // 出院时间过滤
+    @ApiModelProperty(hidden = true)
+    private Date startLeaveDate;
+    // 出院时间过滤
+    @ApiModelProperty(hidden = true)
+    private Date endLeaveDate;
 }

+ 23 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -92,6 +92,7 @@
             and t.is_placefile = #{isPlacefile}
         </if>
         and t.qc_type_id != 0
+        and t.is_placefile = 1
     </select>
 
     <select id="getMsg" resultType="com.diagbot.dto.MsgDTO">
@@ -200,6 +201,7 @@
         select * from med_behospital_info a
         where a.is_deleted = 'N'
         and a.qc_type_id != 0
+        and a.is_placefile = 1
         <if test="filterFlag != null and filterFlag == 0">
             and
             not EXISTS (
@@ -222,6 +224,25 @@
                 #{item}
             </foreach>
         </if>
+        <if test="individuation != null and individuation.contains(1)">
+            union
+            select * from med_behospital_info b
+            where b.is_deleted = 'N'
+            and b.qc_type_id != 0
+            and b.is_placefile = 1
+            <if test="startLeaveDate != null">
+                <![CDATA[ and b.leave_hospital_date >= #{startLeaveDate}]]>
+            </if>
+            <if test="endLeaveDate != null">
+                <![CDATA[ and b.leave_hospital_date <= #{endLeaveDate}]]>
+            </if>
+            <if test="hosptialIdList != null and hosptialIdList.size > 0 ">
+                and b.hospital_id in
+                <foreach collection="hosptialIdList" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </if>
     </select>
 
     <!--质控评分(科室)分页-->
@@ -295,6 +316,7 @@
             and t.is_placefile = #{isPlacefile}
         </if>
         and t.qc_type_id != 0
+        and t.is_placefile = 1
     </select>
 
     <!--质控评分(个人)分页-->
@@ -365,6 +387,7 @@
             and t.is_placefile = #{isPlacefile}
         </if>
         and t.qc_type_id != 0
+        and t.is_placefile = 1
     </select>
 
     <!-- 出院总人数统计-全院-首页 -->