소스 검색

病案首页获取版本信息接口上传,实时提醒接口优化

“wangdsYun 3 달 전
부모
커밋
34cdc715ec
58개의 변경된 파일668개의 추가작업 그리고 4376개의 파일을 삭제
  1. 0 13
      pom.xml
  2. 3 9
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  3. 3 9
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  4. 0 2
      src/main/java/com/diagbot/dto/AlgorithmDTO.java
  5. 32 0
      src/main/java/com/diagbot/dto/AnalyzeCaseDetailDTO.java
  6. 0 4
      src/main/java/com/diagbot/dto/AnalyzeRunDTO.java
  7. 0 139
      src/main/java/com/diagbot/dto/BehospitalInfoDeptDTO.java
  8. 0 55
      src/main/java/com/diagbot/dto/CheckJobDTO.java
  9. 0 23
      src/main/java/com/diagbot/dto/CheckWardDTO.java
  10. 0 144
      src/main/java/com/diagbot/dto/CheckWorkDTO.java
  11. 0 158
      src/main/java/com/diagbot/dto/CheckedRecordListDTO.java
  12. 1 1
      src/main/java/com/diagbot/dto/MsgDTO.java
  13. 0 26
      src/main/java/com/diagbot/dto/RegionMedoupDTO.java
  14. 0 71
      src/main/java/com/diagbot/entity/MedBehospitalType.java
  15. 4 48
      src/main/java/com/diagbot/entity/MedCheckInfo.java
  16. 2 3
      src/main/java/com/diagbot/enums/CheckTypeEnum.java
  17. 30 80
      src/main/java/com/diagbot/facade/AlgorithmFacade.java
  18. 0 45
      src/main/java/com/diagbot/facade/BasDoctorInfoFacade.java
  19. 57 94
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java
  20. 0 4
      src/main/java/com/diagbot/facade/HomePageFacade.java
  21. 0 946
      src/main/java/com/diagbot/facade/MedCheckInfoFacade.java
  22. 0 492
      src/main/java/com/diagbot/facade/MedCheckWorkFacade.java
  23. 321 0
      src/main/java/com/diagbot/facade/MedExamineInfoFacade.java
  24. 44 8
      src/main/java/com/diagbot/facade/QcresultInfoFacade.java
  25. 0 277
      src/main/java/com/diagbot/facade/RecordCheckFacade.java
  26. 2 2
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  27. 0 16
      src/main/java/com/diagbot/mapper/MedBehospitalTypeMapper.java
  28. 0 42
      src/main/java/com/diagbot/mapper/MedCheckInfoMapper.java
  29. 16 0
      src/main/java/com/diagbot/mapper/MedExamineInfoMapper.java
  30. 2 0
      src/main/java/com/diagbot/service/BehospitalInfoService.java
  31. 0 16
      src/main/java/com/diagbot/service/MedBehospitalTypeService.java
  32. 0 24
      src/main/java/com/diagbot/service/MedCheckInfoService.java
  33. 16 0
      src/main/java/com/diagbot/service/MedExamineInfoService.java
  34. 4 1
      src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
  35. 0 20
      src/main/java/com/diagbot/service/impl/MedBehospitalTypeServiceImpl.java
  36. 0 39
      src/main/java/com/diagbot/service/impl/MedCheckInfoServiceImpl.java
  37. 17 0
      src/main/java/com/diagbot/service/impl/MedExamineInfoServiceImpl.java
  38. 0 71
      src/main/java/com/diagbot/task/BehospitalInfoTypeTask.java
  39. 0 3
      src/main/java/com/diagbot/vo/AnalyzeRunVO.java
  40. 0 65
      src/main/java/com/diagbot/vo/CheckJobPageVO.java
  41. 0 51
      src/main/java/com/diagbot/vo/CheckJobVO.java
  42. 0 145
      src/main/java/com/diagbot/vo/CheckWorkPageVO.java
  43. 0 114
      src/main/java/com/diagbot/vo/CheckedRecordListVO.java
  44. 0 42
      src/main/java/com/diagbot/vo/DistributionJobVO.java
  45. 0 31
      src/main/java/com/diagbot/vo/GetRegionAndMedoupInfoVO.java
  46. 2 0
      src/main/java/com/diagbot/vo/QcresultVO.java
  47. 0 24
      src/main/java/com/diagbot/vo/RecordCheckVO.java
  48. 0 9
      src/main/java/com/diagbot/web/BasDoctorInfoController.java
  49. 22 1
      src/main/java/com/diagbot/web/BehospitalInfoController.java
  50. 0 115
      src/main/java/com/diagbot/web/MedCheckInfoController.java
  51. 0 84
      src/main/java/com/diagbot/web/MedCheckWorkController.java
  52. 51 0
      src/main/java/com/diagbot/web/MedExamineInfoController.java
  53. 0 57
      src/main/java/com/diagbot/web/RecordCheckController.java
  54. 16 136
      src/main/resources/mapper/BehospitalInfoMapper.xml
  55. 0 16
      src/main/resources/mapper/MedBehospitalTypeMapper.xml
  56. 0 591
      src/main/resources/mapper/MedCheckInfoMapper.xml
  57. 22 0
      src/main/resources/mapper/MedExamineInfoMapper.xml
  58. 1 10
      src/main/resources/mapper/QcCasesEntryMapper.xml

+ 0 - 13
pom.xml

@@ -224,19 +224,6 @@
             <version>${easypoi.version}</version>
         </dependency>
 
-        <dependency>
-            <groupId>com.oracle</groupId>
-            <artifactId>ojdbc6</artifactId>
-            <version>11.2.0.3</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.microsoft.sqlserver</groupId>
-            <artifactId>mssql-jdbc</artifactId>
-            <version>6.2.0.jre8</version>
-            <scope>runtime</scope>
-        </dependency>
-
     </dependencies>
 
     <!-- 私有仓库 -->

+ 3 - 9
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -64,8 +64,9 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/behospitalInfo/analyze_rpc").permitAll()
                 .antMatchers("/qc/behospitalInfo/analyze_api").permitAll()
                 .antMatchers("/qc/behospitalInfo/analyze_run").permitAll()
-                .antMatchers("/qc/behospitalInfo/sendRuleWarn").permitAll()
-                .antMatchers("/qc/behospitalInfo/checkRule").permitAll()
+                .antMatchers("/qc/behospitalInfo/getCaseDetail").permitAll()
+                .antMatchers("/qc/behospitalInfo/loseSightOfCase").permitAll()
+                .antMatchers("/qc/medExamineInfo/passAudit").permitAll()
                 .antMatchers("/qc/behospitalInfo/upState").permitAll()
                 .antMatchers("/qc/behospitalInfo/delState").permitAll()
                 .antMatchers("/qc/module/getById").permitAll()
@@ -135,10 +136,6 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/casesEntryStatisticsById").permitAll()
                 .antMatchers("/console/hmImproveMRPage").permitAll()
                 .antMatchers("/console/qcCheckMRPage").permitAll()
-                .antMatchers("/consoleByDept/entryCountGroupByCaseAndDept").permitAll()
-                .antMatchers("/consoleByDept/entryCountGroupByCaseAndDeptPage").permitAll()
-                .antMatchers("/consoleByDept/entryCountGroupByEntryAndDept").permitAll()
-                .antMatchers("/consoleByDept/entryCountGroupByEntryAndDeptPage").permitAll()
                 .antMatchers("/consoleByDept/entryGroupByEntryAndDeptInnerPage").permitAll()
                 .antMatchers("/consoleByDept/homePageLevelByDeptLimit").permitAll()
                 .antMatchers("/consoleByDept/homePageLevelStatisticsByDept").permitAll()
@@ -272,9 +269,6 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/print/export/qualityControlExportByDept").permitAll()
                 .antMatchers("/qc/behospitalInfo/getMedQualityCoList").permitAll()
                 .antMatchers("/console/saveMedicaIndicator").permitAll()
-                .antMatchers("/qc/medCheckInfo/createMedBeHospitalInfoType").permitAll()
-                .antMatchers("/qc/medCheckWork/getLocalRegionMedoup").permitAll()
-                .antMatchers("/qc/medCheckInfo/addMedCheckInfo").permitAll()
                 .antMatchers("/sys/versionInfo/getVersionInfoAlls").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();

+ 3 - 9
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -139,8 +139,9 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/analyze_rpc", request)
                 || matchers("/qc/behospitalInfo/analyze_api", request)
                 || matchers("/qc/behospitalInfo/analyze_run", request)
-                || matchers("/qc/behospitalInfo/sendRuleWarn", request)
-                || matchers("/qc/behospitalInfo/checkRule", request)
+                || matchers("/qc/behospitalInfo/getCaseDetail", request)
+                || matchers("/qc/behospitalInfo/loseSightOfCase", request)
+                || matchers("/qc/medExamineInfo/passAudit", request)
                 || matchers("/qc/behospitalInfo/upState", request)
                 || matchers("/qc/behospitalInfo/delState", request)
                 || matchers("/qc/module/getById", request)
@@ -211,10 +212,6 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/casesEntryStatisticsById", request)
                 || matchers("/console/hmImproveMRPage", request)
                 || matchers("/console/qcCheckMRPage", request)
-                || matchers("/consoleByDept/entryCountGroupByCaseAndDept", request)
-                || matchers("/consoleByDept/entryCountGroupByCaseAndDeptPage", request)
-                || matchers("/consoleByDept/entryCountGroupByEntryAndDept", request)
-                || matchers("/consoleByDept/entryCountGroupByEntryAndDeptPage", request)
                 || matchers("/consoleByDept/entryGroupByEntryAndDeptInnerPage", request)
                 || matchers("/consoleByDept/homePageLevelByDeptLimit", request)
                 || matchers("/consoleByDept/homePageLevelStatisticsByDept", request)
@@ -348,9 +345,6 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/print/export/qualityControlExportByDept", request)
                 || matchers("/qc/behospitalInfo/getMedQualityCoList", request)
                 || matchers("/console/saveMedicaIndicator", request)
