Prechádzať zdrojové kódy

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

zhanghang 3 rokov pred
rodič
commit
8e312e9df6

+ 29 - 0
daqe-center/src/main/java/com/lantone/daqe/client/HisDataService.java

@@ -0,0 +1,29 @@
+package com.lantone.daqe.client;
+
+import com.lantone.common.api.CommonResult;
+import com.lantone.common.vo.BlockLossTypeGatherVO;
+import com.lantone.common.vo.DataCompareVO;
+import com.lantone.daqe.dto.HisMedicalRecordDTO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+
+/**
+ * @Description: his数据获取服务远程调用
+ * @author: songxl
+ * @time: 2022/2/28 11:15
+ */
+@FeignClient("trans-center")
+public interface HisDataService {
+
+    //数据比对-获取某个入院时间段内的病历数
+    @PostMapping("/balance/data/getDataCount")
+    CommonResult<List<HisMedicalRecordDTO>> getDataCount(@RequestBody DataCompareVO dataCompareVO);
+
+    //数据比对-获取某个入院时间段内的病历数量
+    @PostMapping("/balance/data/getCount")
+    CommonResult<Integer> getCount(@RequestBody BlockLossTypeGatherVO blockLossTypeGatherVO);
+
+}

+ 34 - 0
daqe-center/src/main/java/com/lantone/daqe/client/hystrix/HisDataServiceHystrix.java

@@ -0,0 +1,34 @@
+package com.lantone.daqe.client.hystrix;
+
+
+import com.lantone.common.api.CommonResult;
+import com.lantone.common.vo.BlockLossTypeGatherVO;
+import com.lantone.common.vo.DataCompareVO;
+import com.lantone.daqe.client.HisDataService;
+import com.lantone.daqe.dto.HisMedicalRecordDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @Description: his数据获取服务远程调用(请求失败熔断)
+ * @author: songxl
+ * @time: 2022/2/28 11:15
+ */
+@Component
+@Slf4j
+public class HisDataServiceHystrix implements HisDataService {
+    @Override
+    public CommonResult<List<HisMedicalRecordDTO>> getDataCount(DataCompareVO dataCompareVO) {
+        log.error("【hystrix】调用{}异常", "getDataCount");
+        return null;
+    }
+
+    @Override
+    public CommonResult<Integer> getCount(BlockLossTypeGatherVO blockLossTypeGatherVO) {
+        log.error("【hystrix】调用{}异常", "getCount");
+        return null;
+    }
+}

+ 34 - 0
daqe-center/src/main/java/com/lantone/daqe/client/hystrix/OperationLogServiceHystrix.java

@@ -0,0 +1,34 @@
+package com.lantone.daqe.client.hystrix;
+
+
+import com.lantone.common.api.CommonResult;
+import com.lantone.common.dto.GetOperationLogDTO;
+import com.lantone.common.vo.BlockLossTypeGatherVO;
+import com.lantone.common.vo.DataCompareVO;
+import com.lantone.daqe.client.OperationLogService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @Description: 操作日志服务远程调用(请求失败熔断)
+ * @author: songxl
+ * @time: 2022/2/28 11:15
+ */
+@Component
+@Slf4j
+public class OperationLogServiceHystrix implements OperationLogService {
+    @Override
+    public CommonResult<List<GetOperationLogDTO>> getOperationLogs(DataCompareVO dataCompareVO) {
+        log.error("【hystrix】调用{}异常", "getOperationLogs");
+        return null;
+    }
+
+    @Override
+    public CommonResult<Integer> getOperationLogNum(BlockLossTypeGatherVO blockLossTypeGatherVO) {
+        log.error("【hystrix】调用{}异常", "getOperationLogNum");
+        return null;
+    }
+}

+ 56 - 50
daqe-center/src/main/java/com/lantone/daqe/facade/BlockLossManagementFacade.java

@@ -16,6 +16,7 @@ import com.lantone.common.util.SysUserUtils;
 import com.lantone.common.vo.BlockLossTypeGatherVO;
 import com.lantone.common.vo.DataCompareVO;
 import com.lantone.common.vo.DataRepariVO;
