Selaa lähdekoodia

返回时间字段

zhoutg 5 vuotta sitten
vanhempi
commit
ac163e539c

+ 4 - 0
doc/005.20200528v1.2.x/qc_init.sql

@@ -64,3 +64,7 @@ INSERT INTO `qc_mode` VALUES ('52', '授权知情同意书', '500', '37', 'N', '
 INSERT INTO `qc_mode` VALUES ('53', '知情同意书', '260', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
 INSERT INTO `qc_mode` VALUES ('54', '谈话告知书', '270', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
 INSERT INTO `qc_mode` VALUES ('55', '其他', '999', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+
+ALTER TABLE `sys_task_cron` ADD COLUMN `param` varchar(500) DEFAULT '' COMMENT '参数' AFTER `cron`;
+UPDATE `sys_task_cron` SET `param` = 1,`is_deleted` = 'N' where cron_code = 'TASK_CX';
+UPDATE `sys_task_cron` SET `param` = 3,`is_deleted` = 'N',`remark` = '评分未评分的数据' where cron_code = 'TASK001';

+ 6 - 94
src/main/java/com/diagbot/entity/SysTaskCron.java

@@ -2,6 +2,7 @@ package com.diagbot.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -14,6 +15,7 @@ import java.util.Date;
  * @author gaodm
  * @since 2020-04-15
  */
+@Data
 public class SysTaskCron implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -69,98 +71,8 @@ public class SysTaskCron implements Serializable {
      */
     private String remark;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public String getCronCode() {
-        return cronCode;
-    }
-
-    public void setCronCode(String cronCode) {
-        this.cronCode = cronCode;
-    }
-
-    public String getCron() {
-        return cron;
-    }
-
-    public void setCron(String cron) {
-        this.cron = cron;
-    }
-
-    public Integer getIsUsed() {
-        return isUsed;
-    }
-
-    public void setIsUsed(Integer isUsed) {
-        this.isUsed = isUsed;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "SysTaskCron{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", cronCode=" + cronCode +
-                ", cron=" + cron +
-                ", remark=" + remark +
-                "}";
-    }
+    /**
+     * 参数
+     */
+    private String param;
 }

+ 38 - 2
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -266,6 +266,22 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         queryVo.setInputCatalogueMap(getInputCatalogueMap(qcCasesEntryDTOList)); // 设置质控条目编码
         List<MedrecVo> medrecVoList = new ArrayList<>(); // 设置内容
 
+
+        // 添加住院病历信息
+        List<BehospitalInfo> behospitalInfoList = this.list(new QueryWrapper<BehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId)
+                .eq("behospital_code", analyzeVO.getBehospitalCode())
+        );
+        if (ListUtil.isNotEmpty(behospitalInfoList)) {
+            MedrecVo medrecVo = new MedrecVo();
+            medrecVo.setTitle("住院病历信息");
+            Map<String, Object> content = new HashMap<>();
+            content.put("content", behospitalInfoList);
+            medrecVo.setContent(content);
+            medrecVoList.add(medrecVo);
+        }
+
         addData("入院记录", recMap, medrecVoList);
         addData("病危通知书", recMap, medrecVoList);
         addData("阶段小结", recMap, medrecVoList);
@@ -647,11 +663,30 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     }
 
 
+    /**
+     * 处理定时任务入参
+     *
+     * @param param
+     * @param taskVO
+     */
+    public void dealTaskVO(String param, TaskVO taskVO) {
+        if (StringUtil.isNotBlank(param)) {
+            String[] hos = param.split(",");
+            List<Long> hosptialIdList = new ArrayList<>();
+            for (String id : hos) {
+                hosptialIdList.add(Long.parseLong(id));
+            }
+            taskVO.setHosptialIdList(hosptialIdList);
+        }
+    }
+
     /**
      * 执行未评分的病历
      */
-    public void execute() {
+    public void execute(String param) {
         TaskVO taskVO = new TaskVO();
+        // 处理入参
+        dealTaskVO(param, taskVO);
         List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
         for (BehospitalInfo bean : behospitalInfoList) {
             AnalyzeVO analyzeVO = new AnalyzeVO();
@@ -682,10 +717,11 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     /**
      * 对出院日期之前3天的未评分的病历进行评分
      */
-    public void execute2() {
+    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();

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

@@ -33,6 +33,8 @@ public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
 
     private SysTaskCron task001 = new SysTaskCron();
 
+    private String param = "";
+
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
 
@@ -49,7 +51,7 @@ public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
                         && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task001.getIsUsed().equals(1)) {
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
-                    behospitalInfoFacade.execute();
+                    behospitalInfoFacade.execute(param);
                 }
             }
         }, new Trigger() {
@@ -62,6 +64,7 @@ public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
                 //2.2 合法性校验.
                 if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
                     cron = task001.getCron();
+                    param = task001.getParam();
                 }
                 CronTrigger trigger = new CronTrigger(cron);
                 return trigger.nextExecutionTime(triggerContext);

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

@@ -33,6 +33,8 @@ public class TASK_CX implements SchedulingConfigurer {
 
     private SysTaskCron task = new SysTaskCron();
 
+    private String param = "";
+
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
 
@@ -49,7 +51,7 @@ public class TASK_CX implements SchedulingConfigurer {
                         && task.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task.getIsUsed().equals(1)) {
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
-                    behospitalInfoFacade.execute2();
+                    behospitalInfoFacade.execute2(param);
                 }
             }
         }, new Trigger() {
@@ -63,6 +65,7 @@ public class TASK_CX implements SchedulingConfigurer {
                 //2.2 合法性校验.
                 if (null != task && StringUtil.isNotBlank(task.getCron())) {
                     cron = task.getCron();
+                    param = task.getParam();
                 }
                 CronTrigger trigger = new CronTrigger(cron);
                 return trigger.nextExecutionTime(triggerContext);

+ 3 - 0
src/main/java/com/diagbot/vo/TaskVO.java

@@ -3,6 +3,7 @@ package com.diagbot.vo;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * @Description:
@@ -14,4 +15,6 @@ public class TaskVO {
 
     // 出院时间过滤
     private Date leaveDate;
+    // 医院
+    private List<Long> hosptialIdList;
 }

+ 1 - 1
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -150,7 +150,7 @@ public class BehospitalInfoController {
     @PostMapping("/execule")
     @SysLogger("execule")
     public RespDTO<Boolean> execule(){
-        behospitalInfoFacade.execute();
+        behospitalInfoFacade.execute("");
         return RespDTO.onSuc(true);
     }
 

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

@@ -413,6 +413,12 @@
          <if test="leaveDate != null">
              <![CDATA[ and a.leave_hospital_date < #{leaveDate}]]>
          </if>
+        <if test="hosptialIdList != null and hosptialIdList.size > 0 ">
+            and a.hospital_id in
+            <foreach collection="hosptialIdList" item="item" open="("  separator=","  close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
 
     <!--质控评分(科室)分页-->