-                || matchers("/qc/medCheckInfo/createMedBeHospitalInfoType", request)
-                || matchers("/qc/medCheckWork/getLocalRegionMedoup", request)
-                || matchers("/qc/medCheckInfo/addMedCheckInfo", request)
                 || matchers("/sys/versionInfo/getVersionInfoAlls", request)
                 || matchers("/", request)) {
             return true;

+ 0 - 2
src/main/java/com/diagbot/dto/AlgorithmDTO.java

@@ -15,6 +15,4 @@ import java.math.BigDecimal;
 public class AlgorithmDTO {
     //得分
     private BigDecimal score;
-    //等级
-    private String level;
 }

+ 32 - 0
src/main/java/com/diagbot/dto/AnalyzeCaseDetailDTO.java

@@ -0,0 +1,32 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: dsYun
+ * @time: 2025/3/28 12:24
+ */
+@Getter
+@Setter
+public class AnalyzeCaseDetailDTO {
+    //姓名
+    private String name;
+    //性别
+    private String sex;
+    //年龄
+    private String age;
+    //病案号
+    private String behospitalCode;
+    //得分
+    private BigDecimal scoreRes;
+    //缺陷总数
+    private int num;
+    // 缺陷条目
+    private List<MsgDTO> msgDTOList = new ArrayList<>();
+}

+ 0 - 4
src/main/java/com/diagbot/dto/AnalyzeRunDTO.java

@@ -18,12 +18,8 @@ import java.util.Map;
 public class AnalyzeRunDTO {
     //得分
     private BigDecimal scoreRes;
-    //等级
-    private String level;
     //缺陷总数
     private Long num;
-    //缺陷总扣分
-    private BigDecimal numScore;
     // 缺陷条目
     private Map<String,List<MsgDTO>> msgDTOMap = new HashMap<>();
 }

+ 0 - 139
src/main/java/com/diagbot/dto/BehospitalInfoDeptDTO.java

@@ -1,139 +0,0 @@
-package com.diagbot.dto;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 住院病历信息
- * </p>
- *
- * @author zhoutg
- * @time: 2024-04-13
- */
-@Data
-public class BehospitalInfoDeptDTO implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 病人住院ID
-     */
-    private String behospitalCode;
-
-    /**
-     * 姓名
-     */
-    private String name;
-
-    /**
-     * 性别
-     */
-    private String sex;
-
-    /**
-     * 出生日期
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date birthday;
-
-    /**
-     * 档案号
-     */
-    private String fileCode;
-
-    /**
-     * 病区名称
-     */
-    private String wardName;
-
-    /**
-     * 住院科室名称
-     */
-    private String behDeptName;
-
-    /**
-     * 医疗组
-     */
-    private String medoupName;
-
-    /**
-     * 床位号
-     */
-    private String bedCode;
-
-    /**
-     * 入院时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date behospitalDate;
-
-    /**
-     * 出院时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date leaveHospitalDate;
-
-    /**
-     * 疾病名称
-     */
-    private String diagnose;
-
-    /**
-     * 医生姓名
-     */
-    private String doctorName;
-
-    /**
-     * 年龄
-     */
-    private String age;
-
-    /**
-     * 病历等级
-     */
-    private String level;
-
-    /**
-     * 最后得分
-     */
-    private Double scoreRes;
-
-    /**
-     * 病案首页得分
-     */
-    private Double scoreBn;
-
-    /**
-     * 评分类型(1:机器,2:人工)
-     */
-    private String gradeType;
-
-    /**
-     * 评分时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date gradeTime;
-
-    private String directorDoctorName ;
-
-    private String behDoctorName;
-
-    /**
-     * 归档时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date placefileDate;
-
-    private Integer checkStatus;
-    private Integer mrStatus;
-    private String chName;
-    private String mrName;
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date chTime;
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date mrTime;
-}

+ 0 - 55
src/main/java/com/diagbot/dto/CheckJobDTO.java

@@ -1,55 +0,0 @@
-package com.diagbot.dto;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description: 科室核查人员输出类
- * @Author:songxl
- * @time: 2024/5/14 13:45
- */
-@Getter
-@Setter
-public class CheckJobDTO {
-    //核查任务id
-    private int id;
-    //病人住院序号
-    private String behospitalCode;
-    //病人姓名
-    private String name;
-    /**
-     * 病区code
-     */
-    private String wardCode;
-    /**
-     * 病区名称
-     */
-    private String wardName;
-    /**
-     * 医疗组Code
-     */
-    private String medoupCode;
-    /**
-     * 医疗组名称
-     */
-    private String medoupName;
-    //科室
-    private String behospitalDept;
-    //主管医生
-    private String attendingDoctor;
-    //出院日期
-    private String leaveHospitalDate;
-    //核查任务生成时间
-    private String jobCreateTime;
-    //任务分配人员id
-    private Long jobDistributor;
-    //任务分配人员名称
-    private String jobDistributorName;
-    //科室id
-    private String behospitalDeptId;
-
-    //筛选分值
-    private int value;
-    //取消分配标志
-    private Boolean delFlag;
-}

+ 0 - 23
src/main/java/com/diagbot/dto/CheckWardDTO.java

@@ -1,23 +0,0 @@
-package com.diagbot.dto;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @Description: 核查病区输出类
- * @Author:songxl
- * @time: 2024/5/14 13:45
- */
-@Getter
-@Setter
-public class CheckWardDTO {
-    //病区id
-    private String wardCode;
-    //病区名称
-    private String wardName;
-    //病区科室集合
-    private List<CheckDeptDTO> checkDepts = new ArrayList<>();
-}

+ 0 - 144
src/main/java/com/diagbot/dto/CheckWorkDTO.java

@@ -1,144 +0,0 @@
-package com.diagbot.dto;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.Date;
-
-/**
- * @Description:
- * @author: wangsy
- * @time: 2024/5/13 15:00
- */
-@Getter
-@Setter
-public class CheckWorkDTO {
-
-    /**
-     * 病人住院序号
-     */
-    private String behospitalCode;
-
-    /**
-     * 病人姓名
-     */
-    private String name;
-
-
-    /**
-     * 病案号
-     */
-    private String fileCode;
-
-    /**
-     * 性别
-     */
-    private String sex;
-
-    /**
-     * 年龄
-     */
-    private String age;
-    private String ageYear;
-    private String ageMon;
-    private String ageDay;
-
-    /**
-     * 病区code
-     */
-    private String wardCode;
-    /**
-     * 病区名称
-     */
-    private String wardName;
-
-    /**
-     * 科室id
-     */
-    private String deptId;
-    /**
-     * 科室
-     */
-    private String behDeptName;
-
-    /**
-     * 医疗组Code
-     */
-    private String medoupCode;
-    /**
-     * 医疗组名称
-     */
-    private String medoupName;
-
-    /**
-     * 出院日期
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date leaveHospitalDate;
-
-    /**
-     * 住院天数
-     */
-    private String behospitalDayNum;
-
-    /**
-     * 主管医生
-     */
-    private String doctorName;
-
-    /**
-     * 病历等级
-     */
-    private String level;
-
-    /**
-     * 病历得分
-     */
-    private String scoreRes;
-
-    /**
-     * 主诊断
-     */
-    private String diagnose;
-
-    /**
-     * 筛选分值
-     */
-    private String score;
-
-    /**
-     * 生成状态
-     */
-    private String creatStatus;
-
-    /**
-     * 生成日期
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date jobCreateTime;
-
-    /**
-     * 核查任务生成人编号
-     */
-    private Long jobCreator;
-    /**
-     * 核查任务生成人
-     */
-    private String jobCreatorName;
-
-    /**
-     * 核查日期
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date checkTime;
-
-    /**
-     * 分配日期
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date jobDistributionTime;
-
-    //取消分配标志
-    private Boolean delFlag = false;
-}

+ 0 - 158
src/main/java/com/diagbot/dto/CheckedRecordListDTO.java

@@ -1,158 +0,0 @@
-package com.diagbot.dto;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @Description:
- * @author: rengb
- * @time: 2024/5/17 18:47
- */
-@Getter
-@Setter
-@ApiModel("核查任务列表-获取核查任务列表-接口出参")
-public class CheckedRecordListDTO {
-
-    /**
-     * 病人住院序号
-     */
-    @ApiModelProperty("病人住院序号")
-    private String behospitalCode;
-
-    /**
-     * 病历核查状态
-     */
-    @ApiModelProperty("病历核查状态")
-    private String status;
-
-    /**
-     * 科室Id
-     */
-    @ApiModelProperty("科室Id")
-    private String behDeptId;
-    /**
-     * 任务来源
-     */
-    @ApiModelProperty("任务来源")
-    private String jobTypeName;
-    /**
-     * 医疗组Code
-     */
-    private String medoupCode;
-    /**
-     * 医疗组名称
-     */
-    private String medoupName;
-
-    /**
-     * 科室
-     */
-    @ApiModelProperty("科室")
-    private String behDeptName;
-
-    /**
-     * 病区code
-     */
-    private String wardCode;
-    /**
-     * 病区名称
-     */
-    private String wardName;
-
-
-    /**
-     * 病人姓名
-     */
-    @ApiModelProperty("病人姓名")
-    private String name;
-
-    /**
-     * 病案号
-     */
-    @ApiModelProperty("病案号")
-    private String fileCode;
-
-    /**
-     * 主管医生
-     */
-    @ApiModelProperty("主管医生")
-    private String doctorName;
-
-    /**
-     * 出院日期
-     */
-    @ApiModelProperty("出院日期")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date leaveHospitalDate;
-
-    /**
-     * 生成日期
-     */
-    @ApiModelProperty("生成日期")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date jobCreateTime;
-
-    /**
-     * 分配日期
-     */
-    @ApiModelProperty("分配日期")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date jobDistributionTime;
-
-    /**
-     * 任务月份
-     */
-    @ApiModelProperty("任务月份")
-    @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
-    private Date month;
-
-    /**
-     * 核查员id
-     */
-    @ApiModelProperty("核查员id")
-    private Long checkId;
-
-    /**
-     * 核查员
-     */
-    @ApiModelProperty("核查员")
-    private String checkName;
-
-    /**
-     * 核查日期
-     */
-    @ApiModelProperty("核查日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
-    private Date checkTime;
-
-    /**
-     * 缺陷数
-     */
-    @ApiModelProperty("缺陷数")
-    private int casesEntryNum;
-
-    /**
-     * 病历等级
-     */
-    @ApiModelProperty("病历等级")
-    private String level;
-
-    /**
-     * 病历得分
-     */
-    @ApiModelProperty("病历得分")
-    private BigDecimal scoreRes;
-
-    /**
-     * 年龄
-     */
-    @ApiModelProperty("年龄")
-    private String age;
-
-}

+ 1 - 1
src/main/java/com/diagbot/dto/MsgDTO.java

@@ -61,7 +61,7 @@ public class MsgDTO {
     // 逻辑删除标志位
     private String isDeleted;
     // 缺陷说明
-    private String explainInfo;
+    private String remark;
     // 条目id对应页面数据的key值
     private List<Long> pageKeyList = new ArrayList<>();
 }

+ 0 - 26
src/main/java/com/diagbot/dto/RegionMedoupDTO.java

@@ -1,26 +0,0 @@
-package com.diagbot.dto;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.util.List;
-
-
-/**
- * @Description:病区、医疗组 对象
- * @author: wangsy
- * @time: 2024/5/13 15:00
- */
-@Data
-public class RegionMedoupDTO {
-  @ApiModelProperty("病区集合")
-  List<RegionDTO> regions;
-  @ApiModelProperty("医疗组集合")
-  List<MedoupDTO> medoups;
-  @ApiModelProperty("医生医疗组")
-  String localMedoupCode;
-  @ApiModelProperty("全部显示flag")
-  boolean showAllFlag;
-
-
-}

+ 0 - 71
src/main/java/com/diagbot/entity/MedBehospitalType.java

@@ -1,71 +0,0 @@
-package com.diagbot.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author songxl
- * @time: 2024-05-11
- */
-@TableName("med_behospital_type")
-@Data
-public class MedBehospitalType implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 医院ID
-     */
-    private Long hospitalId;
-
-    /**
-     * 病历号
-     */
-    private String behospitalCode;
-
-    /**
-     * 患者类型
-     */
-    private String behospitalType;
-
-    /**
-     * 类型分值
-     */
-    private Integer value;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    @Override
-    public String toString() {
-        return "MedBehospitalType{" +
-            "id=" + id +
-            ", hospitalId=" + hospitalId +
-            ", behospitalCode=" + behospitalCode +
-            ", behospitalType=" + behospitalType +
-            ", value=" + value +
-            ", createTime=" + createTime +
-            ", isDeleted=" + isDeleted +
-        "}";
-    }
-}

+ 4 - 48
src/main/java/com/diagbot/entity/MedCheckInfo.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import lombok.Data;
 
 import java.io.Serializable;
-import java.time.LocalDateTime;
 import java.util.Date;
 
 /**
@@ -17,7 +16,7 @@ import java.util.Date;
  * @time: 2024-07-06
  */
 @Data
-public class MedCheckInfo implements Serializable {
+public class MedExamineInfo implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
@@ -83,45 +82,9 @@ public class MedCheckInfo implements Serializable {
     private Integer status;
 
     /**
-     * 核查类型(0病历,1病案首页,2全部
+     * 审核状态(0通过,1驳回
      */
-    private Integer checkType = 2;
-
-    /**
-     * 核查任务创建人编号
-     */
-    private Long jobCreator;
-
-    /**
-     * 核查任务创建人
-     */
-    private String jobCreatorName;
-
-    /**
-     * 核查任务生成时间
-     */
-    private Date jobCreateTime;
-
-    /**
-     * 核查任务类型(0-科室任务 1-院级 2-质控科)
-     */
-    private Integer jobType;
-
-    /**
-     * 核查任务分配人编号
-     */
-    private Long jobDistributor;
-
-    /**
-     * 核查任务分配人姓名
-     */
-    private String jobDistributionName;
-
-    /**
-     * 核查任务分配时间
-     */
-    private Date jobDistributionTime;
-
+    private Integer action = 0;
 
     @Override
     public String toString() {
@@ -138,14 +101,7 @@ public class MedCheckInfo implements Serializable {
                 ", checkName=" + checkName +
                 ", checkTime=" + checkTime +
                 ", status=" + status +
-                ", checkType=" + checkType +
-                ", jobCreator=" + jobCreator +
-                ", jobCreatorName=" + jobCreatorName +
-                ", jobCreateTime=" + jobCreateTime +
-                ", jobType=" + jobType +
-                ", jobDistributor=" + jobDistributor +
-                ", jobDistributionName=" + jobDistributionName +
-                ", jobDistributionTime=" + jobDistributionTime +
+                ", action=" + action +
                 "}";
     }
 }

+ 2 - 3
src/main/java/com/diagbot/enums/CheckTypeEnum.java

@@ -9,9 +9,8 @@ import lombok.Setter;
  * @date 2018年11月21日 下午2:31:42
  */
 public enum CheckTypeEnum implements KeyedNamed {
-    COURSE(0, "病历"),
-    HOMEPAGE(1, "病案首页"),
-    ALL(2, "全部");
+    PASSED(0, "通过"),
+    REJECTED(1, "驳回");
 
     @Setter
     private int key;

+ 30 - 80
src/main/java/com/diagbot/facade/AlgorithmFacade.java

@@ -30,7 +30,7 @@ import java.util.Map;
  */
 @Component
 public class AlgorithmFacade {
-    private final static List<Integer> types = Arrays.asList(0, 1, 2, 3,4);
+    private final static List<Integer> types = Arrays.asList(0, 1, 2, 3, 4, 5);
 
     @Autowired
     private SysHospitalSetFacade sysHospitalSetFacade;
@@ -47,7 +47,6 @@ public class AlgorithmFacade {
         AlgorithmDTO algorithmDTO = new AlgorithmDTO();
         BigDecimal score = this.getScore(algorithmVO);
         algorithmDTO.setScore(score);
-        algorithmDTO.setLevel(this.getLevel(score));
         return algorithmDTO;
     }
 
@@ -59,7 +58,7 @@ public class AlgorithmFacade {
      */
     private BigDecimal getScore(AlgorithmVO algorithmVO) {
         if (!types.contains(algorithmVO.getType())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "操作类型只有0,1,2,3!");
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "操作类型只有0,1,2,3,4,5!");
         }
         //处理数据
         dataDeal(algorithmVO);
@@ -77,58 +76,13 @@ public class AlgorithmFacade {
      * @return 评结果分数
      */
     private BigDecimal getScoreForCx(AlgorithmVO algorithmVO) {
-        List<QcResultAlgVO> qcResultAlgHomePage = new ArrayList<>();
-        List<QcResultAlgVO> qcResultAlgHomePageExt = new ArrayList<>();
-        for (QcResultAlgVO qcResultAlgVO : algorithmVO.getQcResultAlgVOList()) {
-            //首页的情况
-            if (qcResultAlgVO.getCasesId().equals(243L)) {
-                qcResultAlgHomePage.add(qcResultAlgVO);
-            } else {
-                //非首页
-                qcResultAlgHomePageExt.add(qcResultAlgVO);
-            }
-        }
-        List<MedQcresultCasesVO> medQcresultCasesVOList = new ArrayList<>();
+        List<QcResultAlgVO> qcResultAlgHomePage = new ArrayList<>(algorithmVO.getQcResultAlgVOList());
         //病案首页
         AlgorithmVO homePage = new AlgorithmVO();
         BeanUtil.copyProperties(algorithmVO, homePage);
         homePage.setQcResultAlgVOList(qcResultAlgHomePage);
         homePage.setIsHomePage(true);
-        BigDecimal homePageRes = cal(homePage);
-        String level = getHomePageLevel(homePageRes);
-        MedQcresultCasesVO medQcresultCasesVOHp = new MedQcresultCasesVO();
-        medQcresultCasesVOHp.setHospitalId(algorithmVO.getHospitalId());
-        medQcresultCasesVOHp.setBehospitalCode(algorithmVO.getBehospitalCode());
-        medQcresultCasesVOHp.setCasesId(243L);
-        medQcresultCasesVOHp.setScoreRes(homePageRes);
-        medQcresultCasesVOHp.setLevel(level);
-        medQcresultCasesVOList.add(medQcresultCasesVOHp);
-        //病案首页以外
-        AlgorithmVO homePageExt = new AlgorithmVO();
-        BeanUtil.copyProperties(algorithmVO, homePageExt);
-        homePageExt.setQcResultAlgVOList(qcResultAlgHomePageExt);
-        BigDecimal homePageExtRes = cal(homePageExt);
-        MedQcresultCasesVO medQcresultCasesVOHpExt = new MedQcresultCasesVO();
-        medQcresultCasesVOHpExt.setHospitalId(algorithmVO.getHospitalId());
-        medQcresultCasesVOHpExt.setBehospitalCode(algorithmVO.getBehospitalCode());
-        medQcresultCasesVOHpExt.setCasesId(0L);
-        medQcresultCasesVOHpExt.setScoreRes(homePageExtRes);
-        medQcresultCasesVOHpExt.setLevel("");
-        medQcresultCasesVOList.add(medQcresultCasesVOHpExt);
-        algorithmVO.setMedQcresultCasesVOList(medQcresultCasesVOList);
-        //计算分数
-        BigDecimal res = homePageRes
-                .add(homePageExtRes)
-                .multiply(new BigDecimal(100))
-                .divide(new BigDecimal(120), 1, RoundingMode.HALF_UP);
-        // 判断是否是百分制
-        if (sysHospitalSetFacade.getScoreType(algorithmVO.getHospitalId()).equals("1")
-                ||(algorithmVO.getHospitalId().intValue() == 1
-                && StringUtil.isNotBlank(algorithmVO.getIsPlacefile())
-                && algorithmVO.getIsPlacefile().equals("0"))) {
-            res = cal(algorithmVO);
-        }
-        return homePageRes;
+        return cal(homePage);
     }
 
     /**
@@ -146,31 +100,6 @@ public class AlgorithmFacade {
         return level;
     }
 
-    /**
-     * 根据分数评定等级
-     *
-     * @param score 评分分数
-     * @return 等级
-     */
-    private String getLevel(BigDecimal score) {
-        String level = "甲";
-        //得分≥90分为甲级
-        if (BigDecimalUtil.ge(score, new BigDecimal(90))) {
-            level = "甲";
-        }
-        //得分<90分且得分≥80分为乙级
-        if (BigDecimalUtil.lt(score, new BigDecimal(90))
-                && BigDecimalUtil.ge(score, new BigDecimal(80))) {
-            level = "乙";
-        }
-        //得分<80分为丙级
-        if (BigDecimalUtil.lt(score, new BigDecimal(80))) {
-            level = "丙";
-        }
-
-        return level;
-    }
-
     /**
      * 处理数据
      *
@@ -279,6 +208,27 @@ public class AlgorithmFacade {
                 }
             }
         }
+        //忽略
+        else if (algorithmVO.getType().equals(5)) {
+            if (null == algorithmVO.getOptResultAlgVO()) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "忽略操作条目不能为空!");
+            }
+            //操作数据
+            if (ListUtil.isNotEmpty(qcResultAlgVOList)) {
+                Boolean hasData = false;
+                Long optId = algorithmVO.getOptResultAlgVO().getId(); // 操作id
+                for (QcResultAlgVO qcResultAlgVO : qcResultAlgVOList) {
+                    if (qcResultAlgVO.getId().equals(optId)) {
+                        qcResultAlgVOList.remove(qcResultAlgVO);
+                        hasData = true;
+                        break;
+                    }
+                }
+                if (!hasData) {
+                    throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "忽略的条目不存在!");
+                }
+            }
+        }
     }
 
     /**
@@ -331,13 +281,13 @@ public class AlgorithmFacade {
                 //模块计分
                 for (Map.Entry<Long, BigDecimal> casesScore : casesScoreMap.entrySet()) {
                     BigDecimal allSccore = casesMap.get(casesScore.getKey());
-                    if (BigDecimalUtil.le(allSccore, casesScore.getValue())) {
-                        //模块标准分小于等于模块减分总和就用模块标准分
-                        res = res.subtract(allSccore);
-                    } else {
+//                    if (BigDecimalUtil.le(allSccore, casesScore.getValue())) {
+//                        //模块标准分小于等于模块减分总和就用模块标准分
+//                        res = res.subtract(allSccore);
+//                    } else {
                         //模块标准分大于模块减分总和就用模块减分总和
                         res = res.subtract(casesScore.getValue());
-                    }
+//                    }
                 }
             }
             //结果小于0按0计算

+ 0 - 45
src/main/java/com/diagbot/facade/BasDoctorInfoFacade.java

@@ -3,7 +3,6 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.MedoupDTO;
 import com.diagbot.dto.RegionDTO;
-import com.diagbot.dto.RegionMedoupDTO;
 import com.diagbot.entity.*;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.BasDoctorInfoServiceImpl;
@@ -11,7 +10,6 @@ import com.diagbot.service.impl.MedoupServiceImpl;
 import com.diagbot.service.impl.RegionServiceImpl;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.SysUserUtils;
-import com.diagbot.vo.GetRegionAndMedoupInfoVO;
 import com.diagbot.vo.data.BasDoctorInfoVO;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,49 +38,6 @@ public class BasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
     @Autowired
     private MedoupServiceImpl medoupService;
 
-    /**
-     * 获取医院医生下拉列表信息
-     *
-     * @param getRegionAndMedoupInfoVO
-     * @return 医院医生下拉列表信息
-     */
-    public RegionMedoupDTO getRegionAndMedoupList(GetRegionAndMedoupInfoVO getRegionAndMedoupInfoVO) {
-        getRegionAndMedoupInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
-        RegionMedoupDTO regionMedoupDTO = new RegionMedoupDTO();
-        if("1".equals(getRegionAndMedoupInfoVO.getMark())){
-            List<Region> regions = regionService.lambdaQuery()
-                    .eq(Region::getIsDeleted, IsDeleteEnum.N.getKey())
-                    .eq(Region::getHospitalId, getRegionAndMedoupInfoVO.getHospitalId())
-                    .like(StringUtils.isNotBlank(getRegionAndMedoupInfoVO.getRegionStr()), Region::getName,getRegionAndMedoupInfoVO.getRegionStr())
-                    .select(Region::getName, Region::getCode).list();
-            List<RegionDTO> regionDTOS = new ArrayList<>();
-
-            regions.forEach(region->{
-                RegionDTO regionDTO = new RegionDTO();
-                regionDTO.setCode(region.getCode());
-                regionDTO.setName(region.getName());
-                regionDTOS.add(regionDTO);
-            });
-            regionMedoupDTO.setRegions(regionDTOS);
-        }
-        if("2".equals(getRegionAndMedoupInfoVO.getMark())){
-            List<MedoupDTO> medoupDTOS = new ArrayList<>();
-            List<Medoup> medoups = medoupService.lambdaQuery()
-                    .eq(Medoup::getIsDeleted, IsDeleteEnum.N.getKey())
-                    .like(StringUtils.isNotBlank(getRegionAndMedoupInfoVO.getMedoupStr()), Medoup::getName,getRegionAndMedoupInfoVO.getMedoupStr())
-                    .select(Medoup::getName, Medoup::getCode).list();
-            medoups.forEach(medoup->{
-                MedoupDTO medoupDTO = new MedoupDTO();
-                medoupDTO.setCode(medoup.getCode());
-                medoupDTO.setName(medoup.getName());
-                medoupDTOS.add(medoupDTO);
-            });
-            regionMedoupDTO.setMedoups(medoupDTOS);
-        }
-        return regionMedoupDTO;
-
-    }
-
     /**
      * 获取医院医生下拉列表信息
      *

+ 57 - 94
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -4,12 +4,10 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.AuthServiceClient;
 import com.diagbot.dto.*;
 import com.diagbot.entity.*;
-import com.diagbot.enums.CheckStatusEnum;
 import com.diagbot.enums.CheckerRoleEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.RuleTypeEnum;
@@ -21,8 +19,6 @@ import com.diagbot.service.impl.QcresultDetailServiceImpl;
 import com.diagbot.service.impl.StrInformedConsentServiceImpl;
 import com.diagbot.util.*;
 import com.diagbot.vo.*;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
@@ -32,7 +28,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -95,7 +90,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     @Autowired
     MedCrisisInfoFacade medCrisisInfoFacade;
     @Autowired
-    MedCheckInfoFacade medCheckInfoFacade;
+    MedExamineInfoFacade medCheckInfoFacade;
     @Autowired
     StrConsultationApplyFacade strConsultationApplyFacade;
     @Autowired
@@ -397,7 +392,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
     private void checkButtonShow(Long hospitalId, GetDetailVO getDetailVO, Map<String, Object> res) {
         //增加该病历是否核查状态
-        QueryWrapper<MedCheckInfo> medCheckInfoQuerys = new QueryWrapper<>();
+        QueryWrapper<MedExamineInfo> medCheckInfoQuerys = new QueryWrapper<>();
         medCheckInfoQuerys.eq("is_deleted", IsDeleteEnum.N.getKey());
         medCheckInfoQuerys.eq("behospital_code", getDetailVO.getBehospitalCode());
         medCheckInfoQuerys.eq("hospital_id", hospitalId);
@@ -415,7 +410,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         mapAllMr.put("behospital_code", getDetailVO.getBehospitalCode());
         mapAllMr.put("hospital_id", hospitalId);
         mapAllMr.put("check_type", 1);
-        QueryWrapper<MedCheckInfo> medCheckInfoMr = new QueryWrapper<>();
+        QueryWrapper<MedExamineInfo> medCheckInfoMr = new QueryWrapper<>();
         medCheckInfoMr.allEq(mapAllMr);
         int countMr = medCheckInfoFacade.count(medCheckInfoMr);
         if (countMr > 0) {
@@ -425,7 +420,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
         //新增如果当前用户不是核查人员返回标志位用户核查按钮、修改、删除、隐藏显示
         //1.获取病历核查人员id,该操作只能是核查员操作
-        List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
+        List<MedExamineInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedExamineInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", hospitalId)
                 .eq("behospital_code", getDetailVO.getBehospitalCode())
@@ -433,17 +428,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (medCheckInfos.size() >= 1 && medCheckInfos.get(0).getCheckId() != null
                 && medCheckInfos.get(0).getCheckId().equals(Long.parseLong(SysUserUtils.getCurrentPrincipleID()))) {
             //2.1获取核查类型,判断当前用户有没有对应核查类型的角色
-            int jobType = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("behospital_code", getDetailVO.getBehospitalCode())
-                    .eq("hospital_id", hospitalId)
-                    .eq("check_id", SysUserUtils.getCurrentPrincipleID())).get(0).getJobType();
+//            int jobType = medCheckInfoFacade.list(new QueryWrapper<MedExamineInfo>()
+//                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+//                    .eq("behospital_code", getDetailVO.getBehospitalCode())
+//                    .eq("hospital_id", hospitalId)
+//                    .eq("check_id", SysUserUtils.getCurrentPrincipleID())).get(0).getJobType();
             //2.2获取用户角色
             List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("user_id", SysUserUtils.getCurrentPrincipleID())
             ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
-            switch (jobType) {
+//            switch (jobType) {
+            switch (0) {
                 case 0:
                     if (roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l)) {
                         res.put("checkShow", 1);
@@ -1211,7 +1207,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         analyzeDTO.setGradeType(1);
         analyzeDTO.setGradeTypeName("机器");
         analyzeDTO.setScoreRes(algorithmDTO.getScore());
-        analyzeDTO.setLevel(algorithmDTO.getLevel());
         analyzeDTO.setGradeTime(date);
         return analyzeDTO;
     }
@@ -1926,7 +1921,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             reNum = "1";
         }
         QcResultApiDTO qcResultApiDTO = new QcResultApiDTO();
-        if (StringUtils.isNotEmpty(algorithmDTO.getLevel()) && algorithmDTO.getScore() != null && msgDTOList != null) {
+        if (algorithmDTO.getScore() != null && msgDTOList != null) {
             if ("1".equals(reNum)) {
                 bigDecimal = resPr.subtract(algorithmDTO.getScore());
             } else if ("0".equals(reNum)) {
@@ -1940,7 +1935,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                     .filter(Objects::nonNull)
                     .count();
             qcResultApiDTO.setScoreRes(algorithmDTO.getScore());
-            qcResultApiDTO.setLevel(algorithmDTO.getLevel());
             qcResultApiDTO.setNum(num);
             qcResultApiDTO.setNumScore(bigDecimal);
             resMapData.put("result", qcResultApiDTO);
@@ -1984,12 +1978,16 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         // 对codeList 和 codeToInfoMap进行赋值
         setCodeData(outputInfo, codeList, codeToInfoMap);
 
+        AlgorithmDTO algorithmDTO = new AlgorithmDTO();
         // 如果是1,说明已是终末质控,不再保存质控结果数据;如果是0,则保存质控结果数据
         if ("0".equals(analyzeRunVO.getIsPlacefile())) {
-            // 计算分值并保存结果至数据库
             Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
+            algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
+        } else {
+            //终末质控不保存数据
+            Map<String, Object> resMap = calScore(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
+            algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
         }
-
         // 返回缺陷提示信息
         List<MsgDTO> msgDTOList = new ArrayList<>();
         if (ListUtil.isNotEmpty(codeList)) {
@@ -2008,7 +2006,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 }
             }
         }
-
         //缺陷总数
         Long num = msgDTOList
                 .stream()
@@ -2022,16 +2019,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             return analyzeRunDTO;
         }
 
-        AlgorithmDTO algorithmDTO = new AlgorithmDTO();
-        // 如果是1,说明已是终末质控,不再保存质控结果数据;如果是0,则保存质控结果数据
-        if ("0".equals(analyzeRunVO.getIsPlacefile())) {
-            Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
-            algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
-        } else {
-            //终末质控不保存数据
-            Map<String, Object> resMap = calScore(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
-            algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
-        }
         analyzeRunDTO.setScoreRes(algorithmDTO.getScore());
         Map<String, List<MsgDTO>> newMsgMap = msgDTOList.stream()
                 .collect(Collectors.groupingBy(
@@ -2234,8 +2221,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             qcResultAlgQueryVO.setIsPlacefile(isPlacefile);
             qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
         }
-        //关爱病区病历扣分项目中涉及个人史、既往史、家族史、婚姻史条目扣分为0
-        specialDeptData(analyzeVO, qcResultAlgVOList);
         // 对info赋值
         for (QcResultAlgVO bean : qcResultAlgVOList) {
             String info = codeToInfoMap.get(bean.getCode());
@@ -2287,8 +2272,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             qcResultAlgQueryVO.setIsPlacefile(isPlacefile);
             qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
         }
-        //关爱病区病历扣分项目中涉及个人史、既往史、家族史、婚姻史条目扣分为0
-        specialDeptData(analyzeVO, qcResultAlgVOList);
         // 对info赋值
         for (QcResultAlgVO bean : qcResultAlgVOList) {
             String info = codeToInfoMap.get(bean.getCode());
@@ -2450,36 +2433,46 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return qcresultDetails;
     }
 
-    void specialDeptData(AnalyzeVO analyzeVO, List<QcResultAlgVO> qcResultAlgVOList) {
-        BasDeptInfo basDeptInfo = basDeptInfoFacade.lambdaQuery()
-                .eq(BasDeptInfo::getHospitalId, analyzeVO.getHospitalId())
-                .eq(BasDeptInfo::getIsDeleted, IsDeleteEnum.N.getKey())
-                .eq(BasDeptInfo::getDeptName, "关爱病区").one();
-
-        BehospitalInfo behospitalInfo = this.lambdaQuery()
-                .eq(BehospitalInfo::getHospitalId, analyzeVO.getHospitalId())
-                .eq(BehospitalInfo::getIsDeleted, IsDeleteEnum.N.getKey())
-                .eq(BehospitalInfo::getBehospitalCode, analyzeVO.getBehospitalCode()).one();
-
-
-        if (null != basDeptInfo && null != behospitalInfo && StringUtils.isNotBlank(basDeptInfo.getDeptId())
-                && StringUtils.isNotBlank(behospitalInfo.getBehDeptId())
-                && basDeptInfo.getDeptId().equals((behospitalInfo.getBehDeptId()))
-                && ListUtil.isNotEmpty(qcResultAlgVOList)) {
-            List<Long> casesEntryIds = qcCasesEntryFacade.lambdaQuery()
-                    .eq(QcCasesEntry::getIsDeleted, IsDeleteEnum.N.getKey())
-                    .like(QcCasesEntry::getName, "个人史")
-                    .like(QcCasesEntry::getName, "既往史")
-                    .like(QcCasesEntry::getName, "家族史")
-                    .like(QcCasesEntry::getName, "婚姻史").list().stream().map(QcCasesEntry::getId).collect(Collectors.toList());
-            if (ListUtil.isNotEmpty(casesEntryIds)) {
-                qcResultAlgVOList.forEach(obj -> {
-                    if (casesEntryIds.contains(obj.getCasesEntryId())) {
-                        obj.setScore(BigDecimal.ZERO);
-                    }
-                });
-            }
+    /**
+     * 获取明细
+     *
+     * @param behospitalcodeVO
+     * @return
+     */
+    public AnalyzeCaseDetailDTO getCaseDetail(BehospitalcodeVO behospitalcodeVO) {
+        AnalyzeCaseDetailDTO res = new AnalyzeCaseDetailDTO(); // 返回结果
+        // 获取病历信息
+        BehospitalInfo behospitalInfo = this.getOne(new QueryWrapper<BehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", behospitalcodeVO.getHospitalId())
+                .eq("behospital_code", behospitalcodeVO.getBehospitalCode()), false
+        );
+        res.setBehospitalCode(behospitalcodeVO.getBehospitalCode());//病案号
+        res.setName(behospitalInfo.getName());//姓名
+        res.setSex(behospitalInfo.getSex());//性别
+        // 获取患者年龄
+        HomePage homePage = homePageFacade.getOne(new QueryWrapper<HomePage>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", behospitalcodeVO.getHospitalId())
+                .eq("behospital_code", behospitalcodeVO.getBehospitalCode()), false
+        );
+        res.setAge(homePage.getAge());//年龄
+        // 获取提示信息
+        AnalyzeVO analyzeVO = new AnalyzeVO();
+        BeanUtil.copyProperties(behospitalcodeVO, analyzeVO);
+        QcresultInfo qcresultInfo = qcresultInfoFacade.getOne(new QueryWrapper<QcresultInfo>()
+                .eq("hospital_id", analyzeVO.getHospitalId())
+                .eq("behospital_code", analyzeVO.getBehospitalCode())
+                .eq("is_deleted", IsDeleteEnum.N.getKey()));
+        if (qcresultInfo != null && qcresultInfo.getId() != null) {
+            analyzeVO.setQcresultInfoId(qcresultInfo.getId());
         }
+        res.setScoreRes(qcresultInfo.getScoreRes());//得分
+        List<MsgDTO> msgDTOList = getMsgDetail(analyzeVO);
+        res.setNum(msgDTOList.size());//条目数
+        res.setMsgDTOList(msgDTOList);//提示信息
+
+        return res;
     }
 
     /**
@@ -2522,35 +2515,5 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return baseMapper.malignancy(filterVO);
     }
 
-    /**
-     * 获取患者年龄信息(通过出生日期和入院日期重新计算)
-     *
-     * @param hospitalId
-     * @param behospitalCodes
-     * @return
-     */
-    public List<BehospitalInfoAgeDTO> getBehospitalInfoAge(Long hospitalId, List<String> behospitalCodes) {
-        if (hospitalId == null || ListUtil.isEmpty(behospitalCodes)) {
-            return new ArrayList<>();
-        }
-        List<BehospitalInfoAgeDTO> behospitalInfoAgeDTOList = this.baseMapper.getBehospitalInfoAge(hospitalId, behospitalCodes);
-        if (behospitalInfoAgeDTOList == null) {
-            return new ArrayList<>();
-        }
-
-        behospitalInfoAgeDTOList.forEach(behospitalInfoAgeDTO -> {
-            String age = "";
-            if (StringUtil.isNotBlank(behospitalInfoAgeDTO.getAgeYear()) && !behospitalInfoAgeDTO.getAgeYear().equals("0")) {
-                age += behospitalInfoAgeDTO.getAgeYear() + "岁";
-            } else {
-                age += (StringUtil.isNotBlank(behospitalInfoAgeDTO.getAgeMon()) && !behospitalInfoAgeDTO.getAgeMon().equals("0") ? (behospitalInfoAgeDTO.getAgeMon() + "个月") : "")
-                        + (StringUtil.isNotBlank(behospitalInfoAgeDTO.getAgeDay()) && !behospitalInfoAgeDTO.getAgeDay().equals("0") ? (behospitalInfoAgeDTO.getAgeDay() + "天") : "");
-            }
-            behospitalInfoAgeDTO.setAge(age);
-        });
-
-        return behospitalInfoAgeDTOList;
-    }
-
 
 }

+ 0 - 4
src/main/java/com/diagbot/facade/HomePageFacade.java

@@ -1,11 +1,7 @@
 package com.diagbot.facade;
 
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import com.diagbot.entity.HomePage;
 import com.diagbot.service.impl.HomePageServiceImpl;
 
 /**

+ 0 - 946
src/main/java/com/diagbot/facade/MedCheckInfoFacade.java

@@ -1,946 +0,0 @@
-package com.diagbot.facade;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.BasDeptInfoDTO;
-import com.diagbot.dto.CheckDeptDTO;
-import com.diagbot.dto.CheckJobDTO;
-import com.diagbot.dto.CheckMedoupDTO;
-import com.diagbot.dto.CheckWardDTO;
-import com.diagbot.dto.DeptCheckUserDTO;
-import com.diagbot.entity.BasDeptInfo;
-import com.diagbot.entity.BasDoctorInfo;
-import com.diagbot.entity.DeptMedoup;
-import com.diagbot.entity.MedCheckInfo;
-import com.diagbot.entity.RegionDept;
-import com.diagbot.entity.SysRole;
-import com.diagbot.entity.SysUser;
-import com.diagbot.entity.SysUserDept;
-import com.diagbot.entity.SysUserRole;
-import com.diagbot.enums.CheckJobTypeEnum;
-import com.diagbot.enums.CheckerRoleEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.impl.DeptMedoupServiceImpl;
-import com.diagbot.service.impl.MedCheckInfoServiceImpl;
-import com.diagbot.service.impl.RegionDeptServiceImpl;
-import com.diagbot.util.DateUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.StringUtil;
-import com.diagbot.util.SysUserUtils;
-import com.diagbot.vo.CheckJobPageVO;
-import com.diagbot.vo.CheckUserVO;
-import com.diagbot.vo.DistributionJobVO;
-import com.diagbot.vo.MedCheckInfoAddVO;
-import com.diagbot.vo.SysUserBaseVO;
-import com.google.common.collect.Lists;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.stream.Collectors;
-
-/**
- * @author wangfeng
- * @Description:
- * @time: 2024-07-06 13:27
- */
-@Component
-public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
-
-    @Autowired
-    SysUserFacade sysUserFacade;
-    @Autowired
-    SysUserRoleFacade sysUserRoleFacade;
-    @Autowired
-    SysRoleFacade sysRoleFacade;
-    @Autowired
-    SysUserDeptFacade sysUserDeptFacade;
-    @Autowired
-    BasDoctorInfoFacade basDoctorInfoFacade;
-    @Autowired
-    BasDeptInfoFacade basDeptInfoFacade;
-    @Autowired
-    RegionDeptServiceImpl regionDeptService;
-    @Autowired
-    DeptMedoupServiceImpl deptMedoupService;
-    @Autowired
-    BasDoctorInfoFacade medoupUserService;
-
-
-    /**
-     * @param medCheckInfoAddVO
-     * @return
-     */
-    public Boolean addMedCheckInfos(MedCheckInfoAddVO medCheckInfoAddVO) {
-        boolean res = false;
-        Date now = DateUtil.now();
-        //获取人员id 和 该人员的医院id
-        Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
-        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
-        QueryWrapper<SysUser> userQuer = new QueryWrapper<>();
-        userQuer.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id", principleId)
-                .eq("status", 1);
-        SysUser user = sysUserFacade.getOne(userQuer);
-        String principleName = user.getLinkman();
-        Map<String, Object> mapAll = new HashMap<String, Object>();
-        mapAll.put("is_deleted", IsDeleteEnum.N.getKey());
-        mapAll.put("behospital_code", medCheckInfoAddVO.getBehospitalCode());
-        mapAll.put("hospital_id", hospitalId);
-        mapAll.put("check_type", medCheckInfoAddVO.getCheckType());
-        QueryWrapper<MedCheckInfo> medCheckInfoQuerys = new QueryWrapper<>();
-        medCheckInfoQuerys.allEq(mapAll);
-        MedCheckInfo data = this.getOne(medCheckInfoQuerys, false);
-        if (data != null) {
-            //检验核查人是否是本人
-            if (data.getCheckId().equals(principleId)) {
-                res = saveNew(mapAll, now, hospitalId, principleId, principleName, medCheckInfoAddVO);
-            } else {
-                throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据已被人核查,您暂无权限!");
-            }
-        } else {
-            //该病历没有核查的时候, 就添加核查记录
-            MedCheckInfo medCheckInfo = new MedCheckInfo();
-            medCheckInfo.setGmtCreate(now);
-            medCheckInfo.setGmtModified(now);
-            medCheckInfo.setHospitalId(hospitalId);
-            medCheckInfo.setCheckId(principleId);
-            medCheckInfo.setCheckName(principleName);
-            medCheckInfo.setCheckTime(now);
-            medCheckInfo.setCheckType(medCheckInfoAddVO.getCheckType());
-            medCheckInfo.setStatus(medCheckInfoAddVO.getCheckStatus());
-            medCheckInfo.setBehospitalCode(medCheckInfoAddVO.getBehospitalCode());
-            res = this.save(medCheckInfo);
-        }
-
-        return res;
-    }
-
-    /**
-     * @param mapAll
-     * @param now
-     * @param hospitalId
-     * @param principleId
-     * @param principleName
-     * @param medCheckInfoAddVO
-     * @return
-     */
-    public boolean saveNew(Map<String, Object> mapAll, Date now, Long hospitalId, Long principleId, String principleName, MedCheckInfoAddVO medCheckInfoAddVO) {
-        boolean res = false;
-        UpdateWrapper<MedCheckInfo> medCheckInfoUpdate = new UpdateWrapper<>();
-        medCheckInfoUpdate.allEq(mapAll).set("is_deleted", IsDeleteEnum.Y.getKey()).set("gmt_modified", now);
-        res = this.update(medCheckInfoUpdate);
-        //删除原来的成功后, 再新建一条核查数据
-        if (res) {
-            MedCheckInfo medCheckInfo = new MedCheckInfo();
-            medCheckInfo.setGmtCreate(now);
-            medCheckInfo.setGmtModified(now);
-            medCheckInfo.setHospitalId(hospitalId);
-            medCheckInfo.setCheckId(principleId);
-            medCheckInfo.setCheckName(principleName);
-            medCheckInfo.setCheckTime(now);
-            medCheckInfo.setCheckType(medCheckInfoAddVO.getCheckType());
-            medCheckInfo.setStatus(medCheckInfoAddVO.getCheckStatus());
-            medCheckInfo.setBehospitalCode(medCheckInfoAddVO.getBehospitalCode());
-            res = this.save(medCheckInfo);
-        }
-        return res;
-    }
-
-    /**
-     * @Author songxl
-     * @Description 获取操作用户的核查科室以及人员
-     * @time: 2024/5/14
-     * @Param []
-     * @Return java.util.Map<java.lang.String, java.util.List < com.diagbot.dto.CheckDeptDTO>>
-     * @MethodName getCheckUserMap
-     */
-    public IPage<CheckJobDTO> getUserCheckList(CheckJobPageVO checkJobVO) {
-        //校验
-        userCheckPageSet(checkJobVO);
-        //质控管理员要判断该角色是否是质控科
-        //1.获取质控科id
-        //获取人员id 和 该人员的医院id
-        Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
-        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
-        //获取核查监管相关角色id
-        List<Long> checkRoleIds = sysRoleFacade.list(new QueryWrapper<SysRole>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .like("name", "监管人员")
-        ).stream().map(SysRole::getId).collect(Collectors.toList());
-        //查询该角色的所有角色id
-        List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("user_id", principleId)
-        ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
-        List<Long> searchRoleIds = new ArrayList<>();
-        //当前用户是监管人员或者是超级管理员
-        if (roleIds.contains(-1L)) {
-            searchRoleIds.addAll(checkRoleIds);
-        } else {
-            searchRoleIds.addAll(containsRole(checkRoleIds, roleIds));
-        }
-        if (searchRoleIds.isEmpty()) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户不是核查监管人员!");
-        }
-        //质控科监管人员
-        if (searchRoleIds.contains(CheckerRoleEnum.QUAT_SUPERVISOR.getKey() * 1l)
-                && (CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + "").equals(checkJobVO.getJobType())) {
-            //用户是不是质管科人员校验
-            BasDeptInfo deptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", hospitalId)
-                    .eq("station", "质管"));
-            if (deptInfo == null || deptInfo.getDeptId() == null) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在,请联系管理员!");
-            }
-            //2.获取监管人员所在科室集合
-            List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", hospitalId)
-                    .eq("user_id", principleId)
-            ).stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
-            //3.判断这个人是否在质控科
-//            if(deptIds.contains(zkkDeptId))
-//            {
-//
-//            }
-            //质控科任务分配列表是任务类型是质控科的任务与科室无关
-            return getCheckList(checkJobVO);
-        }
-        //临床科室监管人员 或 院级监管人员
-        else if (searchRoleIds.contains(CheckerRoleEnum.DEPT_SUPERVISOR.getKey() * 1l)
-                || searchRoleIds.contains(CheckerRoleEnum.HOSP_SUPERVISOR.getKey() * 1l)) {
-            //临床科室
-            if (CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() == Integer.parseInt(checkJobVO.getJobType())) {
-                //获取当前用户科室
-                if(ListUtil.isEmpty(checkJobVO.getDepts())){
-                    List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
-                            .eq("is_deleted", IsDeleteEnum.N.getKey())
-                            .eq("hospital_id", hospitalId)
-                            .eq("user_id", principleId)
-                    ).stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
-                    checkJobVO.setDepts(deptIds);
-                }
-                //如果没有添加医疗组筛选条件默认筛选全部医疗组
-                List<String> codes = null;
-                if (ListUtil.isEmpty(checkJobVO.getMedoups())) {
-                    //通过科室获取医疗组
-                    List<DeptMedoup> deptMedoups = deptMedoupService.list(new QueryWrapper<DeptMedoup>()
-                            .eq("is_deleted", IsDeleteEnum.N.getKey())
-                            .in("dept_id", checkJobVO.getDepts()));
-                    if (ListUtil.isNotEmpty(deptMedoups)) {
-                        codes = deptMedoups.stream().map(DeptMedoup::getMedoupCode).collect(Collectors.toList());
-                    }
-                } else {
-                    codes = checkJobVO.getMedoups();
-                }
-                if (ListUtil.isNotEmpty(codes)) {
-                    List<BasDoctorInfo> basDoctorInfos = basDoctorInfoFacade.list(new QueryWrapper<BasDoctorInfo>()
-                            .eq("is_deleted", IsDeleteEnum.N.getKey())
-                            .in("group_id", codes)
-                            .or().isNull("group_id")
-                            .in(ListUtil.isNotEmpty(checkJobVO.getDepts()),"dept_id",checkJobVO.getDepts()));
-                    checkJobVO.setDoctorIds(basDoctorInfos.stream().map(BasDoctorInfo::getDoctorId).collect(Collectors.toList()));
-                }
-                //通过主治医生去查,病区、科室、医疗组不作为筛选条件
-//                checkJobVO.setDepts(null);
-                checkJobVO.setWards(null);
-//                checkJobVO.setMedoups(null);
-                return getCheckList(checkJobVO);
-            }
-            return getCheckList(checkJobVO);
-        } else {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户的角色和任务类型不对应!");
-        }
-    }
-
-    /**
-     * @Author songxl
-     * @Description 待分配列表页面校验
-     * @time: 2024/5/18
-     * @Param [checkJobVO]
-     * @Return void
-     * @MethodName userCheckPageSet
-     */
-    private void userCheckPageSet(CheckJobPageVO checkJobVO) {
-        if (StringUtil.isBlank(checkJobVO.getStartTime()) && StringUtil.isBlank(checkJobVO.getEndTime())
-                && StringUtil.isBlank(checkJobVO.getBehosDateStart()) && StringUtil.isBlank(checkJobVO.getBehosDateEnd())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有时间区间!");
-        }
-        if (StringUtil.isBlank(checkJobVO.getJobType())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有任务类型!");
-        }
-        if (StringUtil.isNotBlank(checkJobVO.getBehosDateStart()) && StringUtil.isNotBlank(checkJobVO.getBehosDateEnd())) {
-            if (DateUtil.after(DateUtil.parseDate(checkJobVO.getBehosDateStart()),
-                    DateUtil.parseDate(checkJobVO.getBehosDateEnd()))) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
-            }
-        }
-        if (StringUtil.isNotBlank(checkJobVO.getStartTime()) && StringUtil.isNotBlank(checkJobVO.getEndTime())) {
-            if (DateUtil.after(DateUtil.parseDate(checkJobVO.getStartTime()),
-                    DateUtil.parseDate(checkJobVO.getEndTime()))) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "任务生成的开始时间必须小于结束时间!");
-            }
-        }
-
-    }
-
-    /**
-     * @Author songxl
-     * @Description 获取操作用户的核查科室以及科室核查人员
-     * @time: 2024/5/14
-     * @Param []
-     * @Return java.util.Map<java.lang.String, java.util.List < com.diagbot.dto.CheckDeptDTO>>
-     * @MethodName getCheckUserMap
-     */
-    public Map<String, List<CheckWardDTO>> getCheckUserMap() {
-
-        //1.获取当前用户对应的管理员角色
-        //获取人员id 和 该人员的医院id
-        Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
-        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
-        //获取核查监管相关角色id
-        List<Long> checkRoleIds = sysRoleFacade.list(new QueryWrapper<SysRole>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .like("name", "监管人员")
-        ).stream().map(SysRole::getId).collect(Collectors.toList());
-        //查询该角色的所有角色id
-        List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("user_id", principleId)
-        ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
-        List<Long> searchRoleIds = new ArrayList<>();
-        //当前用户是监管人员或者是超级管理员
-        if (roleIds.contains(-1L)) {
-            searchRoleIds.addAll(checkRoleIds);
-        } else {
-            searchRoleIds.addAll(containsRole(checkRoleIds, roleIds));
-        }
-        if (searchRoleIds.isEmpty()) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户不是核查监管人员!");
-        }
-        //2.获取相应角色对应的科室以及核查人员
-        Map<String, List<CheckWardDTO>> checkUserMap = getCheckRoleMap(searchRoleIds, hospitalId, principleId);
-        return checkUserMap;
-    }
-
-    /**
-     * @Author songxl
-     * @Description 获取相应角色对应的科室以及核查人员
-     * @time: 2024/5/14
-     * @Param [searchRoleIds]
-     * @Return java.util.Map<java.lang.String, java.util.List < java.util.Map < java.lang.String, java.lang.Object>>>
-     * @MethodName getCheckRoleMap
-     */
-
-    private Map<String, List<CheckWardDTO>> getCheckRoleMap(List<Long> searchRoleIds, Long hospitalId, Long principleId) {
-        Map<String, List<CheckWardDTO>> checkRoleMap = new HashMap<>();
-        for (Long id : searchRoleIds) {
-            try {
-                //不同角色不同查询方式
-                switch (id.intValue()) {
-                    //临床科室监管人员
-                    case 4:
-                        getDeptCheckInfo(checkRoleMap, hospitalId, principleId);
-                        break;
-                    //质控科监管人员
-                    case 5:
-//                        getZKKCheckInfo(checkRoleMap, hospitalId, principleId);
-                        checkRoleMap.put(CheckerRoleEnum.QUAT_SUPERVISOR.getKey() + "", new ArrayList<>());
-                        break;
-                    //院级监管人员
-                    case 6:
-//                        getYQCheckInfo(checkRoleMap, hospitalId, principleId);
-                        checkRoleMap.put(CheckerRoleEnum.HOSP_SUPERVISOR.getKey() + "", new ArrayList<>());
-                        break;
-                    default:
-                        break;
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-        return checkRoleMap;
-    }
-
-    /**
-     * @Author songxl
-     * @Description 院区管理员获取管理的科室以及科室包涵质控人员
-     * @time: 2024/5/17
-     * @Param [checkRoleMap, hospitalId, principleId]
-     * @Return void
-     * @MethodName getYQCheckInfo
-     */
-    private void getYQCheckInfo(Map<String, List<CheckDeptDTO>> checkRoleMap, Long hospitalId, Long principleId) {
-        //1.获取院级质控人员有哪些
-        //1.1获取院级质控人员角色id
-        CheckUserVO checkUserVOS = new CheckUserVO();
-        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l));
-        checkUserVOS.setDeptStations(Lists.newArrayList("住院"));
-        checkUserVOS.setHospitalId(hospitalId);
-        List<DeptCheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
-        //2.用户科室整合
-        margeDept(checkRoleMap, checkUserDTOS, CheckerRoleEnum.HOSP_SUPERVISOR.getKey() + "");
-        if (!ListUtil.isEmpty(checkRoleMap.get(CheckerRoleEnum.HOSP_SUPERVISOR.getKey() + ""))) {
-            //2.3获取所有医生信息的核查数
-            CheckUserVO checkUserVO = new CheckUserVO();
-            checkUserVO.setJobType(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey());
-            //通过核查人员id获取核查人员的核查任务数
-            List<DeptCheckUserDTO> userJobs = baseMapper.getDeptJobNumByUserId(checkUserVO);
-            addCheckInfoMaps(checkRoleMap, null, userJobs, checkUserDTOS, CheckerRoleEnum.HOSP_SUPERVISOR.getKey(), CheckJobTypeEnum.HOSP_SUPERVISOR.getKey());
-        } else {
-            checkRoleMap.put(CheckerRoleEnum.HOSP_SUPERVISOR.getKey() + "", new ArrayList<>());
-        }
-
-    }
-
-    /**
-     * @Author songxl
-     * @Description 院区人员用户科室合并
-     * @time: 2024/6/1
-     * @Param [checkRoleMap, checkUserDTOS, s]
-     * @Return void
-     * @MethodName margeDept
-     */
-    private void margeDept(Map<String, List<CheckDeptDTO>> checkRoleMap, List<DeptCheckUserDTO> checkUserDTOS, String roleId) {
-        if (ListUtil.isEmpty(checkUserDTOS)) {
-            return;
-        }
-        Set<String> userIds = checkUserDTOS.stream().map(DeptCheckUserDTO::getDoctorId).collect(Collectors.toSet());
-        try {
-            List<CheckDeptDTO> tempDepts = new ArrayList<>();
-            //全部
-            CheckDeptDTO allCheckDept = new CheckDeptDTO();
-            allCheckDept.setDeptId("-1");
-            allCheckDept.setDeptName("全部");
-            userIds.stream().forEach(userId -> {
-                //获取该用户的科室拼接
-                StringBuilder deptIdBuilder = new StringBuilder();
-                StringBuilder deptNameBuilder = new StringBuilder();
-                StringBuilder userName = new StringBuilder();
-                checkUserDTOS.stream().forEach(checkUserDTO -> {
-                    if (userId.equals(checkUserDTO.getDoctorId())) {
-                        deptIdBuilder.append(checkUserDTO.getDeptId()).append(",");
-                        deptNameBuilder.append(checkUserDTO.getDeptName()).append(",");
-                        if (userName.length() == 0) {
-                            userName.append(checkUserDTO.getDoctorName());
-                        }
-                        //除了全部以外添加科室信息
-                        if (!tempDepts.stream().map(CheckDeptDTO::getDeptId).collect(Collectors.toList())
-                                .contains(checkUserDTO.getDeptId())) {
-                            CheckDeptDTO oneCheckUser = new CheckDeptDTO();
-                            oneCheckUser.setDeptId(checkUserDTO.getDeptId());
-                            oneCheckUser.setDeptName(checkUserDTO.getDeptName());
-                            tempDepts.add(oneCheckUser);
-                        }
-                    }
-                });
-
-                //合并科室
-                String deptId = deptIdBuilder.substring(0, deptIdBuilder.length() - 1);
-                String deptName = deptNameBuilder.substring(0, deptNameBuilder.length() - 1);
-                //科室用户
-                DeptCheckUserDTO deptCheckUserDTO = new DeptCheckUserDTO();
-                deptCheckUserDTO.setDoctorId(userId);
-                deptCheckUserDTO.setDoctorName(userName.toString());
-                deptCheckUserDTO.setDeptId(deptId);
-                deptCheckUserDTO.setDeptName(deptName);
-                AtomicBoolean hasFlag = new AtomicBoolean(false);
-                //全部处理
-//                if (ListUtil.isEmpty(allCheckDept.getDeptcheckUsers())) {
-//                    allCheckDept.getDeptcheckUsers().add(deptCheckUserDTO);
-//                }
-//                allCheckDept.getDeptcheckUsers().forEach(oneDeptCheckUser -> {
-//                    if (!userId.equals(oneDeptCheckUser.getDoctorId())) {
-//                        hasFlag.set(true);
-//                    }
-//                });
-//                if (hasFlag.get()) {
-//                    allCheckDept.getDeptcheckUsers().add(deptCheckUserDTO);
-//                }
-//
-//                tempDepts.stream().forEach(checkDeptDTO -> {
-//                    if (deptId.contains(checkDeptDTO.getDeptId())) {
-//                        checkDeptDTO.getDeptcheckUsers().add(deptCheckUserDTO);
-//                    }
-//                });
-            });
-            tempDepts.add(0, allCheckDept);
-            checkRoleMap.put(roleId + "", tempDepts);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-    }
-
-    /**
-     * @Author songxl
-     * @Description 质控科管理员获取管理的科室以及科室包涵质控人员
-     * @time: 2024/5/17
-     * @Param [checkRoleMap, hospitalId, principleId]
-     * @Return void
-     * @MethodName getZKKCheckInfo
-     */
-    private void getZKKCheckInfo(Map<String, List<CheckDeptDTO>> checkRoleMap, Long hospitalId, Long principleId) {
-        //1.获取质控科id
-        BasDeptInfo deptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .eq("station", "质管"));
-        if (deptInfo == null || deptInfo.getDeptId() == null) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在,请联系管理员!");
-        }
-//        //2.获取监管人员所在科室集合
-//        List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
-//                .eq("is_deleted", IsDeleteEnum.N.getKey())
-//                .eq("hospital_id",hospitalId)
-//                .eq("user_id",principleId)
-//        ).stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
-//        //3.判断这个人是否在质控科
-//        if(deptIds.contains(zkkDeptId))
-//        {
-//
-//
-//        }
-        CheckUserVO checkUserVOS = new CheckUserVO();
-        //质管科人员角色
-        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l));
-        //质管科
-        checkUserVOS.setDeptStations(Lists.newArrayList("质管"));
-        checkUserVOS.setDeptIds(Lists.newArrayList(deptInfo.getDeptId()));
-        checkUserVOS.setHospitalId(hospitalId);
-        List<DeptCheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
-        //2.1获取科室详情
-        Map<String, String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .in("dept_id", Lists.newArrayList(deptInfo.getDeptId()))).stream()
-                .collect(Collectors.toMap(BasDeptInfo::getDeptId, BasDeptInfo::getDeptName, (v1, v2) -> v2));
-        if (deptMap != null && !deptMap.isEmpty()) {
-            //2.3获取质控科核查人员的核查数
-            List<String> doctorIds = checkUserDTOS.stream().map(DeptCheckUserDTO::getDoctorId).collect(Collectors.toList());
-            CheckUserVO checkUserVO = new CheckUserVO();
-            checkUserVO.setJobType(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey());
-            checkUserVO.setUserList(doctorIds);
-            //通过核查人员id获取核查人员的核查任务数
-            List<DeptCheckUserDTO> userJobs = baseMapper.getDeptJobNumByUserId(checkUserVO);
-            userJobs.stream().forEach(deptCheckUserDTO -> {
-                deptCheckUserDTO.setDeptId(deptInfo.getDeptId());
-            });
-            addCheckInfoMaps(checkRoleMap, deptMap, userJobs, checkUserDTOS, CheckerRoleEnum.QUAT_SUPERVISOR.getKey(), CheckJobTypeEnum.QUAT_SUPERVISOR.getKey());
-        } else {
-            checkRoleMap.put(CheckerRoleEnum.QUAT_SUPERVISOR.getKey() + "", new ArrayList<>());
-        }
-
-    }
-
-    /**
-     * @Author songxl
-     * @Description 临床科室管理员获取管理的科室以及科室包涵质控人员
-     * @time: 2024/5/17
-     * @Param [checkRoleMap, hospitalId, principleId]
-     * @Return void
-     * @MethodName getDeptCheckInfo
-     */
-    private void getDeptCheckInfo(Map<String, List<CheckWardDTO>> checkRoleMap, Long hospitalId, Long principleId) {
-
-        //1.获取监管人员所在科室集合
-        List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .eq("user_id", principleId)
-        ).stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
-        if (deptIds.isEmpty()) {
-            return;
-        }
-        //1.2去除质管科
-        BasDeptInfo deptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .eq("station", "质管"));
-        if (deptInfo == null || deptInfo.getDeptId() == null) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在,请联系管理员!");
-        }
-        if (StringUtil.isNotBlank(deptInfo.getDeptId())) {
-            deptIds.remove(deptInfo.getDeptId());
-        }
-        CheckUserVO checkUserVOS = new CheckUserVO();
-        //科室普通核查人员角色筛选
-        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l));
-        checkUserVOS.setDeptIds(deptIds);
-        checkUserVOS.setDeptStations(Lists.newArrayList("住院"));
-        checkUserVOS.setHospitalId(hospitalId);
-        //1.3添加筛选的病区、医疗组
-        //1.3.1通过科室获取病区
-        List<String> regionCodes = regionDeptService.list(new QueryWrapper<RegionDept>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .in("dept_id", deptIds)).stream().map(RegionDept::getRegionCode).collect(Collectors.toList());
-        checkUserVOS.setRegion(regionCodes);
-        //1.3.1获取当前科室的医疗组
-        List<String> userNames = sysUserFacade.list(new QueryWrapper<SysUser>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id", principleId)
-        ).stream().map(SysUser::getUsername).collect(Collectors.toList());
-        if (ListUtil.isNotEmpty(userNames)) {
-            //获取本人科室关联的医疗组code
-            List<DeptMedoup> deptMedoups = deptMedoupService.list(new QueryWrapper<DeptMedoup>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("dept_id", deptIds));
-            if (ListUtil.isNotEmpty(deptMedoups)) {
-                checkUserVOS.setMedoup(deptMedoups.stream().map(DeptMedoup::getMedoupCode).collect(Collectors.toList()));
-            }
-        }
-        //获取所有的科室核查人员
-        List<DeptCheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
-        //2.1获取科室详情
-        Map<String, String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .in("dept_id", deptIds)).stream()
-                .collect(Collectors.toMap(BasDeptInfo::getDeptId, BasDeptInfo::getDeptName, (v1, v2) -> v2));
-        if (deptMap != null && !deptMap.isEmpty()) {
-            //2.3获取所有医生信息的核查数
-            List<String> doctorIds = checkUserDTOS.stream().map(DeptCheckUserDTO::getDoctorId).collect(Collectors.toList());
-            CheckUserVO checkUserVO = new CheckUserVO();
-            checkUserVO.setJobType(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey());
-            checkUserVO.setUserList(doctorIds);
-//            checkUserVO.setDeptIds(deptIds);
-            //通过核查人员id获取核查人员的核查任务数
-            List<DeptCheckUserDTO> userJobs = baseMapper.getDeptJobNumByUserId(checkUserVO);
-            componentCheckInfo(checkRoleMap, checkUserDTOS, userJobs);
-//            addCheckInfoMaps(checkRoleMap, deptMap, userJobs, checkUserDTOS, CheckerRoleEnum.DEPT_SUPERVISOR.getKey(), CheckJobTypeEnum.DEPT_SUPERVISOR.getKey());
-        } else {
-            checkRoleMap.put(CheckerRoleEnum.DEPT_SUPERVISOR.getKey() + "", new ArrayList<>());
-        }
-
-
-    }
-
-    private void componentCheckInfo(Map<String, List<CheckWardDTO>> checkRoleMap, List<DeptCheckUserDTO> checkUserDTOS, List<DeptCheckUserDTO> userJobs) {
-        if (ListUtil.isNotEmpty(checkUserDTOS)) {
-            List<CheckWardDTO> outCheckWards = new ArrayList<>();
-            //核查员map
-            Map<String, Map<String, Map<String, List<DeptCheckUserDTO>>>> checkUserMap = checkUserDTOS.stream()
-                    .collect(
-                            Collectors.groupingBy(
-                                    DeptCheckUserDTO::getWardCode, //通过病区分组
-                                    Collectors.groupingBy(
-                                            DeptCheckUserDTO::getDeptId, //通过科室分组
-                                            Collectors.groupingBy(
-                                                    DeptCheckUserDTO::getMedoupCode //通过医疗组分组
-                                            )
-                                    )
-                            )
-                    );
-            //核查员任务数
-            Map<String, List<DeptCheckUserDTO>> checkUserJobMap = userJobs.stream()
-                    .collect(
-                            Collectors.groupingBy(
-                                    DeptCheckUserDTO::getDoctorId //通过医生分组
-                            )
-                    );
-
-            checkUserMap.keySet().forEach(wardCode -> {
-                //创建病区
-                CheckWardDTO checkWard = new CheckWardDTO();
-                checkWard.setWardCode(wardCode);
-                checkWard.setCheckDepts(new ArrayList<>());
-
-                checkUserMap.get(wardCode).keySet().forEach(deptId -> {
-                    //创建科室
-                    CheckDeptDTO checkDept = new CheckDeptDTO();
-                    checkDept.setDeptId(deptId);
-                    checkDept.setCheckMedoups(new ArrayList<>());
-
-                    checkUserMap.get(wardCode).get(deptId).keySet().forEach(medoupCode -> {
-                        //创建医疗组
-                        CheckMedoupDTO checkMedoup = new CheckMedoupDTO();
-                        checkMedoup.setMedoupCode(medoupCode);
-                        checkMedoup.setDeptcheckUsers(new ArrayList<>());
-
-                        checkUserMap.get(wardCode).get(deptId).get(medoupCode).forEach(deptCheckUserDTO -> {
-                            if (checkUserJobMap.keySet().contains(deptCheckUserDTO.getDoctorId())) {
-                                //添加任务数
-                                checkUserJobMap.get(deptCheckUserDTO.getDoctorId()).forEach(userJob -> {
-                                    //判断同一人
-                                    if (deptCheckUserDTO.getDoctorId().equals(userJob.getDoctorId())) {
-                                        if (userJob.getStatus() == 0) {
-                                            deptCheckUserDTO.setJobNum(userJob.getJobNum());
-                                        }
-                                        if (userJob.getStatus() == 1) {
-                                            deptCheckUserDTO.setCheckNum(userJob.getJobNum());
-                                        }
-                                    }
-                                });
-                            }
-                            //返回结果拼装
-                            //病区名称
-                            checkWard.setWardName(deptCheckUserDTO.getWardName());
-                            //科室名称
-                            checkDept.setDeptName(deptCheckUserDTO.getDeptName());
-                            //医疗组名称
-                            checkMedoup.setMedoupName(deptCheckUserDTO.getMedoupName());
-                            checkMedoup.getDeptcheckUsers().add(deptCheckUserDTO);
-                        });
-                        checkDept.getCheckMedoups().add(checkMedoup);
-                    });
-                    //添加科室
-                    checkWard.getCheckDepts().add(checkDept);
-                });
-                //添加病区
-                outCheckWards.add(checkWard);
-            });
-            checkRoleMap.put(CheckerRoleEnum.DEPT_SUPERVISOR.getKey() + "", outCheckWards);
-        } else {
-            checkRoleMap.put(CheckerRoleEnum.DEPT_SUPERVISOR.getKey() + "", new ArrayList<>());
-        }
-    }
-
-    /**
-     * @Author songxl
-     * @Description 拼装科室、核查人员、任务数对象
-     * @time: 2024/5/17
-     * @Param [checkRoleMap, doctorInfos, userJobs, deptInfos, roleId]
-     * @Return void
-     * @MethodName addCheckInfoMap
-     */
-    private void addCheckInfoMaps(Map<String, List<CheckDeptDTO>> checkRoleMap, Map<String, String> deptMap,
-                                  List<DeptCheckUserDTO> userJobs, List<DeptCheckUserDTO> checkUserDTOS, int roleId, int jobType) {
-        //非院区任务
-        if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() != jobType) {
-            if (deptMap.isEmpty() || checkUserDTOS.isEmpty()) {
-                return;
-            }
-            checkRoleMap.put(roleId + "", new ArrayList<>());
-            //遍历科室
-            for (String deptId : deptMap.keySet()) {
-                //科室对象
-                CheckDeptDTO checkDeptDTO = new CheckDeptDTO();
-                checkDeptDTO.setDeptId(deptId);
-                checkDeptDTO.setDeptName(deptMap.get(deptId));
-//                checkDeptDTO.setDeptcheckUsers(new ArrayList<DeptCheckUserDTO>());
-                //遍历医生
-                for (DeptCheckUserDTO checkUserDTO : checkUserDTOS) {
-                    //同一科室
-                    if (checkDeptDTO.getDeptId().equals(checkUserDTO.getDeptId())) {
-                        DeptCheckUserDTO deptCheckUserDTO = new DeptCheckUserDTO();
-                        deptCheckUserDTO.setDeptId(checkUserDTO.getDeptId());
-                        deptCheckUserDTO.setDeptName(checkUserDTO.getDeptName());
-                        deptCheckUserDTO.setDoctorId(checkUserDTO.getDoctorId());
-                        deptCheckUserDTO.setDoctorName(checkUserDTO.getDoctorName());
-//                        checkDeptDTO.getDeptcheckUsers().add(deptCheckUserDTO);
-                    }
-                }
-//                for (DeptCheckUserDTO deptCheckUserDTO : checkDeptDTO.getDeptcheckUsers()) {
-//                    //遍历数量
-//                    for (DeptCheckUserDTO jobNumDto : userJobs) {
-//                        //这个科室有这个人
-//                        if (deptCheckUserDTO.getDeptId().equals(jobNumDto.getDeptId())) {
-//                            if (deptCheckUserDTO.getDoctorId().equals(jobNumDto.getDoctorId())) {
-//                                if (jobNumDto.getStatus() == 0) {
-//                                    deptCheckUserDTO.setJobNum(jobNumDto.getJobNum());
-//                                }
-//                                if (jobNumDto.getStatus() == 1) {
-//
-//                                    deptCheckUserDTO.setCheckNum(jobNumDto.getJobNum());
-//                                }
-//                            }
-//
-//                        }
-//                    }
-//                }
-                checkRoleMap.get(roleId + "").add(checkDeptDTO);
-            }
-        }
-        //院区任务不是同一科室的人员数量增加
-//        else if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() == jobType) {
-//            checkRoleMap.get(roleId + "").stream().forEach(checkDeptDTO -> {
-//                if (!ListUtil.isEmpty(checkDeptDTO.getDeptcheckUsers())) {
-//                    checkDeptDTO.getDeptcheckUsers().stream().forEach(deptCheckUser -> {
-//                        userJobs.stream().forEach(userJob -> {
-//                            if (deptCheckUser.getDoctorId().equals(userJob.getDoctorId())) {
-//                                if (userJob.getStatus() == 0) {
-//                                    deptCheckUser.setJobNum(userJob.getJobNum());
-//                                }
-//                                if (userJob.getStatus() == 1) {
-//                                    deptCheckUser.setCheckNum(userJob.getJobNum());
-//                                }
-//                            }
-//                        });
-//                    });
-//                }
-//            });
-//        }
-    }
-
-
-    /**
-     * @Author songxl
-     * @Description list求交集
-     * @time: 2024/5/14
-     * @Param [checkRoleIds, roleIds]
-     * @Return java.util.List<java.lang.Long>
-     * @MethodName containsRole
-     */
-    private List<Long> containsRole(List<Long> checkRoleIds, List<Long> roleIds) {
-
-        List<Long> searchRoleIds = new ArrayList<>();
-        for (Long id : roleIds) {
-            if (checkRoleIds.contains(id)) {
-                searchRoleIds.add(id);
-            }
-        }
-        return searchRoleIds;
-    }
-
-    /**
-     * @Author songxl
-     * @Description 分配/取消核查任务
-     * @time: 2024/5/17
-     * @Param [distributionJobVO]
-     * @Return boolean
-     * @MethodName distributionJobs
-     */
-    public boolean distributionJobs(DistributionJobVO distributionJobVO) {
-
-        //1非空校验
-        if (StringUtil.isBlank(distributionJobVO.getCheckId()) ||
-                StringUtil.isBlank(distributionJobVO.getCheckName()) ||
-                StringUtil.isBlank(distributionJobVO.getDistributionType()) ||
-                distributionJobVO.getBehospitalCodes() == null ||
-                distributionJobVO.getBehospitalCodes().isEmpty()) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "入参为空");
-        }
-        if (StringUtil.isBlank(distributionJobVO.getCheckDept())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "核查人科室(checkDept)为空");
-        }
-        if (distributionJobVO.getBehospitalDepts() == null
-                || distributionJobVO.getBehospitalDepts().isEmpty()) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "核查任务科室集合(behospitalDepts)为空");
-        }
-        if (StringUtil.isEmpty(distributionJobVO.getJobType())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "核查任务类型(jobType)为空");
-        }
-        //全院的话要判断院级核查人员和核查病历不是同一科室
-        if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() == Integer.parseInt(distributionJobVO.getJobType())) {
-            for (String deptId : distributionJobVO.getCheckDept().split(",")) {
-                if (distributionJobVO.getBehospitalDepts().contains(deptId)) {
-                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "院级核查人员和核查病历是同一科室");
-                }
-            }
-
-        }
-        //获取人员id 和 该人员的医院id
-        Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
-        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
-        //2.获取任务类型 0分配 1取消
-        String distributionType = distributionJobVO.getDistributionType();
-        //3 分配
-        if (StringUtil.isNotBlank(distributionType) && "0".equals(distributionType)) {
-            //3.1 任务未分配校验
-            List<String> distributionNames = this.list(new QueryWrapper<MedCheckInfo>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", hospitalId)
-                    .in("behospital_code", distributionJobVO.getBehospitalCodes())
-            ).stream().filter(s -> s.getJobDistributionName() != null).map(MedCheckInfo::getJobDistributionName)
-                    .collect(Collectors.toList());
-            if (distributionNames != null && distributionNames.size() > 0) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "待分配任务列表存在已分配任务!");
-            }
-
-            //获取分配用户信息
-            QueryWrapper<SysUser> userQuer = new QueryWrapper<>();
-            userQuer.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("id", principleId)
-                    .eq("status", 1);
-            SysUser user = sysUserFacade.getOne(userQuer);
-            String principleName = user.getLinkman();
-            //用户名称如果是null(目的:分配用户名为null表示用户未分配)
-            if (principleName == null) {
-                principleName = "";
-            }
-            Date now = DateUtil.now();
-            //3.2分配核查任务
-            return this.update(new UpdateWrapper<MedCheckInfo>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", hospitalId)
-                    .in("behospital_code", distributionJobVO.getBehospitalCodes())
-                    .set("job_distributor", principleId)
-                    .set("job_distribution_name", principleName)
-                    .set("check_id", distributionJobVO.getCheckId())
-                    .set("check_name", distributionJobVO.getCheckName())
-                    .set("job_distribution_time", now));
-
-        }
-        //4 取消分配
-        else if (StringUtil.isNotBlank(distributionType) && "1".equals(distributionType)) {
-            //4.1 任务已取消校验
-            Set<Long> checkIds = this.list(new QueryWrapper<MedCheckInfo>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", hospitalId)
-                    .in("behospital_code", distributionJobVO.getBehospitalCodes())
-            ).stream().map(MedCheckInfo::getCheckId).collect(Collectors.toSet());
-            //4.2获取出来的核查用户存在但不是一个
-            if (checkIds == null || checkIds.isEmpty() ||
-                    (checkIds.size() != 1 && checkIds.contains(distributionJobVO.getCheckId()))) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "待取消分配任务列表不存在或存在不是该用户的任务!");
-            } else {
-                Date now = DateUtil.now();
-                //4.3取消分配
-                Long a = null;
-                return this.update(new UpdateWrapper<MedCheckInfo>()
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", hospitalId)
-                        .eq("check_id", distributionJobVO.getCheckId())
-                        .in("behospital_code", distributionJobVO.getBehospitalCodes())
-                        .set("job_distributor", a)
-                        .set("job_distribution_name", a)
-                        .set("check_id", a)
-                        .set("check_name", a)
-                        .set("job_distribution_time", now));
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * @Author songxl
-     * @Description 获取指定核查人员的核查任务
-     * @time: 2024/5/17
-     * @Param [checkJobVO]
-     * @Return java.util.List<com.diagbot.dto.CheckJobDTO>
-     * @MethodName getCheckListByUserId
-     */
-    public IPage<CheckJobDTO> getCheckListByUserId(CheckJobPageVO checkJobVO) {
-        //非空校验
-        if (StringUtil.isBlank(checkJobVO.getCheckId())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有传核查用户id!");
-        }
-        IPage<CheckJobDTO> checkJobDTOS = baseMapper.getCheckListByUserId(checkJobVO);
-        //获取当前登录人员
-        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
-        List<CheckJobDTO> outCheckJobDTOS = new ArrayList<>();
-        //判断分配人员是否是当前人员
-        for (CheckJobDTO checkJobDTO : checkJobDTOS.getRecords()) {
-            if (principleId.equals(checkJobDTO.getJobDistributor())) {
-                checkJobDTO.setDelFlag(true);
-            } else {
-                checkJobDTO.setDelFlag(false);
-            }
-            outCheckJobDTOS.add(checkJobDTO);
-        }
-        checkJobDTOS.setRecords(outCheckJobDTOS);
-        return checkJobDTOS;
-    }
-}

