Browse Source

excel 编码、关联编码循环嵌套

lenovodn 1 year ago
parent
commit
60f791d0cf

+ 2 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/MedicalInsuranceProjectDetailsResponse.java

@@ -20,12 +20,13 @@ public class MedicalInsuranceProjectDetailsResponse implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @ApiModelProperty(value = "项目使用时间")
-    private Date createTime;
+    private Date usageDate;
 
     @ApiModelProperty(value = "科室名称")
     private String dischargeDeptName;
 
     @ApiModelProperty(value = "费用类别")
+
     private String pCategory;
 
     @ApiModelProperty(value = "医保项目编码")

+ 3 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/ReportAfterQueryDetailResponseBO.java

@@ -72,8 +72,9 @@ public class ReportAfterQueryDetailResponseBO implements Serializable {
     @Excel(name = "医保规则名称", width = 15)
     @ApiModelProperty(value = "医保规则名称")
     private java.lang.String medicalInsRuleInfoName;
-    @ApiModelProperty(value = "违规等级")
-    private java.lang.Integer violationLevel;
+    @ApiModelProperty(value = "规则管理级别")
+    @Dict(dicCode = "violation_level")
+    private String reminderLevel;
     @ApiModelProperty(value = "是否医保")
     private String medicalInsurance;
 

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

@@ -90,9 +90,9 @@ public class AfterwardsAuditController extends JeecgController<AfterwardsAudit,
 
 	@ApiOperation(value = "审核端-医院结算明细")
 	@GetMapping(value = "/audit/settlement/detail")
-	public Result<InpatientSettlementDetailResponse> loadInpatientSettlementDetail(HttpServletRequest request, @RequestParam("id") Integer id) {
-		InpatientSettlementDetailResponse result = afterwardsAuditService.loadInpatientSettlementDetail(id);
-		return Result.OK("获取成功", result);
+	public Result<InpatientSettlementDetailResponse> loadInpatientSettlementDetail( @RequestParam("id") Integer id) {
+		InpatientSettlementDetailResponse inpatientSettlementDetailResponse = afterwardsAuditService.loadInpatientSettlementDetail(id);
+		return Result.OK("获取成功", inpatientSettlementDetailResponse);
 	}
 
 	@ApiOperation(value = "审核端-患者住院结算主单")

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

@@ -236,6 +236,7 @@ public class ViolationAnalysisController {
             return Result.OK(new ArrayList<>());
         }*/
         List<PrescriptionOrder> result = violationAnalysisService.loadPrescriptionOrderInfo(detialId);
+
         return Result.OK(result);
     }
 

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

@@ -85,7 +85,7 @@ public interface AfterwardsAuditMapper extends BaseMapper<AfterwardsAudit> {
      * @param id
      * @return
      */
-    List<MedicalInsuranceProjectDetailsResponse> loadMedicalInsuranceProjectDetails(@Param("patientId") String patientId);
+    List<MedicalInsuranceProjectDetailsResponse> loadMedicalInsuranceProjectDetails(@Param("hisid") String hisid);
 
     List<InpatientSettlementMasterResponse> loadInpatientSettlementMaster(@Param("id") Integer id);
 

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

@@ -68,6 +68,7 @@
              ,medical_ins_rule_info_code
              ,medical_ins_rule_info_name
              ,violation_level
+             ,reminder_level
              ,medical_insurance_mark
              ,create_time
              ,description
@@ -269,7 +270,7 @@
     <select id="loadMedicalInsuranceProjectDetails"
             resultType="org.jeecg.modules.medical.common.bo.MedicalInsuranceProjectDetailsResponse">
         SELECT
-            create_time AS createTime, -- "项目使用时间"
+            usage_date AS usageDate, -- "项目使用时间"
             discharge_dept_name AS dischargeDeptName, -- "科室名称"
             p_category AS pCategory, -- "费用类别"
             item_id AS itemId, -- "医保项目编码"
@@ -283,7 +284,7 @@
             hospitalizatio_settle_detail
         WHERE
 
-            patient_id = #{patientId}
+            hisid = #{hisid}
     </select>
 <!--    &#45;&#45;             zyh = (SELECT outpatient_number FROM afterwards_audit AS ad WHERE ad.id = #{id,jdbcType=INTEGER})-->
 

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

@@ -9,6 +9,8 @@
             ,proejct_code as projectCode
             ,proejct_name as projectName
             ,patient_id,
+        violation_level,
+        reminder_level,
             patient_name,
             treatment_type,
             medical_dept_name

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

@@ -23,8 +23,10 @@ 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.system.entity.SysDepart;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.entity.SysUserDepart;
@@ -33,6 +35,7 @@ import org.jeecg.modules.system.service.ISysDepartService;
 import org.jeecg.modules.system.service.ISysUserDepartService;
 import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -51,7 +54,7 @@ import java.util.stream.Collectors;
 /**
  * @Description: afterwards_audit
  * @Author: jeecg-boot
- * @Date:   2023-05-09 14:37:31
+ * @Date: 2023-05-09 14:37:31
  * @Version: V1.0
  */
 @Slf4j
@@ -59,12 +62,17 @@ import java.util.stream.Collectors;
 @RequiredArgsConstructor(onConstructor = @__(@Autowired))
 public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMapper, AfterwardsAudit> implements IAfterwardsAuditService {
 
-    /** 科室/医生复核服务 */
+    /**
+     * 科室/医生复核服务
+     */
     private final IMedicalDoctorAppealRecordService appealRecordService;
     private final ISysUserService sysUserService;
     private final ISysUserDepartService sysUserDepartService;
     private final ISysDepartService departService;
 
+    private final IAfterwardsAuditDetailService afterwardsAuditDetailService;
+    private final IPrescriptionOrderService prescriptionOrderService;
+
     @Override
     public IPage<ReportAfterQueryResponseBO> departmentStatistics(Page<AfterwardsAudit> page, AfterwardsAudit afterwardsAudit) {
         return baseMapper.departmentStatistics(page, afterwardsAudit);
@@ -118,7 +126,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
             a.setCheckState(AfterwardsAuditStatusEnum.wait.getStatus());
         }
         // 检查当前状态 、、兼容空
-        if (!ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.wait.getStatus() , a.getCheckState())
+        if (!ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.wait.getStatus(), a.getCheckState())
                 && !ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.process.getStatus(), a.getCheckState())) {
             log.error("必须为待审核或医生符合后的重新审核状态才可以发起审核,当前数据状态为{}", a.getCheckState());
             throw new JeecgBootException("当前状态不可发起审核,请检查");
@@ -180,14 +188,13 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
     }
 
 
-
     @Override
     public DeptAuditResponse deptAuditPanel(String loginUserName, String doctorName) {
         // 根据当前登录,先获取到医生面板
         SysDepart sysDepart = new SysDepart();
-        if(loginUserName.equals("admin")){
+        if (loginUserName.equals("admin")) {
             sysDepart = new SysDepart();
-        }else{
+        } else {
             sysDepart = baseMapper.loadUserDept(loginUserName);
             if (null == sysDepart) {
                 log.error("找不到当前医生的科室,请检查");
@@ -215,7 +222,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
     }
 
     @Override
-    public IPage<DeptAuditItemResponse> violationDoctor(Page<DeptAuditItemResponse> page,String deptCode,String createTimeBegin,String createTimeEnd) {
+    public IPage<DeptAuditItemResponse> violationDoctor(Page<DeptAuditItemResponse> page, String deptCode, String createTimeBegin, String createTimeEnd) {
 
         // 获取违规医生列表
         List<DeptAuditItemResponse> deptDoctorViolationList = baseMapper.loadDeptDoctorViolationList(deptCode, null);
@@ -263,7 +270,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
             throw new JeecgBootException("审核流转状态不是处理中,请检查!");
         }
         // 审核状态为处理中 && 处理中的状态为 待科室审核时,才继续
-        if (!ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.issue_review.getStatus() ,audit.getReviewResults())) {
+        if (!ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.issue_review.getStatus(), audit.getReviewResults())) {
             log.error("当前申诉工单id={}, 审查结果={},非下发复核状态,请检查!", param.getId(), audit.getStatus());
             throw new JeecgBootException("审查结果非下发复核状态,请检查!");
         }
@@ -338,6 +345,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
 
     /**
      * 根据id获取 事后工单
+     *
      * @param id
      * @return
      */
@@ -402,6 +410,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
 
     /**
      * 根据工单号,获取诊断信息
+     *
      * @param id
      * @return
      */
@@ -413,31 +422,26 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
 
     @Override
     public List<PrescriptionOrder> loadMedicalOrderInfo(Integer id) {
-        List<PrescriptionOrder> medicalOrderInfoResponses = baseMapper.loadMedicalOrderInfo(id);
-
-        for (PrescriptionOrder medicalOrderInfoRespons : medicalOrderInfoResponses) {
-            String itemId = medicalOrderInfoRespons.getItemId();
-            if (StringUtils.hasText(itemId)) {
-//                String medicalInsuranceNumber = hisMedicalProjectCache.loadHisMedicalMapping(itemId);
-            }
-
-        }
-        return medicalOrderInfoResponses;
+        AfterwardsAudit audit = this.getById(id);
+        LambdaQueryWrapper<PrescriptionOrder> queryWrapper = Wrappers.<PrescriptionOrder>lambdaQuery()
+                .eq(PrescriptionOrder::getInpOutpatientNumber, audit.getOutpatientNumber());
+        return prescriptionOrderService.list(queryWrapper);
     }
 
     /**
      * 获取医生对应的违规列表
+     *
      * @param page
      * @param queryWrapper
      * @param loginUser
      * @return
      */
     @Override
-    public IPage<AfterwardsAudit> getDoctorViolations(Page<AfterwardsAudit> page, QueryWrapper<AfterwardsAudit> queryWrapper, LoginUser loginUser,String doctorId) {
+    public IPage<AfterwardsAudit> getDoctorViolations(Page<AfterwardsAudit> page, QueryWrapper<AfterwardsAudit> queryWrapper, LoginUser loginUser, String doctorId) {
         // 根据当前登录,先获取到医生面板
-        SysUser user = sysUserService.lambdaQuery().eq(SysUser::getDoctorId,doctorId).one();
+        SysUser user = sysUserService.lambdaQuery().eq(SysUser::getDoctorId, doctorId).one();
         List<SysUserDepart> list = sysUserDepartService.lambdaQuery().eq(SysUserDepart::getUserId, user.getId()).list();
-        if (list.size()==0) {
+        if (list.size() == 0) {
             log.error("找不到当前医生的科室,请检查");
             throw new JeecgBootException("找不到当前医生的科室,请检查!");
         }
@@ -455,19 +459,19 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
             List<AfterwardsAudit> records = violations.getRecords();
             records = records.stream().map(item -> {
                 // 计算异常多收-少收
-                BigDecimal detailTotalAmt = baseMapper.statisticsErrAmtByAfterwareRecordId(item.getId());
-                item.setErrorRelativelyFewAmt(new BigDecimal("0.00"));
-                item.setErrorRelativelyManyAmt(new BigDecimal("0.00"));
+//                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);
-                    }
-                }
+//                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());
@@ -486,9 +490,9 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
     public InpatientSettlementDetailResponse loadInpatientSettlementDetail(Integer id) {
         // 获取患者信息
         PatientInfoResponse patientInfo = baseMapper.loadInpatientSettlementInfo(id);
-        String patientId = patientInfo.getPersonalCode();
+        String hisid = patientInfo.getSettlementBillNumber();
         // 获取医保项目明细
-        List<MedicalInsuranceProjectDetailsResponse> medicalInsuranceProjects  = baseMapper.loadMedicalInsuranceProjectDetails(patientId);
+        List<MedicalInsuranceProjectDetailsResponse> medicalInsuranceProjects = baseMapper.loadMedicalInsuranceProjectDetails(hisid);
         InpatientSettlementDetailResponse r = new InpatientSettlementDetailResponse();
         r.setPatientInfo(patientInfo);
         r.setHospitalizationSettleDetailResponse(medicalInsuranceProjects);
@@ -510,6 +514,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
 
     /**
      * 根据事后审核工单id,查询住院结算主单
+     *
      * @param id 事后审核工单id
      * @return
      */