소스 검색

Merge remote-tracking branch 'origin/master'

lenovodn 1 년 전
부모
커밋
e16735ebd0
14개의 변경된 파일315개의 추가작업 그리고 58개의 파일을 삭제
  1. 49 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/AfterwardsAuditExportResponse.java
  2. 12 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/AfterwardsAuditController.java
  3. 4 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/ViolationAnalysisController.java
  4. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MedicalInsRuleInfo.java
  5. 67 24
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/RuleEngine.java
  6. 8 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IAfterwardsAuditService.java
  7. 2 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMedicalInsRuleProjectDiagnoseService.java
  8. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IViolationAnalysisService.java
  9. 57 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/AfterwardsAuditServiceImpl.java
  10. 57 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/ExportUtilHelperService.java
  11. 34 11
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MedicalInsRuleProjectDiagnoseServiceImpl.java
  12. 2 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MedicalInsRuleProjectServiceImpl.java
  13. 11 9
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/ViolationAnalysisServiceImpl.java
  14. 6 6
      jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

+ 49 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/AfterwardsAuditExportResponse.java

@@ -0,0 +1,49 @@
+package org.jeecg.modules.medical.common.bo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author yaowei
+ * @time 2023/11/14 20:55 星期二
+ * @description '这里写类描述'
+ * @parentProject medical-java
+ */
+@Data
+public class AfterwardsAuditExportResponse implements Serializable {
+    @Excel(name = "住院号", width = 15)
+    @ApiModelProperty(value = "住院号/门诊号")
+    private java.lang.String outpatientNumber;
+
+    @Excel(name = "患者姓名", width = 15)
+    @ApiModelProperty(value = "患者姓名")
+    private java.lang.String patientName;
+
+    @Excel(name = "出院科室", width = 15)
+    @ApiModelProperty(value = "科室名称")
+    private java.lang.String medicalDeptName;
+
+    @Excel(name = "主治医生", width = 15)
+    @ApiModelProperty(value = "医生姓名")
+    private java.lang.String doctorName;
+
+    @Excel(name = "异常多收", width = 15)
+    @ApiModelProperty(value = "异常多收")
+    private BigDecimal errorRelativelyManyAmt;
+
+    @Excel(name = "异常少收", width = 15)
+    private BigDecimal errorRelativelyFewAmt;
+
+    @Excel(name = "审核来源", width = 15)
+    @ApiModelProperty(value = "资料来源")
+    private String auditSource;
+
+    @Excel(name = "审核", width = 15)
+    @ApiModelProperty(value = "审核状态: wait=待分配; process=处理中; finish=已完成")
+    private java.lang.String checkState;
+}

+ 12 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/AfterwardsAuditController.java

@@ -31,6 +31,7 @@ import org.springframework.web.servlet.ModelAndView;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -69,6 +70,17 @@ public class AfterwardsAuditController extends JeecgController<AfterwardsAudit,
 		 return Result.OK(pageList);
 	 }
 