+ 0 - 492
src/main/java/com/diagbot/facade/MedCheckWorkFacade.java

@@ -1,492 +0,0 @@
-package com.diagbot.facade;
-
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.BasDeptInfoDTO;
-import com.diagbot.dto.BehospitalInfoAgeDTO;
-import com.diagbot.dto.CheckWorkDTO;
-import com.diagbot.dto.MedicalRecordDTO;
-import com.diagbot.dto.MedoupDTO;
-import com.diagbot.dto.RegionDTO;
-import com.diagbot.dto.RegionMedoupDTO;
-import com.diagbot.entity.BasDoctorInfo;
-import com.diagbot.entity.DeptMedoup;
-import com.diagbot.entity.MedBehospitalType;
-import com.diagbot.entity.MedCheckInfo;
-import com.diagbot.entity.Medoup;
-import com.diagbot.entity.Region;
-import com.diagbot.entity.RegionDept;
-import com.diagbot.entity.SysTaskCron;
-import com.diagbot.entity.SysUser;
-import com.diagbot.enums.CheckJobTypeEnum;
-import com.diagbot.enums.CheckerRoleEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.impl.DeptMedoupServiceImpl;
-import com.diagbot.service.impl.MedBehospitalTypeServiceImpl;
-import com.diagbot.service.impl.MedCheckInfoServiceImpl;
-import com.diagbot.service.impl.MedicalRecordServiceImpl;
-import com.diagbot.service.impl.MedoupServiceImpl;
-import com.diagbot.service.impl.RegionDeptServiceImpl;
-import com.diagbot.service.impl.RegionServiceImpl;
-import com.diagbot.util.DateUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.SpringContextUtil;
-import com.diagbot.util.StringUtil;
-import com.diagbot.util.SysUserUtils;
-import com.diagbot.vo.CheckWorkPageVO;
-import com.diagbot.vo.MedCheckWorkAddVO;
-import com.diagbot.vo.RecordTypeVO;
-import com.diagbot.vo.SysUserBaseVO;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-
-/**
- * @author songxl
- * @time: 2024-05-11
- */
-@Slf4j
-@Component
-public class MedCheckWorkFacade {
-    @Autowired
-    SysUserFacade sysUserFacade;
-    @Autowired
-    private MedCheckInfoServiceImpl medCheckInfoServiceImpl;
-    @Autowired
-    private MedCheckInfoFacade medCheckInfoFacade;
-    @Autowired
-    private MedBehospitalTypeServiceImpl medBehospitalTypeServiceImpl;
-    @Autowired
-    private MedicalRecordServiceImpl medicalRecordServiceImpl;
-    @Autowired
-    private SysTaskCronFacade sysTaskCronFacade;
-    @Autowired
-    private BehospitalInfoFacade behospitalInfoFacade;
-    @Autowired
-    private RegionDeptServiceImpl regionDeptService;
-    @Autowired
-    private RegionServiceImpl regionService;
-    @Autowired
-    private DeptMedoupServiceImpl deptMedoupService;
-    @Autowired
-    private MedoupServiceImpl medoupService;
-    @Autowired
-    private BasDoctorInfoFacade medoupUserService;
-    @Autowired
-    private BasDoctorInfoFacade basDoctorInfoFacade;
-    @Autowired
-    private SysHospitalSetFacade sysHospitalSetFacade;
-
-    /**
-     * @Author songxl
-     * @Description 批量操作核查任务(增加和删除)
-     * @time: 2024/5/11
-     * @Param [medCheckWorkVO]
-     * @Return java.lang.Boolean
-     * @MethodName addCheck
-     */
-    public Boolean addCheckWork(MedCheckWorkAddVO medCheckWorkVO) {
-
-        boolean flag = false;
-        Date now = DateUtil.now();
-        //获取核查任务类型(0-科室任务 1-院级 2-质控科)
-        Integer workType = medCheckWorkVO.getJobType();
-        //获取操作类型(0-取消,1-添加)
-        Integer checkStatus = medCheckWorkVO.getCheckStatus();
-        Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
-        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
-        SysUser user = sysUserFacade.getOne(new QueryWrapper<SysUser>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id", principleId)
-                .eq("status", 1));
-        String principleName = user.getLinkman();
-        //取消核查任务【操作类型(0-取消,1-添加)】
-        if (checkStatus != null && checkStatus == 0) {
-            //判断核查任务是否生成
-            QueryWrapper<MedCheckInfo> medicalRecordQe = new QueryWrapper<>();
-            medicalRecordQe.eq("hospital_id", hospitalId);
-            medicalRecordQe.eq("is_deleted", IsDeleteEnum.N.getKey());
-            if (medCheckWorkVO.getBehospitalCodeList().size() > 0) {
-                medicalRecordQe.in("behospital_code", medCheckWorkVO.getBehospitalCodeList());
-            }
-            List<MedCheckInfo> list = medCheckInfoFacade.list(medicalRecordQe);
-            if (ListUtil.isEmpty(list)) {
-                throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL, "存在未生成核查任务!");
-            }
-
-            //创建用户集合
-            Set<Long> creaters = list.stream().map(MedCheckInfo::getJobCreator).collect(Collectors.toSet());
-            if (creaters != null) {
-                //移除当前用户如果还有其他用户
-                creaters.remove(principleId);
-                if (creaters.size() > 0) {
-                    throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL, "无法取消他人生成任务!");
-                }
-            }
-            int i = medCheckInfoFacade.getBaseMapper().deleteBatchCodes(medCheckWorkVO.getBehospitalCodeList());
-            if (i != 0) {
-                return true;
-            }
-        } else if (checkStatus != null && checkStatus == 1) {
-            //生成核查任务
-            MedCheckInfo data = medCheckInfoFacade.getOne(new QueryWrapper<MedCheckInfo>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", hospitalId)
-                    .in("behospital_code", medCheckWorkVO.getBehospitalCodeList())
-            );
-            //任务是否存在
-            if (data != null) {
-                throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL, "核查任务已存在!");
-            }
-
-            //该病历没有核查的时候, 就添加核查记录
-            List<MedCheckInfo> medCheckInfoList = new ArrayList<>();
-            for (String behospitalCode : medCheckWorkVO.getBehospitalCodeList()) {
-                MedCheckInfo medCheckInfo = new MedCheckInfo();
-                medCheckInfo.setIsDeleted(IsDeleteEnum.N.getKey());
-                medCheckInfo.setGmtCreate(now);
-                medCheckInfo.setBehospitalCode(behospitalCode);
-                medCheckInfo.setHospitalId(hospitalId);
-                medCheckInfo.setCheckType(medCheckWorkVO.getCheckType());
-                medCheckInfo.setJobCreator(principleId);
-                medCheckInfo.setJobCreatorName(principleName);
-                medCheckInfo.setJobCreateTime(now);
-                medCheckInfo.setJobType(medCheckWorkVO.getJobType());
-                medCheckInfoList.add(medCheckInfo);
-            }
-            flag = medCheckInfoServiceImpl.saveBatch(medCheckInfoList);
-        }
-        return flag;
-    }
-
-    /**
-     * @Author songxl
-     * @Description 获取每日住院患者的类型(出院、病危、抢救。。。)
-     * @time: 2024/5/11
-     * @Param [param]
-     * @Return void
-     * @MethodName execute
-     */
-    public void execute(String param) {
-        JSONObject paramJson = JSONObject.parseObject(param);
-        JSONObject typeValue = paramJson.getJSONObject("typeVal");
-        JSONObject typeName = paramJson.getJSONObject("typeName");
-        int searchSize = paramJson.getInteger("searchSize");
-        int batchSize = paramJson.getInteger("batchSize");
-
-
-        //定义批量插入的集合
-        HashMap<String, MedBehospitalType> medBehospitalTypeMap = new HashMap<>();
-        //1.获取有指定文书、没有患者类型的患者数据
-        RecordTypeVO recordContentVO = new RecordTypeVO();
-        recordContentVO.setModeList(new ArrayList<>(typeValue.keySet()));
-        List<MedicalRecordDTO> medicalRecordList = medicalRecordServiceImpl.getMedicalRecord(recordContentVO);
-        if (medicalRecordList != null && !medicalRecordList.isEmpty()) {
-            getPatientRecordType(medBehospitalTypeMap, medicalRecordList, typeValue, typeName);
-        }
-        //2.批量执行插入操作
-        try {
-            if (medBehospitalTypeMap != null && medBehospitalTypeMap.size() > 0) {
-                List<MedBehospitalType> medBehospitalTypeList = new ArrayList<>(medBehospitalTypeMap.values());
-                medBehospitalTypeServiceImpl.saveOrUpdateBatch(medBehospitalTypeList, batchSize);
-            }
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * @Author songxl
-     * @Description 获取患者类型存入批量插入map
-     * @time: 2024/5/11
-     * @Param [medBehospitalTypeMap, medicalRecordList, typeValue, typeName, hospiatlId]
-     * @Return void
-     * @MethodName getPatientRecordType
-     */
-    private void getPatientRecordType(HashMap<String, MedBehospitalType> medBehospitalTypeMap,
-                                      List<MedicalRecordDTO> medicalRecordList,
-                                      JSONObject typeValue,
-                                      JSONObject typeName) {
-
-        if (medicalRecordList == null || medicalRecordList.isEmpty()) {
-            return;
-        }
-        //1.遍历查询出来的结果
-        for (MedicalRecordDTO medicalRecordDTO : medicalRecordList) {
-            //2.判断批量插入map中有没有这个患者
-            if (medBehospitalTypeMap.containsKey(medicalRecordDTO.getBehospitalCode())) {
-                //3.比较这两次的分值大小
-                int lval = medBehospitalTypeMap.get(medicalRecordDTO.getBehospitalCode()).getValue();
-                int nval = typeValue.getInteger(medicalRecordDTO.getModeId() + "");
-                if (nval > lval) {
-                    medBehospitalTypeMap.get(medicalRecordDTO.getBehospitalCode()).setValue(nval);
-                    medBehospitalTypeMap.get(medicalRecordDTO.getBehospitalCode())
-                            .setBehospitalType(typeName.getString(medicalRecordDTO.getModeId() + ""));
-                }
-            } else {
-                //4.获取分值记录这个患者
-                MedBehospitalType medBehospitalType = new MedBehospitalType();
-                medBehospitalType.setBehospitalCode(medicalRecordDTO.getBehospitalCode());
-                medBehospitalType.setBehospitalType(typeName.getString(medicalRecordDTO.getModeId() + ""));
-                medBehospitalType.setValue(typeValue.getInteger(medicalRecordDTO.getModeId() + ""));
-                medBehospitalType.setCreateTime(DateUtil.now());
-                medBehospitalType.setHospitalId(medicalRecordDTO.getHospitalId());
-                medBehospitalTypeMap.put(medicalRecordDTO.getBehospitalCode(), medBehospitalType);
-            }
-        }
-    }
-
-
-    /**
-     * 分页
-     *
-     * @param checkWorkPageVO
-     * @return
-     */
-    public IPage<CheckWorkDTO> pageFac(CheckWorkPageVO checkWorkPageVO) {
-        checkWorkPageSet(checkWorkPageVO);
-        IPage<CheckWorkDTO> res = medCheckInfoFacade.getBaseMapper().getCheckWorkPage(checkWorkPageVO);
-        if (res == null || ListUtil.isEmpty(res.getRecords())) {
-            return res;
-        }
-
-        List<String> behospitalCodes = res.getRecords().stream().map(CheckWorkDTO::getBehospitalCode).collect(Collectors.toList());
-        Map<String, BehospitalInfoAgeDTO> ageMap = behospitalInfoFacade.getBehospitalInfoAge(checkWorkPageVO.getHospitalId(), behospitalCodes).stream().collect(Collectors.toMap(i -> i.getBehospitalCode(), i -> i));
-        res.getRecords().forEach(i -> {
-            i.setAge(ageMap.get(i.getBehospitalCode()) == null ? "" : ageMap.get(i.getBehospitalCode()).getAge());
-        });
-
-        //更新delFlag
-        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
-        res.getRecords().stream().forEach(checkWorkDTO -> {
-            if (principleId.equals(checkWorkDTO.getJobCreator())) {
-                checkWorkDTO.setDelFlag(true);
-            }
-        });
-        return res;
-    }
-
-    private void checkWorkPageSet(CheckWorkPageVO checkWorkPageVO) {
-        //入参验证
-        //出院时间
-        if (null != checkWorkPageVO && null != checkWorkPageVO.getStartDate()) {
-            checkWorkPageVO.setStartDate(DateUtil.getFirstTimeOfDay(checkWorkPageVO.getStartDate()));
-        }
-        if (null != checkWorkPageVO && null != checkWorkPageVO.getEndDate()) {
-            checkWorkPageVO.setEndDate(DateUtil.getFirstTimeOfDay(DateUtil.addDay(checkWorkPageVO.getEndDate(), 1)));
-        }
-        if (null != checkWorkPageVO && null != checkWorkPageVO.getStartDate() && null != checkWorkPageVO.getEndDate()) {
-            if (DateUtil.after(checkWorkPageVO.getStartDate(), checkWorkPageVO.getEndDate())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
-            }
-        }
-        //住院天数
-        if (null != checkWorkPageVO && null != checkWorkPageVO.getSmallDay() && null != checkWorkPageVO.getBigDay()) {
-            if (checkWorkPageVO.getSmallDay() > checkWorkPageVO.getBigDay()) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "住院天数区间有误!");
-            }
-        }
-        checkWorkPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
-        //科室任务-获取本科室的用户(改为登录用户科室所在医疗组,通过医疗组获取医生再获取医生的患者)
-        if (StringUtil.isNotBlank(checkWorkPageVO.getJobType()) && (CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "").equals(checkWorkPageVO.getJobType())) {
-//            SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
-//            sysUserBaseVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
-//            List<String> deptIds = Lists.newArrayList();
-//            List<BasDeptInfoDTO> selDepts = sysUserFacade.getUserDepts(sysUserBaseVO).getSelDepts();
-//            if (ListUtil.isNotEmpty(selDepts)) {
-//                deptIds = selDepts.stream().map(i -> i.getDeptId()).collect(Collectors.toList());
-//            }
-//            if (ListUtil.isNotEmpty(checkWorkPageVO.getDepartment())) {
-//                deptIds.retainAll(checkWorkPageVO.getDepartment());
-//            }
-//            if (ListUtil.isEmpty(deptIds)) {
-//                deptIds.add("999999999999");
-//            }
-//            checkWorkPageVO.setDepartment(deptIds);
-            //如果没有添加医疗组筛选条件默认查询科室所有数据+医疗组所有人数据
-            List<String> codes = null;
-            if (ListUtil.isEmpty(checkWorkPageVO.getMedoups())) {
-                //获取当前用户科室
-                SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
-                sysUserBaseVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
-                List<String> deptIds = new ArrayList<>();
-                List<BasDeptInfoDTO> selDepts = sysUserFacade.getUserDepts(sysUserBaseVO).getSelDepts();
-                if (ListUtil.isNotEmpty(selDepts)) {
-                    deptIds = selDepts.stream().map(i -> i.getDeptId()).collect(Collectors.toList());
-                }
-                //通过科室获取医疗组
-                List<DeptMedoup> deptMedoups = deptMedoupService.list(new QueryWrapper<DeptMedoup>()
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .in("dept_id", deptIds));
-                if (ListUtil.isNotEmpty(deptMedoups)) {
-                    codes = deptMedoups.stream().map(DeptMedoup::getMedoupCode).collect(Collectors.toList());
-                }
-            } else {
-                codes = checkWorkPageVO.getMedoups();
-            }
-            if (ListUtil.isNotEmpty(codes)) {
-                List<BasDoctorInfo> basDoctorInfos = basDoctorInfoFacade.list(new QueryWrapper<BasDoctorInfo>()
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .in("group_id", codes)
-                        .or().isNull("group_id")
-                        .in(ListUtil.isNotEmpty(checkWorkPageVO.getDepts()), "dept_id", checkWorkPageVO.getDepts()));
-                checkWorkPageVO.setDoctorIds(basDoctorInfos.stream().map(BasDoctorInfo::getDoctorId).collect(Collectors.toList()));
-            }
-            //获取VIP开房病区科室id
-            String deptsStr = sysHospitalSetFacade.getValue(Long.parseLong(SysUserUtils.getCurrentHospitalID()), "check_order_info");
-            if (StringUtil.isNotEmpty(deptsStr)) {
-                checkWorkPageVO.setOrderDepts(Arrays.asList(deptsStr.split(",")));
-            }
-        }
-    }
-
-    public boolean createMedBeHospitalInfoType() {
-        //1.获取定时任务
-        SysTaskCron task = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
-                .eq("cron_code", "TASK019"), false);
-        //2.执行定时任务
-        if (null != task && StringUtil.isNotBlank(task.getCron())) {
-            try {
-                execute(task.getParam());
-            } catch (Exception e) {
-                e.printStackTrace();
-                return false;
-            }
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * @param
-     * @Description获取当前用户的病区信息
-     * @Return java.util.List<com.diagbot.dto.RegionDTO>
-     */
-    public RegionMedoupDTO getLocalRegionMedoup() {
-
-        Long userId = Long.parseLong(SysUserUtils.getCurrentPrincipleID());
-        SysUserBaseVO sysUserRoleBaseVO = new SysUserBaseVO();
-        sysUserRoleBaseVO.setUserId(userId);
-        List<Long> roleIds = sysUserFacade.getUserRoles(sysUserRoleBaseVO).getSelRoles().stream().map(i -> i.getId()).collect(Collectors.toList());
-        if (ListUtil.isEmpty(roleIds)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户无角色信息");
-        }
-        RegionMedoupDTO regionMedoup = new RegionMedoupDTO();
-        SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
-        sysUserBaseVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
-        //获取当前登录用户的科室信息
-        List<BasDeptInfoDTO> selDepts = sysUserFacade.getUserDepts(sysUserBaseVO).getSelDepts();
-        //获取科室关联的病区
-        List<RegionDTO> regions = getLocalRegion(selDepts);
-        if (ListUtil.isEmpty(regions)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户无病区关联信息");
-        }
-        regionMedoup.setRegions(regions);
-        //获取科室关联的医疗组
-        List<MedoupDTO> medoups = getLocalMdeoup(selDepts);
-        if (ListUtil.isEmpty(medoups)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前用户所属科室无医疗组关联信息");
-        }
-        regionMedoup.setMedoups(medoups);
-        //获取当前用户的医疗组信息
-        List<String> userNames = sysUserFacade.list(new QueryWrapper<SysUser>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id", SysUserUtils.getCurrentPrincipleID())
-        ).stream().map(SysUser::getUsername).collect(Collectors.toList());
-        if (ListUtil.isNotEmpty(userNames)) {
-            List<String> medoupTemps = medoupUserService.list(new QueryWrapper<BasDoctorInfo>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("doctor_id", userNames)
-            ).stream().map(BasDoctorInfo::getGroupId).collect(Collectors.toList());
-            if (ListUtil.isNotEmpty(medoups)) {
-                regionMedoup.setLocalMedoupCode(medoupTemps.get(0));
-            }
-        }
-        if (roleIds.contains(CheckerRoleEnum.DEPT_SUPERVISOR.getKey() * 1l)) {
-            regionMedoup.setShowAllFlag(true);
-        }
-        return regionMedoup;
-    }
-
-    private List<MedoupDTO> getLocalMdeoup(List<BasDeptInfoDTO> selDepts) {
-        List<MedoupDTO> medoups = new ArrayList<>();
-        if (ListUtil.isNotEmpty(selDepts)) {
-            List<String> deptIds = selDepts.stream().map(BasDeptInfoDTO::getDeptId).collect(Collectors.toList());
-            //获取本人科室关联的医疗组code
-            List<DeptMedoup> deptMedoups = deptMedoupService.list(new QueryWrapper<DeptMedoup>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("dept_id", deptIds));
-            List<String> medoupCodes = null;
-//            List<String> doctorIds = sysUserFacade.list(new QueryWrapper<SysUser>()
-//                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-//                    .eq("id", SysUserUtils.getCurrentPrincipleID())
-//            ).stream().map(SysUser::getUsername).collect(Collectors.toList());
-            if (ListUtil.isNotEmpty(deptMedoups)) {
-                medoupCodes = deptMedoups.stream().map(DeptMedoup::getMedoupCode).collect(Collectors.toList());
-//                medoupCodes = medoupUserService.list(new QueryWrapper<BasDoctorInfo>()
-//                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-//                        .in("doctor_id", doctorIds)
-//                ).stream().map(BasDoctorInfo::getGroupId).collect(Collectors.toList());
-            }
-
-            if (ListUtil.isNotEmpty(medoupCodes)) {
-                //通过code获取医疗组详情
-                if (ListUtil.isNotEmpty(medoupCodes)) {
-                    List<Medoup> medoupTemps = medoupService.list(new QueryWrapper<Medoup>()
-                            .in("code", medoupCodes)
-                            .eq("is_deleted", IsDeleteEnum.N.getKey()));
-                    if (ListUtil.isNotEmpty(medoupTemps)) {
-                        medoupTemps.stream().forEach(medoup -> {
-                            MedoupDTO MedoupDTOTemp = new MedoupDTO();
-                            BeanUtils.copyProperties(medoup, MedoupDTOTemp);
-                            medoups.add(MedoupDTOTemp);
-                        });
-                    }
-                }
-            }
-        }
-        return medoups;
-    }
-
-    private List<RegionDTO> getLocalRegion(List<BasDeptInfoDTO> selDepts) {
-        List<RegionDTO> regions = new ArrayList<>();
-        if (ListUtil.isNotEmpty(selDepts)) {
-            List<String> deptIds = selDepts.stream().map(BasDeptInfoDTO::getDeptId).collect(Collectors.toList());
-            List<RegionDept> regionDepts = regionDeptService.list(new QueryWrapper<RegionDept>()
-                    .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("dept_id", deptIds));
-            if (ListUtil.isNotEmpty(regionDepts)) {
-                List<String> regionCodes = regionDepts.stream().map(RegionDept::getRegionCode).collect(Collectors.toList());
-                if (ListUtil.isNotEmpty(regionCodes)) {
-                    List<Region> regionTemps = regionService.list(new QueryWrapper<Region>()
-                            .in("code", regionCodes)
-                            .eq("is_deleted", IsDeleteEnum.N.getKey())
-                            .eq("hospital_id", SysUserUtils.getCurrentHospitalID()));
-                    if (ListUtil.isNotEmpty(regionTemps)) {
-                        regionTemps.stream().forEach(region -> {
-                            RegionDTO RegionDTOTemp = new RegionDTO();
-                            BeanUtils.copyProperties(region, RegionDTOTemp);
-                            regions.add(RegionDTOTemp);
-                        });
-                    }
-                }
-            }
-        }
-        return regions;
-    }
-}

