Преглед изворни кода

Merge branch 'dev/20220228_v3.0.1通用版_渠道管理第一期' into debug

songxinlu пре 3 година
родитељ
комит
9f5508cb56
34 измењених фајлова са 1155 додато и 110 уклоњено
  1. 2 0
      common/src/main/java/com/lantone/common/vo/DataCompareVO.java
  2. 12 12
      daqe-center/src/main/java/com/lantone/daqe/dto/BlockLossTypeGatherDTO.java
  3. 40 0
      daqe-center/src/main/java/com/lantone/daqe/dto/GetConceptLibraryPageDTO.java
  4. 2 2
      daqe-center/src/main/java/com/lantone/daqe/dto/GetRecordTemplateManageDTO.java
  5. 83 0
      daqe-center/src/main/java/com/lantone/daqe/entity/ConceptLibrary.java
  6. 42 0
      daqe-center/src/main/java/com/lantone/daqe/enums/ConceptLibraryTypeEnum.java
  7. 107 83
      daqe-center/src/main/java/com/lantone/daqe/facade/BlockLossManagementFacade.java
  8. 1 1
      daqe-center/src/main/java/com/lantone/daqe/facade/ColumnResultManagementFacade.java
  9. 1 1
      daqe-center/src/main/java/com/lantone/daqe/facade/ColumnVerifyManagementFacade.java
  10. 50 0
      daqe-center/src/main/java/com/lantone/daqe/facade/CurrencyManagementFacade.java
  11. 203 0
      daqe-center/src/main/java/com/lantone/daqe/facade/HisDataManagementFacade.java
  12. 14 0
      daqe-center/src/main/java/com/lantone/daqe/facade/base/ConceptLibraryFacade.java
  13. 13 0
      daqe-center/src/main/java/com/lantone/daqe/mapper/ConceptLibraryMapper.java
  14. 13 0
      daqe-center/src/main/java/com/lantone/daqe/service/ConceptLibraryService.java
  15. 17 0
      daqe-center/src/main/java/com/lantone/daqe/service/impl/ConceptLibraryServiceImpl.java
  16. 1 1
      daqe-center/src/main/java/com/lantone/daqe/vo/ColumnInfoVO.java
  17. 36 0
      daqe-center/src/main/java/com/lantone/daqe/vo/GetConceptLibraryPageVO.java
  18. 35 0
      daqe-center/src/main/java/com/lantone/daqe/web/CurrencyManagmentController.java
  19. 4 4
      daqe-center/src/main/resources/mapper/BlocklossResultMapper.xml
  20. 1 1
      daqe-center/src/main/resources/mapper/ColumnVerifyMapper.xml
  21. 5 0
      daqe-center/src/main/resources/mapper/ConceptLibraryMapper.xml
  22. 19 0
      daqe-center/src/main/resources/mapper/base/BaseConceptLibraryMapper.xml
  23. 22 1
      daqe-center/src/main/resources/upgrade/V1__daqe_init.sql
  24. 3 2
      dblayer-mbg/src/test/java/com/lantone/dblayermbg/CodeAutoGenerator.java
  25. 40 0
      security-center/src/main/java/com/lantone/security/dto/GetMedoupManageDTO.java
  26. 1 0
      security-center/src/main/java/com/lantone/security/facade/LogManagementFacade.java
  27. 168 0
      security-center/src/main/java/com/lantone/security/facade/MedoupManagementFacade.java
  28. 4 1
      security-center/src/main/java/com/lantone/security/mapper/MedoupMapper.java
  29. 38 0
      security-center/src/main/java/com/lantone/security/vo/AddMedoupManageVO.java
  30. 24 0
      security-center/src/main/java/com/lantone/security/vo/DeleteMedoupManageVO.java
  31. 24 0
      security-center/src/main/java/com/lantone/security/vo/GetMedoupManageVO.java
  32. 42 0
      security-center/src/main/java/com/lantone/security/vo/UpdateMedoupManageVO.java
  33. 57 0
      security-center/src/main/java/com/lantone/security/web/MedoupManagementController.java
  34. 31 1
      security-center/src/main/resources/mapper/MedoupMapper.xml

+ 2 - 0
common/src/main/java/com/lantone/common/vo/DataCompareVO.java

@@ -19,6 +19,8 @@ import java.util.Date;
 public class DataCompareVO implements Serializable {
 
     private static final long serialVersionUID = 4949654901048650724L;
+    @ApiModelProperty(value = "医院id", hidden = true)
+    private Long hospitalId;
 
     @ApiModelProperty(value = "开始日期")
     private Date startDate;

+ 12 - 12
daqe-center/src/main/java/com/lantone/daqe/dto/BlockLossTypeGatherDTO.java

@@ -20,29 +20,29 @@ public class BlockLossTypeGatherDTO implements Serializable {
 
     private static final long serialVersionUID = -4656915107891039438L;
     @ApiModelProperty(value = "HIS数量")
-    private Integer hisNum;
+    private Integer hisNum = 0;
     @ApiModelProperty(value = "接口日志数量")
-    private Integer logNum;
+    private Integer logNum = 0;
     @ApiModelProperty(value = "实际数量")
-    private Integer realNum;
+    private Integer realNum = 0;
     @ApiModelProperty(value = "合计丢失数量")
-    private Integer allLossNum;
+    private Integer allLossNum = 0;
     @ApiModelProperty(value = "外部丢失数量")
-    private Integer outLossNum;
+    private Integer outLossNum = 0;
     @ApiModelProperty(value = "外部文书丢失数量")
-    private Integer outRecNum;
+    private Integer outRecNum = 0;
     @ApiModelProperty(value = "外部病历号丢失数量")
-    private Integer outCodeNum;
+    private Integer outCodeNum = 0;
     @ApiModelProperty(value = "外部病案首页丢失数量")
-    private Integer outHomePageNum;
+    private Integer outHomePageNum = 0;
     @ApiModelProperty(value = "内部丢失数量")
-    private Integer inLossNum;
+    private Integer inLossNum = 0;
     @ApiModelProperty(value = "内部文书丢失数量")
-    private Integer inRecNum;
+    private Integer inRecNum = 0;
     @ApiModelProperty(value = "内部病历号丢失数量")
-    private Integer inCodeNum;
+    private Integer inCodeNum = 0;
     @ApiModelProperty(value = "内部病案首页丢失数量")
-    private Integer inHomePageNum;
+    private Integer inHomePageNum = 0;
 
 
 }

+ 40 - 0
daqe-center/src/main/java/com/lantone/daqe/dto/GetConceptLibraryPageDTO.java

@@ -0,0 +1,40 @@
+package com.lantone.daqe.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 获取标准词和同义词(一对一)分页列表-接口出参
+ * @author: rengb
+ * @time: 2022/2/27 14:30
+ */
+@ApiModel(value = "获取标准词和同义词(一对一)分页列表-接口出参")
+@Getter
+@Setter
+public class GetConceptLibraryPageDTO implements Serializable {
+
+    private static final long serialVersionUID = -3423432863909470619L;
+
+    /**
+     * 标准词
+     */
+    @ApiModelProperty(value = "标准词")
+    private String standard;
+
+    /**
+     * 同义词
+     */
+    @ApiModelProperty(value = "同义词")
+    private String synonym;
+
+    /**
+     * 术语类型
+     */
+    @ApiModelProperty(value = "术语类型")
+    private String type;
+
+}

+ 2 - 2
daqe-center/src/main/java/com/lantone/daqe/dto/GetRecordTemplateManageDTO.java

@@ -40,8 +40,8 @@ public class GetRecordTemplateManageDTO implements Serializable {
     @ApiModelProperty(value = "模板内容")
     private String content;
 
-    @ApiModelProperty(value = "模板类型")
-    private String contentType;
+    @ApiModelProperty(value = "模板类型,模板类型,0:未知,1:html,2:xml ")
+    private String type;
 
 
 }

+ 83 - 0
daqe-center/src/main/java/com/lantone/daqe/entity/ConceptLibrary.java

@@ -0,0 +1,83 @@
+package com.lantone.daqe.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 术语表 实体类
+ * </p>
+ */
+@Data
+@TableName("base_concept_library")
+public class ConceptLibrary implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 标准词
+     */
+    @TableField("standard")
+    private String standard;
+
+    /**
+     * 同义词
+     */
+    @TableField("synonym")
+    private String synonym;
+
+    /**
+     * 术语类型,1:诊断,2:手术,3:药品
+     */
+    @TableField("type")
+    private String type;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    @TableField("is_deleted")
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    @TableField("gmt_create")
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    @TableField("gmt_modified")
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    @TableField("creator")
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    @TableField("modifier")
+    private String modifier;
+
+    /**
+     * 备注
+     */
+    @TableField("remark")
+    private String remark;
+
+}

+ 42 - 0
daqe-center/src/main/java/com/lantone/daqe/enums/ConceptLibraryTypeEnum.java

