Browse Source

门诊统筹补录按钮逻辑优化(门诊统筹报销,但是未到起付线的情况)

hurugang 2 years ago
parent
commit
0588d55bcc

+ 11 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzDepositFileMapper.java

@@ -325,6 +325,17 @@ public interface MzDepositFileMapper {
     @Select("select count(1) from mz_deposit_file where patient_id =#{patientId} and times = #{times} and receipt_no=#{receiptNo} and cheque_type ='2' ")
     int selectMzTcZfInfo(@Param(value = "patientId") String patientId, @Param("times") Integer times, @Param("receiptNo") Integer receiptNo);
 
+
+    /**
+     * 查询患者某次缴费有没有进行个账支付
+     * @param patientId
+     * @param times
+     * @param receiptNo
+     * @return
+     */
+    @Select("select count(1) from mz_deposit_file where patient_id =#{patientId} and times = #{times} and receipt_no=#{receiptNo} and cheque_type in('P','T') ")
+    int selectMzTcZfGzInfo(@Param(value = "patientId") String patientId, @Param("times") Integer times, @Param("receiptNo") Integer receiptNo);
+
     /**
      * 查询某次缴费支付的总金额
      * @param patientId

+ 16 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -226,9 +226,24 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     mzChargeDetail.setPrintFlag("-" + YesNoEnum.YES.code.toString());
                 }
                 mzChargeDetail.setCountYbZf(mzPatientMiMapper.countYbZf(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes()));
-                if(mzChargeDetail.getCountYbZf()>0){
+                if(mzChargeDetail.getCountYbZf()<=0){
+                    continue;
+                }
+                Map<String,BigDecimal> ybAmountMap=mzPatientMiMapper.selectYbAmount(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes());
+                if(ybAmountMap==null || ybAmountMap.size()==0){
+                    continue;
+                }
+                BigDecimal fundPaySumamt=ybAmountMap.get("fund_pay_sumamt");
+                BigDecimal acctPay=ybAmountMap.get("acct_pay");
+                if(fundPaySumamt!=null && fundPaySumamt.compareTo(BigDecimal.ZERO)==1){
                     if(mzDepositFileMapper.selectMzTcZfInfo(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(),mzChargeDetail.getReceiptNo())==0){
                         mzChargeDetail.setMztcbl(YesNoEnum.YES.code);
+                        continue;
+                    }
+                }
+                if(acctPay!=null && acctPay.compareTo(BigDecimal.ZERO)==1){
+                    if(mzDepositFileMapper.selectMzTcZfGzInfo(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(),mzChargeDetail.getReceiptNo())==0){
+                        mzChargeDetail.setMztcbl(YesNoEnum.YES.code);
                     }
                 }
             }