Bläddra i källkod

add: 违规审核-科室事中审查列表

Scott 2 år sedan
förälder
incheckning
1b8b0f7cc0

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

@@ -0,0 +1,39 @@
+package org.jeecg.modules.medical.common.bo.mid.response;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author yaowei
+ * @time 2023/10/18 22:01 星期三
+ * @description '这里写类描述'
+ * @parentProject medical-java
+ */
+@Data
+public class MidDeptAuditDetailResponse implements Serializable {
+
+    @ApiModelProperty(value = "科室名称")
+    private java.lang.String medicalDeptName;
+
+    @ApiModelProperty(value = "科室编码")
+    private java.lang.String medicalDeptCode;
+
+    @ApiModelProperty(value = "科室医生总数")
+    private Integer deptDoctorTotal;
+
+    @ApiModelProperty(value = "违规医生总数")
+    private Integer violationDoctorNumber;
+
+    @ApiModelProperty(value = "违规总数")
+    private Integer violationTotal;
+
+    @ApiModelProperty(value = "门诊违规金额")
+    private BigDecimal outpatientsErrorAmount;
+    @ApiModelProperty(value = "住院违规金额")
+    private BigDecimal hospErrorAmount;
+    @ApiModelProperty(value = "异常金额总和")
+    private BigDecimal errorAmountTotal;
+}

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.medical.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -9,6 +10,7 @@ import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetail
 import org.jeecg.modules.medical.common.bo.mid.AuditMidDetailListResponse;
 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.MidDeptAuditDetailResponse;
 import org.jeecg.modules.medical.service.IViolationAnalysisService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -65,6 +67,18 @@ public class ViolationAnalysisController {
     }
 
 
+    @ApiOperation(value="违规分析-科室事中审查-列表", notes="违规分析-科室事中审查-列表")
+    @GetMapping(value = "/mid/dept/list")
+    public Result<IPage<MidDeptAuditDetailResponse>> midDeptAuditList(@RequestParam("deptName") String deptName,
+                                                                        @RequestParam("startTime") String startTime,
+                                                                        @RequestParam("endTime") String endTime,
+                                                                        @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+                                                                        @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
+        IPage<AuditAdvanceWarningAuditDetailResponse> page = new Page<>(pageNo, pageSize);
+        IPage<MidDeptAuditDetailResponse> resultPage = violationAnalysisService.midDeptAuditList(page, deptName, startTime, endTime);
+        return Result.OK(resultPage);
+    }
+
 
 
 

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentAuditDetail.java