@@ -0,0 +1,42 @@
+package com.lantone.daqe.enums;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 术语类型
+ * @author: zhanghang
+ * @time: 2022/3/11 16:03
+ */
+public enum ConceptLibraryTypeEnum {
+    DISEASE("1", "诊断"),
+    OPERATION("2", "手术"),
+    DRUG("3", "药品");
+
+    @Getter
+    @Setter
+    private String key;
+
+    @Getter
+    @Setter
+    private String name;
+
+    ConceptLibraryTypeEnum(String key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ConceptLibraryTypeEnum getEnum(String key) {
+        for (ConceptLibraryTypeEnum item : ConceptLibraryTypeEnum.values()) {
+            if (item.key.equals(key)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(String key) {
+        ConceptLibraryTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+}

+ 107 - 83
daqe-center/src/main/java/com/lantone/daqe/facade/BlockLossManagementFacade.java

@@ -68,6 +68,9 @@ public class BlockLossManagementFacade {
     @Autowired
     private OperationLogService operationLogService;
 
+    @Autowired
+    private HisDataManagementFacade hisDataManagementFacade;
+
 
     /**
      * 获取病历数据丢失明细分页列表
@@ -103,8 +106,10 @@ public class BlockLossManagementFacade {
         Boolean flag = false;
         //====1.获取已丢失状态记录,去数据库中对比判断是否补录
         List<BlocklossResult> lossResults = blocklossResultFacade.list(new QueryWrapper<BlocklossResult>()
-                .ge(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getStartDate())
-                .le(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getEndDate())
+                .select("id,behospital_code,rec_id,loss_type,loss_way")
+//                .ge(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getStartDate())
+//                .le(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getEndDate())
+                .eq(SysUserUtils.getCurrentHospitalId() != null, "hospital_id", SysUserUtils.getCurrentHospitalId())
                 .eq("status", LossStatusEnum.IS_LOSS.getKey())
                 .eq("is_deleted", IsDeleteEnum.N.getKey()));
         Map<String, List<BlocklossResult>> lossResultMap = null;
@@ -135,26 +140,29 @@ public class BlockLossManagementFacade {
         //病历数据
         List<String> dataBaseBehospitalCodes = behospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
                 .select("behospital_code")
-                .ge(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getStartDate())
-                .le(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getEndDate())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                .ge(dataCompareVO.getStartDate() != null && dataCompareVO.getBehospitalCode() == null, "gmt_create", dataCompareVO.getStartDate())
+                .le(dataCompareVO.getEndDate() != null && dataCompareVO.getBehospitalCode() == null, "gmt_create", dataCompareVO.getEndDate())
+                .eq(dataCompareVO.getBehospitalCode() != null, "behospital_code", dataCompareVO.getBehospitalCode())
+                .eq(SysUserUtils.getCurrentHospitalId() != null, "hospital_id", SysUserUtils.getCurrentHospitalId())
                 .eq("is_deleted", IsDeleteEnum.N.getKey()))
                 .stream().map(BehospitalInfo::getBehospitalCode).collect(Collectors.toList());
         //病案首页数据
         List<String> dataBaseHomePageIds = homePageFacade.list(new QueryWrapper<HomePage>()
                 .select("home_page_id")
-                .ge(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getStartDate())
-                .le(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getEndDate())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                .ge(dataCompareVO.getStartDate() != null && dataCompareVO.getBehospitalCode() == null, "gmt_create", dataCompareVO.getStartDate())
+                .le(dataCompareVO.getEndDate() != null && dataCompareVO.getBehospitalCode() == null, "gmt_create", dataCompareVO.getEndDate())
+                .eq(dataCompareVO.getBehospitalCode() != null, "behospital_code", dataCompareVO.getBehospitalCode())
+                .eq(SysUserUtils.getCurrentHospitalId() != null, "hospital_id", SysUserUtils.getCurrentHospitalId())
                 .eq("is_deleted", IsDeleteEnum.N.getKey()))
                 .stream().map(HomePage::getHomePageId).collect(Collectors.toList());
 
         //文书数据
         List<String> dataBaseRecIds = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
                 .select("rec_id")
-                .ge(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getStartDate())
-                .le(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getEndDate())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                .ge(dataCompareVO.getStartDate() != null && dataCompareVO.getBehospitalCode() == null, "gmt_create", dataCompareVO.getStartDate())
+                .le(dataCompareVO.getEndDate() != null && dataCompareVO.getBehospitalCode() == null, "gmt_create", dataCompareVO.getEndDate())
+                .eq(dataCompareVO.getBehospitalCode() != null, "behospital_code", dataCompareVO.getBehospitalCode())
+                .eq(SysUserUtils.getCurrentHospitalId() != null, "hospital_id", SysUserUtils.getCurrentHospitalId())
                 .eq("is_deleted", IsDeleteEnum.N.getKey()))
                 .stream().map(MedicalRecord::getRecId).collect(Collectors.toList());
 
@@ -167,35 +175,36 @@ public class BlockLossManagementFacade {
         List<String> inLossCodes = null;
         List<String> inLossHomepages = null;
         List<String> inLossRecs = null;
-        if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.REC_LOSS.getKey()))) {
-            Map<String, List<BlocklossResult>> lossWayRecMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.REC_LOSS.getKey()), "lossWay");
-            if (ListUtil.isNotEmpty(lossWayRecMap.get(LossWayEnum.OUT_LOSS))) {
-                outLossRecs = lossWayRecMap.get(LossWayEnum.OUT_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
-            }
-            if (ListUtil.isNotEmpty(lossWayRecMap.get(LossWayEnum.IN_LOSS))) {
-                inLossRecs = lossWayRecMap.get(LossWayEnum.IN_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
-            }
-        }
-        if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()))) {
-            Map<String, List<BlocklossResult>> lossWayHomePageMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()), "lossWay");
-            if (ListUtil.isNotEmpty(lossWayHomePageMap.get(LossWayEnum.OUT_LOSS))) {
-                outLossHomepages = lossWayHomePageMap.get(LossWayEnum.OUT_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
-            }
-            if (ListUtil.isNotEmpty(lossWayHomePageMap.get(LossWayEnum.IN_LOSS))) {
-                inLossHomepages = lossWayHomePageMap.get(LossWayEnum.IN_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
+        if (lossResultMap != null) {
+            if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.REC_LOSS.getKey()))) {
+                Map<String, List<BlocklossResult>> lossWayRecMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.REC_LOSS.getKey()), "lossWay");
+                if (ListUtil.isNotEmpty(lossWayRecMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
+                    outLossRecs = lossWayRecMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
+                }
+                if (ListUtil.isNotEmpty(lossWayRecMap.get(LossWayEnum.IN_LOSS.getKey()))) {
+                    inLossRecs = lossWayRecMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
+                }
             }
-        }
-        if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.CODE_LOSS.getKey()))) {
-            Map<String, List<BlocklossResult>> lossWayCodeMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.CODE_LOSS.getKey()), "lossWay");
-            if (ListUtil.isNotEmpty(lossWayCodeMap.get(LossWayEnum.OUT_LOSS))) {
-                outLossCodes = lossWayCodeMap.get(LossWayEnum.OUT_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()))) {
+                Map<String, List<BlocklossResult>> lossWayHomePageMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()), "lossWay");
+                if (ListUtil.isNotEmpty(lossWayHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
+                    outLossHomepages = lossWayHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
+                }
+                if (ListUtil.isNotEmpty(lossWayHomePageMap.get(LossWayEnum.IN_LOSS.getKey()))) {
+                    inLossHomepages = lossWayHomePageMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
+                }
             }
-            if (ListUtil.isNotEmpty(lossWayCodeMap.get(LossWayEnum.IN_LOSS))) {
-                inLossCodes = lossWayCodeMap.get(LossWayEnum.IN_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.CODE_LOSS.getKey()))) {
+                Map<String, List<BlocklossResult>> lossWayCodeMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.CODE_LOSS.getKey()), "lossWay");
+                if (ListUtil.isNotEmpty(lossWayCodeMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
+                    outLossCodes = lossWayCodeMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
+                }
+                if (ListUtil.isNotEmpty(lossWayCodeMap.get(LossWayEnum.IN_LOSS.getKey()))) {
+                    inLossCodes = lossWayCodeMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
+                }
             }
         }
 
-
         //=====2.2数据对比
         //his与log日志做对比
         if (ListUtil.isNotEmpty(hisMedicalRecords)) {
@@ -208,7 +217,7 @@ public class BlockLossManagementFacade {
                     hisMedicalRecordDTO.getHisRecs().stream().forEach(hisRecDTO -> {
                         GetOperationLogDTO medicalRecord = new GetOperationLogDTO();
                         medicalRecord.setRecId(hisRecDTO.getRecId());
-                        medicalRecord.setRecId(hisRecDTO.getRecTitle());
+                        medicalRecord.setRecTitle(hisRecDTO.getRecTitle());
                         medicalRecord.setBehospitalCode(hisMedicalRecordDTO.getBehospitalCode());
                         recs.add(medicalRecord);
                     });
@@ -218,11 +227,11 @@ public class BlockLossManagementFacade {
             //外部丢失数据集合
             List<BlocklossResult> outInserts = new ArrayList<>();
             //文书数据对比
-            compareHisWithLog(recs, recLogs, "0", outInserts, outLossRecs);
+            compareHisWithLog(recs, recLogs, LossTypeEnum.REC_LOSS.getKey(), outInserts, outLossRecs);
             //病案首页数据对比
-            compareHisWithLog(medicalRecords, homePageLogs, "1", outInserts, outLossHomepages);
+            compareHisWithLog(medicalRecords, homePageLogs, LossTypeEnum.HOMEPAGE_LOSS.getKey(), outInserts, outLossHomepages);
             //病历数据对比
-            compareHisWithLog(medicalRecords, behospitalCodeLogs, "2", outInserts, outLossCodes);
+            compareHisWithLog(medicalRecords, behospitalCodeLogs, LossTypeEnum.CODE_LOSS.getKey(), outInserts, outLossCodes);
 
             flag = blocklossResultServiceImpl.saveBatch(outInserts);
         }
@@ -231,13 +240,13 @@ public class BlockLossManagementFacade {
         //内部丢失数据集合
         List<BlocklossResult> inInserts = new ArrayList<>();
         if (ListUtil.isNotEmpty(recLogs)) {
-            compareLogWithLocal(recLogs, dataBaseRecIds, "0", inInserts, inLossRecs);
+            compareLogWithLocal(recLogs, dataBaseRecIds, LossTypeEnum.REC_LOSS.getKey(), inInserts, inLossRecs);
         }
         if (ListUtil.isNotEmpty(homePageLogs)) {
-            compareLogWithLocal(homePageLogs, dataBaseHomePageIds, "1", inInserts, inLossHomepages);
+            compareLogWithLocal(homePageLogs, dataBaseHomePageIds, LossTypeEnum.HOMEPAGE_LOSS.getKey(), inInserts, inLossHomepages);
         }
         if (ListUtil.isNotEmpty(behospitalCodeLogs)) {
-            compareLogWithLocal(behospitalCodeLogs, dataBaseBehospitalCodes, "2", inInserts, inLossCodes);
+            compareLogWithLocal(behospitalCodeLogs, dataBaseBehospitalCodes, LossTypeEnum.CODE_LOSS.getKey(), inInserts, inLossCodes);
         }
         if (ListUtil.isNotEmpty(inInserts)) {
             flag = blocklossResultServiceImpl.saveBatch(inInserts);
@@ -263,7 +272,7 @@ public class BlockLossManagementFacade {
                 logs.stream().forEach(rec -> {
                     //存在记录但是没有入库
                     if (!dataBases.contains(rec.getRecId())) {
-                        if (havingLossIds.contains(rec.getRecId())) {
+                        if (havingLossIds == null || !havingLossIds.contains(rec.getRecId())) {
                             BlocklossResult blocklossResult = new BlocklossResult();
                             blocklossResult.setBehospitalCode(rec.getBehospitalCode());
                             blocklossResult.setRecId(rec.getRecId());
@@ -277,31 +286,40 @@ public class BlockLossManagementFacade {
                     }
                 });
                 //判断只插入文书id的情况
-                List<String> havingRecIds = medicalRecordContentFacade.list(new QueryWrapper<MedicalRecordContent>()
-                        .select("rec_id")
-                        .in("rec_id", dataBases)).stream().map(MedicalRecordContent::getRecId).collect(Collectors.toList());
-                List<String> tempList = new ArrayList<>(dataBases);
-                tempList.removeAll(havingRecIds);
-                Map<String, GetOperationLogDTO> recMap = EntityUtil.makeEntityMap(logs, "recId");
-                tempList.stream().forEach(recId -> {
-                    BlocklossResult blocklossResult = new BlocklossResult();
-                    blocklossResult.setBehospitalCode(recMap.get(recId).getBehospitalCode());
-                    blocklossResult.setRecId(recId);
-                    blocklossResult.setRecTitle(recMap.get(recId).getRecTitle());
-                    blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
-                    blocklossResult.setLossType(LossTypeEnum.REC_LOSS.getKey());
-                    blocklossResult.setLossCause("文书id插入成功,文书内容没有插入");
-                    //拼装病历数据块丢失明细其他信息
-                    assembleOtherBlocklossResult(blocklossResult);
-                    inInserts.add(blocklossResult);
-                });
+                //获取插入的文书
+                if(ListUtil.isNotEmpty(dataBases)){
+                    List<String> havingRecIds = medicalRecordContentFacade.list(new QueryWrapper<MedicalRecordContent>()
+                            .select("rec_id")
+                            .in("rec_id", dataBases)).stream().map(MedicalRecordContent::getRecId).collect(Collectors.toList());
+                    List<String> tempList = new ArrayList<>(dataBases);
+                    //移除查出来有内容的文书
+                    tempList.removeAll(havingRecIds);
+                    Map<String, GetOperationLogDTO> recMap = EntityUtil.makeEntityMap(logs, "recId");
+                    //有文书id无内容文书
+                    tempList.stream().forEach(recId -> {
+                        //没有被记录过
+                        if (havingLossIds == null || !havingLossIds.contains(recId)) {
+                            BlocklossResult blocklossResult = new BlocklossResult();
+                            blocklossResult.setBehospitalCode(recMap.get(recId).getBehospitalCode());
+                            blocklossResult.setRecId(recId);
+                            blocklossResult.setRecTitle(recMap.get(recId).getRecTitle());
+                            blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
+                            blocklossResult.setLossType(LossTypeEnum.REC_LOSS.getKey());
+                            blocklossResult.setLossCause("文书id插入成功,文书内容没有插入");
+                            //拼装病历数据块丢失明细其他信息
+                            assembleOtherBlocklossResult(blocklossResult);
+                            inInserts.add(blocklossResult);
+                        }
+                    });
+                }
+
                 break;
             case "1":
                 //病案首页丢失
                 logs.stream().forEach(homePages -> {
                     //存在记录但是没有入库
                     if (!dataBases.contains(homePages.getRecId())) {
-                        if (havingLossIds.contains(homePages.getRecId())) {
+                        if (havingLossIds == null || !havingLossIds.contains(homePages.getHomePageId())) {
                             BlocklossResult blocklossResult = new BlocklossResult();
                             blocklossResult.setBehospitalCode(homePages.getBehospitalCode());
                             blocklossResult.setRecId(homePages.getHomePageId());
@@ -320,7 +338,7 @@ public class BlockLossManagementFacade {
                 logs.stream().forEach(beHehospitalInfo -> {
                     //存在记录但是没有入库
                     if (!dataBases.contains(beHehospitalInfo.getBehospitalCode())) {
-                        if (havingLossIds.contains(beHehospitalInfo.getBehospitalCode())) {
+                        if (havingLossIds == null || !havingLossIds.contains(beHehospitalInfo.getBehospitalCode())) {
                             BlocklossResult blocklossResult = new BlocklossResult();
                             blocklossResult.setBehospitalCode(beHehospitalInfo.getBehospitalCode());
                             blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
@@ -352,7 +370,7 @@ public class BlockLossManagementFacade {
                 case "0":
                     //文书丢失
                     List<String> redIds = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
-                            .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                            .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                             .in("rec_id", lossResultMap.get(lossType).stream().map(BlocklossResult::getRecId).collect(Collectors.toList()))
                             .in("behospital_code", lossResultMap.get(lossType).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList()))
                             .eq("is_deleted", IsDeleteEnum.N.getKey()))
@@ -363,17 +381,18 @@ public class BlockLossManagementFacade {
                                 .set("solve_time", DateUtil.now())
                                 .set("gmt_modified", DateUtil.now())
                                 .set("status", LossStatusEnum.NOT_LOSS.getKey())
-                                .set("modifier", SysUserUtils.getCurrentPrincipleId())
+                                .set("modifier", SysUserUtils.getCurrentPrincipleId() != null ? SysUserUtils.getCurrentPrincipleId() + "" : "0")
+                                .eq("status", LossStatusEnum.IS_LOSS.getKey())
                                 .eq("loss_type", lossType)
                                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                                .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                                 .in("rec_id", redIds)));
                     }
                     break;
                 case "1":
                     //病案首页丢失
                     List<String> homePages = homePageFacade.list(new QueryWrapper<HomePage>()
-                            .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                            .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                             .in("home_page_id", lossResultMap.get(lossType).stream().map(BlocklossResult::getRecId).collect(Collectors.toList()))
                             .in("behospital_code", lossResultMap.get(lossType).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList()))
                             .eq("is_deleted", IsDeleteEnum.N.getKey()))
@@ -385,9 +404,10 @@ public class BlockLossManagementFacade {
                                 .set("solve_time", DateUtil.now())
                                 .set("gmt_modified", DateUtil.now())
                                 .set("status", LossStatusEnum.NOT_LOSS.getKey())
-                                .set("modifier", SysUserUtils.getCurrentPrincipleId())
+                                .set("modifier", SysUserUtils.getCurrentPrincipleId() != null ? SysUserUtils.getCurrentPrincipleId() + "" : "0")
+                                .eq("status", LossStatusEnum.IS_LOSS.getKey())
                                 .eq("loss_type", lossType)
-                                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                                .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                                 .in("rec_id", homePages)
                                 .eq("is_deleted", IsDeleteEnum.N.getKey())));
                     }
@@ -395,7 +415,7 @@ public class BlockLossManagementFacade {
                 case "2":
                     //患者信息丢失
                     List<String> behospitalCodes = behospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
-                            .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                            .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                             .in("behospital_code", lossResultMap.get(lossType).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList()))
                             .eq("is_deleted", IsDeleteEnum.N.getKey()))
                             .stream().map(BehospitalInfo::getBehospitalCode).collect(Collectors.toList());
@@ -405,10 +425,11 @@ public class BlockLossManagementFacade {
                                 .set("solve_time", DateUtil.now())
                                 .set("gmt_modified", DateUtil.now())
                                 .set("status", LossStatusEnum.NOT_LOSS.getKey())
-                                .set("modifier", SysUserUtils.getCurrentPrincipleId())
+                                .set("modifier", SysUserUtils.getCurrentPrincipleId() != null ? SysUserUtils.getCurrentPrincipleId() + "" : "0")
+                                .eq("status", LossStatusEnum.IS_LOSS.getKey())
                                 .eq("loss_type", lossType)
                                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                                .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                                 .in("behospital_code", behospitalCodes)));
                     }
                     break;
@@ -429,6 +450,10 @@ public class BlockLossManagementFacade {
      */
     private void compareHisWithLog(List<GetOperationLogDTO> medicalRecords, List<GetOperationLogDTO> logs,
                                    String type, List<BlocklossResult> outInserts, List<String> havingLossIds) {
+        //his数据为空直接返回
+        if(ListUtil.isEmpty(medicalRecords)){
+            return;
+        }
         switch (type) {
             case "0":
                 List<String> recLogs = logs.stream().map(GetOperationLogDTO::getRecId).collect(Collectors.toList());
@@ -437,7 +462,7 @@ public class BlockLossManagementFacade {
                     if (StringUtil.isNotEmpty(medicalRecord.getRecId())) {
                         if (!recLogs.contains(medicalRecord.getRecId())) {
                             //该记录没有插入
-                            if (ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getRecId())) {
+                            if (havingLossIds == null || ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getRecId())) {
                                 BlocklossResult blocklossResult = new BlocklossResult();
                                 blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
                                 blocklossResult.setRecId(medicalRecord.getRecId());
@@ -457,7 +482,7 @@ public class BlockLossManagementFacade {
                 medicalRecords.stream().forEach(medicalRecord -> {
                     //病案首页不存在操作记录
                     if (StringUtil.isNotEmpty(medicalRecord.getHomePageId()) && !homepageLogs.contains(medicalRecord.getHomePageId())) {
-                        if (ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getHomePageId())) {
+                        if (havingLossIds == null || ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getHomePageId())) {
                             BlocklossResult blocklossResult = new BlocklossResult();
                             blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
                             blocklossResult.setRecId(medicalRecord.getHomePageId());
@@ -476,7 +501,7 @@ public class BlockLossManagementFacade {
                 medicalRecords.stream().forEach(medicalRecord -> {
                     //病历数据不存在操作记录
                     if (!behospitalCodeLogs.contains(medicalRecord.getBehospitalCode())) {
-                        if (ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getBehospitalCode())) {
+                        if (havingLossIds == null || ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getBehospitalCode())) {
                             BlocklossResult blocklossResult = new BlocklossResult();
                             blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
                             blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
@@ -527,8 +552,7 @@ public class BlockLossManagementFacade {
     private List<HisMedicalRecordDTO> getHisMedicalRecords(DataCompareVO dataCompareVO) {
         //技术服务部接口 /balance/data/getDataCount
         //###模拟
-
-        return new ArrayList<>();
+        return hisDataManagementFacade.getHisMedicalRecords(dataCompareVO);
     }
 
     /**
@@ -548,27 +572,27 @@ public class BlockLossManagementFacade {
         blockLossTypeGatherDTO.setLogNum(logNum);
         //获取该时间段的实际数量
         Integer codeNum = behospitalInfoFacade.count(new QueryWrapper<BehospitalInfo>()
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                .eq("hospital_id",SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                 .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
                 .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getEndDate()));
         Integer homePageNum = homePageFacade.count(new QueryWrapper<HomePage>()
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                 .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
                 .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getEndDate()));
         Integer recNum = medicalRecordFacade.count(new QueryWrapper<MedicalRecord>()
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                 .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
                 .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getEndDate()));
         blockLossTypeGatherDTO.setRealNum(codeNum + homePageNum + recNum);
         //获取该时间段的丢失数量
         List<BlocklossResult> blocklossResults = blocklossResultFacade.list(new QueryWrapper<BlocklossResult>()
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                 .eq("status", LossStatusEnum.IS_LOSS.getKey())
                 .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
                 .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getEndDate()));
         Integer allLossNum = blocklossResults.size();
         blockLossTypeGatherDTO.setAllLossNum(allLossNum);
-        blockLossTypeGatherDTO.setHisNum(logNum + allLossNum);
+        blockLossTypeGatherDTO.setHisNum(codeNum + homePageNum + recNum + allLossNum);
 
         Map<String, List<BlocklossResult>> lossWayMap = EntityUtil.makeEntityListMap(blocklossResults, "lossWay");
         //外部丢失
@@ -623,6 +647,6 @@ public class BlockLossManagementFacade {
     public boolean dataRepari(DataRepariVO dataRepariVO) {
         //调用数据补录服务
 
-        return false;
+        return hisDataManagementFacade.dataRepari(dataRepariVO);
     }
 }

+ 1 - 1
daqe-center/src/main/java/com/lantone/daqe/facade/ColumnResultManagementFacade.java

@@ -57,7 +57,7 @@ import java.util.List;
 
 
 /**
- * @Description: 字段校验问题明细维护API
+ * @Description: 字段校验问题明细维护API-业务处理类
  * @author: zhanghang
  * @time: 2022/3/8 14:49
  */

+ 1 - 1
daqe-center/src/main/java/com/lantone/daqe/facade/ColumnVerifyManagementFacade.java

@@ -47,7 +47,7 @@ import java.util.Date;
 import java.util.List;
 
 /**
- * @Description: 字段校验规则维护API
+ * @Description: 字段校验规则维护API-业务处理类
  * @author: zhanghang
  * @time: 2022/3/1 10:14
  */

+ 50 - 0
daqe-center/src/main/java/com/lantone/daqe/facade/CurrencyManagementFacade.java

@@ -0,0 +1,50 @@
+package com.lantone.daqe.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.lantone.common.enums.IsDeleteEnum;
+import com.lantone.common.util.BeanUtil;
+import com.lantone.common.util.StringUtil;
+import com.lantone.daqe.dto.GetConceptLibraryPageDTO;
+import com.lantone.daqe.entity.ConceptLibrary;
+import com.lantone.daqe.enums.ConceptLibraryTypeEnum;
+import com.lantone.daqe.facade.base.ConceptLibraryFacade;
+import com.lantone.daqe.vo.GetConceptLibraryPageVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 通用处理API-业务处理类
+ * @author: rengb
+ * @time: 2022/3/1 10:14
+ */
+@Component
+public class CurrencyManagementFacade {
+
+    @Autowired
+    private ConceptLibraryFacade conceptLibraryFacade;
+
+    public IPage<GetConceptLibraryPageDTO> getConceptLibraryPage(GetConceptLibraryPageVO getConceptLibraryPageVO) {
+        IPage<GetConceptLibraryPageDTO> getConceptLibraryPageDTOIPage = new Page<>();
+
+        QueryWrapper<ConceptLibrary> conceptLibraryQueryWrapper = new QueryWrapper<>();
+        conceptLibraryQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        conceptLibraryQueryWrapper.eq("type", getConceptLibraryPageVO.getType());
+        conceptLibraryQueryWrapper.like(StringUtil.isNotBlank(getConceptLibraryPageVO.getWord()), "synonym", getConceptLibraryPageVO.getWord());
+
+        Page<ConceptLibrary> conceptLibraryIPage = new Page<>(getConceptLibraryPageVO.getCurrent(), getConceptLibraryPageVO.getSize());
+        conceptLibraryFacade.page(conceptLibraryIPage, conceptLibraryQueryWrapper);
+        BeanUtil.copyProperties(conceptLibraryIPage, getConceptLibraryPageDTOIPage);
+
+        List<GetConceptLibraryPageDTO> getConceptLibraryPageDTOList = BeanUtil.listCopyTo(conceptLibraryIPage.getRecords(), GetConceptLibraryPageDTO.class);
+        getConceptLibraryPageDTOList.forEach(i -> {
+            i.setType(ConceptLibraryTypeEnum.getName(i.getType()));
+        });
+        getConceptLibraryPageDTOIPage.setRecords(getConceptLibraryPageDTOList);
+        return getConceptLibraryPageDTOIPage;
+    }
+
+}

+ 203 - 0
daqe-center/src/main/java/com/lantone/daqe/facade/HisDataManagementFacade.java

@@ -0,0 +1,203 @@
+package com.lantone.daqe.facade;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.lantone.common.enums.IsDeleteEnum;
+import com.lantone.common.exception.Asserts;
+import com.lantone.common.util.BeanUtil;
+import com.lantone.common.util.EntityUtil;
+import com.lantone.common.util.ListUtil;
+import com.lantone.common.vo.DataCompareVO;
+import com.lantone.common.vo.DataRepariVO;
+import com.lantone.daqe.dto.HisMedicalRecordDTO;
+import com.lantone.daqe.dto.HisRecDTO;
+import com.lantone.daqe.entity.BehospitalInfo;
+import com.lantone.daqe.entity.HisBehospitalInfo;
+import com.lantone.daqe.entity.HisHomePage;
+import com.lantone.daqe.entity.HisMedicalRecord;
+import com.lantone.daqe.entity.HisMedicalRecordContent;
+import com.lantone.daqe.entity.HomePage;
+import com.lantone.daqe.entity.MedicalRecord;
+import com.lantone.daqe.entity.MedicalRecordContent;
+import com.lantone.daqe.facade.base.HisBehospitalInfoFacade;
+import com.lantone.daqe.facade.base.HisHomePageFacade;
+import com.lantone.daqe.facade.base.HisMedicalRecordContentFacade;
+import com.lantone.daqe.facade.base.HisMedicalRecordFacade;
+import com.lantone.daqe.service.impl.BehospitalInfoServiceImpl;
+import com.lantone.daqe.service.impl.HomePageServiceImpl;
+import com.lantone.daqe.service.impl.MedicalRecordContentServiceImpl;
+import com.lantone.daqe.service.impl.MedicalRecordServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: His数据模拟对接-业务处理类
+ * @author: songxl
+ * @time: 2022/3/4 10:39
+ */
+@Component
+public class HisDataManagementFacade {
+    @Autowired
+    private HisBehospitalInfoFacade hisBehospitalInfoFacade;
+    @Autowired
+    private HisHomePageFacade hisHomePageFacade;
+    @Autowired
+    private HisMedicalRecordFacade hisMedicalRecordFacade;
+    @Autowired
+    private HisMedicalRecordContentFacade hisMedicalRecordContentFacade;
+
+    @Autowired
+    private BehospitalInfoServiceImpl behospitalInfoServiceImpl;
+    @Autowired
+    private HomePageServiceImpl homePageServiceImpl;
+    @Autowired
+    private MedicalRecordServiceImpl medicalRecordServiceImpl;
+    @Autowired
+    private MedicalRecordContentServiceImpl medicalRecordContentServiceImpl;
+
+
+    /**
+     * 数据补录
+     *
+     * @param dataRepariVO
+     * @Return boolean
+     */
+    public boolean dataRepari(DataRepariVO dataRepariVO) {
+        //=====获取his数据
+        //病历数据
+        List<HisBehospitalInfo> hisBehospitalInfos = hisBehospitalInfoFacade.list(new QueryWrapper<HisBehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(dataRepariVO.getStartDate() != null && dataRepariVO.getBehospitalCode() == null, "behospital_date", dataRepariVO.getStartDate())
+                .le(dataRepariVO.getEndDate() != null && dataRepariVO.getBehospitalCode() == null, "behospital_date", dataRepariVO.getEndDate())
+                .eq(dataRepariVO.getBehospitalCode() != null, "behospital_code", dataRepariVO.getBehospitalCode()));
+        //病案首页
+        List<HisHomePage> hisHomePages = hisHomePageFacade.list(new QueryWrapper<HisHomePage>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(dataRepariVO.getStartDate() != null && dataRepariVO.getBehospitalCode() == null, "behospital_date", dataRepariVO.getStartDate())
+                .le(dataRepariVO.getEndDate() != null && dataRepariVO.getBehospitalCode() == null, "behospital_date", dataRepariVO.getEndDate())
+                .eq(dataRepariVO.getBehospitalCode() != null, "behospital_code", dataRepariVO.getBehospitalCode())
+        );
+
+        //文书
+        List<HisMedicalRecord> hisMedicalRecords = hisMedicalRecordFacade.list(new QueryWrapper<HisMedicalRecord>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(dataRepariVO.getStartDate() != null && dataRepariVO.getBehospitalCode() == null, "rec_date", dataRepariVO.getStartDate())
+                .le(dataRepariVO.getEndDate() != null && dataRepariVO.getBehospitalCode() == null, "rec_date", dataRepariVO.getEndDate())
+                .eq(dataRepariVO.getBehospitalCode() != null, "behospital_code", dataRepariVO.getBehospitalCode())
+        );
+        List<HisMedicalRecordContent> hisMedicalRecordContents = null;
+        if (ListUtil.isNotEmpty(hisMedicalRecords)) {
+            hisMedicalRecordContents = hisMedicalRecordContentFacade.list(new QueryWrapper<HisMedicalRecordContent>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("rec_id", hisMedicalRecords.stream().map(HisMedicalRecord::getRecId).collect(Collectors.toList())));
+        }
+
+        //=====删除该时间段插入我们库中的数据,重新插入
+        behospitalInfoServiceImpl.remove(new UpdateWrapper<BehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(dataRepariVO.getStartDate() != null && dataRepariVO.getBehospitalCode() == null, "gmt_create", dataRepariVO.getStartDate())
+                .le(dataRepariVO.getEndDate() != null && dataRepariVO.getBehospitalCode() == null, "gmt_create", dataRepariVO.getEndDate())
+                .eq(dataRepariVO.getBehospitalCode() != null, "behospital_code", dataRepariVO.getBehospitalCode()));
+        homePageServiceImpl.remove(new UpdateWrapper<HomePage>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(dataRepariVO.getStartDate() != null && dataRepariVO.getBehospitalCode() == null, "gmt_create", dataRepariVO.getStartDate())
+                .le(dataRepariVO.getEndDate() != null && dataRepariVO.getBehospitalCode() == null, "gmt_create", dataRepariVO.getEndDate())
+                .eq(dataRepariVO.getBehospitalCode() != null, "behospital_code", dataRepariVO.getBehospitalCode()));
+        medicalRecordServiceImpl.remove(new UpdateWrapper<MedicalRecord>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(dataRepariVO.getStartDate() != null && dataRepariVO.getBehospitalCode() == null, "gmt_create", dataRepariVO.getStartDate())
+                .le(dataRepariVO.getEndDate() != null && dataRepariVO.getBehospitalCode() == null, "gmt_create", dataRepariVO.getEndDate())
+                .eq(dataRepariVO.getBehospitalCode() != null, "behospital_code", dataRepariVO.getBehospitalCode()));
+        //删除改时间段文书内容
+        List<String> delRecIds = medicalRecordServiceImpl.list(new QueryWrapper<MedicalRecord>().select("rec_id")
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(dataRepariVO.getStartDate() != null && dataRepariVO.getBehospitalCode() == null, "gmt_create", dataRepariVO.getStartDate())
+                .le(dataRepariVO.getEndDate() != null && dataRepariVO.getBehospitalCode() == null, "gmt_create", dataRepariVO.getEndDate())
+                .eq(dataRepariVO.getBehospitalCode() != null, "behospital_code", dataRepariVO.getBehospitalCode()))
+                .stream().map(MedicalRecord::getRecId).collect(Collectors.toList());
+        if (ListUtil.isNotEmpty(delRecIds)) {
+            medicalRecordContentServiceImpl.remove(new UpdateWrapper<MedicalRecordContent>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("rec_id", delRecIds));
+        }
+
+        //插入新查出的his数据
+        try {
+            behospitalInfoServiceImpl.saveBatch(BeanUtil.listCopyTo(hisBehospitalInfos, BehospitalInfo.class));
+            homePageServiceImpl.saveBatch(BeanUtil.listCopyTo(hisHomePages, HomePage.class));
+            medicalRecordServiceImpl.saveBatch(BeanUtil.listCopyTo(hisMedicalRecords, MedicalRecord.class));
+            if (ListUtil.isNotEmpty(hisMedicalRecordContents)) {
+                medicalRecordContentServiceImpl.saveBatch(BeanUtil.listCopyTo(hisMedicalRecordContents, MedicalRecordContent.class));
+            }
+        } catch (Exception e) {
+            Asserts.fail("文书批量插入过程出错");
+        }
+        return true;
+    }
+
+    /**
+     * 模拟获取his某段时间的数据
+     *
+     * @param dataCompareVO
+     * @Return java.util.List<com.lantone.daqe.dto.HisMedicalRecordDTO>
+     */
+    public List<HisMedicalRecordDTO> getHisMedicalRecords(DataCompareVO dataCompareVO) {
+        List<HisMedicalRecordDTO> out = new ArrayList<>();
+        //病历数据
+        List<String> codes = hisBehospitalInfoFacade.list(new QueryWrapper<HisBehospitalInfo>().select("behospital_code")
+                .eq(dataCompareVO.getHospitalId() != null, "hospital_id", dataCompareVO.getHospitalId())
+                .ge(dataCompareVO.getStartDate() != null && dataCompareVO.getBehospitalCode() == null, "behospital_date", dataCompareVO.getStartDate())
+                .le(dataCompareVO.getEndDate() != null && dataCompareVO.getBehospitalCode() == null, "behospital_date", dataCompareVO.getEndDate())
+                .eq(dataCompareVO.getBehospitalCode() != null, "behospital_code", dataCompareVO.getBehospitalCode())).stream().map(HisBehospitalInfo::getBehospitalCode).collect(Collectors.toList());
+        //通过病历获取病案首页和文书
+        if (ListUtil.isEmpty(codes)) {
+            return out;
+        }
+        //病案首页
+        List<HisHomePage> homePages = hisHomePageFacade.list(new QueryWrapper<HisHomePage>().select("home_page_id,behospital_code")
+                        .eq(dataCompareVO.getHospitalId() != null, "hospital_id", dataCompareVO.getHospitalId())
+                        .ge(dataCompareVO.getStartDate() != null && dataCompareVO.getBehospitalCode() == null, "behospital_date", dataCompareVO.getStartDate())
+                        .le(dataCompareVO.getEndDate() != null && dataCompareVO.getBehospitalCode() == null, "behospital_date", dataCompareVO.getEndDate())
+                        .eq(dataCompareVO.getBehospitalCode() != null, "behospital_code", dataCompareVO.getBehospitalCode())
+                //                .in("behospital_code", codes)
+        );
+        Map<String, List<HisHomePage>> homePageMap = EntityUtil.makeEntityListMap(homePages, "behospitalCode");
+
+        //文书
+        List<HisMedicalRecord> hisMedicalRecords = hisMedicalRecordFacade.list(new QueryWrapper<HisMedicalRecord>().select("rec_id,rec_title,behospital_code")
+                        .eq(dataCompareVO.getHospitalId() != null, "hospital_id", dataCompareVO.getHospitalId())
+                        .ge(dataCompareVO.getStartDate() != null && dataCompareVO.getBehospitalCode() == null, "rec_date", dataCompareVO.getStartDate())
+                        .le(dataCompareVO.getEndDate() != null && dataCompareVO.getBehospitalCode() == null, "rec_date", dataCompareVO.getEndDate())
+                        .eq(dataCompareVO.getBehospitalCode() != null, "behospital_code", dataCompareVO.getBehospitalCode())
+                //                .in("behospital_code", codes)
+        );
+        Map<String, List<HisMedicalRecord>> medicalRecordMap = EntityUtil.makeEntityListMap(hisMedicalRecords, "behospitalCode");
+
+        //拼装
+        codes.stream().forEach(code -> {
+            HisMedicalRecordDTO oneData = new HisMedicalRecordDTO();
+            oneData.setBehospitalCode(code);
+            if (homePageMap != null && ListUtil.isNotEmpty(homePageMap.get(code))) {
+                oneData.setHomePageId(homePageMap.get(code).get(0).getHomePageId());
+            }
+            List<HisRecDTO> recs = new ArrayList<>();
+            if (medicalRecordMap != null && ListUtil.isNotEmpty(medicalRecordMap.get(code))) {
+                medicalRecordMap.get(code).stream().forEach(hisMedicalRecord -> {
+                    HisRecDTO rec = new HisRecDTO();
+                    rec.setRecId(hisMedicalRecord.getRecId());
+                    rec.setRecTitle(hisMedicalRecord.getRecTitle());
+                    recs.add(rec);
+                });
+                oneData.setHisRecs(recs);
+            }
+            out.add(oneData);
+        });
+        return out;
+    }
+}

+ 14 - 0
daqe-center/src/main/java/com/lantone/daqe/facade/base/ConceptLibraryFacade.java

@@ -0,0 +1,14 @@
+package com.lantone.daqe.facade.base;
+
+import com.lantone.daqe.service.impl.ConceptLibraryServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * <p>
+ * 表名:base_concept_library 业务类
+ * </p>
+ */
+@Component
+public class ConceptLibraryFacade extends ConceptLibraryServiceImpl {
+
+}

+ 13 - 0
daqe-center/src/main/java/com/lantone/daqe/mapper/ConceptLibraryMapper.java

@@ -0,0 +1,13 @@
+package com.lantone.daqe.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.lantone.daqe.entity.ConceptLibrary;
+
+/**
+ * <p>
+ * 表名:base_concept_library Mapper接口
+ * </p>
+ */
+public interface ConceptLibraryMapper extends BaseMapper<ConceptLibrary> {
+
+}

+ 13 - 0
daqe-center/src/main/java/com/lantone/daqe/service/ConceptLibraryService.java

@@ -0,0 +1,13 @@
+package com.lantone.daqe.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.lantone.daqe.entity.ConceptLibrary;
+
+/**
+ * <p>
+ * 术语表 Service类
+ * </p>
+ */
+public interface ConceptLibraryService extends IService<ConceptLibrary> {
+
+}

+ 17 - 0
daqe-center/src/main/java/com/lantone/daqe/service/impl/ConceptLibraryServiceImpl.java

@@ -0,0 +1,17 @@
+package com.lantone.daqe.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.lantone.daqe.entity.ConceptLibrary;
+import com.lantone.daqe.mapper.ConceptLibraryMapper;
+import com.lantone.daqe.service.ConceptLibraryService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 术语表 Service实现类
+ * </p>
+ */
+@Service
+public class ConceptLibraryServiceImpl extends ServiceImpl<ConceptLibraryMapper, ConceptLibrary> implements ConceptLibraryService {
+
+}

+ 1 - 1
daqe-center/src/main/java/com/lantone/daqe/vo/ColumnInfoVO.java

@@ -19,7 +19,7 @@ import java.io.Serializable;
 public class ColumnInfoVO implements Serializable {
     private static final long serialVersionUID = -4822420650132733065L;
 
-    @ApiModelProperty(value = "主键")
+    @ApiModelProperty(value = "主键",required = true)
     private Long id;
 
     @ApiModelProperty(value = "表名称(中文)", required = true)

+ 36 - 0
daqe-center/src/main/java/com/lantone/daqe/vo/GetConceptLibraryPageVO.java

@@ -0,0 +1,36 @@
+package com.lantone.daqe.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 javax.validation.constraints.NotBlank;
+
+/**
+ * @Description: 获取标准词和同义词(一对一)分页列表-接口入参
+ * @author: rengb
+ * @time: 2022/2/27 11:15
+ */
+@ApiModel(value = "获取标准词和同义词(一对一)分页列表-接口入参")
+@Getter
+@Setter
+public class GetConceptLibraryPageVO extends Page {
+
+    private static final long serialVersionUID = 4521884666557513363L;
+
+    /**
+     * 术语类型,1:诊断,2:手术,3:药品
+     */
+    @ApiModelProperty(value = "术语类型,1:诊断,2:手术,3:药品", required = true)
+    @NotBlank(message = "术语类型不能为空")
+    private String type;
+
+    /**
+     * 搜索关键词
+     */
+    @ApiModelProperty(value = "搜索关键词")
+    private String word;
+
+}

+ 35 - 0
daqe-center/src/main/java/com/lantone/daqe/web/CurrencyManagmentController.java

@@ -0,0 +1,35 @@
+package com.lantone.daqe.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.api.CommonResult;
+import com.lantone.daqe.dto.GetConceptLibraryPageDTO;
+import com.lantone.daqe.facade.CurrencyManagementFacade;
+import com.lantone.daqe.vo.GetConceptLibraryPageVO;
+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;
+
+/**
+ * @Description: 通用处理API
+ * @author: rengb
+ * @time: 2022/3/8 14:24
+ */
+@RestController
+@Api(value = "通用处理API", tags = { "通用处理API" })
+@RequestMapping("/currencyManage")
+public class CurrencyManagmentController {
+
+    @Autowired
+    private CurrencyManagementFacade currencyManagementFacade;
+
+    @ApiOperation(value = "获取标准词和同义词(一对一)分页列表 [by:rengb]")
+    @PostMapping("/getConceptLibraryPage")
+    public CommonResult<IPage<GetConceptLibraryPageDTO>> getConceptLibraryPage(@RequestBody GetConceptLibraryPageVO getConceptLibraryPageVO) {
+        return CommonResult.success(currencyManagementFacade.getConceptLibraryPage(getConceptLibraryPageVO));
+    }
+
+}

+ 4 - 4
daqe-center/src/main/resources/mapper/BlocklossResultMapper.xml

@@ -36,16 +36,16 @@
         <if test="getBlockLossPageVO.recTitle != null and getBlockLossPageVO.recTitle != ''">
             AND rec_title LIKE CONCAT('%',#{getBlockLossPageVO.recTitle},'%')
         </if>
-        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+        <if test="getBlockLossPageVO.lossType != null and getBlockLossPageVO.lossType != ''">
             AND loss_type = #{getBlockLossPageVO.lossType}
         </if>
-        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+        <if test="getBlockLossPageVO.lossWay != null and getBlockLossPageVO.lossWay != ''">
             AND loss_way = #{getBlockLossPageVO.lossWay}
         </if>
-        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+        <if test="getBlockLossPageVO.isAudited != null and getBlockLossPageVO.isAudited != ''">
             AND is_audited = #{getBlockLossPageVO.isAudited}
         </if>
-        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+        <if test="getBlockLossPageVO.status != null and getBlockLossPageVO.status != ''">
             AND `status` = #{getBlockLossPageVO.status}
         </if>
     </select>

+ 1 - 1
daqe-center/src/main/resources/mapper/ColumnVerifyMapper.xml

@@ -51,7 +51,7 @@
         where
         1=1
         <if test="getColumnVerifyPageVO.isRequired != null and getColumnVerifyPageVO.isRequired != ''">
-            AND a.column_ename = #{getColumnVerifyPageVO.columnEname}
+            AND a.isRequired = #{getColumnVerifyPageVO.isRequired}
         </if>
         <if test="getColumnVerifyPageVO.regularName != null and getColumnVerifyPageVO.regularName != ''">
             AND a.regular = #{getColumnVerifyPageVO.regularName}

+ 5 - 0
daqe-center/src/main/resources/mapper/ConceptLibraryMapper.xml

@@ -0,0 +1,5 @@
+<?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.lantone.daqe.mapper.ConceptLibraryMapper">
+
+</mapper>

+ 19 - 0
daqe-center/src/main/resources/mapper/base/BaseConceptLibraryMapper.xml

@@ -0,0 +1,19 @@
+<?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.lantone.daqe.mapper.ConceptLibraryMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.lantone.daqe.entity.ConceptLibrary">
+        <id column="id" property="id"/>
+        <result column="standard" property="standard"/>
+        <result column="synonym" property="synonym"/>
+        <result column="type" property="type"/>
+        <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="remark" property="remark"/>
+    </resultMap>
+
+</mapper>

+ 22 - 1
daqe-center/src/main/resources/upgrade/V1__daqe_init.sql

@@ -8,6 +8,7 @@ CREATE TABLE `dc_column_info` (
   `table_ename` varchar(32) NOT NULL COMMENT '表英文名',
   `column_cname` varchar(32) NOT NULL COMMENT '字段中文名',
   `column_ename` varchar(32) NOT NULL COMMENT '字段英文名',
+  `type` varchar(2) NOT NULL DEFAULT '1' COMMENT '字段类型说明,1:普通字段,2:编号字段',
   `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
   `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
   `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
@@ -386,4 +387,24 @@ CREATE TABLE `hos_record_template` (
   `modifier` varchar(32) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
   `remark` varchar(128) DEFAULT NULL COMMENT '备注',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='医院病历文书模板信息表';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='医院病历文书模板信息表';
+
+-- ----------------------------
+-- Table structure for base_concept_library
+-- ----------------------------
+DROP TABLE IF EXISTS `base_concept_library`;
+CREATE TABLE `base_concept_library` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `standard` varchar(128) NOT NULL COMMENT '标准词',
+  `synonym` varchar(128) NOT NULL COMMENT '同义词',
+  `spell` varchar(128) DEFAULT NULL COMMENT '同义词的拼音首字母(大写)',
+  `type` varchar(2) NOT NULL COMMENT '术语类型,1:诊断,2:手术,3:药品',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(32) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(32) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `uniq_stand_syn_type` (`standard`,`synonym`,`type`) USING BTREE COMMENT '字段standard、字段synonym和字段type的值组合必须全表唯一'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='术语表';

+ 3 - 2
dblayer-mbg/src/test/java/com/lantone/dblayermbg/CodeAutoGenerator.java

@@ -122,10 +122,11 @@ public class CodeAutoGenerator {
                 "his_behospital_info",
                 "his_home_page",
                 "his_medical_record",
-                "his_medical_record_content"
+                "his_medical_record_content",
+                "base_concept_library"
         };
         //生成的实体类忽略表前缀: 不需要则置空
-        String[] ENTITY_IGNORE_PREFIX = { "hos_", "dc_", "med_" };
+        String[] ENTITY_IGNORE_PREFIX = { "hos_", "dc_", "med_", "base_" };
 
         GeneratorUtil.create(moduleName_, parentPackagePath_, packageName_, username, password, url, TABLES, ENTITY_IGNORE_PREFIX);
     }

+ 40 - 0
security-center/src/main/java/com/lantone/security/dto/GetMedoupManageDTO.java

@@ -0,0 +1,40 @@
+package com.lantone.security.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 查看医疗组具体信息-接口出参
+ * @author: zhanghang
+ * @time: 2022/3/17 13:26
+ */
+@ApiModel(value = "查看医疗组具体信息-接口出参")
+@Getter
+@Setter
+public class GetMedoupManageDTO implements Serializable {
+
+    @ApiModelProperty(value = "主键id")
+    private Long id;
+
+    @ApiModelProperty(value = "医疗组代码")
+    private String code;
+
+    @ApiModelProperty(value = "医疗组名称")
+    private String name;
+
+    @ApiModelProperty(value = "上级科室ID")
+    private Long deptId;
+
+    @ApiModelProperty(value = "上级科室名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "上级病区ID")
+    private Long regionId;
+
+    @ApiModelProperty(value = "上级病区名称")
+    private String regionName;
+}

+ 1 - 0
security-center/src/main/java/com/lantone/security/facade/LogManagementFacade.java

@@ -151,6 +151,7 @@ public class LogManagementFacade {
                     getOperationLogDTO.setHomePageId(temp.getString("homePageId"));
                     getOperationLogDTO.setRecId(temp.getString("recId"));
                     getOperationLogDTO.setRecTitle(temp.getString("recTitle"));
+                    out.add(getOperationLogDTO);
                 }
             });
         }

+ 168 - 0
security-center/src/main/java/com/lantone/security/facade/MedoupManagementFacade.java

@@ -0,0 +1,168 @@
+package com.lantone.security.facade;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.lantone.common.enums.IsDeleteEnum;
+import com.lantone.common.exception.Asserts;
+import com.lantone.common.util.SysUserUtils;
+import com.lantone.security.dto.GetMedoupManageDTO;
+import com.lantone.security.entity.DeptMedoup;
+import com.lantone.security.entity.Medoup;
+import com.lantone.security.entity.RegionMedoup;
+import com.lantone.security.facade.base.DeptMedoupFacade;
+import com.lantone.security.facade.base.MedoupFacade;
+import com.lantone.security.facade.base.RegionMedoupFacade;
+import com.lantone.security.vo.AddMedoupManageVO;
+import com.lantone.security.vo.DeleteMedoupManageVO;
+import com.lantone.security.vo.GetMedoupManageVO;
+import com.lantone.security.vo.UpdateMedoupManageVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @Description: 医疗组管理API
+ * @author: zhanghang
+ * @time: 2022/3/17 13:20
+ */
+@Component
+public class MedoupManagementFacade {
+    @Autowired
+    MedoupFacade medoupFacade;
+    @Autowired
+    DeptMedoupFacade deptMedoupFacade;
+    @Autowired
+    RegionMedoupFacade regionMedoupFacade;
+
+    /**
+     * 新增医疗组信息
+     *
+     * @param addMedoupManageVO
+     * @return: 是否成功
+     */
+    public Boolean addMedoupManage(AddMedoupManageVO addMedoupManageVO) {
+        Long currentPrincipleId = SysUserUtils.getCurrentPrincipleId();
+        //医疗组表
+        Medoup medoup = new Medoup();
+        medoup.setCode(addMedoupManageVO.getCode());
+        medoup.setName(addMedoupManageVO.getName());
+        medoup.setGmtCreate(new Date());
+        medoup.setCreator(currentPrincipleId.toString());
+        try {
+            medoupFacade.getBaseMapper().insert(medoup);
+        } catch (Exception e) {
+            Asserts.fail("新增医疗组失败!");
+        }
+        Long medoupId = medoup.getId();
+        //病区与医疗组关联表
+        RegionMedoup regionMedoup = new RegionMedoup();
+        regionMedoup.setMedoupId(medoupId);
+        regionMedoup.setRegionId(addMedoupManageVO.getRegionId());
+        regionMedoup.setGmtCreate(new Date());
+        regionMedoup.setCreator(currentPrincipleId.toString());
+        try {
+            regionMedoupFacade.getBaseMapper().insert(regionMedoup);
+        } catch (Exception e) {
+            Asserts.fail("新增病区与医疗组关联表失败!");
+        }
+        //科室与医疗组关联表
+        DeptMedoup deptMedoup = new DeptMedoup();
+        deptMedoup.setMedoupId(medoupId);
+        deptMedoup.setDeptId(addMedoupManageVO.getDeptId());
+        deptMedoup.setGmtCreate(new Date());
+        deptMedoup.setCreator(currentPrincipleId.toString());
+        try {
+            deptMedoupFacade.getBaseMapper().insert(deptMedoup);
+        } catch (Exception e) {
+            Asserts.fail("新增科室与医疗组关联表失败!");
+        }
+        return true;
+    }
+
+    /**
+     * 修改医疗组信息
+     *
+     * @param updateMedoupManageVO
+     * @return: 是否成功
+     */
+    public Boolean updateMedoupManage(UpdateMedoupManageVO updateMedoupManageVO) {
+        Long currentPrincipleId = SysUserUtils.getCurrentPrincipleId();
+        //医疗组表
+        medoupFacade.update(new UpdateWrapper<Medoup>()
+                .eq("id", updateMedoupManageVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("code", updateMedoupManageVO.getCode())
+                .set("name", updateMedoupManageVO.getName())
+                .set("modifier", currentPrincipleId)
+                .set("gmt_modified", new Date())
+        );
+        Long manageVOId = updateMedoupManageVO.getId();
+        //删除病区与医疗组关联表
+        regionMedoupFacade.remove(new QueryWrapper<RegionMedoup>()
+                .eq("medoup_id", manageVOId)
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+        );
+        //病区与医疗组关联表
+        RegionMedoup regionMedoup = new RegionMedoup();
+        regionMedoup.setMedoupId(manageVOId);
+        regionMedoup.setRegionId(updateMedoupManageVO.getRegionId());
+        regionMedoup.setGmtCreate(new Date());
+        regionMedoup.setCreator(currentPrincipleId.toString());
+        regionMedoupFacade.getBaseMapper().insert(regionMedoup);
+        //删除科室与医疗组关联表
+        deptMedoupFacade.remove(new QueryWrapper<DeptMedoup>()
+                .eq("medoup_id", manageVOId)
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+        );
+        //科室与医疗组关联表
+        DeptMedoup deptMedoup = new DeptMedoup();
+        deptMedoup.setMedoupId(manageVOId);
+        deptMedoup.setDeptId(updateMedoupManageVO.getDeptId());
+        deptMedoup.setGmtCreate(new Date());
+        deptMedoup.setCreator(currentPrincipleId.toString());
+        deptMedoupFacade.getBaseMapper().insert(deptMedoup);
+        return true;
+    }
+
+    /**
+     * 查看医疗组具体信息
+     *
+     * @param getMedoupManageVO
+     * @return:
+     */
+    public GetMedoupManageDTO getMedoupManage(GetMedoupManageVO getMedoupManageVO) {
+        return medoupFacade.getBaseMapper().getMedoupManage(getMedoupManageVO);
+    }
+
+    /**
+     * 删除医疗组具体信息
+     *
+     * @param deleteMedoupManageVO
+     * @return:
+     */
+    public Boolean deleteMedoupManage(DeleteMedoupManageVO deleteMedoupManageVO) {
+        Long currentPrincipleId = SysUserUtils.getCurrentPrincipleId();
+        String manageVOId = deleteMedoupManageVO.getId();
+        regionMedoupFacade.update(new UpdateWrapper<RegionMedoup>()
+                .eq("medoup_id", manageVOId)
+                .set("is_deleted", IsDeleteEnum.Y.getKey())
+                .set("modifier", currentPrincipleId)
+                .set("gmt_modified", new Date())
+        );
+        deptMedoupFacade.update(new UpdateWrapper<DeptMedoup>()
+                .eq("medoup_id", manageVOId)
+                .set("is_deleted", IsDeleteEnum.Y.getKey())
+                .set("modifier", currentPrincipleId)
+                .set("gmt_modified", new Date())
+        );
+        medoupFacade.update(new UpdateWrapper<Medoup>()
+                .eq("id", manageVOId)
+                .eq("is_deleted", IsDeleteEnum.Y.getKey())
+                .set("modifier", currentPrincipleId)
+                .set("gmt_modified", new Date())
+        );
+        return true;
+    }
+}

+ 4 - 1
security-center/src/main/java/com/lantone/security/mapper/MedoupMapper.java

@@ -1,7 +1,10 @@
 package com.lantone.security.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.lantone.security.dto.GetMedoupManageDTO;
 import com.lantone.security.entity.Medoup;
+import com.lantone.security.vo.GetMedoupManageVO;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -9,5 +12,5 @@ import com.lantone.security.entity.Medoup;
  * </p>
  */
 public interface MedoupMapper extends BaseMapper<Medoup> {
-
+    GetMedoupManageDTO getMedoupManage(@Param("getMedoupManageVO") GetMedoupManageVO getMedoupManageVO);
 }

+ 38 - 0
security-center/src/main/java/com/lantone/security/vo/AddMedoupManageVO.java

@@ -0,0 +1,38 @@
+package com.lantone.security.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 新增医疗组信息-接口入参
+ * @author: zhanghang
+ * @time: 2022/3/17 13:26
+ */
+@ApiModel(value = "新增医疗组信息-接口入参")
+@Getter
+@Setter
+public class AddMedoupManageVO implements Serializable {
+
+    private static final long serialVersionUID = 4874891805624327667L;
+    @ApiModelProperty(value = "医疗组代码")
+    private String code;
+
+    @ApiModelProperty(value = "医疗组名称")
+    private String name;
+
+    @ApiModelProperty(value = "上级科室ID")
+    private Long deptId;
+
+    @ApiModelProperty(value = "上级科室名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "上级病区ID")
+    private Long regionId;
+
+    @ApiModelProperty(value = "上级病区名称")
+    private String regionName;
+}

+ 24 - 0
security-center/src/main/java/com/lantone/security/vo/DeleteMedoupManageVO.java

@@ -0,0 +1,24 @@
+package com.lantone.security.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 查看医疗组具体信息-接口入参
+ * @author: zhanghang
+ * @time: 2022/3/17 13:26
+ */
+@ApiModel(value = "查看医疗组具体信息-接口入参")
+@Getter
+@Setter
+public class DeleteMedoupManageVO implements Serializable {
+
+    private static final long serialVersionUID = -712909706557139236L;
+    @ApiModelProperty(value = "医疗组id")
+    private String id;
+
+}

+ 24 - 0
security-center/src/main/java/com/lantone/security/vo/GetMedoupManageVO.java

@@ -0,0 +1,24 @@
+package com.lantone.security.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 查看医疗组具体信息-接口入参
+ * @author: zhanghang
+ * @time: 2022/3/17 13:26
+ */
+@ApiModel(value = "查看医疗组具体信息-接口入参")
+@Getter
+@Setter
+public class GetMedoupManageVO implements Serializable {
+
+    private static final long serialVersionUID = -6590076897770004835L;
+    @ApiModelProperty(value = "医疗组id")
+    private String id;
+
+}

+ 42 - 0
security-center/src/main/java/com/lantone/security/vo/UpdateMedoupManageVO.java

@@ -0,0 +1,42 @@
+package com.lantone.security.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 修改医疗组信息-接口入参
+ * @author: zhanghang
+ * @time: 2022/3/17 13:26
+ */
+@ApiModel(value = "修改医疗组信息-接口入参")
+@Getter
+@Setter
+public class UpdateMedoupManageVO implements Serializable {
+
+
+    private static final long serialVersionUID = -7530624210971806925L;
+    @ApiModelProperty(value = "主键id")
+    private Long id;
+
+    @ApiModelProperty(value = "医疗组代码")
+    private String code;
+
+    @ApiModelProperty(value = "医疗组名称")
+    private String name;
+
+    @ApiModelProperty(value = "上级科室ID")
+    private Long deptId;
+
+    @ApiModelProperty(value = "上级科室名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "上级病区ID")
+    private Long regionId;
+
+    @ApiModelProperty(value = "上级病区名称")
+    private String regionName;
+}

+ 57 - 0
security-center/src/main/java/com/lantone/security/web/MedoupManagementController.java

@@ -0,0 +1,57 @@
+package com.lantone.security.web;
+
+import com.lantone.common.api.CommonResult;
+import com.lantone.security.dto.GetMedoupManageDTO;
+import com.lantone.security.facade.MedoupManagementFacade;
+import com.lantone.security.vo.AddMedoupManageVO;
+import com.lantone.security.vo.DeleteMedoupManageVO;
+import com.lantone.security.vo.GetMedoupManageVO;
+import com.lantone.security.vo.UpdateMedoupManageVO;
+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;
+
+/**
+ * @Description: 医疗组管理API
+ * @author: zhanghang
+ * @time: 2022/3/17 13:20
+ */
+@RestController
+@Api(value = "医疗组管理API", tags = { "医疗组管理API" })
+@RequestMapping("/medoupManage")
+public class MedoupManagementController {
+    @Autowired
+    MedoupManagementFacade medoupManagementFacade;
+
+    @ApiOperation(value = "新增医疗组信息 [by:zhanghang]")
+    @PostMapping("/addMedoupManage")
+    @Transactional
+    public CommonResult<Boolean> addMedoupManage(@RequestBody AddMedoupManageVO addMedoupManageVO) {
+        return CommonResult.success(medoupManagementFacade.addMedoupManage(addMedoupManageVO));
+    }
+
+    @ApiOperation(value = "查看医疗组具体信息 [by:zhanghang]")
+    @PostMapping("/getMedoupManage")
+    public CommonResult<GetMedoupManageDTO> getMedoupManage(@RequestBody GetMedoupManageVO getMedoupManageVO) {
+        return CommonResult.success(medoupManagementFacade.getMedoupManage(getMedoupManageVO));
+    }
+
+    @ApiOperation(value = "修改医疗组信息 [by:zhanghang]")
+    @PostMapping("/updateMedoupManage")
+    @Transactional
+    public CommonResult<Boolean> updateMedoupManage(@RequestBody UpdateMedoupManageVO updateMedoupManageVO) {
+        return CommonResult.success(medoupManagementFacade.updateMedoupManage(updateMedoupManageVO));
+    }
+
+    @ApiOperation(value = "删除医疗组信息 [by:zhanghang]")
+    @PostMapping("/deleteMedoupManage")
+    @Transactional
+    public CommonResult<Boolean> deleteMedoupManage(@RequestBody DeleteMedoupManageVO deleteMedoupManageVO) {
+        return CommonResult.success(medoupManagementFacade.deleteMedoupManage(deleteMedoupManageVO));
+    }
+}

+ 31 - 1
security-center/src/main/resources/mapper/MedoupMapper.xml

@@ -1,5 +1,35 @@
 <?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.lantone.security.mapper.MedoupMapper">
-
+    <select id="getMedoupManage" resultType="com.lantone.security.dto.GetMedoupManageDTO">
+        SELECT
+            smp.id meduopId,
+            smp.code,
+            smp.name,
+            sdm.dept_id,
+            sd.hospital_id,
+            sd.NAME deptName,
+            srm.region_id,
+            sr.NAME regionName,
+            sr.hospital_id regionHospital
+        FROM
+            sys_medoup smp,
+            sys_dept_medoup sdm,
+            sys_dept sd,
+            sys_region_medoup srm,
+            sys_region sr
+        WHERE
+            smp.id = sdm.medoup_id
+        AND sdm.is_deleted = 'N'
+        AND smp.is_deleted = 'N'
+        AND sr.is_deleted = 'N'
+        AND srm.is_deleted = 'N'
+        AND sd.is_deleted = 'N'
+        AND sdm.dept_id = sd.id
+        AND sd.hospital_id = 4
+        AND smp.id = srm.medoup_id
+        AND srm.region_id = sr.id
+        AND sr.hospital_id = sd.hospital_id
+        AND smp.id= #{id}
+    </select>
 </mapper>