+ 321 - 0
src/main/java/com/diagbot/facade/MedExamineInfoFacade.java

@@ -0,0 +1,321 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.CheckDeptDTO;
+import com.diagbot.dto.CheckMedoupDTO;
+import com.diagbot.dto.DeptCheckUserDTO;
+import com.diagbot.entity.*;
+import com.diagbot.enums.CheckJobTypeEnum;
+import com.diagbot.enums.CheckTypeEnum;
+import com.diagbot.enums.CheckerRoleEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.MedExamineInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.BehospitalcodeVO;
+import com.diagbot.vo.MedCheckInfoAddVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @time: 2024-07-06 13:27
+ */
+@Component
+public class MedExamineInfoFacade extends MedExamineInfoServiceImpl {
+
+    @Autowired
+    SysUserFacade sysUserFacade;
+    @Autowired
+    MedExamineInfoFacade medExamineInfoFacade;
+
+    public boolean passAudit(BehospitalcodeVO behospitalcodeVO) {
+        Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
+        Long userId = Long.parseLong(SysUserUtils.getCurrentPrincipleID());
+
+        //获取判断是否有审核
+        QueryWrapper<MedExamineInfo> medExamineInfoQueryWrapper = new QueryWrapper<>();
+        medExamineInfoQueryWrapper.eq("behospital_code", behospitalcodeVO.getBehospitalCode());
+        medExamineInfoQueryWrapper.eq("hospital_id", hospitalId);
+//        medCheckInfoQueryWrapper.eq("check_id", userId);
+//        medCheckInfoQueryWrapper.eq("check_type", CheckTypeEnum.ALL.getKey());
+        MedExamineInfo medExamineInfo = medExamineInfoFacade.getOne(medExamineInfoQueryWrapper);
+        SysUser user = sysUserFacade.getOne(new QueryWrapper<SysUser>()
+                .eq("id", userId)
+                .eq("is_deleted", IsDeleteEnum.N.getKey()));
+        if (medExamineInfo == null) {
+            MedExamineInfo insertCheckInfo = new MedExamineInfo();
+            insertCheckInfo.setBehospitalCode(behospitalcodeVO.getBehospitalCode());
+            insertCheckInfo.setCheckId(userId);
+            if (user != null) {
+                insertCheckInfo.setCheckName(user.getLinkman());
+            }
+            insertCheckInfo.setAction(CheckTypeEnum.PASSED.getKey());
+            insertCheckInfo.setHospitalId(hospitalId);
+            insertCheckInfo.setStatus(1);
+            insertCheckInfo.setCheckTime(DateUtil.now());
+            return medExamineInfoFacade.save(insertCheckInfo);
+        }
+
+        medExamineInfo.setCheckId(userId);
+        if (user != null) {
+            medExamineInfo.setCheckName(user.getLinkman());
+        }
+        medExamineInfo.setStatus(1);
+        medExamineInfo.setCheckTime(DateUtil.now());
+        medExamineInfoFacade.updateById(medExamineInfo);
+
+        return true;
+    }
+
+    /**
+     * @param medCheckInfoAddVO
+     * @return
+     */
+    public Boolean addMedCheckInfos(MedCheckInfoAddVO medCheckInfoAddVO) {
+        boolean res = false;
+        Date now = DateUtil.now();
+        //获取人员id 和 该人员的医院id
+        Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
+        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
+        QueryWrapper<SysUser> userQuer = new QueryWrapper<>();
+        userQuer.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", principleId)
+                .eq("status", 1);
+        SysUser user = sysUserFacade.getOne(userQuer);
+        String principleName = user.getLinkman();
+        Map<String, Object> mapAll = new HashMap<String, Object>();
+        mapAll.put("is_deleted", IsDeleteEnum.N.getKey());
+        mapAll.put("behospital_code", medCheckInfoAddVO.getBehospitalCode());
+        mapAll.put("hospital_id", hospitalId);
+        mapAll.put("check_type", medCheckInfoAddVO.getCheckType());
+        QueryWrapper<MedExamineInfo> medCheckInfoQuerys = new QueryWrapper<>();
+        medCheckInfoQuerys.allEq(mapAll);
+        MedExamineInfo data = this.getOne(medCheckInfoQuerys, false);
+        if (data != null) {
+            //检验核查人是否是本人
+            if (data.getCheckId().equals(principleId)) {
+                res = saveNew(mapAll, now, hospitalId, principleId, principleName, medCheckInfoAddVO);
+            } else {
+                throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据已被人核查,您暂无权限!");
+            }
+        } else {
+            //该病历没有核查的时候, 就添加核查记录
+            MedExamineInfo medCheckInfo = new MedExamineInfo();
+            medCheckInfo.setGmtCreate(now);
+            medCheckInfo.setGmtModified(now);
+            medCheckInfo.setHospitalId(hospitalId);
+            medCheckInfo.setCheckId(principleId);
+            medCheckInfo.setCheckName(principleName);
+            medCheckInfo.setCheckTime(now);
+            medCheckInfo.setAction(medCheckInfoAddVO.getCheckType());
+            medCheckInfo.setStatus(medCheckInfoAddVO.getCheckStatus());
+            medCheckInfo.setBehospitalCode(medCheckInfoAddVO.getBehospitalCode());
+            res = this.save(medCheckInfo);
+        }
+
+        return res;
+    }
+
+    /**
+     * @param mapAll
+     * @param now
+     * @param hospitalId
+     * @param principleId
+     * @param principleName
+     * @param medCheckInfoAddVO
+     * @return
+     */
+    public boolean saveNew(Map<String, Object> mapAll, Date now, Long hospitalId, Long principleId, String principleName, MedCheckInfoAddVO medCheckInfoAddVO) {
+        boolean res = false;
+        UpdateWrapper<MedExamineInfo> medCheckInfoUpdate = new UpdateWrapper<>();
+        medCheckInfoUpdate.allEq(mapAll).set("is_deleted", IsDeleteEnum.Y.getKey()).set("gmt_modified", now);
+        res = this.update(medCheckInfoUpdate);
+        //删除原来的成功后, 再新建一条核查数据
+        if (res) {
+            MedExamineInfo medCheckInfo = new MedExamineInfo();
+            medCheckInfo.setGmtCreate(now);
+            medCheckInfo.setGmtModified(now);
+            medCheckInfo.setHospitalId(hospitalId);
+            medCheckInfo.setCheckId(principleId);
+            medCheckInfo.setCheckName(principleName);
+            medCheckInfo.setCheckTime(now);
+            medCheckInfo.setAction(medCheckInfoAddVO.getCheckType());
+            medCheckInfo.setStatus(medCheckInfoAddVO.getCheckStatus());
+            medCheckInfo.setBehospitalCode(medCheckInfoAddVO.getBehospitalCode());
+            res = this.save(medCheckInfo);
+        }
+        return res;
+    }
+
+    /**
+     * @Author songxl
+     * @Description 院区人员用户科室合并
+     * @time: 2024/6/1
+     * @Param [checkRoleMap, checkUserDTOS, s]
+     * @Return void
+     * @MethodName margeDept
+     */
+    private void margeDept(Map<String, List<CheckDeptDTO>> checkRoleMap, List<DeptCheckUserDTO> checkUserDTOS, String roleId) {
+        if (ListUtil.isEmpty(checkUserDTOS)) {
+            return;
+        }
+        Set<String> userIds = checkUserDTOS.stream().map(DeptCheckUserDTO::getDoctorId).collect(Collectors.toSet());
+        try {
+            List<CheckDeptDTO> tempDepts = new ArrayList<>();
+            //全部
+            CheckDeptDTO allCheckDept = new CheckDeptDTO();
+            allCheckDept.setDeptId("-1");
+            allCheckDept.setDeptName("全部");
+            userIds.stream().forEach(userId -> {
+                //获取该用户的科室拼接
+                StringBuilder deptIdBuilder = new StringBuilder();
+                StringBuilder deptNameBuilder = new StringBuilder();
+                StringBuilder userName = new StringBuilder();
+                checkUserDTOS.stream().forEach(checkUserDTO -> {
+                    if (userId.equals(checkUserDTO.getDoctorId())) {
+                        deptIdBuilder.append(checkUserDTO.getDeptId()).append(",");
+                        deptNameBuilder.append(checkUserDTO.getDeptName()).append(",");
+                        if (userName.length() == 0) {
+                            userName.append(checkUserDTO.getDoctorName());
+                        }
+                        //除了全部以外添加科室信息
+                        if (!tempDepts.stream().map(CheckDeptDTO::getDeptId).collect(Collectors.toList())
+                                .contains(checkUserDTO.getDeptId())) {
+                            CheckDeptDTO oneCheckUser = new CheckDeptDTO();
+                            oneCheckUser.setDeptId(checkUserDTO.getDeptId());
+                            oneCheckUser.setDeptName(checkUserDTO.getDeptName());
+                            tempDepts.add(oneCheckUser);
+                        }
+                    }
+                });
+
+                //合并科室
+                String deptId = deptIdBuilder.substring(0, deptIdBuilder.length() - 1);
+                String deptName = deptNameBuilder.substring(0, deptNameBuilder.length() - 1);
+                //科室用户
+                DeptCheckUserDTO deptCheckUserDTO = new DeptCheckUserDTO();
+                deptCheckUserDTO.setDoctorId(userId);
+                deptCheckUserDTO.setDoctorName(userName.toString());
+                deptCheckUserDTO.setDeptId(deptId);
+                deptCheckUserDTO.setDeptName(deptName);
+                AtomicBoolean hasFlag = new AtomicBoolean(false);
+                //全部处理
+//                if (ListUtil.isEmpty(allCheckDept.getDeptcheckUsers())) {
+//                    allCheckDept.getDeptcheckUsers().add(deptCheckUserDTO);
+//                }
+//                allCheckDept.getDeptcheckUsers().forEach(oneDeptCheckUser -> {
+//                    if (!userId.equals(oneDeptCheckUser.getDoctorId())) {
+//                        hasFlag.set(true);
+//                    }
+//                });
+//                if (hasFlag.get()) {
+//                    allCheckDept.getDeptcheckUsers().add(deptCheckUserDTO);
+//                }
+//
+//                tempDepts.stream().forEach(checkDeptDTO -> {
+//                    if (deptId.contains(checkDeptDTO.getDeptId())) {
+//                        checkDeptDTO.getDeptcheckUsers().add(deptCheckUserDTO);
+//                    }
+//                });
+            });
+            tempDepts.add(0, allCheckDept);
+            checkRoleMap.put(roleId + "", tempDepts);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    /**
+     * @Author songxl
+     * @Description 拼装科室、核查人员、任务数对象
+     * @time: 2024/5/17
+     * @Param [checkRoleMap, doctorInfos, userJobs, deptInfos, roleId]
+     * @Return void
+     * @MethodName addCheckInfoMap
+     */
+    private void addCheckInfoMaps(Map<String, List<CheckDeptDTO>> checkRoleMap, Map<String, String> deptMap,
+                                  List<DeptCheckUserDTO> userJobs, List<DeptCheckUserDTO> checkUserDTOS, int roleId, int jobType) {
+        //非院区任务
+        if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() != jobType) {
+            if (deptMap.isEmpty() || checkUserDTOS.isEmpty()) {
+                return;
+            }
+            checkRoleMap.put(roleId + "", new ArrayList<>());
+            //遍历科室
+            for (String deptId : deptMap.keySet()) {
+                //科室对象
+                CheckDeptDTO checkDeptDTO = new CheckDeptDTO();
+                checkDeptDTO.setDeptId(deptId);
+                checkDeptDTO.setDeptName(deptMap.get(deptId));
+//                checkDeptDTO.setDeptcheckUsers(new ArrayList<DeptCheckUserDTO>());
+                //遍历医生
+                for (DeptCheckUserDTO checkUserDTO : checkUserDTOS) {
+                    //同一科室
+                    if (checkDeptDTO.getDeptId().equals(checkUserDTO.getDeptId())) {
+                        DeptCheckUserDTO deptCheckUserDTO = new DeptCheckUserDTO();
+                        deptCheckUserDTO.setDeptId(checkUserDTO.getDeptId());
+                        deptCheckUserDTO.setDeptName(checkUserDTO.getDeptName());
+                        deptCheckUserDTO.setDoctorId(checkUserDTO.getDoctorId());
+                        deptCheckUserDTO.setDoctorName(checkUserDTO.getDoctorName());
+//                        checkDeptDTO.getDeptcheckUsers().add(deptCheckUserDTO);
+                    }
+                }
+//                for (DeptCheckUserDTO deptCheckUserDTO : checkDeptDTO.getDeptcheckUsers()) {
+//                    //遍历数量
+//                    for (DeptCheckUserDTO jobNumDto : userJobs) {
+//                        //这个科室有这个人
+//                        if (deptCheckUserDTO.getDeptId().equals(jobNumDto.getDeptId())) {
+//                            if (deptCheckUserDTO.getDoctorId().equals(jobNumDto.getDoctorId())) {
+//                                if (jobNumDto.getStatus() == 0) {
+//                                    deptCheckUserDTO.setJobNum(jobNumDto.getJobNum());
+//                                }
+//                                if (jobNumDto.getStatus() == 1) {
+//
+//                                    deptCheckUserDTO.setCheckNum(jobNumDto.getJobNum());
+//                                }
+//                            }
+//
+//                        }
+//                    }
+//                }
+                checkRoleMap.get(roleId + "").add(checkDeptDTO);
+            }
+        }
+        //院区任务不是同一科室的人员数量增加
+//        else if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() == jobType) {
+//            checkRoleMap.get(roleId + "").stream().forEach(checkDeptDTO -> {
+//                if (!ListUtil.isEmpty(checkDeptDTO.getDeptcheckUsers())) {
+//                    checkDeptDTO.getDeptcheckUsers().stream().forEach(deptCheckUser -> {
+//                        userJobs.stream().forEach(userJob -> {
+//                            if (deptCheckUser.getDoctorId().equals(userJob.getDoctorId())) {
+//                                if (userJob.getStatus() == 0) {
+//                                    deptCheckUser.setJobNum(userJob.getJobNum());
+//                                }
+//                                if (userJob.getStatus() == 1) {
+//                                    deptCheckUser.setCheckNum(userJob.getJobNum());
+//                                }
+//                            }
+//                        });
+//                    });
+//                }
+//            });
+//        }
+    }
+}

+ 44 - 8
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.*;
 import com.diagbot.entity.*;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.enums.ModeIdEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.MedQcresultCasesServiceImpl;
@@ -18,7 +17,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
-import java.math.BigDecimal;
 import java.util.*;
 
 /**
@@ -43,7 +41,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
     @Autowired
     private QcCasesEntryFacade qcCasesEntryFacade;
     @Autowired
-    private MedCheckInfoFacade medCheckInfoFacade;
+    private MedExamineInfoFacade medCheckInfoFacade;
     @Autowired
     @Qualifier("medQcresultCasesServiceImpl")
     private MedQcresultCasesServiceImpl medQcresultCasesService;
@@ -59,11 +57,33 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         if (StringUtil.isBlank(qcresultVO.getBehospitalCode())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "病历id不能为空!");
         }
+
+        Long hospitalId = qcresultVO.getHospitalId();
+        if (hospitalId == null) {
+            hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
+        }
+
+        if (null == qcresultVO.getOptResultAlgVO() || null == qcresultVO.getOptResultAlgVO().getId()) {
+            try {
+                QcresultDetail qcresultDetail
+                        = qcresultDetailServiceImpl.getOne(
+                        new QueryWrapper<QcresultDetail>()
+                                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                                .eq("hospital_id", hospitalId)
+                                .eq("behospital_code", qcresultVO.getBehospitalCode())
+                                .eq("cases_entry_id", qcresultVO.getCasesEntryId()));
+                QcResultAlgVO qcResultAlgVO = new QcResultAlgVO();
+                qcResultAlgVO.setId(qcresultDetail.getId());
+                qcresultVO.setOptResultAlgVO(qcResultAlgVO);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "操作条目不存在!");
+            }
+        }
+
         if (null == qcresultVO.getOptResultAlgVO()) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "操作条目不能为空!");
         }
-
-        Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
+//        Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
         //验证病历的存在性
         List<BehospitalInfo> behospitalInfos
                 = behospitalInfoFacade.list(
@@ -118,7 +138,6 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         analyzeDTO.setGradeType(2);
         analyzeDTO.setGradeTypeName("人工");
         analyzeDTO.setScoreRes(algorithmDTO.getScore());
-        analyzeDTO.setLevel(algorithmDTO.getLevel());
         analyzeDTO.setGradeTime(date);
         return analyzeDTO;
     }
@@ -173,7 +192,6 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         qcresultInfo.setBehospitalCode(analyzeVO.getBehospitalCode());
         qcresultInfo.setHospitalId(analyzeVO.getHospitalId());
         qcresultInfo.setScoreRes(algorithmDTO.getScore());
-        qcresultInfo.setLevel(algorithmDTO.getLevel());
         if (algorithmVO.getType().equals(0)) {
             qcresultInfo.setGradeType(1);
         } else {
@@ -212,9 +230,12 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                 }
 
                 qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
+//                        .eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", analyzeVO.getHospitalId())
+                        .eq("qcresult_info_id", qcresultInfoup.getId())
                         .eq("behospital_code", analyzeVO.getBehospitalCode())
+                        .set("grade_type", 1)
+                        .set("opt_type", 1)
                         .set("is_deleted", IsDeleteEnum.Y.getKey())
                         .set("modifier", useId)
                         .set("gmt_modified", now));
@@ -337,6 +358,21 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                     throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "delStatus参数错误");
                 }
                 break;
+            case 5:
+                //忽略条目
+                qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
+                        .eq("id", algorithmVO.getOptResultAlgVO().getId())
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("hospital_id", analyzeVO.getHospitalId())
+                        .eq("behospital_code", analyzeVO.getBehospitalCode())
+                        .set("is_deleted", IsDeleteEnum.Y.getKey())
+                        .set("grade_type", 2)
+                        .set("opt_type", 4)
+                        .set("qcresult_info_id", newId)
+                        .set("modifier", useId)
+                        .set("gmt_modified", now)
+                );
+                break;
             default:
                 /* DO NOTHING */
                 break;

+ 0 - 277
src/main/java/com/diagbot/facade/RecordCheckFacade.java

@@ -1,277 +0,0 @@
-package com.diagbot.facade;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.BehospitalInfoAgeDTO;
-import com.diagbot.dto.CheckedRecordListDTO;
-import com.diagbot.dto.SysUserDeptDTO;
-import com.diagbot.entity.BasDeptInfo;
-import com.diagbot.entity.BasDoctorInfo;
-import com.diagbot.entity.DeptMedoup;
-import com.diagbot.entity.MedBehospitalType;
-import com.diagbot.entity.MedCheckInfo;
-import com.diagbot.entity.SysRole;
-import com.diagbot.entity.SysUser;
-import com.diagbot.entity.SysUserDept;
-import com.diagbot.entity.SysUserRole;
-import com.diagbot.enums.CheckJobTypeEnum;
-import com.diagbot.enums.CheckStatusEnum;
-import com.diagbot.enums.CheckTypeEnum;
-import com.diagbot.enums.CheckerRoleEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.MedQcresultDetailService;
-import com.diagbot.service.impl.DeptMedoupServiceImpl;
-import com.diagbot.service.impl.MedBehospitalTypeServiceImpl;
-import com.diagbot.util.DateUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.StringUtil;
-import com.diagbot.util.SysUserUtils;
-import com.diagbot.vo.CheckedRecordListVO;
-import com.diagbot.vo.RecordCheckVO;
-import com.diagbot.vo.SysUserBaseVO;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.core.userdetails.User;
-import org.springframework.stereotype.Component;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * @Description:
- * @author: rengb
- * @time: 2024/5/17 18:43
- */
-@Component
-public class RecordCheckFacade {
-
-    @Autowired
-    SysUserFacade sysUserFacade;
-    @Autowired
-    SysUserDeptFacade sysUserDeptFacade;
-    @Autowired
-    SysUserRoleFacade sysUserRoleFacade;
-    @Autowired
-    SysRoleFacade sysRoleFacade;
-    @Autowired
-    MedCheckInfoFacade medCheckInfoFacade;
-    @Autowired
-    MedQcresultDetailService medQcresultDetailService;
-    @Autowired
-    BehospitalInfoFacade behospitalInfoFacade;
-    @Autowired
-    BasDeptInfoFacade basDeptInfoFacade;
-    @Autowired
-    MedBehospitalTypeServiceImpl medBehospitalTypeServiceImpl;
-    @Autowired
-    DeptMedoupServiceImpl deptMedoupService;
-    @Autowired
-    BasDoctorInfoFacade basDoctorInfoFacade;
-
-
-    public IPage<CheckedRecordListDTO> checkedRecordList(CheckedRecordListVO checkedRecordListVO) {
-        Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
-        Long userId = Long.parseLong(SysUserUtils.getCurrentPrincipleID());
-        SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
-        sysUserBaseVO.setUserId(userId);
-        List<Long> roleIds = sysUserFacade.getUserRoles(sysUserBaseVO).getSelRoles().stream().map(i -> i.getId()).collect(Collectors.toList());
-        List<String> deptIds = Lists.newArrayList();
-        SysUserDeptDTO sysUserDeptDTO = sysUserFacade.getUserDepts(sysUserBaseVO);
-        if (ListUtil.isNotEmpty(sysUserDeptDTO.getSelDepts())) {
-            deptIds.addAll(sysUserDeptDTO.getSelDepts().stream().map(i -> i.getDeptId()).collect(Collectors.toList()));
-        }
-        //1.2去除质管科
-        BasDeptInfo deptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .eq("station", "质管"));
-
-        List<Long> userIds = Lists.newArrayList();
-        List<String> JobTypes = Lists.newArrayList();
-        roleIds.forEach(roleId -> {
-            if (roleId.intValue() == CheckerRoleEnum.HOSP_SUPERVISOR.getKey()
-                    && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() + ""))) {
-                userIds.addAll(getUserIdsOfRoleId(hospitalId, null, CheckerRoleEnum.HOSP_GENERAL.getKey()));
-                JobTypes.add(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() + "");
-            } else if (roleId.intValue() == CheckerRoleEnum.QUAT_SUPERVISOR.getKey()
-                    && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + ""))) {
-                //添加质管科人员
-                if (deptInfo != null || deptInfo.getDeptId() != null) {
-                    deptIds.add(deptInfo.getDeptId());
-                }
-                userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.QUAT_GENERAL.getKey()));
-                JobTypes.add(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + "");
-            } else if (roleId.intValue() == CheckerRoleEnum.DEPT_SUPERVISOR.getKey() && ListUtil.isNotEmpty(deptIds)
-                    && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + ""))) {
-                //移除质管科人员
-                if (deptInfo != null || deptInfo.getDeptId() != null) {
-                    deptIds.remove(deptInfo.getDeptId());
-                }
-                JobTypes.add(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "");
-                userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.DEPT_GENERAL.getKey()));
-            } else if ((roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey() && ListUtil.isNotEmpty(deptIds))
-                    || roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey() || roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()) {
-                userIds.add(userId);
-            }
-        });
-
-        //如果用户是质控科核查人员,在不传入任务类型的时候要添加质控科任务类型进行筛选
-        if (roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l)) {
-            JobTypes.add(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + "");
-        }
-        if (roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l)) {
-            JobTypes.add(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "");
-        }
-        if (roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l)) {
-            JobTypes.add(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() + "");
-        }
-
-        if (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes())) {
-            checkedRecordListVO.setCheckJobTypes(JobTypes);
-        }
-        if (ListUtil.isEmpty(userIds)) {
-            userIds.add(999999999999999999l);
-        }
-        checkedRecordListVO.setCurrentDeptIds(String.join(",", deptIds));
-        checkedRecordListVO.setCurrentGeneralUserIds(userIds);
-        checkedRecordListVO.setHospitalId(hospitalId);
-
-        //通过主治医生去查,病区、科室、医疗组不作为筛选条件
-//        checkedRecordListVO.setDepts(null);
-//        checkedRecordListVO.setWards(null);
-//        checkedRecordListVO.setMedoups(null);
-        IPage<CheckedRecordListDTO> iPage = medCheckInfoFacade.getBaseMapper().checkedRecordList(checkedRecordListVO);
-
-        if (ListUtil.isNotEmpty(iPage.getRecords())) {
-            List<String> behospitalCodes = iPage.getRecords().stream().map(i -> i.getBehospitalCode()).collect(Collectors.toList());
-            Map<String, BehospitalInfoAgeDTO> ageMap = behospitalInfoFacade.getBehospitalInfoAge(hospitalId, behospitalCodes).stream().collect(Collectors.toMap(i -> i.getBehospitalCode(), i -> i));
-            iPage.getRecords().forEach(i -> {
-                i.setMonth(i.getJobDistributionTime());
-                i.setStatus(CheckStatusEnum.getName(Integer.parseInt(i.getStatus())));
-                i.setAge(ageMap.get(i.getBehospitalCode()) == null ? "" : ageMap.get(i.getBehospitalCode()).getAge());
-            });
-        }
-
-        return iPage;
-    }
-
-
-    private List<Long> getUserIdsOfRoleId(Long hospitalId, List<String> deptIds, long roleId) {
-        QueryWrapper<SysUserDept> sysUserDeptQueryWrapper = new QueryWrapper<>();
-        sysUserDeptQueryWrapper.eq("hospital_id", hospitalId);
-        sysUserDeptQueryWrapper.in(ListUtil.isNotEmpty(deptIds), "dept_id", deptIds);
-        List<Long> userIds = sysUserDeptFacade.list(sysUserDeptQueryWrapper).stream().map(i -> i.getUserId()).collect(Collectors.toList());
-
-        if (ListUtil.isEmpty(userIds)) {
-            return null;
-        }
-        QueryWrapper<SysUserRole> sysUserRoleQueryWrapper = new QueryWrapper<>();
-        sysUserRoleQueryWrapper.in("user_id", userIds);
-        sysUserRoleQueryWrapper.eq("role_id", roleId);
-        return sysUserRoleFacade.list(sysUserRoleQueryWrapper).stream().map(i -> i.getUserId()).collect(Collectors.toList());
-    }
-
-    public boolean recordCheck(RecordCheckVO recordCheckVO) {
-        Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
-        Long userId = Long.parseLong(SysUserUtils.getCurrentPrincipleID());
-
-        //获取核查监管相关角色id
-        List<Long> checkRoleIds = sysRoleFacade.list(new QueryWrapper<SysRole>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .like("name", "质控人员")
-        ).stream().map(SysRole::getId).collect(Collectors.toList());
-        //查询该角色的所有角色id
-        List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("user_id", userId)
-        ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
-        if (ListUtil.isNotEmpty(checkRoleIds)) {
-            checkRoleIds.retainAll(roleIds);
-        }
-
-        if (ListUtil.isEmpty(checkRoleIds)) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "您暂无核查权限,请联系管理员~");
-        }
-        //获取判断是否有生成分配的核查任务
-        QueryWrapper<MedCheckInfo> medCheckInfoQueryWrapper = new QueryWrapper<>();
-        medCheckInfoQueryWrapper.eq("behospital_code", recordCheckVO.getBehospitalCode());
-        medCheckInfoQueryWrapper.eq("hospital_id", hospitalId);
-//        medCheckInfoQueryWrapper.eq("check_id", userId);
-//        medCheckInfoQueryWrapper.eq("check_type", CheckTypeEnum.ALL.getKey());
-        MedCheckInfo medCheckInfo = medCheckInfoFacade.getOne(medCheckInfoQueryWrapper);
-        SysUser user = sysUserFacade.getOne(new QueryWrapper<SysUser>()
-                .eq("id", userId)
-                .eq("is_deleted", IsDeleteEnum.N.getKey()));
-        if (medCheckInfo == null) {
-            MedCheckInfo insertCheckInfo = new MedCheckInfo();
-            insertCheckInfo.setBehospitalCode(recordCheckVO.getBehospitalCode());
-            insertCheckInfo.setCheckId(userId);
-            if (user != null) {
-                insertCheckInfo.setCheckName(user.getLinkman());
-            }
-            insertCheckInfo.setCheckType(CheckTypeEnum.ALL.getKey());
-            insertCheckInfo.setHospitalId(hospitalId);
-            insertCheckInfo.setStatus(1);
-            //有科室核查人员角色就讲任务定义为科室核查任务(只针对七院科室核查)
-            if(checkRoleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey()*1l)){
-                insertCheckInfo.setCheckType(0);
-            }
-            insertCheckInfo.setCheckTime(DateUtil.now());
-            return medCheckInfoFacade.save(insertCheckInfo);
-
-        }
-
-        medCheckInfo.setCheckId(userId);
-        if (user != null) {
-            medCheckInfo.setCheckName(user.getLinkman());
-        }
-        medCheckInfo.setStatus(1);
-        medCheckInfo.setCheckTime(DateUtil.now());
-        medCheckInfoFacade.updateById(medCheckInfo);
-
-        return true;
-    }
-
-    /**
-     * @Author songxl
-     * @Description获取当前用户的任务来源 和筛选分值
-     * @time: 2024/5/28
-     * @Param []
-     * @Return java.util.Map<java.lang.String, java.lang.String>
-     * @MethodName getCheckType
-     */
-    public Map<String, Object> getCheckType() {
-        Map<String, Object> out = Maps.newLinkedHashMap();
-        Map<Integer, String> checkTypes = Maps.newLinkedHashMap();
-        Long userId = Long.parseLong(SysUserUtils.getCurrentPrincipleID());
-        SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
-        sysUserBaseVO.setUserId(userId);
-        List<Long> roleIds = sysUserFacade.getUserRoles(sysUserBaseVO).getSelRoles().stream().map(i -> i.getId()).collect(Collectors.toList());
-        roleIds.stream().forEach(roleId -> {
-            if (roleId.intValue() == CheckerRoleEnum.DEPT_SUPERVISOR.getKey() || roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey()) {
-                checkTypes.put(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey(), CheckJobTypeEnum.DEPT_SUPERVISOR.getName());
-            }
-            if (roleId.intValue() == CheckerRoleEnum.QUAT_SUPERVISOR.getKey() || roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey()) {
-                checkTypes.put(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey(), CheckJobTypeEnum.QUAT_SUPERVISOR.getName());
-            }
-            if (roleId.intValue() == CheckerRoleEnum.HOSP_SUPERVISOR.getKey() || roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()) {
-                checkTypes.put(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey(), CheckJobTypeEnum.HOSP_SUPERVISOR.getName());
-            }
-        });
-        Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
-        List<Integer> valus = medBehospitalTypeServiceImpl.list(new QueryWrapper<MedBehospitalType>()
-                .eq("hospital_id", hospitalId)
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .isNotNull("value")
-                .groupBy("value")).stream().map(MedBehospitalType::getValue).collect(Collectors.toList());
-        out.put("source", checkTypes);
-        out.put("value", valus);
-        return out;
-    }
-}