+	@ApiOperation(value="审核-审核列表导出", notes="审核列表导出")
+	@RequestMapping(value = "/audit/exportXls")
+	public ModelAndView auditExportXls(HttpServletRequest req, AfterwardsAudit afterwardsAudit) {
+		try {
+			return afterwardsAuditService.auditExportXls(req, afterwardsAudit, AfterwardsAuditExportResponse.class, "审核-审核列表");
+//			return violationAnalysisService.midViolateRuleExportXls(req, medicalInsRuleInfoName, projectType,startTime, endTime, MidAuditDetailResponse.class, "事中-规则类型统计");
+		} catch (UnsupportedEncodingException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
 
 
 

+ 4 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/ViolationAnalysisController.java

@@ -25,6 +25,7 @@ import org.jeecg.modules.medical.entity.AfterwardsAuditDetail;
 import org.jeecg.modules.medical.service.IAfterwardsAuditDetailService;
 import org.jeecg.modules.medical.service.IAfterwardsAuditService;
 import org.jeecg.modules.medical.service.IViolationAnalysisService;
+import org.jeecg.modules.medical.service.impl.ExportUtilHelperService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -56,6 +57,8 @@ public class ViolationAnalysisController {
     @Autowired
     private IViolationAnalysisService violationAnalysisService;
     @Autowired
+    private ExportUtilHelperService exportUtilHelperService;
+    @Autowired
     private IAdvanceWarningAuditService advanceWarningAuditService;
     @Autowired
     private IAfterwardsAuditService afterwardsAuditService;
@@ -347,7 +350,7 @@ public class ViolationAnalysisController {
                 );
             }
             List<AfterwardsAuditDetail> exportList = afterwardsAuditDetailService.list(queryWrapper);
-            return violationAnalysisService.commonExportXml(item -> AfterwardsAuditDetail.class, "事后-全院稽核统计", exportList);
+            return exportUtilHelperService.commonExportXml(item -> AfterwardsAuditDetail.class, "事后-全院稽核统计", exportList);
         } catch (UnsupportedEncodingException e) {
             throw new RuntimeException(e);
         }

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MedicalInsRuleInfo.java

@@ -96,6 +96,11 @@ public class MedicalInsRuleInfo implements Serializable {
     @ApiModelProperty(value = "调用场景;1=事前  2=事后  3=事前/事后 4=事中 5=事后/事中")
     @Dict(dicCode = "call_scenario")
     private java.lang.String callScenario;
+
+    /**
+     * 匹配类型;为空或者1:项目编码匹配,2:诊断编码匹配
+     */
+    private java.lang.String searchType;
 	/**状态*/
 	@Excel(name = "状态", width = 15)
     @ApiModelProperty(value = "状态")

+ 67 - 24
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/RuleEngine.java

@@ -152,6 +152,15 @@ public class RuleEngine {
 
     public static Set<Integer> daysRuleIdSet = new HashSet<>();
 
+    /**
+     * 配置了项目编码,但是是以诊断编码匹配的规则id列表
+     */
+    public static List<Integer> diagRuleIdList = new ArrayList<>();
+    /**
+     * 没有配置项目编码,只配置了诊断编码类的规则id列表
+     */
+    public static List<Integer> noProjectCodeDiagRuleIdList = new ArrayList<>();
+
     public void initMedicalInsRule() {
         log.info("进入初始化RuleEngine");
         List<MedicalInsRuleInfo> medicalInsRuleInfoList = medicalInsRuleInfoService.lambdaQuery().eq(MedicalInsRuleInfo::getState, Constant.EFF_STATE).list();
@@ -165,12 +174,25 @@ public class RuleEngine {
          */
         List<MedicalInsRuleInfo> midMedicalInsRuleInfoList = new ArrayList<>();
         for (MedicalInsRuleInfo medicalInsRuleInfo : medicalInsRuleInfoList) {
+            //诊断编码匹配
+            if ("2".equals(medicalInsRuleInfo.getSearchType())) {
+                diagRuleIdList.add(medicalInsRuleInfo.getId());
+            }
             allMedicalMap.put(medicalInsRuleInfo.getId(), medicalInsRuleInfo);
             if (Constant.TREATMEN_TYPE_ADVANCE_WARNING.equals(medicalInsRuleInfo.getCallScenario())) {
                 advanceWaringRuleIdList.add(medicalInsRuleInfo.getId());
             } else {
                 midMedicalInsRuleInfoList.add(medicalInsRuleInfo);
             }
+            String selectedRoles = medicalInsRuleInfo.getSelectedRoles();
+            if (StringUtils.isNotBlank(selectedRoles)) {
+                String[] selectedRolesArr = selectedRoles.split(",");
+                boolean diagnoseFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("medicalDiagnoseCode"));
+                boolean projectCodeFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("projectCode"));
+                if (diagnoseFlag && !projectCodeFlag) {
+                    noProjectCodeDiagRuleIdList.add(medicalInsRuleInfo.getId());
+                }
+            }
         }
 
         genItemCodeAndRuleIdMap(midMedicalInsRuleInfoList);
@@ -506,7 +528,7 @@ public class RuleEngine {
     }
 
 
-    public void dealAfterAdvance(AfterIncidentLog afterIncidentLog,Map<String,Object> paramMap, List<Integer> ruleIdList, List<Map<String, Object>> itemList) {
+    public void dealAfterAdvance(AfterIncidentLog afterIncidentLog, Map<String, Object> paramMap, List<Integer> ruleIdList, List<Map<String, Object>> itemList) {
         if (CollectionUtil.isEmpty(ruleIdList)) {
             log.error("事后提醒未配置对应的提醒规则");
             return;
@@ -793,31 +815,10 @@ public class RuleEngine {
 
             Object diagnose = itemMap.get(Constant.MEDICAL_DIAGNOSE_CODE_KEY);
             if (null != diagnose) {
+                List<String> diagnoseList = (List<String>) diagnose;
                 //获取诊断编码配置的规则ID,加入需要执行的规则
-                List<MedicalInsRuleProject> medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByDiagCode(diagnose.toString());
-                if (CollectionUtil.isEmpty(medicalInsRuleProjectTempList)) {
-                    log.info("诊断编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", diagnose);
-                }
-                Set<Integer> medicalInsRuleInfoIdDiagSet = medicalInsRuleProjectTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
-                log.info("数据库检索到匹配规则ID列表:{} 诊断编码为:{}", medicalInsRuleInfoIdDiagSet, diagnose);
+                getAndSetDiagRule(diagnoseList, medicalInsRuleProjectList);
 
-                if (CollectionUtil.isNotEmpty(medicalInsRuleProjectTempList)) {
-                    if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
-                        medicalInsRuleProjectList = new ArrayList<>();
-                    }
-                    for (MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectTempList) {
-                        MedicalInsRuleInfo projectRuleInfo = allMedicalMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
-                        String selectedRoles = projectRuleInfo.getSelectedRoles();
-                        if (StringUtils.isNotBlank(selectedRoles)) {
-                            String[] selectedRolesArr = selectedRoles.split(",");
-                            boolean diagnoseFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("medicalDiagnoseCode"));
-                            boolean projectCodeFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("projectCode"));
-                            if (diagnoseFlag && !projectCodeFlag) {
-                                medicalInsRuleProjectList.add(medicalInsRuleProject);
-                            }
-                        }
-                    }
-                }
             }
             if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
                 log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据,退出执行规则", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
@@ -853,6 +854,48 @@ public class RuleEngine {
 
     }
 
+    public void getAndSetDiagRule(List<String> diagnoseList, List<MedicalInsRuleProject> medicalInsRuleProjectList) {
+        if (CollectionUtil.isNotEmpty(diagRuleIdList)) {
+            List<MedicalInsRuleProjectDiagnose> projectDiagnoseList = medicalInsRuleProjectDiagnoseService.getRuleProjectByDiagCodeAndRuleId(diagRuleIdList, diagnoseList);
+            if (CollectionUtil.isNotEmpty(projectDiagnoseList)) {
+                List<String> projectCodeList = new ArrayList<>();
+                for (MedicalInsRuleProjectDiagnose medicalInsRuleProjectDiagnose : projectDiagnoseList) {
+                    projectCodeList.add(medicalInsRuleProjectDiagnose.getMedicalInsProjectCode());
+                }
+                List<MedicalInsRuleProject> medicalInsRuleProjectTempList = medicalInsRuleProjectService.lambdaQuery().in(MedicalInsRuleProject::getProjectCode)
+                        .in(MedicalInsRuleProject::getMedicalInsRuleInfoId, diagRuleIdList).list();
+                if (CollectionUtil.isNotEmpty(medicalInsRuleProjectTempList)) {
+                    Set<Integer> ruleIdSet = medicalInsRuleProjectTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
+                    log.error("有项目编码以诊断编码为主的诊断规则 诊断编码:{} 匹配的规则id:{} ", diagnoseList, ruleIdSet);
+                    for (MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectTempList) {
+                        medicalInsRuleProjectList.add(medicalInsRuleProject);
+                    }
+                }
+            }
+        }
+        if (CollectionUtil.isNotEmpty(noProjectCodeDiagRuleIdList)) {
+            List<MedicalInsRuleProjectDiagnose> projectDiagnoseList = medicalInsRuleProjectDiagnoseService.getRuleProjectByDiagCodeAndRuleId(noProjectCodeDiagRuleIdList, diagnoseList);
+            if (CollectionUtil.isNotEmpty(projectDiagnoseList)) {
+                Set<Integer> medicalRuleIdSet = projectDiagnoseList.stream().map(MedicalInsRuleProjectDiagnose::getMedicalInsRuleInfoId).collect(Collectors.toSet());
+                List<String> diagnoseCodeList = new ArrayList<>();
+                for (MedicalInsRuleProjectDiagnose medicalInsRuleProjectDiagnose : projectDiagnoseList) {
+                    diagnoseCodeList.add(medicalInsRuleProjectDiagnose.getMedicalDiagnoseCode());
+                }
+                List<MedicalInsRuleProject> medicalInsRuleProjectDiagTempList = medicalInsRuleProjectService.lambdaQuery().in(MedicalInsRuleProject::getMedicalDiagnoseCode, diagnoseCodeList).in(MedicalInsRuleProject::getMedicalInsRuleInfoId, medicalRuleIdSet).list();
+                if (CollectionUtil.isNotEmpty(medicalInsRuleProjectDiagTempList)) {
+                    Set<Integer> ruleIdSet = medicalInsRuleProjectDiagTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
+                    log.error("无项目编码以诊断编码为主的诊断规则 诊断编码:{} 匹配的规则id:{} ", diagnoseList, ruleIdSet);
+                    for (MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectDiagTempList) {
+                        medicalInsRuleProjectList.add(medicalInsRuleProject);
+                    }
+                } else {
+                    log.error("无项目编码的诊断规则 诊断编码:{} 规则id:{} 在medical_ins_rule_project表数据缺失", diagnoseCodeList, medicalRuleIdSet);
+                }
+
+            }
+        }
+    }
+
     /**
      * 把当前明细记录的主单下的所有项目编码设置到当前项目记录
      */

+ 8 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IAfterwardsAuditService.java

@@ -16,7 +16,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.medical.entity.AfterwardsAuditDetail;
 import org.jeecg.modules.medical.entity.MedicalDoctorAppealRecord;
 import org.jeecg.modules.medical.entity.PrescriptionOrder;
+import org.springframework.web.servlet.ModelAndView;
 
+import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.util.List;
 
@@ -48,6 +51,8 @@ public interface IAfterwardsAuditService extends IService<AfterwardsAudit> {
      */
     IPage<AfterwardsAudit> auditQueryListPage(Page<AfterwardsAudit> page, QueryWrapper<AfterwardsAudit> queryWrapper);
 
+    List<AfterwardsAuditExportResponse> auditQueryList(QueryWrapper<AfterwardsAudit> queryWrapper);
+
     boolean audit(LoginUser loginUser, AuditRequestBO param);
 
     DeptAuditResponse deptAuditPanel(String loginUserName, String doctorName);
@@ -122,4 +127,7 @@ public interface IAfterwardsAuditService extends IService<AfterwardsAudit> {
     BigDecimal statisticsAfterAuditTotal(AfterDeptDetailRequest afterwardsAuditDetail);
 
 
+    ModelAndView auditExportXls(HttpServletRequest req, AfterwardsAudit afterwardsAudit, Class<AfterwardsAuditExportResponse> clazz, String title) throws UnsupportedEncodingException;
+
+
 }

+ 2 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMedicalInsRuleProjectDiagnoseService.java

@@ -16,9 +16,9 @@ public interface IMedicalInsRuleProjectDiagnoseService extends IService<MedicalI
     boolean saveDiagnose(List<String> medicalDiagnoseCode,Integer projectCodeType, Integer medicalInsRuleInfoId, String projectCode);
     boolean updateDiagnose(List<String> medicalDiagnoseCode,Integer projectCodeType, Integer medicalInsRuleInfoId, String projectCode);
 
-    List<MedicalInsRuleProjectDiagnose> getRuleProjectByDiagCodeAndRuleId(List<Integer> medicalInsRuleInfoIdList, String medicalDiagnoseCode);
+    List<MedicalInsRuleProjectDiagnose> getRuleProjectByDiagCodeAndRuleId(List<Integer> medicalInsRuleInfoIdList, List<String> medicalDiagnoseCode);
 
-    List<MedicalInsRuleProjectDiagnose> getRuleProjectByMedicalDiagnoseCode(String medicalDiagnoseCode);
+    List<MedicalInsRuleProjectDiagnose> getRuleProjectByDiagnoseCodeAndProjectNull(List<String> medicalDiagnoseCode);
 //    boolean saveCorrelationDiagnose(List<String> medicalDiagnoseCode, Integer medicalInsRuleInfoId, String medicalInsProjectCode);
 
 }

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IViolationAnalysisService.java

@@ -78,7 +78,7 @@ public interface IViolationAnalysisService {
      * @param advanceWarningAuditDetail
      * @return
      */
-    ModelAndView commonExportXml(BiFunction<?, Class<?>> biFunction, String title, List<?> exportList) throws UnsupportedEncodingException;
+    /*ModelAndView commonExportXml(BiFunction<?, Class<?>> biFunction, String title, List<?> exportList) throws UnsupportedEncodingException;*/
 
     ModelAndView auditMidDetailExportXml(HttpServletRequest req, AuditMidDetailListRequest request, Class<AuditMidDetailListResponse> auditMidDetailListResponseClass, String 事中审查统计) throws UnsupportedEncodingException;
 

+ 57 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/AfterwardsAuditServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.medical.service.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.medical.common.bo.*;
@@ -24,10 +26,7 @@ import org.jeecg.modules.medical.entity.MedicalDoctorAppealRecord;
 import org.jeecg.modules.medical.entity.PrescriptionOrder;
 import org.jeecg.modules.medical.mapper.AfterwardsAuditMapper;
 import org.jeecg.modules.medical.ruleengine.projectcache.HisMedicalProjectCache;
-import org.jeecg.modules.medical.service.IAfterwardsAuditDetailService;
-import org.jeecg.modules.medical.service.IAfterwardsAuditService;
-import org.jeecg.modules.medical.service.IMedicalDoctorAppealRecordService;
-import org.jeecg.modules.medical.service.IPrescriptionOrderService;
+import org.jeecg.modules.medical.service.*;
 import org.jeecg.modules.system.entity.SysDepart;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.entity.SysUserDepart;
@@ -44,7 +43,10 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
 
+import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
@@ -73,6 +75,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
 
     private final IAfterwardsAuditDetailService afterwardsAuditDetailService;
     private final IPrescriptionOrderService prescriptionOrderService;
+    private final ExportUtilHelperService exportUtilHelperService;
 
     @Override
     public IPage<ReportAfterQueryResponseBO> departmentStatistics(Page<AfterwardsAudit> page, AfterwardsAudit afterwardsAudit) {
@@ -122,6 +125,41 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
         return auditQueryPageList;
     }
 
+    @Override
+    public List<AfterwardsAuditExportResponse> auditQueryList(QueryWrapper<AfterwardsAudit> queryWrapper) {
+        List<AfterwardsAudit> dataList = this.list(queryWrapper); // TODO 待审核状态默认是空,需要查询为空
+        List<AfterwardsAuditExportResponse> resultList = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(dataList)) {
+            resultList = dataList.stream().map(item -> {
+                AfterwardsAuditExportResponse resultItem = new AfterwardsAuditExportResponse();
+                // 计算异常多收-少收
+/*                BigDecimal detailTotalAmt = baseMapper.statisticsErrAmtByAfterwareRecordId(item.getId());
+                item.setErrorRelativelyFewAmt(new BigDecimal("0.00"));
+                item.setErrorRelativelyManyAmt(new BigDecimal("0.00"));
+                if (!StringUtils.hasText(item.getCheckState())) {
+                    item.setCheckState(AfterwardsAuditStatusEnum.wait.getStatus());
+                }
+                if (null != detailTotalAmt) {
+                    if (detailTotalAmt.compareTo(BigDecimal.ZERO) > 0) { // 异常金额大于0,就是多收
+                        item.setErrorRelativelyManyAmt(detailTotalAmt);
+                    } else if (detailTotalAmt.compareTo(BigDecimal.ZERO) < 0) {
+                        item.setErrorRelativelyFewAmt(detailTotalAmt);
+                    }
+                }*/
+                int appealNumber = 0;
+                MedicalDoctorAppealRecord appealRecord = appealRecordService.loadMaxAppealNumber(item.getId(), item.getMedicalDeptCode(), item.getDoctorId());
+                if (null != appealRecord && appealRecord.getAppealNumber() != null) {
+                    appealNumber = appealRecord.getAppealNumber();
+                }
+                item.setAuditNumber(appealNumber);
+                BeanUtil.copyProperties(item, resultItem);
+
+                return resultItem;
+            }).collect(Collectors.toList());
+        }
+        return resultList;
+    }
+
     @Transactional(readOnly = false)
     @Override
     public boolean audit(LoginUser loginUser, AuditRequestBO param) {
@@ -563,4 +601,19 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
         return baseMapper.statisticsAfterAuditTotal(afterwardsAuditDetail);
     }
 
+    @Override
+    public ModelAndView auditExportXls(HttpServletRequest req, AfterwardsAudit afterwardsAudit, Class<AfterwardsAuditExportResponse> clazz, String title) throws UnsupportedEncodingException {
+
+        String checkState = afterwardsAudit.getCheckState();
+        if (ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.wait.getStatus(),afterwardsAudit.getCheckState())) {
+            afterwardsAudit.setCheckState(null);
+        }
+        QueryWrapper<AfterwardsAudit> queryWrapper = QueryGenerator.initQueryWrapper(afterwardsAudit, req.getParameterMap());
+        if (ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.wait.getStatus() ,checkState)) {
+            queryWrapper.and(q -> q.isNull( "check_state").or().eq( "check_state", "wait"));
+        }
+        List<AfterwardsAuditExportResponse> exportList = this.auditQueryList(queryWrapper);
+        // 获取数据
+        return exportUtilHelperService.commonExportXml(item -> clazz, title, exportList);
+    }
 }

+ 57 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/ExportUtilHelperService.java

@@ -0,0 +1,57 @@
+package org.jeecg.modules.medical.service.impl;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.medical.BiFunction;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.List;
+
+/**
+ * @author Scott
+ * @time 2023/11/14 21:25 星期二
+ * @description 'Excel结合jeecg导出服务'
+ * @parentProject medical-java
+ */
+@Slf4j
+@Service
+public class ExportUtilHelperService {
+
+    @Value("${jeecg.path.upload}")
+    protected String upLoadPath;
+    public ModelAndView commonExportXml(BiFunction<?, Class<?>> biFunction, String title, List<?> exportList) throws UnsupportedEncodingException {
+        // Step.1 组装查询条件
+//        QueryWrapper<T> queryWrapper = QueryGenerator.initQueryWrapper(object, request.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        // Step.2 获取导出数据
+//        List<T> exportList = service.list(queryWrapper);
+
+        final String noCodeTitle = title + "模板";
+        title = URLEncoder.encode(title, "UTF-8");
+
+        Class<?> process = biFunction.process(null);
+
+        // Step.3 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        //此处设置的filename无效 ,前端会重更新设置一下
+        mv.addObject(NormalExcelConstants.FILE_NAME, title);
+        mv.addObject(NormalExcelConstants.CLASS, process);
+        //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
+        ExportParams exportParams=new ExportParams(noCodeTitle + "报表", "导出人:" + sysUser.getRealname(), noCodeTitle);
+        exportParams.setImageBasePath(upLoadPath);
+        exportParams.setType(ExcelType.XSSF);
+        //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
+        mv.addObject(NormalExcelConstants.PARAMS,exportParams);
+        mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
+        return mv;
+    }
+}

+ 34 - 11
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MedicalInsRuleProjectDiagnoseServiceImpl.java

@@ -1,14 +1,12 @@
 package org.jeecg.modules.medical.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.jeecg.modules.medical.Constant;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.medical.entity.MedicalInsRuleProjectDiagnose;
 import org.jeecg.modules.medical.mapper.MedicalInsRuleProjectDiagnoseMapper;
 import org.jeecg.modules.medical.service.IMedicalInsRuleProjectDiagnoseService;
 import org.springframework.stereotype.Service;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -24,13 +22,13 @@ public class MedicalInsRuleProjectDiagnoseServiceImpl extends ServiceImpl<Medica
 
 
     @Override
-    public boolean saveDiagnose(List<String> medicalDiagnoseCode,Integer projectCodeType, Integer medicalInsRuleInfoId, String projectCode) {
+    public boolean saveDiagnose(List<String> medicalDiagnoseCode, Integer projectCodeType, Integer medicalInsRuleInfoId, String projectCode) {
         List<MedicalInsRuleProjectDiagnose> diagnoseList = this.lambdaQuery().in(MedicalInsRuleProjectDiagnose::getMedicalDiagnoseCode, medicalDiagnoseCode)
                 .eq(MedicalInsRuleProjectDiagnose::getProjectCodeType, projectCodeType)
                 .eq(MedicalInsRuleProjectDiagnose::getMedicalInsProjectCode, projectCode)
                 .eq(MedicalInsRuleProjectDiagnose::getMedicalInsRuleInfoId, medicalInsRuleInfoId).list();
         List<MedicalInsRuleProjectDiagnose> list = new ArrayList<>();
-        if(diagnoseList.size()>0){
+        if (diagnoseList.size() > 0) {
             List<String> collect = diagnoseList.stream().map(it -> it.getMedicalDiagnoseCode()).collect(Collectors.toList());
             medicalDiagnoseCode = medicalDiagnoseCode.stream().filter(item -> !collect.contains(item)).collect(Collectors.toList());
         }
@@ -64,23 +62,48 @@ public class MedicalInsRuleProjectDiagnoseServiceImpl extends ServiceImpl<Medica
     }
 
     @Override
-    public List<MedicalInsRuleProjectDiagnose> getRuleProjectByDiagCodeAndRuleId(List<Integer> medicalInsRuleInfoIdList, String medicalDiagnoseCode) {
+    public List<MedicalInsRuleProjectDiagnose> getRuleProjectByDiagCodeAndRuleId(List<Integer> medicalInsRuleInfoIdList, List<String> medicalDiagnoseCode) {
         QueryWrapper<MedicalInsRuleProjectDiagnose> queryWrapper = new QueryWrapper<MedicalInsRuleProjectDiagnose>();
         queryWrapper.in("medical_ins_rule_info_id", medicalInsRuleInfoIdList);
-        queryWrapper.isNull("medical_ins_project_code");
-        queryWrapper.last(" and INSTR('"+medicalDiagnoseCode+"',medical_diagnose_code)=1  ");
+        StringBuffer lastSql = new StringBuffer(" and (");
+        for (int i = 0; i < medicalDiagnoseCode.size(); i++) {
+            String diagnose = medicalDiagnoseCode.get(i);
+            if (i == 0) {
+                lastSql.append("INSTR('").append(diagnose).append("',medical_diagnose_code)=1");
+            } else {
+                lastSql.append(" or INSTR('").append(diagnose).append("',medical_diagnose_code)=1");
+            }
+
+            if (i == medicalDiagnoseCode.size()-1) {
+                lastSql.append(")");
+            }
+        }
+
+        queryWrapper.last(lastSql.toString());
 
         return this.list(queryWrapper);
     }
 
 
     @Override
-    public List<MedicalInsRuleProjectDiagnose> getRuleProjectByMedicalDiagnoseCode(String medicalDiagnoseCode) {
+    public List<MedicalInsRuleProjectDiagnose> getRuleProjectByDiagnoseCodeAndProjectNull(List<String> medicalDiagnoseCodeList) {
         QueryWrapper<MedicalInsRuleProjectDiagnose> queryWrapper = new QueryWrapper<MedicalInsRuleProjectDiagnose>();
         queryWrapper.isNull("medical_ins_project_code");
-        queryWrapper.last(" and INSTR('"+medicalDiagnoseCode+"',medical_diagnose_code)=1  ");
+        StringBuffer lastSql = new StringBuffer(" and (");
+        for (int i = 0; i < medicalDiagnoseCodeList.size(); i++) {
+            String diagnose = medicalDiagnoseCodeList.get(i);
+            if (i == 0) {
+                lastSql.append("INSTR('").append(diagnose).append("',medical_diagnose_code)=1");
+            } else {
+                lastSql.append(" or INSTR('").append(diagnose).append("',medical_diagnose_code)=1");
+            }
 
+            if (i == medicalDiagnoseCodeList.size()-1) {
+                lastSql.append(")");
+            }
+        }
+
+        queryWrapper.last(lastSql.toString());
         return this.list(queryWrapper);
     }
-
 }

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MedicalInsRuleProjectServiceImpl.java

@@ -631,6 +631,7 @@ public class MedicalInsRuleProjectServiceImpl extends ServiceImpl<MedicalInsRule
     public List<MedicalInsRuleProject> getRuleProjectByMedicalProjectCode(String medicalProjectCode) {
         QueryWrapper<MedicalInsRuleProject> queryWrapper = new QueryWrapper<MedicalInsRuleProject>();
         queryWrapper.eq("STATE", Constant.EFF_STATE);
+        queryWrapper.isNull("search_type");
         queryWrapper.last(" and INSTR('"+medicalProjectCode+"',project_code)=1");
 
         return this.list(queryWrapper);
@@ -640,6 +641,7 @@ public class MedicalInsRuleProjectServiceImpl extends ServiceImpl<MedicalInsRule
     public List<MedicalInsRuleProject> getRuleProjectByRuleIdAndProjectCode(List<Integer> medicalInsRuleInfoIdList, String medicalProjectCode) {
         QueryWrapper<MedicalInsRuleProject> queryWrapper = new QueryWrapper<MedicalInsRuleProject>();
         queryWrapper.in("medical_ins_rule_info_id", medicalInsRuleInfoIdList);
+        queryWrapper.isNull("search_type");
         queryWrapper.eq("STATE", Constant.EFF_STATE);
         queryWrapper.last(" and INSTR('"+medicalProjectCode+"',project_code)=1  ");
 

+ 11 - 9
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/ViolationAnalysisServiceImpl.java

@@ -76,6 +76,8 @@ public class ViolationAnalysisServiceImpl implements IViolationAnalysisService {
 
     @Autowired
     private IPrescriptionOrderService prescriptionOrderService;
+    @Autowired
+    private ExportUtilHelperService exportUtilHelperService;
 
     @Value("${jeecg.path.upload}")
     protected String upLoadPath;
@@ -393,7 +395,7 @@ public class ViolationAnalysisServiceImpl implements IViolationAnalysisService {
 
     }
 
-    @Override
+    /*@Override
     public ModelAndView commonExportXml(BiFunction<?, Class<?>> biFunction, String title, List<?> exportList) throws UnsupportedEncodingException {
         // Step.1 组装查询条件
 //        QueryWrapper<T> queryWrapper = QueryGenerator.initQueryWrapper(object, request.getParameterMap());
@@ -419,12 +421,12 @@ public class ViolationAnalysisServiceImpl implements IViolationAnalysisService {
         mv.addObject(NormalExcelConstants.PARAMS,exportParams);
         mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
         return mv;
-    }
+    }*/
 
     @Override
     public ModelAndView auditMidDetailExportXml(HttpServletRequest req, AuditMidDetailListRequest request, Class<AuditMidDetailListResponse> clazz, String title) throws UnsupportedEncodingException {
         List<AuditMidDetailListResponse> exportList = midIncidentAuditService.loadMidAuditPageList(request);
-        return this.commonExportXml(item -> clazz, title, exportList);
+        return exportUtilHelperService.commonExportXml(item -> clazz, title, exportList);
     }
 
     @Override
@@ -434,38 +436,38 @@ public class ViolationAnalysisServiceImpl implements IViolationAnalysisService {
         String startTime = request.getStartTime();
         String endTime = request.getEndTime();
         List<MidDeptAuditDetailResponse> exportList = midIncidentAuditDetailService.midDeptAuditList(medicalDeptCode, deptName, startTime, endTime);
-        return this.commonExportXml(item -> clazz, title, exportList);
+        return exportUtilHelperService.commonExportXml(item -> clazz, title, exportList);
     }
 
     @Override
     public ModelAndView midViolateProjectExportXml(HttpServletRequest req, String projectSearch, String startTime, String endTime, Class<MidAuditViolateProjectStatisticsResponse> clazz, String title) throws UnsupportedEncodingException {
         List<MidAuditViolateProjectStatisticsResponse> exportList = midIncidentAuditDetailService.violateProjectStatisticsList(projectSearch, startTime, endTime);
-        return this.commonExportXml(item -> clazz, title, exportList);
+        return exportUtilHelperService.commonExportXml(item -> clazz, title, exportList);
     }
 
     @Override
     public ModelAndView midViolateRuleExportXls(HttpServletRequest req, String medicalInsRuleInfoName, String projectType, String startTime, String endTime, Class<MidAuditDetailResponse> clazz, String title) throws UnsupportedEncodingException {
         List<MidAuditDetailResponse> exportList = midIncidentAuditDetailService.midViolateRuleTypePageList(medicalInsRuleInfoName, projectType, startTime, endTime);
-        return this.commonExportXml(item -> clazz, title, exportList);
+        return exportUtilHelperService.commonExportXml(item -> clazz, title, exportList);
     }
 
 
     @Override
     public ModelAndView afterDeptExportXls(HttpServletRequest req, AfterwardsAudit afterwardsAudit, Class<ReportAfterQueryResponseBO> clazz, String title) throws UnsupportedEncodingException {
         List<ReportAfterQueryResponseBO> exportList = afterwardsAuditService.departmentStatistics(afterwardsAudit);
-        return this.commonExportXml(item -> clazz, title, exportList);
+        return exportUtilHelperService.commonExportXml(item -> clazz, title, exportList);
     }
 
     @Override
     public ModelAndView afterProjectExportXls(HttpServletRequest req, String projectCode, String medicalProjectSearch, String startTime, String endTime, Class<MidAuditViolateProjectStatisticsResponse> clazz, String title) throws UnsupportedEncodingException {
         List<MidAuditViolateProjectStatisticsResponse> exportList = afterwardsAuditDetailService.afterViolateProjectStatisticsList(projectCode, medicalProjectSearch, startTime, endTime);
-        return this.commonExportXml(item -> clazz, title, exportList);
+        return exportUtilHelperService.commonExportXml(item -> clazz, title, exportList);
     }
 
     @Override
     public ModelAndView afterViolateRuleExportXls(HttpServletRequest req, String medicalInsRuleInfoName, String projectType, String startTime, String endTime, Class<MidAuditDetailResponse> clazz, String title) throws UnsupportedEncodingException {
         List<MidAuditDetailResponse> exportList = midIncidentAuditDetailService.afterViolateRuleTypePageList(medicalInsRuleInfoName, projectType, startTime, endTime);
-        return this.commonExportXml(item -> clazz, title, exportList);
+        return exportUtilHelperService.commonExportXml(item -> clazz, title, exportList);
     }
 
     //    @Override

+ 6 - 6
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -109,9 +109,9 @@ spring:
       druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
         # 连接池的配置信息
         # 初始化大小,最小,最大
-        initial-size: 5
-        min-idle: 5
-        maxActive: 20
+        initial-size: 10
+        min-idle: 10
+        maxActive: 120
         # 配置获取连接等待超时的时间
         maxWait: 60000
         # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
@@ -161,7 +161,7 @@ mybatis-plus:
       table-underline: true
   configuration:
     # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     # 返回类型为Map,显示null对应的字段
     call-setters-on-nulls: true
 #jeecg专用配置
@@ -296,8 +296,8 @@ third-app:
 
 cdr:
   threadpool:
-    corePoolSize: 8 # 核心线程数
-    maxPoolSize: 20 # 设置最大线程数
+    corePoolSize: 20 # 核心线程数
+    maxPoolSize: 100 # 设置最大线程数
     keepAliveSeconds: 300 # 设置线程活跃时间
     queueCapacity: 100 # 设置队列容量
     prefixName: async-service- # 线程名称前缀