Bläddra i källkod

add: 违规审核模块的导出

Scott 1 år sedan
förälder
incheckning
3ec96941c3
24 ändrade filer med 475 tillägg och 21 borttagningar
  1. 17 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/ReportAfterQueryResponseBO.java
  2. 39 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/AuditMidDetailListResponse.java
  3. 21 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/MidDeptAuditListPageRequest.java
  4. 10 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/response/MidAuditDetailResponse.java
  5. 7 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/response/MidAuditViolateProjectStatisticsResponse.java
  6. 10 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/response/MidDeptAuditDetailResponse.java
  7. 2 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/AdvanceWarningAuditDetailController.java
  8. 136 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/ViolationAnalysisController.java
  9. 3 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/AfterwardsAuditDetailMapper.java
  10. 2 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/AfterwardsAuditMapper.java
  11. 13 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/MidIncidentAuditDetailMapper.java
  12. 2 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/MidIncidentAuditMapper.java
  13. 1 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/xml/AfterwardsAuditMapper.xml
  14. 34 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/xml/MidIncidentAuditMapper.xml
  15. 4 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IAfterwardsAuditDetailService.java
  16. 2 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IAfterwardsAuditService.java
  17. 8 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMidIncidentAuditDetailService.java
  18. 2 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMidIncidentAuditService.java
  19. 33 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IViolationAnalysisService.java
  20. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/AfterwardsAuditDetailServiceImpl.java
  21. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/AfterwardsAuditServiceImpl.java
  22. 21 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MidIncidentAuditDetailServiceImpl.java
  23. 6 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MidIncidentAuditServiceImpl.java
  24. 92 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/ViolationAnalysisServiceImpl.java

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.medical.common.bo;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -18,20 +19,36 @@ public class ReportAfterQueryResponseBO implements Serializable {
     private Integer id;
     @ApiModelProperty(value = "排名")
     private Integer orderNum;
+
+    @Excel(name = "科室名称", width = 15)
     @ApiModelProperty(value = "科室名称")
     private String medicalDeptName;
     @ApiModelProperty(value = "科室编码")
     private String medicalDeptCode;
+
+    @Excel(name = "科室医生总数", width = 15)
     @ApiModelProperty(value = "科室医生总数")
     private Integer deptDoctorTotal;
+
+    @Excel(name = "违规医生总数", width = 15)
     @ApiModelProperty(value = "违规医生总数")
     private Integer violationDoctorNumber;
     @ApiModelProperty(value = "违规总数")
     private Integer violationTotal;
+
+    @Excel(name = "门诊异常金额", width = 15)
     @ApiModelProperty(value = "门诊异常金额")
     private BigDecimal outpatientsErrorAmount;
+
+
+
+
+
+    @Excel(name = "住院异常金额", width = 15)
     @ApiModelProperty(value = "住院异常金额")
     private BigDecimal hospErrorAmount;
+
+    @Excel(name = "异常金额合计", width = 15)
     @ApiModelProperty(value = "异常金额统计")
     private BigDecimal errorAmountTotal;
 

+ 39 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/AuditMidDetailListResponse.java

@@ -1,9 +1,12 @@
 package org.jeecg.modules.medical.common.bo.mid;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.jeecg.common.aspect.annotation.Dict;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -18,9 +21,12 @@ import java.util.Date;
 @Data
 @ApiModel(description = "事中-审查统计响应值")
 public class AuditMidDetailListResponse implements Serializable {
+
+    @Excel(name = "项目编码", width = 15)
     @ApiModelProperty(value = "项目编码")
     private String projectCode;
 
+    @Excel(name = "项目名称", width = 15)
     @ApiModelProperty(value = "项目名称")
     private String projectName;
 
@@ -30,11 +36,14 @@ public class AuditMidDetailListResponse implements Serializable {
     @ApiModelProperty(value = "项目名称")
     private String proejctName;
 
+//    @Excel(name = "事中提醒工单ID", width = 15)
     @ApiModelProperty(value = "事中工单id")
     private Integer id;
 
+//    @Excel(name = "事中提醒工单ID", width = 15)
     private Integer midIncidentAuditId;
 
+    @Excel(name = "参保人编号", width = 15)
     @ApiModelProperty(value = "患者编码|参保人编码")
     private String patientId;
 
@@ -45,24 +54,32 @@ public class AuditMidDetailListResponse implements Serializable {
 //    private String violationRuleCode;
 
 
+    @Excel(name = "违反规则编号", width = 15)
     @ApiModelProperty(value = "医保规则编码")
     private String medicalInsRuleInfoCode;
 
+    @Excel(name = "违反规则名称", width = 15)
     @ApiModelProperty(value = "医保规则名称")
     private String medicalInsRuleInfoName;
 
+    @Excel(name = "医保项目编码(违规项目编码)", width = 15)
     @ApiModelProperty(value = "医保项目编码(违规项目编码)")
     private java.lang.String medicalProjectCode;
+
+    @Excel(name = "医保项目名称(项目名称)", width = 15)
     @ApiModelProperty(value = "医保项目名称(项目名称)")
     private java.lang.String medicalProjectName;
 
+    @Excel(name = "规则管理级别", width = 15)
     @ApiModelProperty(value = "规则管理级别")
     @Dict(dicCode = "violation_level")
     private String reminderLevel;
 
+    @Excel(name = "参保人姓名", width = 15)
     @ApiModelProperty(value = "患者姓名")
     private String patientName;
 
+    @Excel(name = "就诊类型", width = 15)
     @ApiModelProperty(value = "就诊类型")
     @Dict(dicCode = "treatment_type")
     private String treatmentType;
@@ -70,16 +87,24 @@ public class AuditMidDetailListResponse implements Serializable {
 //    @ApiModelProperty(value = "是否医保")
 //    private String medicalInsuranceMark;
 
+    @Excel(name = "科室", width = 15)
     @ApiModelProperty(value = "科室名称")
     private String medicalDeptName;
 
+//    @Excel(name = "科室编码", width = 15)
     private String medicalDeptCode;
 
+    @Excel(name = "医生", width = 15)
     @ApiModelProperty(value = "医生名称")
     private String doctorName;
+
+//    @Excel(name = "医生编码", width = 15)
     @ApiModelProperty(value = "医生编码")
     private String doctorId;
 
+    @Excel(name = "提醒时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8",pattern =  "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern= "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "提醒时间")
     private Date createTime;
 //
@@ -89,28 +114,42 @@ public class AuditMidDetailListResponse implements Serializable {
 //    @ApiModelProperty(value = "数量")
 //    private BigDecimal medicalNumber;
 
+//    @Excel(name = "金额", width = 15)
     @ApiModelProperty(value = "金额")
     private BigDecimal amount;
 
+    @Excel(name = "异常-多收", width = 15)
     @ApiModelProperty(value = "异常-多收")
     private BigDecimal errorRelativelyManyAmt;
 
+    @Excel(name = "异常-少收", width = 15)
     @ApiModelProperty(value = "异常-少收")
     private BigDecimal errorRelativelyFewAmt;
 
 
+//    @Excel(name = "违反规则编码", width = 15)
     @ApiModelProperty(value = "违反规则编码")
     private String feedbackCode;
 
+
+    @Excel(name = "医生处理意见", width = 15)
     @ApiModelProperty(value = "医生处理意见")
     private String feedbackResult;
 
+
+//    @Excel(name = "规则处理结果", width = 15)
     @ApiModelProperty(value = "违规名称-弹窗部分橘黄色副标题")
     private String description;
+
+//    @Excel(name = "是否医保", width = 15)
     @ApiModelProperty(value = "是否医保")
     private String medicalInsuranceMark;
+
+//    @Excel(name = "单价", width = 15)
     @ApiModelProperty(value = "单价")
     private BigDecimal price;
+
+//    @Excel(name = "数量", width = 15)
     @ApiModelProperty(value = "数量")
     private Integer medicalNumber;
 }

+ 21 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/MidDeptAuditListPageRequest.java

@@ -0,0 +1,21 @@
+package org.jeecg.modules.medical.common.bo.mid;
+
+import lombok.Data;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.io.Serializable;
+
+/**
+ * @author yaowei
+ * @time 2023/11/13 21:49 星期一
+ * @description '这里写类描述'
+ * @parentProject medical-java
+ */
+@Data
+public class MidDeptAuditListPageRequest implements Serializable {
+
+    private String deptName;
+    private String medicalDeptCode;
+    private String startTime;
+    private String endTime;
+}

+ 10 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/response/MidAuditDetailResponse.java

@@ -6,6 +6,7 @@ import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecg.modules.medical.common.bo.DiagnosticInfoResponse;
 import org.jeecg.modules.medical.common.bo.before.PatientInformationResponse;
 import org.jeecg.modules.medical.common.bo.before.PrescriptionDetail;
+import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -31,8 +32,11 @@ public class MidAuditDetailResponse implements Serializable {
     private String violationLevel;
     @ApiModelProperty(value = "违反规则编码")
     private String medicalInsRuleInfoCode;
+
+    @Excel(name = "违反规则名称", width = 15)
     @ApiModelProperty(value = "医保规则名称")
     private String medicalInsRuleInfoName;
+
     @ApiModelProperty(value = "提醒时间")
     private Date createTime;
     @ApiModelProperty(value = "违规项目/药品明细")
@@ -43,15 +47,21 @@ public class MidAuditDetailResponse implements Serializable {
     private MidAuditDoctorInfo doctorInfo;
     @ApiModelProperty(value = "诊断信息")
     private List<DiagnosticInfoResponse> diagnosticInfoList;
+
+    @Excel(name = "项目所属类别", width = 15)
     @ApiModelProperty(value = "类型")
+
     private String projectType;
     @ApiModelProperty(value = "类型")
     private String projectCode;
     @ApiModelProperty(value = "类型")
     private String projectName;
+
+    @Excel(name = "违规总数", width = 15)
     @ApiModelProperty(value = "违规总数")
     private Integer violationTotal;
 
+    @Excel(name = "项目异常金额", width = 15)
     @ApiModelProperty(value = "异常金额总和")
     private BigDecimal errorAmountTotal;
     @ApiModelProperty(value = "药量情况")

+ 7 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/response/MidAuditViolateProjectStatisticsResponse.java

@@ -22,16 +22,21 @@ public class MidAuditViolateProjectStatisticsResponse implements Serializable {
     @ApiModelProperty(value = "项目类型")
     private java.lang.String projectType;
 
+    @Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "医保项目名称")
+    private java.lang.String medicalProjectName;
+
+    @Excel(name = "项目编码", width = 15)
     @ApiModelProperty(value = "医保项目编码")
     private java.lang.String medicalProjectCode;
     /**项目名称*/
 
-    @ApiModelProperty(value = "医保项目名称")
-    private java.lang.String medicalProjectName;
 
+    @Excel(name = "违规总数", width = 15)
     @ApiModelProperty(value = "违规总数")
     private Integer violationTotal;
 
+    @Excel(name = "异常金额合计", width = 15)
     @ApiModelProperty(value = "异常金额总和")
     private BigDecimal errorAmountTotal;
 

+ 10 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/response/MidDeptAuditDetailResponse.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.medical.common.bo.mid.response;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -15,25 +16,34 @@ import java.math.BigDecimal;
 @Data
 public class MidDeptAuditDetailResponse implements Serializable {
 
+
+    @Excel(name = "科室名称", width = 15)
     @ApiModelProperty(value = "科室名称")
     private java.lang.String medicalDeptName;
 
     @ApiModelProperty(value = "科室编码")
     private java.lang.String medicalDeptCode;
 
+    @Excel(name = "科室医生总数", width = 15)
     @ApiModelProperty(value = "科室医生总数")
     private Integer deptDoctorTotal;
 
+    @Excel(name = "违规医生总数", width = 15)
     @ApiModelProperty(value = "违规医生总数")
     private Integer violationDoctorNumber;
 
     @ApiModelProperty(value = "违规总数")
     private Integer violationTotal;
 
+    @Excel(name = "门诊异常金额", width = 15)
     @ApiModelProperty(value = "门诊违规金额")
     private BigDecimal outpatientsErrorAmount;
+
+    @Excel(name = "住院异常金额", width = 15)
     @ApiModelProperty(value = "住院违规金额")
     private BigDecimal hospErrorAmount;
+
+    @Excel(name = "异常金额合计", width = 15)
     @ApiModelProperty(value = "异常金额总和")
     private BigDecimal errorAmountTotal;
 }

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

@@ -43,7 +43,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
  * @Date:   2023-05-09 14:37:22
  * @Version: V1.0
  */
-@Api(tags="advance_warning_audit_detail")
+@Api(tags="违规分析")
 @RestController
 @RequestMapping("/medical/advanceWarningAuditDetail")
 @Slf4j
@@ -152,6 +152,7 @@ public class AdvanceWarningAuditDetailController extends JeecgController<Advance
     * @param request
     * @param advanceWarningAuditDetail
     */
+	@ApiOperation(value="违规分析-事前提醒统计导出", notes="事前提醒统计明细")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, AdvanceWarningAuditDetail advanceWarningAuditDetail) {
         return super.exportXls(request, advanceWarningAuditDetail, AdvanceWarningAuditDetail.class, "advance_warning_audit_detail");

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

@@ -7,15 +7,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.medical.common.bo.*;
 import org.jeecg.modules.medical.common.bo.after.response.AfterDeptDetailRequest;
 import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetailResponse;
 import org.jeecg.modules.medical.common.bo.mid.AuditMidDetailListResponse;
+import org.jeecg.modules.medical.common.bo.mid.MidDeptAuditListPageRequest;
 import org.jeecg.modules.medical.common.bo.mid.request.AuditMidDetailListRequest;
 import org.jeecg.modules.medical.common.bo.mid.response.MidAuditDetailResponse;
 import org.jeecg.modules.medical.common.bo.mid.response.MidAuditViolateProjectStatisticsResponse;
@@ -33,13 +31,13 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
+import java.util.*;
 import java.util.List;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
 
 /**
  * @author Scott
@@ -72,6 +70,7 @@ public class ViolationAnalysisController {
         IPage<AuditAdvanceWarningAuditDetailResponse> result = violationAnalysisService.loadBeforeList(advanceWarningAuditDetail, pageNo, pageSize, parameterMap);
         return Result.OK(result);
     }
+
     @ApiOperation(value="违规分析-事前审查统-查看详情", notes="违规分析-事前审查-查看详情")
     @GetMapping(value = "/before/detail")
     public Result<MidAuditDetailResponse> beforeAuditDetail(@RequestParam(name = "detailId") Integer detailId) {
@@ -92,6 +91,26 @@ public class ViolationAnalysisController {
         return Result.OK(result);
     }
 
+
+    /**
+     * 事中审查统计,导出Excel
+     *
+     * @param req
+     * @param request
+     */
+    @ApiOperation(value="事中审查统计-事中审查统计导出", notes="事中审查统计导出")
+    @RequestMapping(value = "/mid/exportXls")
+    public ModelAndView exportXls(HttpServletRequest req, AuditMidDetailListRequest request) {
+        try {
+            return violationAnalysisService.auditMidDetailExportXml(req, request, AuditMidDetailListResponse.class, "事中审查统计");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+
+
     @ApiOperation(value="违规分析-事中审查统-查看详情", notes="违规分析-事中审查-查看详情")
     @GetMapping(value = "/mid/detail")
     public Result<MidAuditDetailResponse> midAuditDetail(@RequestParam(name = "detailId") Integer detailId) {
@@ -113,6 +132,30 @@ public class ViolationAnalysisController {
         return Result.OK(resultPage);
     }
 
+    /**
+     * 事中审查统计,导出Excel
+     *
+     */
+    @ApiOperation(value="事中-科室事中审查统计导出", notes="科室事中审查统计导出")
+    @RequestMapping(value = "/mid/dept/exportXls")
+    public ModelAndView midDeptAuditExportXml(HttpServletRequest req, @RequestParam("deptName") String deptName,
+                                              String medicalDeptCode,
+                                              @RequestParam("startTime") String startTime,
+                                              @RequestParam("endTime") String endTime) {
+        try {
+            MidDeptAuditListPageRequest reqO = new MidDeptAuditListPageRequest();
+            reqO.setDeptName(deptName);
+            reqO.setMedicalDeptCode(medicalDeptCode);
+            reqO.setStartTime(startTime);
+            reqO.setEndTime(endTime);
+            return violationAnalysisService.midDeptAuditExportXml(req, reqO, MidDeptAuditDetailResponse.class, "科室事中审查统计导出");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+
     @ApiOperation(value="违规分析-科室事中审查-列表-里面的详情", notes="违规分析-科室事中审查-列表-里面的详情")
     @GetMapping(value = "/mid/dept/child/list")
     public Result<IPage<AuditMidDetailListResponse>> midDeptAuditByDeptDetailList(
@@ -159,6 +202,23 @@ public class ViolationAnalysisController {
         return Result.OK(result);
     }
 
+    /**
+     * 事中审查统计,导出Excel
+     *
+     * @param req
+     */
+    @ApiOperation(value="事中-违规项目统计", notes="违规项目统计导出")
+    @RequestMapping(value = "/mid/project/exportXls")
+    public ModelAndView midViolateProjectExportXls(HttpServletRequest req, String projectSearch, //项目类别
+                                                   String startTime,
+                                                   String endTime) {
+        try {
+            return violationAnalysisService.midViolateProjectExportXml(req, projectSearch, startTime, endTime, MidAuditViolateProjectStatisticsResponse.class, "事中-违规项目统计");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
     @ApiOperation(value="违规分析-事中违规项目统计-列表-里面的详情", notes="违规分析-科室事中审查-列表-里面的详情")
     @GetMapping(value = "/mid/project/child/list")
     public Result<IPage<AuditMidDetailListResponse>> midDeptAuditByDeptDetailList(
@@ -200,6 +260,21 @@ public class ViolationAnalysisController {
         return Result.OK(result);
     }
 
+    /**
+     * 事中审查统计,导出Excel
+     *
+     * @param req
+     */
+    @ApiOperation(value="事中-规则类型统计", notes="规则类型统计")
+    @RequestMapping(value = "/mid/rule/exportXls")
+    public ModelAndView midViolateRuleExportXls(HttpServletRequest req, String medicalInsRuleInfoName, String projectType, String startTime, String endTime) {
+        try {
+            return violationAnalysisService.midViolateRuleExportXls(req, medicalInsRuleInfoName, projectType,startTime, endTime, MidAuditDetailResponse.class, "事中-规则类型统计");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
 
     @ApiOperation(value="违规分析-事中违规项目统计-列表-里面的详情", notes="违规分析-科室事中审查-列表-里面的详情")
     @GetMapping(value = "/mid/rule/child/list")
@@ -258,6 +333,26 @@ public class ViolationAnalysisController {
         return Result.OK(pageList);
     }
 
+
+    @ApiOperation(value="事后-全院稽核统计导出", notes="全院稽核统计导出")
+    @RequestMapping(value = "/after/all/exportXls")
+    public ModelAndView afterAllAuditExportXls(HttpServletRequest req, AfterwardsAuditDetail afterwardsAuditDetail) {
+        try {
+            QueryWrapper<AfterwardsAuditDetail> queryWrapper = QueryGenerator.initQueryWrapper(afterwardsAuditDetail, req.getParameterMap());
+            if (StringUtils.hasText(afterwardsAuditDetail.getProjectSearch())) {
+                queryWrapper.and(q1 ->
+                        q1.eq("medical_project_code", afterwardsAuditDetail.getProjectSearch()).or().eq("medical_project_code", afterwardsAuditDetail.getProjectSearch())
+                );
+            }
+            List<AfterwardsAuditDetail> exportList = afterwardsAuditDetailService.list(queryWrapper);
+            return violationAnalysisService.commonExportXml(item -> AfterwardsAuditDetail.class, "事后-全院稽核统计", exportList);
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+
     @ApiOperation(value="事后-全员稽核统计-查看申述意见", notes="事后-全员稽核统计-查看申述意见")
     @GetMapping(value = "/after/all/views")
     public Result<?> beforeShowViews(@RequestParam("id") Integer id) {
@@ -287,6 +382,17 @@ public class ViolationAnalysisController {
         return Result.OK(pageList);
     }
 
+    @ApiOperation(value="事后-科室稽核统计导出", notes="科室稽核统计导出")
+    @RequestMapping(value = "/after/dept/exportXls")
+    public ModelAndView afterDeptExportXls(HttpServletRequest req, AfterwardsAudit afterwardsAudit) {
+        try {
+            return violationAnalysisService.afterDeptExportXls(req, afterwardsAudit, ReportAfterQueryResponseBO.class, "事后-科室稽核统计");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
     @ApiOperation(value = "事后-科室统计-详情",notes = "事后-科室统计-详情,事后-科室稽核统计")
     @GetMapping(value = "/after/group/department/detail")
     public Result<IPage<ReportAfterQueryDetailResponseBO>> afterDepartmentDetail(AfterDeptDetailRequest deptDetailRequest,
@@ -317,6 +423,20 @@ public class ViolationAnalysisController {
         return Result.OK(result2);
     }
 
+    @ApiOperation(value="事后-违规项目统计导出", notes="违规项目统计导出")
+    @RequestMapping(value = "/after/project/exportXls")
+    public ModelAndView afterProjectExportXls(HttpServletRequest req,
+                                              String projectCode, //项目类别
+                                              String projectSearch, //项目编码、名称
+                                              String startTime,
+                                              String endTime) {
+        try {
+            return violationAnalysisService.afterProjectExportXls(req, projectCode, projectSearch,startTime, endTime, MidAuditViolateProjectStatisticsResponse.class, "事后-违规项目统计");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
     @ApiOperation(value = "事后-事后违规项目统计-列表-子列表",notes = "事后-事后违规项目统计-列表-子列表")
     @GetMapping(value = "/after/project/child/list")
     public Result<IPage<ReportAfterQueryDetailResponseBO>> afterDepartmentDetail(String medicalProjectCode,
@@ -349,6 +469,16 @@ public class ViolationAnalysisController {
         return Result.OK(result);
     }
 
+    @ApiOperation(value="事中-规则类型统计", notes="规则类型统计")
+    @RequestMapping(value = "/after/rule/exportXls")
+    public ModelAndView afterViolateRuleExportXls(HttpServletRequest req, String medicalInsRuleInfoName, String projectType, String startTime, String endTime) {
+        try {
+            return violationAnalysisService.afterViolateRuleExportXls(req, medicalInsRuleInfoName, projectType,startTime, endTime, MidAuditDetailResponse.class, "事后-规则类型统计");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
     @ApiOperation(value="违规分析-事后违规项目统计-列表-里面的详情", notes="违规分析-事后违规项目统计-列表-里面的详情")
     @GetMapping(value = "/after/rule/child/list")
     public Result<IPage<AuditMidDetailListResponse>> afterRuleAuditByDeptDetailList(

+ 3 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/AfterwardsAuditDetailMapper.java

@@ -23,4 +23,7 @@ public interface AfterwardsAuditDetailMapper extends BaseMapper<AfterwardsAuditD
 
     IPage<MidAuditViolateProjectStatisticsResponse> afterViolateProjectStatisticsList(IPage<AuditAdvanceWarningAuditDetailResponse> page, @Param("projectCode")  String projectCode,
                                                                                       @Param("medicalProjectSearch")String medicalProjectSearch,@Param("startTime") String startTime,@Param("endTime") String endTime);
+
+    List<MidAuditViolateProjectStatisticsResponse> afterViolateProjectStatisticsList(@Param("projectCode")  String projectCode,
+                                                                                      @Param("medicalProjectSearch")String medicalProjectSearch,@Param("startTime") String startTime,@Param("endTime") String endTime);
 }

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/AfterwardsAuditMapper.java

@@ -32,6 +32,8 @@ public interface AfterwardsAuditMapper extends BaseMapper<AfterwardsAudit> {
      */
     IPage<ReportAfterQueryResponseBO> departmentStatistics(Page<AfterwardsAudit> page, @Param("ew") AfterwardsAudit afterwardsAudit);
 
+    List<ReportAfterQueryResponseBO> departmentStatistics( @Param("ew") AfterwardsAudit afterwardsAudit);
+
     /**
      * 科室: 事后统计,详情列表
      */

+ 13 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/MidIncidentAuditDetailMapper.java

@@ -35,6 +35,10 @@ public interface MidIncidentAuditDetailMapper extends BaseMapper<MidIncidentAudi
                                                        @Param("medicalDeptCode") String medicalDeptCode,
                                                        @Param("deptName") String deptName,
                                                        @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    List<MidDeptAuditDetailResponse> midDeptAuditList(@Param("medicalDeptCode") String medicalDeptCode,
+                                                      @Param("deptName") String deptName,
+                                                      @Param("startTime") String startTime, @Param("endTime") String endTime);
     IPage<MidDeptAuditDetailResponse> afterDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page,
                                                          @Param("medicalDeptCode") String medicalDeptCode,
                                                          @Param("deptName") String deptName,
@@ -43,8 +47,17 @@ public interface MidIncidentAuditDetailMapper extends BaseMapper<MidIncidentAudi
     IPage<MidAuditViolateProjectStatisticsResponse> violateProjectStatisticsList(IPage<AuditAdvanceWarningAuditDetailResponse> page, @Param("projectSearch")String projectSearch,
                                                                                  @Param("startTime") String startTime, @Param("endTime") String endTime);
 
+    List<MidAuditViolateProjectStatisticsResponse> violateProjectStatisticsList(@Param("projectSearch")String projectSearch,
+                                                                                 @Param("startTime") String startTime, @Param("endTime") String endTime);
+
     IPage<MidAuditDetailResponse> midViolateRuleTypePageList(IPage<AuditAdvanceWarningAuditDetailResponse> page, @Param("medicalInsRuleInfoName") String medicalInsRuleInfoName,
                                                              @Param("projectType") String projectType, @Param("startTime")  String startTime, @Param("endTime") String endTime);
+
+    List<MidAuditDetailResponse> midViolateRuleTypePageList(@Param("medicalInsRuleInfoName") String medicalInsRuleInfoName,
+                                                             @Param("projectType") String projectType, @Param("startTime")  String startTime, @Param("endTime") String endTime);
     IPage<MidAuditDetailResponse> afterViolateRuleTypePageList(IPage<AuditAdvanceWarningAuditDetailResponse> page, @Param("medicalInsRuleInfoName") String medicalInsRuleInfoName,
                                                              @Param("projectType") String projectType, @Param("startTime")  String startTime, @Param("endTime") String endTime);
+
+    List<MidAuditDetailResponse> afterViolateRuleTypePageList(@Param("medicalInsRuleInfoName") String medicalInsRuleInfoName,
+                                                               @Param("projectType") String projectType, @Param("startTime")  String startTime, @Param("endTime") String endTime);
 }

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/MidIncidentAuditMapper.java

@@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 public interface MidIncidentAuditMapper extends BaseMapper<MidIncidentAudit> {
 
     IPage<AuditMidDetailListResponse> loadMidAuditPageList(Page<AuditMidDetailListResponse> page, @Param("ew") AuditMidDetailListRequest ew);
+
+    List<AuditMidDetailListResponse> loadMidAuditPageList(@Param("ew") AuditMidDetailListRequest ew);
     IPage<AuditMidDetailListResponse> loadAfterAuditPageList(Page<AuditMidDetailListResponse> page, @Param("ew") AuditMidDetailListRequest ew);
 
     BigDecimal statisticsMidAuditTotal(@Param("ew") AuditMidDetailListRequest request);

+ 1 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/xml/AfterwardsAuditMapper.xml

@@ -42,10 +42,7 @@
             </if>
         </where>
         GROUP BY m.medical_dept_code
-        ORDER BY violationDoctorNumber DESC;
-
-
-
+        ORDER BY violationDoctorNumber DESC
     </select>
 
     <select id="departmentDetailStatistics"

+ 34 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/xml/MidIncidentAuditMapper.xml

@@ -160,7 +160,7 @@
         </where>
     </select>
 
-    <select id="statissticsErrAmtByMidAuditRecordId" resultType="java.math.BigDecimal">
+    <!--<select id="statissticsErrAmtByMidAuditRecordId" resultType="java.math.BigDecimal">
         SELECT
             sum((tdetail.amount - (tdetail.quantity * tdetail.price))) as detailTotalAmt
         from(
@@ -177,15 +177,43 @@
                        WHEN 'medicine' THEN m.max_sale_limit
                        WHEN 'consumable' THEN c.price
                        WHEN 'diagnoses' THEN d.price
-                       else 0 end as price -- 单价
-                 ,t.medical_number as quantity -- 数量
+                       else 0 end as price &#45;&#45; 单价
+                 ,t.medical_number as quantity &#45;&#45; 数量
                  ,t.amount
             from mid_incident_audit_detail as t
-                     left JOIN medicine as m on t.medical_project_code = m.medicine_code and t.project_type = 'medicine' -- 计算药品
-                     LEFT JOIN consumable_material as c on t.medical_project_code = c.consumable_code AND t.project_type = 'consumable' -- 计算耗材
-                     left JOIN diagnosis_treatment as d on t.medical_project_code = d.project_code AND t.project_type = 'diagnoses' -- 计算出诊费用
+                     left JOIN medicine as m on t.medical_project_code = m.medicine_code and t.project_type = 'medicine' &#45;&#45; 计算药品
+                     LEFT JOIN consumable_material as c on t.medical_project_code = c.consumable_code AND t.project_type = 'consumable' &#45;&#45; 计算耗材
+                     left JOIN diagnosis_treatment as d on t.medical_project_code = d.project_code AND t.project_type = 'diagnoses' &#45;&#45; 计算出诊费用
             WHERE t.id = #{id}
         ) as tdetail
+    </select>-->
+
+    <select id="statissticsErrAmtByMidAuditRecordId" resultType="java.math.BigDecimal">
+        SELECT
+            sum((tdetail.amount - (tdetail.quantity * tdetail.price))) as detailTotalAmt
+        from(
+                SELECT
+                    t.medical_dept_name,
+                    t.doctor_id,
+                    t.doctor_name
+                     , CASE t.project_type
+                           WHEN 'medicine' THEN m.id
+                           WHEN 'consumable' THEN c.id
+                           WHEN 'diagnoses' THEN d.id
+                           ELSE 0 END as join_id
+                     , CASE t.proejct_code
+                           WHEN 'medicine' THEN m.max_sale_limit
+                           WHEN 'consumable' THEN c.price
+                           WHEN 'diagnoses' THEN d.price
+                           else 0 end as price -- 单价
+                     ,t.medical_number as quantity -- 数量
+                     ,t.amount
+                from mid_incident_audit_detail as t
+                         left JOIN medicine as m on t.medical_project_code = m.medicine_code and t.project_type = 'medicine' -- 计算药品
+                         LEFT JOIN consumable_material as c on t.medical_project_code = c.consumable_code AND t.project_type = 'consumable' -- 计算耗材
+                         left JOIN diagnosis_treatment as d on t.medical_project_code = d.project_code AND t.project_type = 'diagnoses' -- 计算出诊费用
+                WHERE t.id = #{id}
+            ) as tdetail
     </select>
 
     <select id="loadViolationDetail"

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

@@ -8,6 +8,8 @@ import org.jeecg.modules.medical.common.bo.mid.response.MidAuditViolateProjectSt
 import org.jeecg.modules.medical.entity.AfterwardsAuditDetail;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * @Description: afterwards_audit_detail
  * @Author: jeecg-boot
@@ -28,4 +30,6 @@ public interface IAfterwardsAuditDetailService extends IService<AfterwardsAuditD
     PatientInformationResponse beforeLoadPatientInfoById(Integer auditId, IAdvanceWarningAuditService afterwardsAuditService);
 
     IPage<MidAuditViolateProjectStatisticsResponse> afterViolateProjectStatisticsList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String projectCode, String medicalProjectSearch, String startTime, String endTime);
+
+    List<MidAuditViolateProjectStatisticsResponse> afterViolateProjectStatisticsList(String projectCode, String medicalProjectSearch, String startTime, String endTime);
 }

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

@@ -30,6 +30,8 @@ public interface IAfterwardsAuditService extends IService<AfterwardsAudit> {
 
     IPage<ReportAfterQueryResponseBO> departmentStatistics(Page<AfterwardsAudit> page, AfterwardsAudit afterwardsAudit);
 
+    List<ReportAfterQueryResponseBO> departmentStatistics(AfterwardsAudit afterwardsAudit);
+
     /**
      * 查看科室对应违规记录的列表信息
      * @param page

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

@@ -50,11 +50,19 @@ public interface IMidIncidentAuditDetailService extends IService<MidIncidentAudi
 
 
     IPage<MidDeptAuditDetailResponse> midDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page,String medicalDeptCode, String deptName, String startTime, String endTime);
+
+    List<MidDeptAuditDetailResponse> midDeptAuditList(String medicalDeptCode, String deptName, String startTime, String endTime);
     IPage<MidDeptAuditDetailResponse> afterDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page,String medicalDeptCode, String deptName, String startTime, String endTime);
 
 
     IPage<MidAuditViolateProjectStatisticsResponse> violateProjectStatisticsList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String projectSearch, String startTime, String endTime);
 
+    List<MidAuditViolateProjectStatisticsResponse> violateProjectStatisticsList(String projectSearch, String startTime, String endTime);
+
     IPage<MidAuditDetailResponse> midViolateRuleTypePageList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String medicalInsRuleInfoName, String projectType, String startTime, String endTime);
+
+    List<MidAuditDetailResponse> midViolateRuleTypePageList(String medicalInsRuleInfoName, String projectType, String startTime, String endTime);
     IPage<MidAuditDetailResponse> afterViolateRuleTypePageList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String medicalInsRuleInfoName, String projectType, String startTime, String endTime);
+
+    List<MidAuditDetailResponse> afterViolateRuleTypePageList(String medicalInsRuleInfoName, String projectType, String startTime, String endTime);
 }

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

@@ -24,6 +24,8 @@ public interface IMidIncidentAuditService extends IService<MidIncidentAudit> {
 
 
     IPage<AuditMidDetailListResponse> loadMidAuditPageList(Page<AuditMidDetailListResponse> page, AuditMidDetailListRequest request);
+
+    List<AuditMidDetailListResponse> loadMidAuditPageList(AuditMidDetailListRequest request);
     IPage<AuditMidDetailListResponse> loadAfterAuditPageList(Page<AuditMidDetailListResponse> page, AuditMidDetailListRequest request);
     BigDecimal statisticsMidAuditTotal(AuditMidDetailListRequest request);
 

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

@@ -1,15 +1,23 @@
 package org.jeecg.modules.medical.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.jeecg.modules.medical.BiFunction;
+import org.jeecg.modules.medical.common.bo.ReportAfterQueryResponseBO;
 import org.jeecg.modules.medical.common.bo.after.response.AfterDeptDetailRequest;
 import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetailResponse;
 import org.jeecg.modules.medical.common.bo.mid.AuditMidDetailListResponse;
+import org.jeecg.modules.medical.common.bo.mid.MidDeptAuditListPageRequest;
 import org.jeecg.modules.medical.common.bo.mid.request.AuditMidDetailListRequest;
 import org.jeecg.modules.medical.common.bo.mid.response.MidAuditDetailResponse;
 import org.jeecg.modules.medical.common.bo.mid.response.MidAuditViolateProjectStatisticsResponse;
 import org.jeecg.modules.medical.common.bo.mid.response.MidDeptAuditDetailResponse;
+import org.jeecg.modules.medical.entity.AfterwardsAudit;
+import org.jeecg.modules.medical.entity.AfterwardsAuditDetail;
 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;
 import java.util.Map;
@@ -61,4 +69,29 @@ public interface IViolationAnalysisService {
     IPage<MidAuditViolateProjectStatisticsResponse> afterViolateProjectStatisticsList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String projectCode, String medicalProjectSearch, String startTime, String endTime);
 
     List<PrescriptionOrder> loadPrescriptionOrderInfo(Integer detialId);
+
+    /**
+     * 事中审查统计 Excel导出
+     * @param req
+     * @param request
+     * @param auditMidDetailListResponseClass
+     * @param advanceWarningAuditDetail
+     * @return
+     */
+    ModelAndView commonExportXml(BiFunction<?, Class<?>> biFunction, String title, List<?> exportList) throws UnsupportedEncodingException;
+
+    ModelAndView auditMidDetailExportXml(HttpServletRequest req, AuditMidDetailListRequest request, Class<AuditMidDetailListResponse> auditMidDetailListResponseClass, String 事中审查统计) throws UnsupportedEncodingException;
+
+    ModelAndView midDeptAuditExportXml(HttpServletRequest req, MidDeptAuditListPageRequest reqO, Class<MidDeptAuditDetailResponse> auditMidDetailListResponseClass, String 科室事中审查统计) throws UnsupportedEncodingException;
+
+    ModelAndView midViolateProjectExportXml(HttpServletRequest req, String projectSearch, String startTime, String endTime, Class<MidAuditViolateProjectStatisticsResponse> midAuditViolateProjectStatisticsResponseClass, String s) throws UnsupportedEncodingException;
+
+    ModelAndView midViolateRuleExportXls(HttpServletRequest req, String medicalInsRuleInfoName, String projectType, String startTime, String endTime, Class<MidAuditDetailResponse> midAuditDetailResponseClass, String s) throws UnsupportedEncodingException;
+
+
+    ModelAndView afterDeptExportXls(HttpServletRequest req, AfterwardsAudit afterwardsAudit, Class<ReportAfterQueryResponseBO> reportAfterQueryResponseBOClass, String s) throws UnsupportedEncodingException;
+
+    ModelAndView afterProjectExportXls(HttpServletRequest req, String projectCode, String projectSearch, String startTime, String endTime, Class<MidAuditViolateProjectStatisticsResponse> midAuditViolateProjectStatisticsResponseClass, String s) throws UnsupportedEncodingException;
+
+    ModelAndView afterViolateRuleExportXls(HttpServletRequest req, String medicalInsRuleInfoName, String projectType, String startTime, String endTime, Class<MidAuditDetailResponse> midAuditDetailResponseClass, String s) throws UnsupportedEncodingException;
 }

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

@@ -122,6 +122,11 @@ public class AfterwardsAuditDetailServiceImpl extends ServiceImpl<AfterwardsAudi
         return baseMapper.afterViolateProjectStatisticsList(page, projectCode, medicalProjectSearch, startTime, endTime);
     }
 
+    @Override
+    public List<MidAuditViolateProjectStatisticsResponse> afterViolateProjectStatisticsList(String projectCode, String medicalProjectSearch, String startTime, String endTime) {
+        return baseMapper.afterViolateProjectStatisticsList(projectCode, medicalProjectSearch, startTime, endTime);
+    }
+
     private List<AfterwardsAuditDetail> loadDetailList(Integer id) {
         LambdaQueryWrapper<AfterwardsAuditDetail> queryWrapper = Wrappers.<AfterwardsAuditDetail>lambdaQuery()
                 .eq(AfterwardsAuditDetail::getAfterwardsAuditId, id);

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

@@ -79,6 +79,11 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
         return baseMapper.departmentStatistics(page, afterwardsAudit);
     }
 
+    @Override
+    public List<ReportAfterQueryResponseBO> departmentStatistics(AfterwardsAudit afterwardsAudit) {
+        return baseMapper.departmentStatistics(afterwardsAudit);
+    }
+
     @Override
     public IPage<ReportAfterQueryDetailResponseBO> departmentDetailStatistics(Page<AfterwardsAuditDetail> page, AfterDeptDetailRequest afterwardsAuditDetail) {
         return baseMapper.departmentDetailStatistics(page, afterwardsAuditDetail);

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

@@ -144,6 +144,11 @@ public class MidIncidentAuditDetailServiceImpl extends ServiceImpl<MidIncidentAu
         return baseMapper.midDeptAuditList(page, medicalDeptCode, deptName, startTime, endTime);
     }
 
+    @Override
+    public List<MidDeptAuditDetailResponse> midDeptAuditList(String medicalDeptCode, String deptName, String startTime, String endTime) {
+        return baseMapper.midDeptAuditList(medicalDeptCode, deptName, startTime, endTime);
+    }
+
     @Override
     public IPage<MidDeptAuditDetailResponse> afterDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String medicalDeptCode, String deptName, String startTime, String endTime) {
         return baseMapper.afterDeptAuditList(page, medicalDeptCode, deptName, startTime, endTime);
@@ -154,12 +159,28 @@ public class MidIncidentAuditDetailServiceImpl extends ServiceImpl<MidIncidentAu
         return baseMapper.violateProjectStatisticsList(page, projectSearch, startTime, endTime);
     }
 
+    @Override
+    public List<MidAuditViolateProjectStatisticsResponse> violateProjectStatisticsList(String projectSearch, String startTime, String endTime) {
+        return baseMapper.violateProjectStatisticsList(projectSearch, startTime, endTime);
+    }
+
     @Override
     public IPage<MidAuditDetailResponse> midViolateRuleTypePageList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String medicalInsRuleInfoName, String projectType, String startTime, String endTime) {
         return baseMapper.midViolateRuleTypePageList(page, medicalInsRuleInfoName, projectType, startTime, endTime);
     }
+
+    @Override
+    public List<MidAuditDetailResponse> midViolateRuleTypePageList(String medicalInsRuleInfoName, String projectType, String startTime, String endTime) {
+        return baseMapper.midViolateRuleTypePageList(medicalInsRuleInfoName, projectType, startTime, endTime);
+    }
+
     @Override
     public IPage<MidAuditDetailResponse> afterViolateRuleTypePageList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String medicalInsRuleInfoName, String projectType, String startTime, String endTime) {
         return baseMapper.afterViolateRuleTypePageList(page, medicalInsRuleInfoName, projectType, startTime, endTime);
     }
+
+    @Override
+    public List<MidAuditDetailResponse> afterViolateRuleTypePageList(String medicalInsRuleInfoName, String projectType, String startTime, String endTime) {
+        return baseMapper.afterViolateRuleTypePageList(medicalInsRuleInfoName, projectType, startTime, endTime);
+    }
 }

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

@@ -28,6 +28,12 @@ public class MidIncidentAuditServiceImpl extends ServiceImpl<MidIncidentAuditMap
     public IPage<AuditMidDetailListResponse> loadMidAuditPageList(Page<AuditMidDetailListResponse> page, AuditMidDetailListRequest request) {
         return baseMapper.loadMidAuditPageList(page, request);
     }
+
+    @Override
+    public List<AuditMidDetailListResponse> loadMidAuditPageList(AuditMidDetailListRequest request) {
+        return baseMapper.loadMidAuditPageList(request);
+    }
+
     public IPage<AuditMidDetailListResponse> loadAfterAuditPageList(Page<AuditMidDetailListResponse> page, AuditMidDetailListRequest request) {
         return baseMapper.loadAfterAuditPageList(page, request);
     }

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

@@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.medical.BiFunction;
 import org.jeecg.modules.medical.common.bo.DiagnosticInfoResponse;
-import org.jeecg.modules.medical.common.bo.MedicalOrderInfoResponse;
+import org.jeecg.modules.medical.common.bo.ReportAfterQueryResponseBO;
 import org.jeecg.modules.medical.common.bo.after.response.AfterDeptDetailRequest;
 import org.jeecg.modules.medical.common.bo.after.response.AfterwardsAuditDetailResponse;
 import org.jeecg.common.util.oConvertUtils;
@@ -17,6 +20,7 @@ import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetail
 import org.jeecg.modules.medical.common.bo.before.PatientInformationResponse;
 import org.jeecg.modules.medical.common.bo.before.PrescriptionDetail;
 import org.jeecg.modules.medical.common.bo.mid.AuditMidDetailListResponse;
+import org.jeecg.modules.medical.common.bo.mid.MidDeptAuditListPageRequest;
 import org.jeecg.modules.medical.common.bo.mid.request.AuditMidDetailListRequest;
 import org.jeecg.modules.medical.common.bo.mid.response.*;
 import org.jeecg.modules.medical.entity.AdvanceWarningAuditDetail;
@@ -24,14 +28,22 @@ import org.jeecg.modules.medical.entity.AfterwardsAudit;
 import org.jeecg.modules.medical.entity.PrescriptionOrder;
 import org.jeecg.modules.medical.service.*;
 import org.jeecg.modules.medical.entity.AfterwardsAuditDetail;
-import org.jeecg.modules.medical.service.*;
+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.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 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.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -65,6 +77,9 @@ public class ViolationAnalysisServiceImpl implements IViolationAnalysisService {
     @Autowired
     private IPrescriptionOrderService prescriptionOrderService;
 
+    @Value("${jeecg.path.upload}")
+    protected String upLoadPath;
+
 
     @Override
     public IPage<AuditAdvanceWarningAuditDetailResponse> loadBeforeList(AuditAdvanceWarningAuditDetailResponse advanceWarningAuditDetail, Integer pageNo, Integer pageSize, Map<String, String[]> parameterMap) {
@@ -378,6 +393,81 @@ public class ViolationAnalysisServiceImpl implements IViolationAnalysisService {
 
     }
 
+    @Override
+    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;
+    }
+
+    @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);
+    }
+
+    @Override
+    public ModelAndView midDeptAuditExportXml(HttpServletRequest req, MidDeptAuditListPageRequest request, Class<MidDeptAuditDetailResponse> clazz, String title) throws UnsupportedEncodingException {
+        String medicalDeptCode = request.getMedicalDeptCode();
+        String deptName = request.getDeptName();
+        String startTime = request.getStartTime();
+        String endTime = request.getEndTime();
+        List<MidDeptAuditDetailResponse> exportList = midIncidentAuditDetailService.midDeptAuditList(medicalDeptCode, deptName, startTime, endTime);
+        return this.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);
+    }
+
+    @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);
+    }
+
+
+    @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);
+    }
+
+    @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);
+    }
+
+    @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);
+    }
+
     //    @Override
 //    public IPage<AfterwardsAuditDetail> allAuditPage(AuditMidDetailListRequest request, Integer pageNo, Integer pageSize, Map<String, String[]> parameterMap) {
 //        Page<AfterwardsAuditDetail> page = new Page<>(pageNo, pageSize);