+ 2 - 2
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -44,6 +44,8 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
     public List<MsgDTO> getMsg(AnalyzeVO analyzeVO);
 
+    public List<MsgDTO> getMsgDetail(AnalyzeVO analyzeVO);
+
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
 
     /**
@@ -271,8 +273,6 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDeptDTO> qcResultShortByDeptPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
-    IPage<BehospitalInfoDeptDTO> levelStatisticsByDeptPage(BehospitalPageVO behospitalPageVO);
-
     /**
      * 根据两个主键-批量修改
      *

+ 0 - 16
src/main/java/com/diagbot/mapper/MedBehospitalTypeMapper.java

@@ -1,16 +0,0 @@
-package com.diagbot.mapper;
-
-import com.diagbot.entity.MedBehospitalType;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author songxl
- * @time: 2024-05-11
- */
-public interface MedBehospitalTypeMapper extends BaseMapper<MedBehospitalType> {
-
-}

+ 0 - 42
src/main/java/com/diagbot/mapper/MedCheckInfoMapper.java

@@ -1,42 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.CheckJobDTO;
-import com.diagbot.dto.CheckUserDTO;
-import com.diagbot.dto.CheckWorkDTO;
-import com.diagbot.dto.CheckedRecordListDTO;
-import com.diagbot.dto.DeptCheckUserDTO;
-import com.diagbot.entity.MedCheckInfo;
-import com.diagbot.vo.CheckJobPageVO;
-import com.diagbot.vo.CheckJobVO;
-import com.diagbot.vo.CheckUserVO;
-import com.diagbot.vo.CheckWorkPageVO;
-import com.diagbot.vo.CheckedRecordListVO;
-
-import java.util.List;
-
-/**
- * <p>
- * 核查表 Mapper 接口
- * </p>
- *
- * @author wangfeng
- * @time: 2024-07-06
- */
-public interface MedCheckInfoMapper extends BaseMapper<MedCheckInfo> {
-    //获取未分配的核查任务
-    IPage<CheckJobDTO> getCheckList(CheckJobPageVO checkJobVO);
-    //临床科室核查人员通过id获取核查人员的核查任务数
-    List<DeptCheckUserDTO> getDeptJobNumByUserId(CheckUserVO checkUserVO);
-    //核查任务列表
-    IPage<CheckWorkDTO> getCheckWorkPage(CheckWorkPageVO checkWorkPageVO);
-    //获取指定核查人员的核查任务
-    IPage<CheckJobDTO> getCheckListByUserId(CheckJobPageVO checkJobVO);
-    //取消核查任务
-    int deleteBatchCodes(List<String> list);
-
-    IPage<CheckedRecordListDTO> checkedRecordList(CheckedRecordListVO checkedRecordListVO);
-    //获取核查人员用户科室、姓名、角色
-    List<DeptCheckUserDTO> getCheckUser(CheckUserVO checkUserVOS);
-}