+import com.lantone.daqe.client.HisDataService;
 import com.lantone.daqe.client.OperationLogService;
 import com.lantone.daqe.dto.BlockLossTypeGatherDTO;
 import com.lantone.daqe.dto.GetBlockLossPageDTO;
@@ -69,6 +70,9 @@ public class BlockLossManagementFacade {
     @Autowired
     private OperationLogService operationLogService;
 
+    @Autowired
+    private HisDataService hisDataService;
+
     @Autowired
     private HisDataManagementFacade hisDataManagementFacade;
 
@@ -144,36 +148,36 @@ public class BlockLossManagementFacade {
             Map<String, List<BlocklossResult>> auditedResultMap = EntityUtil.makeEntityListMap(auditedResults, "lossType");
             if (ListUtil.isNotEmpty(auditedResultMap.get(LossTypeEnum.CODE_LOSS.getKey()))) {
                 List<BlocklossResult> auditedResultCodes = auditedResultMap.get(LossTypeEnum.CODE_LOSS.getKey());
-                if(ListUtil.isNotEmpty(auditedResultCodes)){
-                    Map<String, List<BlocklossResult>> tempCodeMap = EntityUtil.makeEntityListMap(auditedResultCodes,"lossWay");
-                    if(ListUtil.isNotEmpty(tempCodeMap.get(LossWayEnum.IN_LOSS.getKey()))){
+                if (ListUtil.isNotEmpty(auditedResultCodes)) {
+                    Map<String, List<BlocklossResult>> tempCodeMap = EntityUtil.makeEntityListMap(auditedResultCodes, "lossWay");
+                    if (ListUtil.isNotEmpty(tempCodeMap.get(LossWayEnum.IN_LOSS.getKey()))) {
                         inAuditedResultCodes = tempCodeMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
                     }
-                    if(ListUtil.isNotEmpty(tempCodeMap.get(LossWayEnum.OUT_LOSS.getKey()))){
+                    if (ListUtil.isNotEmpty(tempCodeMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
                         outAuditedResultCodes = tempCodeMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
                     }
                 }
             }
             if (ListUtil.isNotEmpty(auditedResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()))) {
                 List<BlocklossResult> auditedResultHomePages = auditedResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey());
-                if(ListUtil.isNotEmpty(auditedResultHomePages)){
-                    Map<String, List<BlocklossResult>> tempHomePageMap = EntityUtil.makeEntityListMap(auditedResultHomePages,"lossWay");
-                    if(ListUtil.isNotEmpty(tempHomePageMap.get(LossWayEnum.IN_LOSS.getKey()))){
+                if (ListUtil.isNotEmpty(auditedResultHomePages)) {
+                    Map<String, List<BlocklossResult>> tempHomePageMap = EntityUtil.makeEntityListMap(auditedResultHomePages, "lossWay");
+                    if (ListUtil.isNotEmpty(tempHomePageMap.get(LossWayEnum.IN_LOSS.getKey()))) {
                         inAuditedResultHomePages = tempHomePageMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
                     }
-                    if(ListUtil.isNotEmpty(tempHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()))){
+                    if (ListUtil.isNotEmpty(tempHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
                         outAuditedResultHomePages = tempHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
                     }
                 }
             }
             if (ListUtil.isNotEmpty(auditedResultMap.get(LossTypeEnum.REC_LOSS.getKey()))) {
                 List<BlocklossResult> auditedResultRecIds = auditedResultMap.get(LossTypeEnum.REC_LOSS.getKey());
-                if(ListUtil.isNotEmpty(auditedResultRecIds)){
-                    Map<String, List<BlocklossResult>> tempRecMap = EntityUtil.makeEntityListMap(auditedResultRecIds,"lossWay");
-                    if(ListUtil.isNotEmpty(tempRecMap.get(LossWayEnum.IN_LOSS.getKey()))){
+                if (ListUtil.isNotEmpty(auditedResultRecIds)) {
+                    Map<String, List<BlocklossResult>> tempRecMap = EntityUtil.makeEntityListMap(auditedResultRecIds, "lossWay");
+                    if (ListUtil.isNotEmpty(tempRecMap.get(LossWayEnum.IN_LOSS.getKey()))) {
                         inAuditedResultRecIds = tempRecMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
                     }
-                    if(ListUtil.isNotEmpty(tempRecMap.get(LossWayEnum.OUT_LOSS.getKey()))){
+                    if (ListUtil.isNotEmpty(tempRecMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
                         outAuditedResultRecIds = tempRecMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
                     }
                 }
@@ -199,12 +203,11 @@ public class BlockLossManagementFacade {
         //文书数据
         List<GetOperationLogDTO> recLogs = new ArrayList<>();
 
-        List<String> logCodes = null;
         //没有病历数据就不用去查病案首页和文书
         if (ListUtil.isNotEmpty(behospitalCodeLogs)) {
             //日志去重防止多次操作
             behospitalCodeLogs = removeRepeat(behospitalCodeLogs, "behospitalCode");
-            logCodes = behospitalCodeLogs.stream().map(GetOperationLogDTO::getBehospitalCode).collect(Collectors.toList());
+            List<String> logCodes = behospitalCodeLogs.stream().map(GetOperationLogDTO::getBehospitalCode).collect(Collectors.toList());
             dataCompareVO.setBehospitalCodes(logCodes);
             //病案首页数据
             dataCompareVO.setOperationUrl(DataSaveUrlEnum.HOME_PAGE.getKey());
@@ -272,6 +275,7 @@ public class BlockLossManagementFacade {
             compareHisWithLog(medicalRecords, behospitalCodeLogs, LossTypeEnum.CODE_LOSS.getKey(), outAuditedResultCodes, outInserts, hisMedicalRecordMap, hospitalId, principleId, dataUps);
 
             flag = blocklossResultServiceImpl.saveBatch(outInserts);
+            System.out.println("...");
         }
 
         //日志与入库数据对比
@@ -290,16 +294,16 @@ public class BlockLossManagementFacade {
         if (ListUtil.isNotEmpty(dataUps)) {
             Long finalPrincipleId = principleId;
             Long finalHospitalId = hospitalId;
-            dataUps.stream().forEach(data->{
+            dataUps.stream().forEach(data -> {
                 blocklossResultFacade.update(new UpdateWrapper<BlocklossResult>()
                         .set("gmt_modified", DateUtil.now())
                         .set("modifier", finalPrincipleId != null ? finalPrincipleId + "" : "0")
-                        .eq(StringUtil.isNotBlank(data.getRecId()),"rec_id", data.getRecId())
+                        .eq(StringUtil.isNotBlank(data.getRecId()), "rec_id", data.getRecId())
                         .notIn("is_audited", LossIsAuditedEnum.NOT_AUDITED.getKey())
-                        .eq("behospital_code",data.getBehospitalCode())
+                        .eq("behospital_code", data.getBehospitalCode())
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .ge(dataCompareVO.getStartDate() != null , "behospital_date", dataCompareVO.getStartDate())
-                        .le(dataCompareVO.getEndDate() != null , "behospital_date", dataCompareVO.getEndDate())
+                        .ge(dataCompareVO.getStartDate() != null, "behospital_date", dataCompareVO.getStartDate())
+                        .le(dataCompareVO.getEndDate() != null, "behospital_date", dataCompareVO.getEndDate())
                         .eq(finalHospitalId != null, "hospital_id", finalHospitalId));
             });
         }
@@ -501,7 +505,7 @@ public class BlockLossManagementFacade {
                             .eq("hospital_id", hospitalId != null ? hospitalId : 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()))
-                            .notIn(ListUtil.isNotEmpty(lossCodes),"behospital_code",lossCodes)//如果说入院记录丢失了,文书的状态还是已丢失不会更新
+                            .notIn(ListUtil.isNotEmpty(lossCodes), "behospital_code", lossCodes)//如果说入院记录丢失了,文书的状态还是已丢失不会更新
                             .eq("is_deleted", IsDeleteEnum.N.getKey()))
                             .stream().map(MedicalRecord::getRecId).collect(Collectors.toList());
                     //更新状态-已恢复
@@ -524,7 +528,7 @@ public class BlockLossManagementFacade {
                             .eq("hospital_id", hospitalId != null ? hospitalId : 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()))
-                            .notIn(ListUtil.isNotEmpty(lossCodes),"behospital_code",lossCodes)//如果说入院记录丢失了,病案首页的状态还是已丢失不会更新
+                            .notIn(ListUtil.isNotEmpty(lossCodes), "behospital_code", lossCodes)//如果说入院记录丢失了,病案首页的状态还是已丢失不会更新
                             .eq("is_deleted", IsDeleteEnum.N.getKey()))
                             .stream().map(HomePage::getHomePageId).collect(Collectors.toList());
                     //更新状态-已恢复
@@ -655,7 +659,7 @@ public class BlockLossManagementFacade {
                 medicalRecords.stream().forEach(medicalRecord -> {
                     //病历数据不存在操作记录
                     if (!behospitalCodeLogs.contains(medicalRecord.getBehospitalCode())) {
-                        if (auditedResultDatas == null || !auditedResultDatas.contains(medicalRecord.getRecId())) {
+                        if (auditedResultDatas == null || !auditedResultDatas.contains(medicalRecord.getBehospitalCode())) {
                             BlocklossResult blocklossResult = new BlocklossResult();
                             blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
                             blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
@@ -715,6 +719,7 @@ public class BlockLossManagementFacade {
      */
     private List<HisMedicalRecordDTO> getHisMedicalRecords(DataCompareVO dataCompareVO) {
         //技术服务部接口 /balance/data/getDataCount
+//        return hisDataService.getDataCount(dataCompareVO).getData();
         //###模拟
         return hisDataManagementFacade.getHisMedicalRecords(dataCompareVO);
     }
@@ -730,40 +735,26 @@ public class BlockLossManagementFacade {
                 DataSaveUrlEnum.HOME_PAGE.getKey(),
                 DataSaveUrlEnum.MEDICAL_RECORD.getKey()));
 
-        DataCompareVO dataCompareVO = new DataCompareVO();
-        dataCompareVO.setStartDate(blockLossTypeGatherVO.getStartDate());
-        dataCompareVO.setEndDate(blockLossTypeGatherVO.getEndDate());
-        //获取his数据
-        List<HisMedicalRecordDTO> hisMedicalRecords = getHisMedicalRecords(dataCompareVO);
 
         BlockLossTypeGatherDTO blockLossTypeGatherDTO = new BlockLossTypeGatherDTO();
-        //his数据量
-        blockLossTypeGatherDTO.setHisNum(getHisMedicalRecordsCount(hisMedicalRecords));
+        //获取his数据
+        //        DataCompareVO dataCompareVO = new DataCompareVO();
+        //        dataCompareVO.setStartDate(blockLossTypeGatherVO.getStartDate());
+        //        dataCompareVO.setEndDate(blockLossTypeGatherVO.getEndDate());
+        //        List<HisMedicalRecordDTO> hisMedicalRecords = getHisMedicalRecords(dataCompareVO);
+        //        blockLossTypeGatherDTO.setHisNum(getHisMedicalRecordsCount(hisMedicalRecords));
 
-        //获取该时间段的日志数量
-        //病历数据
-        dataCompareVO.setOperationUrl(DataSaveUrlEnum.BEHOSPITAL_INFO.getKey());
-        List<GetOperationLogDTO> behospitalCodeLogs = getOperationLogs(dataCompareVO);
-        //病案首页数据
-        List<GetOperationLogDTO> homePageLogs = new ArrayList<>();
-        //文书数据
-        List<GetOperationLogDTO> recLogs = new ArrayList<>();
 
-        if (ListUtil.isNotEmpty(behospitalCodeLogs)) {
-            List<String> logCodes = behospitalCodeLogs.stream().map(GetOperationLogDTO::getBehospitalCode).collect(Collectors.toList());
-            dataCompareVO.setBehospitalCodes(logCodes);
-            //病案首页数据
-            dataCompareVO.setOperationUrl(DataSaveUrlEnum.HOME_PAGE.getKey());
-            homePageLogs = getOperationLogs(dataCompareVO);
-            //文书数据
-            dataCompareVO.setOperationUrl(DataSaveUrlEnum.MEDICAL_RECORD.getKey());
-            recLogs = getOperationLogs(dataCompareVO);
-            Integer logNum = logCodes.size() + homePageLogs.size() + recLogs.size();
-            blockLossTypeGatherDTO.setLogNum(logNum);
-        }
+        //获取his数据
+        blockLossTypeGatherDTO.setHisNum(getHisDataCount(blockLossTypeGatherVO));
+
+        //获取该时间段的日志数量
+        Integer logNum = operationLogService.getOperationLogNum(blockLossTypeGatherVO).getData();
+        blockLossTypeGatherDTO.setLogNum(logNum);
 
         //获取该时间段的实际数量
         List<String> codes = behospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
+                .select("behospital_code")
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                 .ge(blockLossTypeGatherVO.getStartDate() != null, "behospital_date", blockLossTypeGatherVO.getStartDate())
@@ -776,9 +767,11 @@ public class BlockLossManagementFacade {
         if (ListUtil.isNotEmpty(codes)) {
             homePageNum = homePageFacade.count(new QueryWrapper<HomePage>()
                     .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .in("behospital_code", codes));
             recNum = medicalRecordFacade.count(new QueryWrapper<MedicalRecord>()
                     .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .in("behospital_code", codes));
         }
 
@@ -787,11 +780,11 @@ public class BlockLossManagementFacade {
         List<BlocklossResult> blocklossResults = blocklossResultFacade.list(new QueryWrapper<BlocklossResult>()
                 .eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
                 .eq("status", LossStatusEnum.IS_LOSS.getKey())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .ge(blockLossTypeGatherVO.getStartDate() != null, "behospital_date", blockLossTypeGatherVO.getStartDate())
                 .le(blockLossTypeGatherVO.getEndDate() != null, "behospital_date", blockLossTypeGatherVO.getEndDate()));
         Integer allLossNum = blocklossResults.size();
         blockLossTypeGatherDTO.setAllLossNum(allLossNum);
-        //        blockLossTypeGatherDTO.setHisNum(codeNum + homePageNum + recNum + allLossNum);
 
         Map<String, List<BlocklossResult>> lossWayMap = EntityUtil.makeEntityListMap(blocklossResults, "lossWay");
         //外部丢失
@@ -837,6 +830,19 @@ public class BlockLossManagementFacade {
         return blockLossTypeGatherDTO;
     }
 
+    /**
+     * 获取his数据数量
+     *
+     * @param blockLossTypeGatherVO
+     * @Return java.lang.Integer
+     */
+    private Integer getHisDataCount(BlockLossTypeGatherVO blockLossTypeGatherVO) {
+        //获取his数量
+//        return  hisDataService.getCount(blockLossTypeGatherVO).getData();
+        //模拟his
+        return hisDataManagementFacade.gethisDataCount(blockLossTypeGatherVO);
+    }
+
     /**
      * 获取这段时间内his的数据量
      *

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

@@ -453,7 +453,7 @@ public class ColumnResultManagementFacade {
     public List<BehospitalInfo> getBehospitalInfos(Date startDate, Date endDate, Long hospitalId) {
         return behospitalInfoFacade.getBaseMapper().selectList(new QueryWrapper<BehospitalInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
+                .eq(hospitalId!=null,"hospital_id", hospitalId)
                 .ge("behospital_date", startDate)
                 .le("behospital_date", endDate)
         );
@@ -814,9 +814,6 @@ public class ColumnResultManagementFacade {
             String standardvalue = standardvalueInfo.getStandardvalue();
             String modeId = ModeEnum.valueOf(columnInfo.getTableEname()).getKey();
             String modeName = ModeEnum.valueOf(columnInfo.getTableEname()).getName();
-            //删除结果表所有的信息
-            removeStandardvalueResultSolved(behospitalCodeList, hospitalId, columnId);
-            removeColumnResultSolved(behospitalCodeList, hospitalId, columnId, ColumnResultTypeEnum.STANDARD_TYPE.getKey());
             for (GetTableColumnInfoDTO getTableColumnInfoDTO : tableColumnVal) {
                 getTableColumnInfoDTO.setModeId(Long.valueOf(modeId));
                 getTableColumnInfoDTO.setModeName(modeName);
@@ -1246,76 +1243,6 @@ public class ColumnResultManagementFacade {
         return false;
     }
 
-    /**
-     * 删除非空校验结果表信息
-     *
-     * @param behospitalCodeList
-     * @param hospitalId
-     * @param columnId
-     * @return:
-     */
-    public void removeNonnullResultSolved(List<String> behospitalCodeList, Long hospitalId, Long columnId) {
-        nonnullResultFacade.remove(new UpdateWrapper<NonnullResult>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .in("behospital_code", behospitalCodeList)
-                .eq("column_id", columnId)
-        );
-    }
-
-    /**
-     * 删除正则校验结果表信息
-     *
-     * @param behospitalCodeList
-     * @param hospitalId
-     * @param columnId
-     * @return:
-     */
-    public void removeRegularResultSolved(List<String> behospitalCodeList, Long hospitalId, Long columnId) {
-        regularResultFacade.remove(new UpdateWrapper<RegularResult>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .in("behospital_code", behospitalCodeList)
-                .eq("column_id", columnId)
-        );
-    }
-
-    /**
-     * 删除关键字校验结果表信息
-     *
-     * @param behospitalCodeList
-     * @param hospitalId
-     * @param columnId
-     * @return:
-     */
-    public void removeStandardvalueResultSolved(List<String> behospitalCodeList, Long hospitalId, Long columnId) {
-        standardvalueResultFacade.remove(new UpdateWrapper<StandardvalueResult>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .in("behospital_code", behospitalCodeList)
-                .eq("column_id", columnId)
-        );
-    }
-
-    /**
-     * 删除结果总表
-     *
-     * @param behospitalCodeList
-     * @param hospitalId
-     * @param columnId
-     * @return:
-     */
-    public void removeColumnResultSolved(List<String> behospitalCodeList, Long hospitalId, Long columnId, String type) {
-        //未解决修改
-        columnResultFacade.remove(new UpdateWrapper<ColumnResult>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId)
-                .in("behospital_code", behospitalCodeList)
-                .eq("column_id", columnId)
-                .eq("type", type)
-        );
-    }
-
     /**
      * 新增校验结果总表信息
      *

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

@@ -10,6 +10,7 @@ import com.lantone.common.util.DateUtil;
 import com.lantone.common.util.EntityUtil;
 import com.lantone.common.util.ListUtil;
 import com.lantone.common.util.StringUtil;
+import com.lantone.common.vo.BlockLossTypeGatherVO;
 import com.lantone.common.vo.DataCompareVO;
 import com.lantone.common.vo.DataRepariVO;
 import com.lantone.daqe.dto.HisMedicalRecordDTO;
@@ -214,4 +215,26 @@ public class HisDataManagementFacade {
         });
         return out;
     }
+
+    public Integer gethisDataCount(BlockLossTypeGatherVO blockLossTypeGatherVO) {
+        List<String> codes = hisBehospitalInfoFacade.list(new QueryWrapper<HisBehospitalInfo>()
+                .select("behospital_code")
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(blockLossTypeGatherVO.getStartDate() != null, "behospital_date", blockLossTypeGatherVO.getStartDate())
+                .le(blockLossTypeGatherVO.getEndDate() != null, "behospital_date", blockLossTypeGatherVO.getEndDate()))
+                .stream().map(HisBehospitalInfo::getBehospitalCode).collect(Collectors.toList());
+
+        Integer codeNum = codes.size();
+        Integer homePageNum = 0;
+        Integer recNum = 0;
+        if (ListUtil.isNotEmpty(codes)) {
+            homePageNum = hisHomePageFacade.count(new QueryWrapper<HisHomePage>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("behospital_code", codes));
+            recNum = hisMedicalRecordFacade.count(new QueryWrapper<HisMedicalRecord>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("behospital_code", codes));
+        }
+        return codeNum + homePageNum + recNum;
+    }
 }

+ 36 - 14
daqe-center/src/main/java/com/lantone/daqe/facade/RegularManagementFacade.java

@@ -11,10 +11,13 @@ import com.lantone.common.util.DateUtil;
 import com.lantone.common.util.ListUtil;
 import com.lantone.common.util.SysUserUtils;
 import com.lantone.daqe.dto.GetRegularPageDTO;
+import com.lantone.daqe.entity.ColumnResult;
 import com.lantone.daqe.entity.ColumnVerify;
 import com.lantone.daqe.entity.RegularInfo;
 import com.lantone.daqe.entity.RegularMapping;
+import com.lantone.daqe.entity.RegularResult;
 import com.lantone.daqe.enums.ColumnVerifyTypeEnum;
+import com.lantone.daqe.facade.base.ColumnResultFacade;
 import com.lantone.daqe.facade.base.ColumnVerifyFacade;
 import com.lantone.daqe.facade.base.RegularInfoFacade;
 import com.lantone.daqe.facade.base.RegularMappingFacade;
@@ -29,6 +32,7 @@ import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 正则式维护-业务处理类
@@ -50,6 +54,9 @@ public class RegularManagementFacade {
     @Autowired
     private ColumnVerifyFacade columnVerifyFacade;
 
+    @Autowired
+    private ColumnResultFacade columnResultFacade;
+
     /**
      * 获取正则式维护分页列表
      *
@@ -146,19 +153,34 @@ public class RegularManagementFacade {
             if (regularMappingFacade.remove(new UpdateWrapper<RegularMapping>()
                     .eq("regular_id", id)
                     .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
-                return columnVerifyFacade.remove(new UpdateWrapper<ColumnVerify>()
+                if (columnVerifyFacade.remove(new UpdateWrapper<ColumnVerify>()
                         .in("verify_id", regularMappingIdList)
                         .eq("type", ColumnVerifyTypeEnum.REGULAR_TYPE.getKey())
-                        .eq("is_deleted", IsDeleteEnum.N.getKey()));
+                        .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
+                    //拿到正则结果表中关联数据的id
+                    List<RegularResult> regularResults = regularResultFacade.getBaseMapper().selectList(new QueryWrapper<RegularResult>()
+                            .eq("regular_id", id)
+                            .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    );
+                    List<Long> regularResultId = new ArrayList<>();
+                    regularResults.stream().forEach(regularResult->{
+                        regularResultId.add(regularResult.getId());
+                    });
+                    //            删除表字段的正则式校验结果表中的正则式
+                    if (regularResultFacade.remove(new UpdateWrapper<RegularResult>()
+                            .eq(hospitalId != null, "hospital_id", hospitalId)
+                            .eq("regular_id", id)
+                            .eq("is_deleted", IsDeleteEnum.N.getKey()))) {
+                        //删除总结果表信息
+                        return columnResultFacade.remove(new UpdateWrapper<ColumnResult>()
+                                .eq(hospitalId != null, "hospital_id", hospitalId)
+                                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                                .eq("result_id",regularResultId)
+                        );
+                    }
+                }
             }
-            //删除表字段的正则式校验结果表中的正则式
-            //            return regularResultFacade.update(new UpdateWrapper<RegularResult>()
-            //                    .eq(hospitalId != null, "hospital_id", hospitalId)
-            //                    .eq("regular_id", id)
-            //                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-            //                    .set("modifier", SysUserUtils.getCurrentPrinciple() == null ? "0" : SysUserUtils.getCurrentPrinciple())
-            //                    .set("gmt_modified", DateUtil.now())
-            //                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
+
 
         }
         return false;
@@ -185,16 +207,16 @@ public class RegularManagementFacade {
     }
 
     /**
-     *  判断该正则式是否关联
+     * 判断该正则式是否关联
      *
      * @param upRegularByIdVO
      * @Return java.lang.Boolean
      */
     public Boolean isRelation(UpRegularByIdVO upRegularByIdVO) {
         int count = regularMappingFacade.count(new QueryWrapper<RegularMapping>()
-                .eq("is_deleted",IsDeleteEnum.N.getKey())
-                .eq("regular_id",upRegularByIdVO.getId()));
-        if(count>0){
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("regular_id", upRegularByIdVO.getId()));
+        if (count > 0) {
             return true;
         }
         return false;

+ 8 - 2
daqe-center/src/main/java/com/lantone/daqe/task/ColumnResultDataCompareTask.java

@@ -40,8 +40,14 @@ public class ColumnResultDataCompareTask implements SchedulingConfigurer {
             public void run() {
                 if(Boolean.parseBoolean(isUsed)){
                     DataCheckVO dataCheckVO = new DataCheckVO();
-                    dataCheckVO.setDateStart(DateUtil.addDate(DateUtil.now(),-1));
-                    dataCheckVO.setDateEnd(DateUtil.now());
+                    String start="2021-01-01 03:08:38";
+                    String end="2021-01-30 03:08:38";
+                    Date dateStart = DateUtil.parseDateTime(start);
+                    Date dateEnd = DateUtil.parseDateTime(end);
+                    /*dataCheckVO.setDateStart(DateUtil.addDate(DateUtil.now(),-1));
+                    dataCheckVO.setDateEnd(DateUtil.now());*/
+                    dataCheckVO.setDateStart(dateStart);
+                    dataCheckVO.setDateEnd(dateEnd);
                     dataCheckVO.setHospitalId(Long.valueOf(hospitalId));
                     columnResultManagementFacade.dataCheck(dataCheckVO);
                 }

+ 1 - 1
daqe-center/src/main/resources/bootstrap.yml

@@ -65,7 +65,7 @@ blockloss:
 #数据校验定时器
 columnResult:
   compare:
-    cron: 0 30 1 * * ?
+    cron: 0 0 12 * * ?
     use: true
     hospitalId: 4
 #修改规则数据校验定时器

+ 13 - 4
security-center/src/main/java/com/lantone/security/facade/LogManagementFacade.java

@@ -169,9 +169,18 @@ public class LogManagementFacade {
      * @Return java.lang.Integer
      */
     public Integer getOperationLogNum(BlockLossTypeGatherVO blockLossTypeGatherVO) {
-        return operationLogFacade.count(new QueryWrapper<OperationLog>()
-                .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
-                .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getEndDate())
-                .in("operation_url", blockLossTypeGatherVO.getOperationUrls()));
+        List<String> codes = operationLogFacade.list(new QueryWrapper<OperationLog>()
+                .select("remark")
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .ge(blockLossTypeGatherVO.getStartDate() != null , "gmt_create", blockLossTypeGatherVO.getStartDate())
+                .le(blockLossTypeGatherVO.getEndDate() != null  , "gmt_create", blockLossTypeGatherVO.getEndDate())
+                .eq("operation_url", blockLossTypeGatherVO.getOperationUrls().get(0)))
+                .stream().map(OperationLog::getRemark).collect(Collectors.toList());
+        if(ListUtil.isNotEmpty(codes)){
+            return operationLogFacade.count(new QueryWrapper<OperationLog>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("remark", codes));
+        }
+        return 0;
     }
 }