@@ -56,7 +56,7 @@ public class MidIncidentAuditDetail implements Serializable {
 
 	/**就诊类别;住院/门诊*/
 	@Excel(name = "就诊类别;1:住院 2:门诊", width = 15)
-    @ApiModelProperty(value = "就诊类别;1:住院 2:门诊")
+    @ApiModelProperty(value = "就诊类别;1:住院 2:门诊;3:住院/门诊")
     private java.lang.String treatmentType;
 	/**警示级别*/
 	@Excel(name = "警示级别", width = 15)

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

@@ -5,9 +5,11 @@ import java.util.List;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetailResponse;
 import org.jeecg.modules.medical.common.bo.before.PatientInformationResponse;
 import org.jeecg.modules.medical.common.bo.mid.ViolationDetails;
 import org.jeecg.modules.medical.common.bo.mid.ViolationInfo;
+import org.jeecg.modules.medical.common.bo.mid.response.MidDeptAuditDetailResponse;
 import org.jeecg.modules.medical.entity.MidIncidentAuditDetail;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
@@ -26,4 +28,6 @@ public interface MidIncidentAuditDetailMapper extends BaseMapper<MidIncidentAudi
     IPage<ViolationDetails> loadViolationDetails(Page<ViolationDetails> page, @Param("id") String id, @Param("ruleCode") String ruleCode);
 
 
+    IPage<MidDeptAuditDetailResponse> midDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page, @Param("deptName") String deptName,
+                                                       @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

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

@@ -52,4 +52,32 @@
         </where>
     </select>
 
+
+    <select id="midDeptAuditList"
+            resultType="org.jeecg.modules.medical.common.bo.mid.response.MidDeptAuditDetailResponse">
+        SELECT
+            m.medical_dept_name
+             ,m.medical_dept_code
+             ,(SELECT count(*) from sys_user_depart where dep_id = (SELECT id from sys_depart where medical_dept_code = m.medical_dept_code)) as deptDoctorTotal -- 科室医生总数
+             ,(select count(*) from ( SELECT  count(doctor_id) from mid_incident_audit_detail WHERE medical_dept_code = m.medical_dept_code GROUP BY doctor_id) as t  ) as violationDoctorNumber -- 违规医生总数
+             ,COUNT(id) as violationTotal
+             ,(select IFNULL(sum(amount), 0) from mid_incident_audit_detail WHERE medical_dept_code = m.medical_dept_code and treatment_type = '2') as outpatientsErrorAmount  -- 门诊违规金额
+             ,(select IFNULL(sum(amount),0) from mid_incident_audit_detail WHERE medical_dept_code = m.medical_dept_code and treatment_type = '1') as hospErrorAmount -- 住院违规金额
+             ,sum(amount) as errorAmountTotal -- 异常金额总和
+        FROM mid_incident_audit_detail as m
+        <where>
+            <if test="deptName != null and deptName != ''">
+                AND m.medical_dept_name like LIKE concat(concat('%',#{deptName}),'%')
+            </if>
+            <if test="startTime != null and startTime != ''">
+                and <![CDATA[ m.create_time >= #{startTime} ]]>
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and <![CDATA[ m.create_time <= #{endTime} ]]>
+            </if>
+        </where>
+        GROUP BY medical_dept_code
+        ORDER BY violationDoctorNumber DESC
+    </select>
+
 </mapper>

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

@@ -2,10 +2,12 @@ package org.jeecg.modules.medical.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetailResponse;
 import org.jeecg.modules.medical.common.bo.before.PatientInformationResponse;
 import org.jeecg.modules.medical.common.bo.mid.FeedbackReasonRequest;
 import org.jeecg.modules.medical.common.bo.mid.ViolationDetails;
 import org.jeecg.modules.medical.common.bo.mid.ViolationInfo;
+import org.jeecg.modules.medical.common.bo.mid.response.MidDeptAuditDetailResponse;
 import org.jeecg.modules.medical.entity.MidIncidentAuditDetail;
 import com.baomidou.mybatisplus.extension.service.IService;
 
@@ -43,5 +45,5 @@ public interface IMidIncidentAuditDetailService extends IService<MidIncidentAudi
     void updateReason(FeedbackReasonRequest request, IMidIncidentAuditService midIncidentAuditService);
 
 
-
+    IPage<MidDeptAuditDetailResponse> midDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String deptName, String startTime, String endTime);
 }

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

@@ -5,6 +5,7 @@ import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetail
 import org.jeecg.modules.medical.common.bo.mid.AuditMidDetailListResponse;
 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.MidDeptAuditDetailResponse;
 
 import java.util.Map;
 
@@ -33,4 +34,7 @@ public interface IViolationAnalysisService {
      * @return
      */
     MidAuditDetailResponse midAuditDetail(Integer detailId);
+
+
+    IPage<MidDeptAuditDetailResponse> midDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String deptName, String startTime, String endTime);
 }

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

@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetailResponse;
 import org.jeecg.modules.medical.common.bo.before.PatientInformationResponse;
 import org.jeecg.modules.medical.common.bo.mid.FeedbackReasonRequest;
 import org.jeecg.modules.medical.common.bo.mid.ViolationDetails;
 import org.jeecg.modules.medical.common.bo.mid.ViolationInfo;
+import org.jeecg.modules.medical.common.bo.mid.response.MidDeptAuditDetailResponse;
 import org.jeecg.modules.medical.common.enums.MidFeedBackReasonEnum;
 import org.jeecg.modules.medical.entity.AdvanceWarningAudit;
 import org.jeecg.modules.medical.entity.AdvanceWarningAuditDetail;
@@ -128,4 +130,9 @@ public class MidIncidentAuditDetailServiceImpl extends ServiceImpl<MidIncidentAu
                 .eq(MidIncidentAudit::getId, audit.getId());
         midIncidentAuditService.update(updateWrapper);
     }
+
+    @Override
+    public IPage<MidDeptAuditDetailResponse> midDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String deptName, String startTime, String endTime) {
+        return baseMapper.midDeptAuditList(page, deptName, startTime, endTime);
+    }
 }

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

@@ -12,6 +12,7 @@ import org.jeecg.modules.medical.common.bo.mid.AuditMidDetailListResponse;
 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.MidAuditDoctorInfo;
+import org.jeecg.modules.medical.common.bo.mid.response.MidDeptAuditDetailResponse;
 import org.jeecg.modules.medical.common.bo.mid.response.ViolationsProjectMedicinesDetail;
 import org.jeecg.modules.medical.entity.AdvanceWarningAuditDetail;
 import org.jeecg.modules.medical.service.IAdvanceWarningAuditDetailService;
@@ -153,4 +154,9 @@ public class ViolationAnalysisServiceImpl implements IViolationAnalysisService {
 
         return result;
     }
+
+    @Override
+    public IPage<MidDeptAuditDetailResponse> midDeptAuditList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String deptName, String startTime, String endTime) {
+        return midIncidentAuditDetailService.midDeptAuditList(page, deptName, startTime, endTime);
+    }
 }