+ 16 - 0
src/main/java/com/diagbot/mapper/MedExamineInfoMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.MedExamineInfo;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhanghang
+ * @time: 2024-04-30
+ */
+public interface MedExamineInfoMapper extends BaseMapper<MedExamineInfo> {
+
+}

+ 2 - 0
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -26,6 +26,8 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
 
     public List<MsgDTO> getMsg(AnalyzeVO analyzeVO);
 
+    public List<MsgDTO> getMsgDetail(AnalyzeVO analyzeVO);
+
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
 
     /**

+ 0 - 16
src/main/java/com/diagbot/service/MedBehospitalTypeService.java

@@ -1,16 +0,0 @@
-package com.diagbot.service;
-
-import com.diagbot.entity.MedBehospitalType;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author songxl
- * @time: 2024-05-11
- */
-public interface MedBehospitalTypeService extends IService<MedBehospitalType> {
-
-}

+ 0 - 24
src/main/java/com/diagbot/service/MedCheckInfoService.java

@@ -1,24 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.CheckJobDTO;
-import com.diagbot.dto.DeptCheckUserDTO;
-import com.diagbot.entity.MedCheckInfo;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.vo.CheckJobPageVO;
-import com.diagbot.vo.CheckJobVO;
-import com.diagbot.vo.CheckUserVO;
-
-import java.util.List;
-
-/**
- * <p>
- * 核查表 服务类
- * </p>
- *
- * @author wangfeng
- * @time: 2024-07-06
- */
-public interface MedCheckInfoService extends IService<MedCheckInfo> {
-    public IPage<CheckJobDTO> getCheckList(CheckJobPageVO checkJobVO);
-}

+ 16 - 0
src/main/java/com/diagbot/service/MedExamineInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.MedExamineInfo;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @time: 2024-04-13
+ */
+public interface MedExamineInfoService extends IService<MedExamineInfo> {
+
+}

+ 4 - 1
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -38,7 +38,10 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<MsgDTO> getMsg(AnalyzeVO analyzeVO) {
         return baseMapper.getMsg(analyzeVO);
     }
-
+    @Override
+    public List<MsgDTO> getMsgDetail(AnalyzeVO analyzeVO) {
+        return baseMapper.getMsgDetail(analyzeVO);
+    }
     @Override
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO) {
         return baseMapper.getMsgByEntryCode(analyzeCodeVO);

+ 0 - 20
src/main/java/com/diagbot/service/impl/MedBehospitalTypeServiceImpl.java

@@ -1,20 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.diagbot.entity.MedBehospitalType;
-import com.diagbot.mapper.MedBehospitalTypeMapper;
-import com.diagbot.service.MedBehospitalTypeService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author songxl
- * @time: 2024-05-11
- */
-@Service
-public class MedBehospitalTypeServiceImpl extends ServiceImpl<MedBehospitalTypeMapper, MedBehospitalType> implements MedBehospitalTypeService {
-
-}

+ 0 - 39
src/main/java/com/diagbot/service/impl/MedCheckInfoServiceImpl.java

@@ -1,39 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.CheckJobDTO;
-import com.diagbot.dto.CheckWorkDTO;
-import com.diagbot.entity.MedCheckInfo;
-import com.diagbot.mapper.MedCheckInfoMapper;
-import com.diagbot.service.MedCheckInfoService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.vo.CheckJobPageVO;
-import com.diagbot.vo.CheckJobVO;
-import com.diagbot.vo.CheckWorkPageVO;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * <p>
- * 核查表 服务实现类
- * </p>
- *
- * @author wangfeng
- * @time: 2024-07-06
- */
-@Service
-public class MedCheckInfoServiceImpl extends ServiceImpl<MedCheckInfoMapper, MedCheckInfo> implements MedCheckInfoService {
-
-    public IPage<CheckWorkDTO> getCheckWorkPage(CheckWorkPageVO checkWorkPageVO) {
-        return baseMapper.getCheckWorkPage(checkWorkPageVO);
-    }
-
-    public int deleteBatchCodes(List<String> list){
-        return baseMapper.deleteBatchCodes(list);
-    }
-    @Override
-    public IPage<CheckJobDTO> getCheckList(CheckJobPageVO checkJobVO) {
-        return baseMapper.getCheckList(checkJobVO);
-    }
-}

+ 17 - 0
src/main/java/com/diagbot/service/impl/MedExamineInfoServiceImpl.java

@@ -0,0 +1,17 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.MedExamineInfo;
+import com.diagbot.mapper.MedExamineInfoMapper;
+import com.diagbot.service.MedExamineInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ * @author zhanghang
+ * @time: 2024-03-26
+ */
+@Service
+public class MedExamineInfoServiceImpl extends ServiceImpl<MedExamineInfoMapper, MedExamineInfo> implements MedExamineInfoService {
+
+}

+ 0 - 71
src/main/java/com/diagbot/task/BehospitalInfoTypeTask.java

@@ -1,71 +0,0 @@
-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.MedCheckWorkFacade;
-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;
-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;
-
-import java.time.LocalDateTime;
-import java.util.Date;
-
-@Configuration      //1.主要用于标记配置类,兼备Component的效果。
-@EnableScheduling   // 2.开启定时任务(每隔半小时检查今天患者,然后修改今天的患者的类型)
-@Slf4j
-public class BehospitalInfoTypeTask implements SchedulingConfigurer{
-    @Autowired
-    private SysTaskCronFacade sysTaskCronFacade;
-
-    private SysTaskCron task001 = new SysTaskCron();
-
-    private String param = "";
-
-    //添加核查任务
-    @Autowired
-    private MedCheckWorkFacade medCheckWorkFacade;
-    /**
-     * 执行定时任务.
-     */
-    @Override
-    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
-        taskRegistrar.addTriggerTask(new Runnable() {
-            @Override
-            public void run() {
-                //1.添加任务内容(Runnable)
-                if (null != task001
-                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
-                        && task001.getIsUsed().equals(1)) {
-                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
-                    medCheckWorkFacade.execute(param);
-                }
-            }
-        }, new Trigger() {
-            @Override
-            public Date nextExecutionTime(TriggerContext triggerContext) {
-                //2.1 从数据库获取执行周期
-                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
-                        .eq("cron_code", "TASK019"), false);
-                String cron = "0 0/30 * * * ?";
-                //2.2 合法性校验.
-                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
-                    cron = task001.getCron();
-                    param = task001.getParam();
-                }
-                CronTrigger trigger = new CronTrigger(cron);
-                return trigger.nextExecutionTime(triggerContext);
-            }
-        });
-    }
-}

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

@@ -20,9 +20,6 @@ public class AnalyzeRunVO {
     private Long hospitalId;
     // 归档字段
     private String isPlacefile = "0";
-
-    private Long qcresultInfoId; // 病历主表id
-
     // 是否展示内容
     private String isDefect = "0";
 }

+ 0 - 65
src/main/java/com/diagbot/vo/CheckJobPageVO.java

@@ -1,65 +0,0 @@
-package com.diagbot.vo;
-
-import java.io.Serializable;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * @description: 分配任务入参对象-分页
- * @author: songxl
- * @time: 2024/05/17
- */
-@Data
-@EqualsAndHashCode(callSuper=false)
-public class CheckJobPageVO extends Page implements Serializable {
-    private static final long serialVersionUID = 1L;
-    //生成任务开始时间
-    @ApiModelProperty("生成任务开始时间,格式为:yyyy-MM-dd")
-    private String startTime;
-    //生成任务结束时间
-    @ApiModelProperty("生成任务结束时间,格式为:yyyy-MM-dd")
-    private String endTime;
-    //出院开始时间
-    @ApiModelProperty("出院开始时间,格式为:yyyy-MM-dd")
-    private String behosDateStart;
-    //出院结束时间
-    @ApiModelProperty("出院结束时间,格式为:yyyy-MM-dd")
-    private String behosDateEnd;
-    //任务类型
-    @ApiModelProperty("任务类型 0-科室任务 1-院级 2-质控科")
-    private String jobType;
-    //核查用户id
-    @ApiModelProperty("核查用户id")
-    private String checkId;
-    //病人姓名
-    @ApiModelProperty("病人姓名")
-    private String name;
-    //病人住院序号
-    @ApiModelProperty("病人住院序号")
-    private String behospitalCode;
-    //病案号
-    @ApiModelProperty("病案号")
-    private String fileCode;
-    //主诊断医生
-    @ApiModelProperty("主诊断医生")
-    private String doctorName;
-    //科室id集合
-    @ApiModelProperty("科室id集合")
-    private List<String> depts;
-    @ApiModelProperty("病区集合")
-    private List<String> wards;
-    @ApiModelProperty("医疗组集合")
-    private List<String> medoups;
-    //筛选分值集合
-    @ApiModelProperty("筛选分值集合")
-    private List<String> values;
-
-    @ApiModelProperty("医生id")
-    private List<String> doctorIds;
-
-}

+ 0 - 51
src/main/java/com/diagbot/vo/CheckJobVO.java

@@ -1,51 +0,0 @@
-package com.diagbot.vo;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * @description: 分配任务入参对象
- * @author: songxl
- * @time: 2024/05/17
- */
-@Data
-public class CheckJobVO {
-    //生成任务开始时间
-    @ApiModelProperty("生成任务开始时间,格式为:yyyy-MM-dd")
-    private String startTime;
-    //生成任务结束时间
-    @ApiModelProperty("生成任务结束时间,格式为:yyyy-MM-dd")
-    private String endTime;
-    //出院开始时间
-    @ApiModelProperty("出院开始时间,格式为:yyyy-MM-dd")
-    private String behosDateStart;
-    //出院结束时间
-    @ApiModelProperty("出院结束时间,格式为:yyyy-MM-dd")
-    private String behosDateEnd;
-    //核查用户id
-    @ApiModelProperty("核查用户id")
-    private String checkId;
-    //任务类型
-    @ApiModelProperty(hidden = true)
-    private String jobType;
-    //病人姓名
-    @ApiModelProperty(hidden = true)
-    private String name;
-    //病人住院序号
-    @ApiModelProperty(hidden = true)
-    private String behospitalCode;
-    //主诊断医生
-    @ApiModelProperty(hidden = true)
-    private String doctorName;
-    //科室id集合
-    @ApiModelProperty(hidden = true)
-    private List<String> deptList;
-
-
-
-}

+ 0 - 145
src/main/java/com/diagbot/vo/CheckWorkPageVO.java

@@ -1,145 +0,0 @@
-package com.diagbot.vo;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * <p>
- * 核查患者病历信息
- * </p>
- *
- * @author wangsy
- * @time: 2024-05-13
- */
-@Data
-@EqualsAndHashCode(callSuper=false)
-public class CheckWorkPageVO extends Page implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 出院开始时间
-     */
-    @ApiModelProperty("出院开始时间")
-    private Date startDate;
-
-    /**
-     * 出院结束时间
-     */
-    @ApiModelProperty("出院结束时间")
-    private Date endDate;
-
-    /**
-     * 生成状态[0-未生成 1-已生成(默认未生成)]
-     */
-    @ApiModelProperty("生成状态[0-未生成 1-已生成(默认未生成)]")
-    private String creatStatus="0";
-
-    /**
-     * 核查任务类型(0-科室任务 2-院级 1-质控科)
-     */
-    private String jobType;
-
-    /**
-     * 医院ID
-     */
-
-    @ApiModelProperty(hidden = true)
-    private Long hospitalId;
-
-    /**
-     * 病人住院序号
-     */
-    @ApiModelProperty("病人住院序号")
-    private String behospitalCode;
-
-    /**
-     * 病案号
-     */
-    @ApiModelProperty("病案号")
-    private String fileCode;
-
-    /**
-     * 病区编号集合
-     */
-    @ApiModelProperty("病区编号集合")
-    private List<String> wards;
-    /**
-     * 科室编号集合
-     */
-    @ApiModelProperty("科室编号集合")
-    private List<String> depts;
-    /**
-     * 医疗组编号集合
-     */
-    @ApiModelProperty("医疗组编号集合")
-    private List<String> medoups;
-    /**
-     * 病人住院序号集合
-     */
-    @ApiModelProperty(hidden = true)
-    private List<String> behospitalCodes;
-    /**
-     * 其他病区集合
-     */
-    @ApiModelProperty(hidden = true)
-    private List<String> orderDepts;
-
-    /**
-     * 病历等级
-     */
-    @ApiModelProperty("病历等级")
-    private String level;
-
-    /**
-     * 病人姓名
-     */
-    @ApiModelProperty("病人姓名")
-    private String name;
-
-    /**
-     * 医生id
-     */
-    @ApiModelProperty("医生id")
-    private List<String> doctorIds;
-
-    /**
-     * 医生姓名
-     */
-    @ApiModelProperty("医生姓名")
-    private String doctorName;
-
-    /**
-     * 主诊断
-     */
-    @ApiModelProperty("主诊断")
-    private String diagnose;
-
-    /**
-     * 最小天数
-     */
-    @ApiModelProperty("最小天数")
-    private Integer smallDay;
-
-    /**
-     * 最大天数
-     */
-    @ApiModelProperty("最大天数")
-    private Integer bigDay;
-
-    /**
-     * 是否归档(0:未归档,1:已归档)
-     */
-    @ApiModelProperty("是否归档(0:未归档,1:已归档)")
-    private String isPlacefile = "1";
-    //筛选分值集合
-    @ApiModelProperty("筛选分值集合")
-    private List<String> values;
-}

+ 0 - 114
src/main/java/com/diagbot/vo/CheckedRecordListVO.java

@@ -1,114 +0,0 @@
-package com.diagbot.vo;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @Description:
- * @author: rengb
- * @time: 2024/5/17 18:48
- */
-@Getter
-@Setter
-@ApiModel("核查任务列表-获取核查任务列表-接口入参")
-public class CheckedRecordListVO extends Page implements Serializable {
-
-    /**
-     * 病历核查状态
-     */
-    @ApiModelProperty("病历核查状态,0-未核查,1-已核查")
-    private Integer status;
-
-    /**
-     * 任务类型
-     */
-    @ApiModelProperty("任务类型,0-科室任务 1-院级 2-质控科")
-    private List<String> checkJobTypes;
-
-    /**
-     * 科室
-     */
-    @ApiModelProperty("科室id集合")
-    private List<String> depts;
-
-    /**
-     * 病人姓名
-     */
-    @ApiModelProperty("病人姓名")
-    private String name;
-
-    /**
-     * 病人住院序号
-     */
-    @ApiModelProperty("病人住院序号")
-    private String behospitalCode;
-
-    /**
-     * 病案号
-     */
-    @ApiModelProperty("病案号")
-    private String fileCode;
-
-    /**
-     * 医生姓名
-     */
-    @ApiModelProperty("医生姓名")
-    private String doctorName;
-
-    /**
-     * 分配日期起始日期
-     */
-    @ApiModelProperty("分配日期起始日期,格式为:2018-11-28")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date jobDistributionTimeStart;
-
-    /**
-     * 分配日期终止日期
-     */
-    @ApiModelProperty("分配日期终止日期,格式为:2018-11-28")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date jobDistributionTimeEnd;
-
-    /**
-     * 核查员
-     */
-    @ApiModelProperty("核查员")
-    private String checkName;
-
-    /**
-     * 病历等级
-     */
-    @ApiModelProperty("病历等级")
-    private String level;
-
-    /**
-     * 当前用户归属科室Id集合,多个科室用英文逗号隔开
-     */
-    @ApiModelProperty(hidden = true)
-    private String currentDeptIds;
-
-    @ApiModelProperty("病区集合")
-    private List<String> wards;
-    @ApiModelProperty("医疗组集合")
-    private List<String> medoups;
-    /**
-     * 当前用户下级普通质控员Id集合
-     */
-    @ApiModelProperty(hidden = true)
-    private List<Long> currentGeneralUserIds;
-
-    /**
-     * 当前用户归属医院Id
-     */
-    @ApiModelProperty(hidden = true)
-    private long hospitalId;
-
-}

+ 0 - 42
src/main/java/com/diagbot/vo/DistributionJobVO.java

@@ -1,42 +0,0 @@
-package com.diagbot.vo;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * @description: 分配核查任务入参对象
- * @author: songxl
- * @time: 2024/05/17
- */
-@Data
-public class DistributionJobVO {
-    //病人住院序号集合
-    @ApiModelProperty("病人住院序号集合")
-    private List<String> behospitalCodes;
-    //医院id
-    @ApiModelProperty(hidden = true)
-    private String hospitalId;
-    //分配用户id
-    @ApiModelProperty(hidden = true)
-    private String jobDistributor;
-    //核查用户id
-    @ApiModelProperty("核查用户id")
-    private String checkId;
-    //核查用户姓名
-    @ApiModelProperty("核查用户姓名")
-    private String checkName;
-    @ApiModelProperty("核查用户科室id")
-    private String checkDept;
-    @ApiModelProperty("病人住院科室集合")
-    private List<String> behospitalDepts;
-    @ApiModelProperty("任务类型 0科室、1质控科额、2院级")
-    private String jobType;
-    //操作类型 分配或取消 0-分配,1-取消分配
-    @ApiModelProperty("操作类型 分配或取消 0-分配,1-取消分配")
-    private String distributionType;
-
-
-
-}

+ 0 - 31
src/main/java/com/diagbot/vo/GetRegionAndMedoupInfoVO.java

@@ -1,31 +0,0 @@
-package com.diagbot.vo;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @author: cy
- * @time: 2024/12/24 11:28
- */
-@Getter
-@Setter
-public class GetRegionAndMedoupInfoVO {
-    /**
-     * 病区搜索参数
-     */
-    private String regionStr;
-    /**
-     * 医疗组搜索参数
-     */
-    private String medoupStr;
-    /**
-     * 1-病区 2-医疗组
-     */
-    private String mark;
-    @ApiModelProperty(hidden = true)
-    private Long hospitalId;
-    @ApiModelProperty(hidden = true)
-    private Long userId;
-}

+ 2 - 0
src/main/java/com/diagbot/vo/QcresultVO.java

@@ -22,6 +22,8 @@ public class QcresultVO {
     private Integer type;
     @ApiModelProperty("逻辑删除接口(1-恢复和0-删除)标志")
     private Integer delStatus;
+    //規則id
+    private String casesEntryId;
     //操作条目
     private QcResultAlgVO optResultAlgVO;
 }

+ 0 - 24
src/main/java/com/diagbot/vo/RecordCheckVO.java

@@ -1,24 +0,0 @@
-package com.diagbot.vo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @author: rengb
- * @time: 2024/5/18 20:15
- */
-@Getter
-@Setter
-@ApiModel("核查任务列表-病历核查-接口入参")
-public class RecordCheckVO {
-
-    /**
-     * 病人住院序号
-     */
-    @ApiModelProperty("病人住院序号")
-    private String behospitalCode;
-
-}

+ 0 - 9
src/main/java/com/diagbot/web/BasDoctorInfoController.java

@@ -2,11 +2,9 @@ package com.diagbot.web;
 
 
 import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.RegionMedoupDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.BasDoctorInfo;
 import com.diagbot.facade.BasDoctorInfoFacade;
-import com.diagbot.vo.GetRegionAndMedoupInfoVO;
 import com.diagbot.vo.data.BasDoctorInfoVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -41,11 +39,4 @@ public class BasDoctorInfoController {
     public RespDTO<List<BasDoctorInfo>> getList(@RequestBody BasDoctorInfoVO basDoctorInfoVO) {
         return RespDTO.onSuc(basDoctorInfoFacade.getDoctorByDept(basDoctorInfoVO));
     }
-
-    @ApiOperation(value = "获取病区、医疗组[by:cy]")
-    @PostMapping("/getRegionAndMedoupList")
-    @SysLogger("getRegionAndMedoupList")
-    public RespDTO<RegionMedoupDTO> getRegionAndMedoupList(@RequestBody GetRegionAndMedoupInfoVO getRegionAndMedoupInfoVO) {
-        return RespDTO.onSuc(basDoctorInfoFacade.getRegionAndMedoupList(getRegionAndMedoupInfoVO));
-    }
 }

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

@@ -84,7 +84,9 @@ public class BehospitalInfoController {
                     "    医院ID\n" +
                     "    Long hospitalId;\n" +
                     "    归档字段\n" +
-                    "    String isPlacefile;")
+                    "    String isPlacefile +\n" +
+                    "    0:返回所有信息,1:只返回缺陷数量\n" +
+                    "    String isDefect;")
     @PostMapping("/analyze_run")
     @SysLogger("analyze_run")
     @Transactional
@@ -113,6 +115,25 @@ public class BehospitalInfoController {
         return RespDTO.onSuc(behospitalInfoFacade.analyzeApi(analyzeRunVO));
     }
 
+    @ApiOperation(value = "根据病历号查看全部缺陷详情[by:dsYun]",
+            notes = "")
+    @PostMapping("/getCaseDetail")
+    @SysLogger("getCaseDetail")
+    public RespDTO<AnalyzeCaseDetailDTO> getCaseDetail(@RequestBody BehospitalcodeVO behospitalcodeVO) {
+        AnalyzeCaseDetailDTO data = behospitalInfoFacade.getCaseDetail(behospitalcodeVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "忽略质控条目[by:dsYun]",
+            notes = "")
+    @PostMapping("/loseSightOfCase")
+    @SysLogger("loseSightOfCase")
+    @Transactional
+    public RespDTO<AnalyzeDTO> loseSightOfCase(@RequestBody QcresultVO qcresultVO) {
+        qcresultVO.setType(5);
+        return RespDTO.onSuc(qcresultInfoFacade.changeQcResult(qcresultVO));
+    }
+
     @ApiOperation(value = "新增质控条目[by:zhoutg]",
             notes = "")
     @PostMapping("/addCase")

+ 0 - 115
src/main/java/com/diagbot/web/MedCheckInfoController.java

@@ -1,115 +0,0 @@
-package com.diagbot.web;
-
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.CheckDeptDTO;
-import com.diagbot.dto.CheckJobDTO;
-import com.diagbot.dto.CheckWardDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.MedCheckInfoFacade;
-import com.diagbot.facade.MedCheckWorkFacade;
-import com.diagbot.vo.CheckJobPageVO;
-import com.diagbot.vo.CheckJobVO;
-import com.diagbot.vo.DistributionJobVO;
-import com.diagbot.vo.MedCheckInfoAddVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import springfox.documentation.annotations.ApiIgnore;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * 核查表 前端控制器
- * </p>
- *
- * @author wangfeng
- * @time: 2024-07-06
- */
-@RestController
-@RequestMapping("/qc/medCheckInfo")
-@Api(value = "核查病历数据模块相关接口API", tags = { "核查病历数据模块相关接口API" })
-@SuppressWarnings("unchecked")
-public class MedCheckInfoController {
-
-    @Autowired
-    MedCheckInfoFacade medCheckInfoFacade;
-    @Autowired
-    MedCheckWorkFacade medCheckWorkFacade;
-
-    @ApiOperation(value = "核查数据接口[by:wangfeng]",
-            notes = "核查数据接口")
-    @PostMapping("/addMedCheckInfo")
-    @SysLogger("addMedCheckInfo")
-    @ApiIgnore
-    public RespDTO<Boolean> addMedCheckInfo(@RequestBody MedCheckInfoAddVO medCheckInfoAddVO) {
-        Boolean res = medCheckInfoFacade.addMedCheckInfos(medCheckInfoAddVO);
-        return RespDTO.onSuc(res);
-    }
-
-
-
-    @ApiOperation(value = "分配核查任务--获取核查人员列表[by:songxl]",
-            notes = "获取核查人员列表")
-    @PostMapping("/getCheckUserMap")
-    @SysLogger("getCheckUserMap")
-    public RespDTO<Map<String, List<CheckWardDTO>>> getCheckUserMap() {
-        Map<String, List<CheckWardDTO>> userInfoMap = medCheckInfoFacade.getCheckUserMap();
-        return RespDTO.onSuc(userInfoMap);
-    }
-
-
-    @ApiOperation(value = "分配核查任务--获取待分配核查任务列表[by:songxl]",
-            notes = "startTime:任务生成开始时间 必填<br>" +
-                    "endTime:  任务生成结束时间 必填<br>" +
-                    "或<br>" +
-                    "behosDateStart:  出院开始时间 必填<br>" +
-                    "behosDateEnd:  出院结束时间 必填<br>" +
-                    "jobType:核查任务类型 必填 0-科室任务  1-质控科 2-院级<br>" )
-    @PostMapping("/getCheckList")
-    @SysLogger("getCheckList")
-    public RespDTO<IPage<CheckJobDTO>> getCheckList(@RequestBody CheckJobPageVO checkJobPageVO) {
-        IPage<CheckJobDTO> userInfos = medCheckInfoFacade.getUserCheckList(checkJobPageVO);
-        return RespDTO.onSuc(userInfos);
-    }
-
-    @ApiOperation(value = "分配核查任务--分配/取消核查任务[by:songxl]",
-            notes = "behospitalCodes:病人住院序号集合 必填<br>" +
-                    "checkId:  核查用户id 必填<br>" +
-                    "checkName:  核查用户姓名 必填<br>" +
-                    "checkDept:  核查人科室id 必填<br>" +
-                    "behospitalDepts:  核查任务科室id集合 必填<br>" +
-                    "jobType:  任务类型 0科室、1质控科额、2院级 必填<br>" +
-                    "distributionType:操作类型 必填 分配或取消 0-分配,1-取消分配<br>")
-    @PostMapping("/updateDistributionCheck")
-    @SysLogger("updateDistributionCheck")
-    public RespDTO<Boolean> distributionJobs(@RequestBody DistributionJobVO distributionJobVO) {
-        return RespDTO.onSuc(medCheckInfoFacade.distributionJobs(distributionJobVO));
-    }
-
-
-    @ApiOperation(value = "分配核查任务--获取指定核查人员的核查任务[by:songxl]",
-            notes = "checkId:核查用户id")
-    @PostMapping("/getCheckListByUserId")
-    @SysLogger("getCheckListByUserId")
-    public RespDTO<IPage<CheckJobDTO>> getCheckListByUserId(@RequestBody CheckJobPageVO checkJobVO) {
-        IPage<CheckJobDTO> userInfos = medCheckInfoFacade.getCheckListByUserId(checkJobVO);
-        return RespDTO.onSuc(userInfos);
-    }
-
-    @ApiOperation(value = "质控核查--生成患者病历类型[by:songxl]",
-            notes = "生成患者病历类型 <br>" +
-                    "备注:如果历史患者病历类型已经生成,接口只会筛选当前时间前半个小时入院患者生成类型")
-    @PostMapping("/createMedBeHospitalInfoType")
-    @SysLogger("createMedBeHospitalInfoType")
-    public RespDTO<Boolean> createMedBeHospitalInfoType() {
-        return RespDTO.onSuc(medCheckWorkFacade.createMedBeHospitalInfoType());
-    }
-}

+ 0 - 84
src/main/java/com/diagbot/web/MedCheckWorkController.java

@@ -1,84 +0,0 @@
-package com.diagbot.web;
-
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.CheckWorkDTO;
-import com.diagbot.dto.RegionDTO;
-import com.diagbot.dto.RegionMedoupDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.MedCheckWorkFacade;
-import com.diagbot.vo.CheckWorkPageVO;
-import com.diagbot.vo.MedCheckWorkAddVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- *
- * @author songxl
- * @time: 2024-05-11
- */
-@RestController
-@RequestMapping("/qc/medCheckWork")
-@Api(value = "生成核查任务--相关接口API", tags = { "生成核查任务--相关接口API" })
-public class MedCheckWorkController {
-    @Autowired
-    MedCheckWorkFacade medCheckworkFacade;
-
-    @ApiOperation(value = "生成/取消核查任务[by:wangsy]",
-            notes = "生成/取消核查任务 <br>" +
-            "behospitalCodeList:病历id(List) 【必填】<br>" +
-            "jobType:核查任务类型(0-科室任务 1-院级 1-质控科) 【必填】<br>" +
-            "checkStatus:操作类型(0-取消,1-添加) 【必填】<br>" +
-            "createTime: 操作时间<br>" +
-            "checkType:核查类型(0病历,1病案首页,2全部 默认)<br>")
-    @PostMapping("/addCheckWork")
-    @SysLogger("addCheckWork")
-    public RespDTO<Boolean> addCheckTask(@RequestBody MedCheckWorkAddVO medCheckWorkVO) {
-        Boolean res = medCheckworkFacade.addCheckWork(medCheckWorkVO);
-        return RespDTO.onSuc(res);
-    }
-
-    @ApiOperation(value = "获取患者病历列表[by:wangsy]",
-            notes = "startDate:出院开始时间 【必填】<br>" +
-                    "endDate:出院结束时间 【必填】<br>" +
-                    "creatStatus:生成状态(0-未生成 1-已生成) 【必填】<br>" +
-                    "jobType:核查任务类型(0-科室任务 1-质控科 2-院级) <br>" +
-                    "hospitalId: 医院ID<br>" +
-                    "behospitalCode:病人住院序号<br>" +
-                    "fileCode:病案号<br>" +
-                    "ward:病区<br>" +
-                    "depts:科室<br>" +
-                    "medoups:医疗组<br>" +
-                    "level:病历等级<br>" +
-                    "name:病人姓名<br>" +
-                    "doctorName:医生姓名<br>" +
-                    "diagnose:主诊断<br>" +
-                    "smallDay:最小天数<br>" +
-                    "bigDay:最大天数<br>" +
-                    "isPlacefile:是否归档<br>")
-    @PostMapping("/getUserList")
-    @SysLogger("getUserList")
-    public RespDTO<IPage<CheckWorkDTO>> checkWorkPage(@RequestBody CheckWorkPageVO checkWorkPageVO) {
-        IPage<CheckWorkDTO> data = medCheckworkFacade.pageFac(checkWorkPageVO);
-        return RespDTO.onSuc(data);
-    }
-
-    @ApiOperation(value = "获取当前用户所属病区医疗组信息[by:wangsy]",
-            notes = "")
-    @PostMapping("/getLocalRegionMedoup")
-    @SysLogger("getLocalRegionMedoup")
-    public RespDTO<RegionMedoupDTO> getLocalRegionMedoup() {
-        RegionMedoupDTO data = medCheckworkFacade.getLocalRegionMedoup();
-        return RespDTO.onSuc(data);
-    }
-
-}

+ 51 - 0
src/main/java/com/diagbot/web/MedExamineInfoController.java

@@ -0,0 +1,51 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.MedExamineInfoFacade;
+import com.diagbot.vo.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 审核 前端控制器
+ * </p>
+ *
+ * @author dsYun
+ * @time: 2024-07-06
+ */
+@RestController
+@RequestMapping("/qc/medExamineInfo")
+@Api(value = "审核相关接口API", tags = { "审核相关接口API" })
+@SuppressWarnings("unchecked")
+public class MedExamineInfoController {
+
+    @Autowired
+    MedExamineInfoFacade medExamineInfoFacade;
+
+//    @ApiOperation(value = "核查数据接口[by:wangfeng]",
+//            notes = "核查数据接口")
+//    @PostMapping("/addMedCheckInfo")
+//    @SysLogger("addMedCheckInfo")
+//    @ApiIgnore
+//    public RespDTO<Boolean> addMedCheckInfo(@RequestBody MedCheckInfoAddVO medCheckInfoAddVO) {
+//        Boolean res = medExamineInfoFacade.addMedCheckInfos(medCheckInfoAddVO);
+//        return RespDTO.onSuc(res);
+//    }
+
+    @ApiOperation(value = "通过审核[by:dsYun]")
+    @PostMapping("/passAudit")
+    @SysLogger("passAudit")
+    @Transactional
+    public RespDTO<Boolean> passAudit(@RequestBody BehospitalcodeVO behospitalcodeVO) {
+        Boolean res = medExamineInfoFacade.passAudit(behospitalcodeVO);
+        return RespDTO.onSuc(res);
+    }
+}

+ 0 - 57
src/main/java/com/diagbot/web/RecordCheckController.java

@@ -1,57 +0,0 @@
-package com.diagbot.web;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.CheckedRecordListDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.RecordCheckFacade;
-import com.diagbot.vo.CheckedRecordListVO;
-import com.diagbot.vo.RecordCheckVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Map;
-
-/**
- * @author rengb
- * @time: 2024-05-11
- */
-@RestController
-@RequestMapping("/qc/recCheck")
-@Api(value = "核查任务列表--相关接口API", tags = { "核查任务列表--相关接口API" })
-public class RecordCheckController {
-
-    @Autowired
-    RecordCheckFacade recordCheckFacade;
-
-    @ApiOperation(value = "获取核查任务列表[by:rengb]")
-    @PostMapping("/checkedRecordList")
-    @SysLogger("checkedRecordList")
-    public RespDTO<IPage<CheckedRecordListDTO>> checkedRecordList(@RequestBody CheckedRecordListVO checkedRecordListVO) {
-        IPage<CheckedRecordListDTO> data = recordCheckFacade.checkedRecordList(checkedRecordListVO);
-        return RespDTO.onSuc(data);
-    }
-
-    @ApiOperation(value = "病历核查[by:rengb]")
-    @PostMapping("/recordCheck")
-    @SysLogger("recordCheck")
-    @Transactional
-    public RespDTO<Boolean> recordCheck(@RequestBody RecordCheckVO recordCheckVO) {
-        Boolean res = recordCheckFacade.recordCheck(recordCheckVO);
-        return RespDTO.onSuc(res);
-    }
-
-    @ApiOperation(value = "获取核查任务来源[by:songxl]")
-    @PostMapping("/getCheckType")
-    @SysLogger("getCheckType")
-    public RespDTO<Map<String, Object>> getCheckType() {
-        Map<String, Object> data = recordCheckFacade.getCheckType();
-        return RespDTO.onSuc(data);
-    }
-}

+ 16 - 136
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -326,7 +326,22 @@
         LEFT JOIN sys_user u  on u.id = a.modifier  and u.is_deleted = 'N'
     </select>
 
-
+    <select id="getMsgDetail" resultType="com.diagbot.dto.MsgDTO">
+        SELECT DISTINCT b.`name` model_name,c.score,c.msg,c.cases_entry_id,c.is_reject,c.id id,c.info, a.cases_id cases_id,
+        b.id model_id, a.name standard_msg, c.opt_type, c.grade_type,
+        c.gmt_create, c.gmt_modified, c.modifier,c.is_deleted,a.remark,
+        a.type, a.drgs,a.rule_type
+        FROM
+        `qc_cases_entry` a, qc_mode b, med_qcresult_detail c
+        where a.is_deleted = 'N' and b.is_deleted = 'N'
+        and a.id = c.cases_entry_id and a.mode_id = b.id
+        and c.hospital_id = #{hospitalId}
+        <if test="qcresultInfoId != null">
+            AND c.qcresult_info_id = #{qcresultInfoId}
+        </if>
+        and c.behospital_code = #{behospitalCode} and b.id = 6 and c.opt_type not in (2,4)
+        order by b.order_no, c.grade_type desc, a.order_no
+    </select>
 
 
     <select id="getMsgByEntryCode" resultType="com.diagbot.dto.MsgDTO">
@@ -623,141 +638,6 @@
         </if>
     </select>
 
-    <!--各科室缺陷占比病历列表-->
-    <select id="levelStatisticsByDeptPage" resultType="com.diagbot.dto.BehospitalInfoDeptDTO">
-        SELECT * from (
-        SELECT
-        t.*,
-        t3.name as medoup_name,
-        CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
-        CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
-        g.check_type as ch_type,
-        h.check_type AS mr_type,
-        g.check_name as ch_name,
-        h.check_name as mr_name,
-        g.check_time as ch_time,
-        h.check_time AS mr_time
-        FROM
-        ( SELECT
-        a.*,
-        IFNULL(b.level, '未评分') AS `level`,
-        b.grade_type,
-        b.score_res,
-        e.score_res as score_bn,
-        b.gmt_create AS grade_time,
-        CONCAT( ifnull(c.age,'') ,ifnull(c.age_unit,'') )as age
-        FROM
-        med_behospital_info a
-        JOIN sys_user_dept d
-        ON a.hospital_id = d.hospital_id
-        AND a.beh_dept_id = d.dept_id
-        LEFT JOIN med_qcresult_info b
-        ON a.behospital_code = b.behospital_code
-        AND b.is_deleted = 'N'
-        LEFT JOIN med_qcresult_cases e
-        on  a.behospital_code = e.behospital_code
-        AND e.is_deleted = 'N'
-        and e.cases_id = 243
-        LEFT JOIN med_home_page c
-        ON a.behospital_code = c.behospital_code
-        AND c.is_deleted = 'N'
-        WHERE d.is_deleted = 'N'
-        AND d.user_id = #{userId}
-        ) t
-        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
-        ON t.behospital_code = g.behospital_code
-        AND t.hospital_id = g.hospital_id
-        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
-        ON t.behospital_code = h.behospital_code
-        AND t.hospital_id = h.hospital_id
-        LEFT JOIN bas_doctor_info t2 ON t.doctor_id = t2.doctor_id
-        AND t.hospital_id = t2.hospital_id
-        AND t2.is_deleted = 'N'
-        LEFT JOIN sys_medoup t3 ON t2.group_id = t3.`code`
-        AND t3.is_deleted = 'N'
-        where t.is_deleted = 'N'
-        <if test="medoupName != null and medoupName != ''">
-            AND t3.name = #{medoupName}
-        </if>
-        <if test="wardName != null and wardName != ''">
-            AND t.ward_name = #{wardName}
-        </if>
-        <if test="diagnose != null and diagnose != ''">
-            AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
-        </if>
-        <if test="deptName != null and deptName != ''">
-            and t.beh_dept_name = #{deptName}
-        </if>
-        <if test="deptId != null and deptId != ''">
-            and t.beh_dept_Id = #{deptId}
-        </if>
-        <if test="doctorName != null and doctorName != ''">
-            and t.doctor_name = #{doctorName}
-        </if>
-        <if test="doctorCode != null and doctorCode != ''">
-            and t.doctor_id = #{doctorCode}
-        </if>
-        <if test="doctorId != null and doctorId != ''">
-            and t.doctor_id = #{doctorId}
-        </if>
-        <if test="name != null and name != ''">
-            and t.name like CONCAT('%',#{name},'%')
-        </if>
-        <if test="fileCode != null and fileCode != ''">
-            and t.file_code like CONCAT('%',#{fileCode},'%')
-        </if>
-        <if test="hospitalId != null">
-            and t.hospital_id = #{hospitalId}
-        </if>
-        <if test="behospitalCode != null and behospitalCode != ''">
-            and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
-        </if>
-        <if test="behosDateStart != null">
-            <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
-        </if>
-        <if test="behosDateEnd != null">
-            <![CDATA[ and t.behospital_date < #{behosDateEnd}]]>
-        </if>
-        <if test="leaveHosDateStart != null">
-            <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
-        </if>
-        <if test="leaveHosDateEnd != null">
-            <![CDATA[ and t.leave_hospital_date < #{leaveHosDateEnd}]]>
-        </if>
-        <if test="level != null and level != ''">
-            and t.level = #{level}
-        </if>
-        <if test="isPlacefile != null and isPlacefile != ''">
-            and t.is_placefile = #{isPlacefile}
-        </if>
-        and t.qc_type_id != 0) p
-        where p.is_deleted="N"
-        <if test="checkStatus != null ">
-            and p.check_status = #{checkStatus}
-        </if>
-        <if test="mrStatus != null ">
-            AND p.mr_status = #{mrStatus}
-        </if>
-        <if test="chName != null and chName !=''">
-            AND p.ch_name like CONCAT('%',#{chName},'%')
-        </if>
-        <if test="mrName != null and mrName !=''">
-            AND p.mr_name like CONCAT('%',#{mrName},'%')
-        </if>
-        <if test="chTimeStart != null">
-            <![CDATA[ and p.ch_time >= #{chTimeStart}]]>
-        </if>
-        <if test="chTimeEnd != null">
-            <![CDATA[ and p.ch_time < #{chTimeEnd}]]>
-        </if>
-        <if test="mrTimeStart != null">
-            <![CDATA[ and p.mr_time >= #{mrTimeStart}]]>
-        </if>
-        <if test="mrTimeEnd != null">
-            <![CDATA[ and p.mr_time < #{mrTimeEnd}]]>
-        </if>
-    </select>
-
     <!-- 出院总人数统计-全院-首页 -->
     <select id="leaveHosCount" parameterType="com.diagbot.vo.FilterVO" resultType="int">
         SELECT

+ 0 - 16
src/main/resources/mapper/MedBehospitalTypeMapper.xml

@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.diagbot.mapper.MedBehospitalTypeMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.MedBehospitalType">
-        <id column="id" property="id" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="behospital_type" property="behospitalType" />
-        <result column="value" property="value" />
-        <result column="create_time" property="createTime" />
-        <result column="is_deleted" property="isDeleted" />
-    </resultMap>
-
-</mapper>

+ 0 - 591
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -1,591 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.diagbot.mapper.MedCheckInfoMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.MedCheckInfo">
-        <id column="id" property="id" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="check_id" property="checkId" />
-        <result column="check_name" property="checkName" />
-        <result column="check_time" property="checkTime" />
-        <result column="status" property="status" />
-        <result column="check_type" property="checkType" />
-        <result column="job_creator" property="jobCreator" />
-        <result column="job_creator_name" property="jobCreatorName" />
-        <result column="job_create_time" property="jobCreateTime" />
-        <result column="job_type" property="jobType" />
-        <result column="job_distributor" property="jobDistributor" />
-        <result column="job_distribution_name" property="jobDistributionName" />
-        <result column="job_distribution_time" property="jobDistributionTime" />
-    </resultMap>
-    <!--获取核查人员用户科室、姓名、角色-->
-    <select id="getCheckUser" resultType="com.diagbot.dto.DeptCheckUserDTO">
-        SELECT DISTINCT
-        a.*, r.`code` wardCode,
-        r.`name` wardName,
-        m.`code` medoupCode,
-        m.`name` medoupName
-        FROM
-        (
-        SELECT DISTINCT
-        a.id doctorId,
-        a.username,
-        a.linkman doctorName,
-        c.dept_id deptId,
-        d.dept_name deptName
-        from
-        sys_user a,sys_user_role b,sys_user_dept c ,bas_dept_info d
-        where a.id = b.user_id and a.is_deleted = "N" and b.is_deleted = "N" and c.is_deleted = "N" and a.id = c.user_id
-        and d.dept_id = c.dept_id and c.hospital_id = d.hospital_id
-        and c.hospital_id = #{hospitalId}
-        <if test="roleIds !=null and roleIds.size()!=0 ">
-            and b.role_id in
-            <foreach collection="roleIds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-
-        <if test="deptIds !=null and deptIds.size()!=0">
-            and c.dept_id in
-            <foreach collection="deptIds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="deptStations !=null and deptStations.size()!=0">
-            and d.station in
-            <foreach collection="deptStations" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        order by c.dept_id
-        ) a
-        LEFT JOIN sys_region_dept rd ON rd.dept_id = a.deptId
-        AND rd.is_deleted = 'N'
-        LEFT JOIN sys_region r ON r.`code` = rd.region_code
-        AND r.is_deleted = 'N'
-        LEFT JOIN bas_doctor_info mu ON mu.doctor_id = a.username
-        AND mu.is_deleted = 'N'
-        LEFT JOIN sys_medoup m ON m.`code` = mu.group_id
-        AND m.is_deleted = 'N'
-        WHERE
-        1 = 1
-        <if test="region !=null and region.size()!=0 ">
-            AND r.`code` IN
-            <foreach collection="region" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="medoup !=null and medoup.size()!=0 ">
-            AND m.`code` IN
-            <foreach collection="medoup" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-
-    </select>
-    <!--核查人员通过id获取核查人员的核查任务数-->
-    <select id="getDeptJobNumByUserId" resultType="com.diagbot.dto.DeptCheckUserDTO">
-        SELECT
-        b.check_id doctorId,
-        count(*) AS jobNum,
-        b.`status`
-        FROM
-        med_behospital_info a
-        LEFT JOIN bas_doctor_info d ON d.doctor_id = a.doctor_id
-        AND d.hospital_id = a.hospital_id
-        AND d.is_deleted = 'N'
-        LEFT JOIN med_check_info b ON a.behospital_code = b.behospital_code
-        AND a.hospital_id = b.hospital_id
-        LEFT JOIN sys_user u ON u.id = b.check_id
-        AND u.is_deleted = 'N'
-        LEFT JOIN bas_doctor_info doctor ON u.username = doctor.doctor_id
-        AND doctor.is_deleted = 'N'
-        where b.is_deleted = 'N' and a.is_deleted = 'N'   and b.`status` is not null
-        <if test="jobType != null ">
-            and b.job_type = #{jobType}
-        </if>
-
-        <if test="userList !=null and userList.size!=0">
-            and b.check_id in
-            <foreach collection="userList" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="deptIds !=null and deptIds.size()!=0 and jobType ==0">
-            and a.beh_dept_id in
-            <foreach collection="deptIds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="deptIds !=null and deptIds.size()!=0 and jobType ==2">
-            and a.beh_dept_id not in
-            <foreach collection="deptIds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="jobType ==0">
-            GROUP BY b.check_id,b.`status`
-        </if>
-        <if test="jobType ==1 or jobType ==2">
-            GROUP BY b.check_id,b.`status`
-        </if>
-    </select>
-
-
-    <!--获取待分配核查任务列表-->
-    <select id="getCheckList" resultType="com.diagbot.dto.CheckJobDTO">
-        SELECT
-        a.behospital_code behospitalCode,
-        a.beh_dept_name behospitalDept,
-        a.doctor_name attendingDoctor,
-        a.leave_hospital_date leaveHospitalDate,
-        a.`name`,
-        b.`value`,
-        a.id,
-        a.beh_dept_id behospitalDeptId,
-        a.job_create_time jobCreateTime,
-        a.wardCode,
-        a.wardName,
-        a.medoupCode,
-        a.medoupName
-        from
-        (
-        SELECT
-        a.behospital_code,
-        a.`name`,
-        a.beh_dept_name,
-        a.doctor_name,
-        a.leave_hospital_date,
-        a.hospital_id,
-        a.beh_dept_id,
-        b.job_create_time,
-        b.id,
-        a.wardCode,
-        a.wardName,
-        a.medoupCode,
-        a.medoupName
-        FROM
-        (SELECT
-        a.behospital_code,
-        a.`name`,
-        a.beh_dept_name,
-        a.doctor_name,
-        a.leave_hospital_date,
-        a.hospital_id,
-        a.beh_dept_id,
-        a.ward_code wardCode,
-        a.ward_name wardName,
-        m.`code` medoupCode,
-        m.`name` medoupName
-        FROM
-        med_behospital_info a
-        LEFT JOIN bas_doctor_info mu ON mu.doctor_id = a.doctor_id
-        AND mu.is_deleted = 'N'
-        LEFT JOIN sys_medoup m ON m.`code` = mu.group_id
-        AND m.is_deleted = 'N'
-        WHERE
-        a.is_deleted = 'N'
-        <if test="behosDateStart != null and behosDateStart != ''">
-            <![CDATA[ AND a.leave_hospital_date >= #{behosDateStart}]]>
-        </if>
-        <if test="behosDateEnd != null and behosDateEnd != ''">
-            <![CDATA[ AND a.leave_hospital_date <= #{behosDateEnd}]]>
-        </if>
-        <if test="doctorName !=null and doctorName != ''">and a.doctor_name LIKE CONCAT('%',#{doctorName},'%')
-        </if>
-        <if test="behospitalCode !=null and behospitalCode != ''">
-            and a.behospital_code LIKE CONCAT('%',#{behospitalCode},'%')
-        </if>
-        <if test="fileCode !=null and fileCode != ''">
-            and a.file_code LIKE CONCAT('%',#{fileCode},'%')
-        </if>
-        <if test="name !=null and name != ''">
-            and a.`name` LIKE CONCAT('%',#{name},'%')
-        </if>
-
-        <if test="wards !=null and wards.size()!=0 ">
-            AND a.ward_code in
-            <foreach collection="wards" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-
-        <if test="doctorIds !=null and doctorIds.size()!=0 ">
-            AND (a.doctor_id in
-            <foreach collection="doctorIds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-            <if test="depts !=null and depts.size()!=0 and(medoups!=null and medoups.size==0)">
-                or a.beh_dept_id in
-                <foreach collection="depts" item="item" open="(" close=")" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-            )
-        </if>
-        ) a
-        JOIN med_check_info b ON a.behospital_code = b.behospital_code
-        AND a.hospital_id = b.hospital_id
-        WHERE
-        b.is_deleted = 'N'
-        AND b.job_distribution_name IS NULL
-        AND b.`status` = 0
-        <if test="jobType !=null and jobType != ''">
-            and b.job_type = #{jobType}
-        </if>
-        <if test="startTime != null and startTime != ''">
-            <![CDATA[ AND b.job_create_time >= #{startTime}]]>
-        </if>
-        <if test="endTime != null and endTime != ''">
-            <![CDATA[ AND b.job_create_time <= #{endTime}]]>
-        </if>
-        ) a
-        JOIN med_behospital_type b on a.behospital_code = b.behospital_code
-        and a.hospital_id = b.hospital_id and b.is_deleted = 'N' and  b.`value` is not null
-        <if test="values !=null and values.size()!=0 ">
-            and b.`value` in
-            <foreach collection="values" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-    </select>
-
-
-    <!--获取指定核查人员的核查任务-->
-    <select id="getCheckListByUserId" resultType="com.diagbot.dto.CheckJobDTO">
-        SELECT
-        a.behospital_code behospitalCode,
-        a.beh_dept_name behospitalDept,
-        a.doctor_name attendingDoctor,
-        a.leave_hospital_date leaveHospitalDate,
-        a.`name`,
-        b.`value`,
-        a.id,
-        a.job_distributor jobDistributor,
-        a.job_distribution_name jobDistributorName
-        from
-        (select
-            a.behospital_code,
-            a.`name`,
-            a.beh_dept_name,
-            a.doctor_name,
-            a.leave_hospital_date,
-            a.hospital_id,
-            a.beh_dept_id,
-            b.id,
-            b.job_distributor,
-            b.job_distribution_name
-            from
-            med_behospital_info a ,med_check_info b
-            where a.behospital_code = b.behospital_code and a.hospital_id = b.hospital_id and a.is_deleted = 'N'
-            and b.is_deleted = 'N' and b.`status` = 0
-            <if test="jobType !=null and jobType != ''">
-                and b.job_type = #{jobType}
-            </if>
-            <if test="startTime != null and startTime != ''">
-                <![CDATA[ AND b.job_create_time >= #{startTime}]]>
-            </if>
-            <if test="endTime != null and endTime != ''">
-                <![CDATA[ AND b.job_create_time <= #{endTime}]]>
-            </if>
-
-            <if test="behosDateStart != null and behosDateStart != ''">
-                <![CDATA[ AND a.leave_hospital_date >= #{behosDateStart}]]>
-            </if>
-            <if test="behosDateEnd != null and behosDateEnd != ''">
-                <![CDATA[ AND a.leave_hospital_date <= #{behosDateEnd}]]>
-            </if>
-            <if test="checkId !=null and checkId != ''">
-                and b.check_id = #{checkId}
-            </if>
-            <if test="depts !=null and depts.size()!=0 and jobType==0">
-                and a.beh_dept_id in
-                <foreach collection="depts" item="item" open="(" close=")" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="depts !=null and depts.size()!=0 and jobType==2">
-                and a.beh_dept_id not in
-                <foreach collection="depts" item="item" open="(" close=")" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-        ) a LEFT JOIN med_behospital_type b on a.behospital_code = b.behospital_code
-        and a.hospital_id = b.hospital_id and b.is_deleted = 'N'
-    </select>
-    <select id="getCheckWorkPage" resultType="com.diagbot.dto.CheckWorkDTO">
-        SELECT
-        mbi.behospital_code behospitalCode,
-        mbi.`name`,
-        mbi.file_code fileCode,
-        mbi.sex,
-        TIMESTAMPDIFF(
-        DAY,
-        ifnull(mhp.birthday, mbi.birthday),
-        mbi.behospital_date
-        ) AS birthday,
-        mhp.age,
-        mbi.ward_code wardCode,
-        mbi.ward_name wardName,
-        mbi.beh_dept_id deptId,
-        mbi.beh_dept_name behDeptName,
-        mbi.leave_hospital_date leaveHospitalDate,
-        mhp.behospital_day_num + 0 behospitalDayNum,
-        mbi.doctor_id doctorId,
-        mbi.doctor_name doctorName,
-        mqi.score_res scoreRes,
-        mqi.`level`,
-        mbi.diagnose,
-        CASE
-        WHEN mbt.behospital_type = '出院病人' THEN
-        '6'
-        WHEN mbt.behospital_type = '死亡病人' THEN
-        '6'
-        WHEN mbt.behospital_type = '危重病人' THEN
-        '4'
-        WHEN mbt.behospital_type = '抢救病人' THEN
-        '5'
-        WHEN mbt.behospital_type = '手术病人' THEN
-        '2'
-        WHEN mbt.behospital_type = '疑难病人' THEN
-        '3'
-        WHEN mbt.behospital_type = '输血病人' THEN
-        '4'
-        ELSE
-        '0'
-        END AS score,
-        CASE
-        WHEN ISNULL(mci.job_create_time) THEN
-        '未生成'
-        ELSE
-        '已生成'
-        END AS creatStatus,
-        mci.job_create_time jobCreateTime,
-        mci.job_creator jobCreator,
-        mci.job_creator_name jobCreatorName,
-        mci.check_time checkTime,
-        mci.job_distribution_time jobDistributionTime,
-        medoup.`code` medoupCode,
-        medoup.`name` medoupName
-        FROM
-        med_behospital_info mbi
-        LEFT JOIN med_home_page mhp ON mbi.behospital_code = mhp.behospital_code
-        AND mbi.hospital_id = mhp.hospital_id
-        AND mhp.is_deleted = 'N'
-        LEFT JOIN bas_doctor_info doctor ON doctor.doctor_id = mbi.doctor_id
-        AND doctor.is_deleted = 'N'
-        LEFT JOIN sys_medoup medoup ON medoup.`code` = doctor.group_id
-        AND medoup.is_deleted = 'N'
-        LEFT JOIN med_check_info mci ON mbi.behospital_code = mci.behospital_code
-        AND mbi.hospital_id = mci.hospital_id
-        AND mci.is_deleted = 'N'
-        LEFT JOIN med_qcresult_info mqi ON mbi.behospital_code = mqi.behospital_code
-        AND mbi.hospital_id = mqi.hospital_id
-        AND mqi.is_deleted = 'N'
-        JOIN med_behospital_type mbt ON mbi.behospital_code = mbt.behospital_code
-        AND mbi.hospital_id = mbt.hospital_id
-        AND mbt.is_deleted = 'N'
-        WHERE
-        mbi.hospital_id=#{hospitalId} AND mbi.is_deleted = 'N' and mqi.score_res is not null
-        AND mbi.qc_type_id != 0
-        AND mci.check_id is null
-        <if test="startDate != null">
-            <![CDATA[ AND mbi.leave_hospital_date >= #{startDate}]]>
-        </if>
-        <if test="endDate != null">
-            <![CDATA[ AND mbi.leave_hospital_date < #{endDate}]]>
-        </if>
-        <if test="creatStatus != null and creatStatus == '1'.toString()">
-            AND mci.job_create_time is not null
-            <if test="jobType != null and jobType != ''">
-                AND mci.job_type=#{jobType}
-            </if>
-        </if>
-        <if test="creatStatus != null and creatStatus == '0'.toString()">
-            AND mci.job_create_time is null
-        </if>
-        <if test="name != null and name != ''">
-            AND mbi.`name` like CONCAT('%',#{name},'%')
-        </if>
-        <if test="behospitalCode != null and behospitalCode != ''">
-            AND mbi.behospital_code like CONCAT('%',#{behospitalCode},'%')
-        </if>
-        <if test="fileCode != null and fileCode != ''">
-            AND mbi.file_code like CONCAT('%',#{fileCode},'%')
-        </if>
-        <if test="smallDay != null">
-            <![CDATA[ AND mhp.behospital_day_num >= #{smallDay}]]>
-        </if>
-        <if test="bigDay != null">
-            <![CDATA[ AND mhp.behospital_day_num <= #{bigDay}]]>
-        </if>
-        <if test="doctorName != null and doctorName != ''">
-            AND mbi.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
-        </if>
-        <if test="diagnose != null and diagnose != ''">
-            AND mbi.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
-        </if>
-        <if test="level != null and level != ''">
-            AND mqi.`level`= #{level}
-        </if>
-        <if test="isPlacefile != null and isPlacefile != ''">
-            AND mbi.is_placefile = #{isPlacefile}
-        </if>
-        <if test="values !=null and values.size > 0">
-            and mbt.`value` in
-            <foreach collection="values" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-
-        AND( 1=1
-        <if test="wards !=null and wards.size > 0 and depts.size ==0">
-            AND mbi.ward_code IN
-            <foreach collection="wards" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="depts !=null and depts.size > 0">
-            AND mbi.beh_dept_id in
-            <foreach collection="depts" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="medoups !=null and medoups.size > 0">
-            AND medoup.`code` IN
-            <foreach collection="medoups" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-
-        <if test="doctorIds !=null and doctorIds.size > 0 and orderDepts !=null and orderDepts.size>0">
-            OR (mbi.beh_dept_id in
-            <foreach collection="orderDepts" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-            and mbi.doctor_id IN
-            <foreach collection="doctorIds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-            )
-        </if>
-        )
-    </select>
-
-    <!--通过住院号,取消核查任务-->
-    <update id="deleteBatchCodes">
-        <foreach collection="list" item="item"  separator=";">
-            delete from
-            med_check_info
-            where behospital_code = #{item} and is_deleted = 'N'
-        </foreach>
-    </update>
-
-    <select id="checkedRecordList" resultType="com.diagbot.dto.CheckedRecordListDTO">
-        SELECT t1.*,SUM(if(t2.behospital_code is null,0,1)) as casesEntryNum
-        from
-        (select
-        b.behospital_code as behospitalCode,
-        a.`status` as status,
-        b.ward_code wardCode,
-        b.ward_name wardName,
-        b.beh_dept_id AS behDeptId,
-        b.beh_dept_name AS behDeptName,
-        medoup.`code` medoupCode,
-        medoup.`name` medoupName,
-        b.`name` as name,
-        b.file_code as fileCode,
-        b.doctor_name as doctorName,
-        b.leave_hospital_date as leaveHospitalDate,
-        a.job_create_time as jobCreateTime,
-        a.job_distribution_time as jobDistributionTime,
-        a.check_id as checkId,
-        a.check_name as checkName,
-        a.check_time as checkTime,
-        c.`level` as level,
-        c.score_res as scoreRes,
-        CASE WHEN a.job_type='0' THEN '科室任务'
-        WHEN a.job_type='1' THEN '质控科任务'
-        WHEN a.job_type='2' THEN '院级任务' END AS jobTypeName,
-        <!-- 张三是A科室的监管员,李四是A科室和B科室的普通质控员,那么张三在核查任务列表中不能看到李四B科室的数据  -->
-        case when a.job_type='0' and FIND_IN_SET(b.beh_dept_id,#{currentDeptIds})=0 then 0 else 1 end as isDel
-        from med_check_info a join med_behospital_info b on a.hospital_id=b.hospital_id and
-        a.behospital_code=b.behospital_code
-        LEFT JOIN bas_doctor_info doctor ON doctor.doctor_id = b.doctor_id
-        AND doctor.is_deleted = 'N'
-        LEFT JOIN sys_medoup medoup ON medoup.`code` = doctor.group_id
-        AND medoup.is_deleted = 'N'
-        JOIN med_qcresult_info c on b.hospital_id=c.hospital_id and b.behospital_code=c.behospital_code and
-        b.is_deleted='N' and c.is_deleted = 'N'
-        where a.hospital_id=#{hospitalId} and a.is_deleted='N'
-        and b.hospital_id=#{hospitalId} and b.is_deleted='N'
-        and c.hospital_id=#{hospitalId}
-        and a.check_id in
-        <foreach collection="currentGeneralUserIds" item="currentGeneralUserId" separator="," close=")" open="(">
-            #{currentGeneralUserId}
-        </foreach>
-        <if test="status!=null">
-            and a.`status`=#{status}
-        </if>
-        <if test="depts !=null and depts.size()!=0 ">
-            and b.beh_dept_id in
-            <foreach collection="depts" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="wards !=null and wards.size()!=0 ">
-            AND b.ward_code in
-            <foreach collection="wards" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="medoups !=null and medoups.size()!=0 ">
-            AND  medoup.`code` in
-            <foreach collection="medoups" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-
-        <if test="name!=null and name!=''">
-            and b.`name` like concat('%',#{name},'%')
-        </if>
-        <if test="behospitalCode!=null and behospitalCode!=''">
-            and b.behospital_code like concat('%',#{behospitalCode},'%')
-        </if>
-        <if test="behospitalCode!=null and behospitalCode!=''">
-            and b.behospital_code like concat('%',#{behospitalCode},'%')
-        </if>
-        <if test="doctorName!=null and doctorName!=''">
-            and b.file_code like concat('%',#{fileCode},'%')
-        </if>
-        <if test="jobDistributionTimeStart!=null">
-            and a.job_distribution_time >= #{jobDistributionTimeStart}
-        </if>
-        <if test="jobDistributionTimeEnd!=null">
-            and #{jobDistributionTimeEnd} >= a.job_distribution_time
-        </if>
-        <if test="checkName!=null and checkName!=''">
-            and a.check_name like concat('%',#{checkName},'%')
-        </if>
-        <if test="level!=null and level!=''">
-            and c.`level`=#{level}
-        </if>
-        <if test="checkJobTypes!=null and checkJobTypes.size>0">
-            and a.job_type in
-            <foreach collection="checkJobTypes" item="checkJobType" separator="," close=")" open="(">
-                #{checkJobType}
-            </foreach>
-        </if>
-        ) t1 left join med_qcresult_detail t2 on t1.behospitalCode=t2.behospital_code and t2.hospital_id=#{hospitalId} and t2.is_deleted='N'
-
-        group by t1.behospitalCode
-    </select>
-
-</mapper>

+ 22 - 0
src/main/resources/mapper/MedExamineInfoMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.MedExamineInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.MedExamineInfo">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="behospital_code" property="behospitalCode" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="check_id" property="checkId" />
+        <result column="check_name" property="checkName" />
+        <result column="check_time" property="checkTime" />
+        <result column="status" property="status" />
+        <result column="action" property="action" />
+    </resultMap>
+
+</mapper>

+ 1 - 10
src/main/resources/mapper/QcCasesEntryMapper.xml

@@ -59,8 +59,6 @@
 
     <select id="getQcResultAlgVO" parameterType="com.diagbot.vo.QcResultAlgQueryVO" resultType="com.diagbot.vo.QcResultAlgVO">
         SELECT DISTINCT
-            t4.cases_id AS casesId,
-            t4.score AS casesScore,
             t1.cases_entry_id AS casesEntryId,
             <choose>
                 <when test='isPlacefile != null and isPlacefile =="0"'>
@@ -75,20 +73,13 @@
             t2.code
         FROM
             qc_cases_entry_hospital t1,
-            qc_cases_entry t2,
-            qc_cases t3,
-            qc_cases_hospital t4
+            qc_cases_entry t2
         WHERE
             t1.cases_entry_id = t2.id
-        AND t2.cases_id = t3.id
-        AND t3.id = t4.cases_id
         AND t1.is_deleted = 'N'
         AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t4.is_deleted = 'N'
         <if test="hospitalId != null and hospitalId != ''">
             AND t1.hospital_id = #{hospitalId}
-            AND t4.hospital_id = #{hospitalId}
         </if>
         <if test="codeList != null and codeList.size() > 0">
             AND t2.`code` IN