Prechádzať zdrojové kódy

门诊统筹退费功能优化

hurugang 2 rokov pred
rodič
commit
bb9b0f61a8

+ 8 - 1
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -587,7 +587,14 @@ public class MzChargeDetailController {
                 returnMzChargeDetail.setName(oriMzChargeDetails.get(0).getName());
                 returnMzChargeDetail.setAmount(BigDecimal.ZERO);
                 returnMzChargeDetail.setOriAmount(oriAmount);
-                returnMzChargeDetail.setRefundFee(oriAmount);
+                Map<String,BigDecimal> ybAmountMap=tsmzService.queryYbAmount(mzDepositFileVo.getPatientId(),mzDepositFileVo.getTimes());
+                BigDecimal refundFee=oriAmount;
+                if(ybAmountMap!=null && ybAmountMap.size()>0){
+                    BigDecimal fundPaySumamt=ybAmountMap.get("fund_pay_sumamt");
+                    BigDecimal acctPay=ybAmountMap.get("acct_pay");
+                    refundFee=(refundFee==null?BigDecimal.ZERO:refundFee).subtract(fundPaySumamt==null?BigDecimal.ZERO:fundPaySumamt).subtract(acctPay==null?BigDecimal.ZERO:acctPay);
+                }
+                returnMzChargeDetail.setRefundFee(refundFee);
                 pageViewVo.setTotal(0);
                 pageViewVo.setData(Arrays.asList(returnMzChargeDetail));
                 resultMap.put("code", 0);

+ 1 - 1
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzChargeDetail.java

@@ -203,7 +203,7 @@ public class MzChargeDetail implements Serializable,Comparable<MzChargeDetail> {
     private BigDecimal amount;
     //退款金额
     private BigDecimal refundFee;
-    //原缴费金额金额
+    //原缴费金额
     private BigDecimal oriAmount;
     //单价的字符串
     private String unitPriceStr;

+ 12 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzPatientMiMapper.java

@@ -6,7 +6,9 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
 
+import java.math.BigDecimal;
 import java.util.List;
+import java.util.Map;
 
 public interface MzPatientMiMapper {
     /**
@@ -207,4 +209,14 @@ public interface MzPatientMiMapper {
             "</when>",
             "</script>"})
     String selectMztczfsf(@Param("patientId") String patientId,@Param("times") Integer times,@Param("insutype") String insutype);
+
+
+    /**
+     * 根据门诊ID和就诊次数查询门诊统筹报销金额 包含统筹支付和个人账户支付金额
+     * @param patientId
+     * @param times
+     * @return
+     */
+    @Select("select fund_pay_sumamt,acct_pay from t_si_setlinfo where pat_no=#{patientId} and times=#{times} and revoked=0")
+    Map<String,BigDecimal>  selectYbAmount(@Param("patientId") String patientId,@Param("times") Integer times);
 }

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TsmzServiceImpl.java

@@ -296,4 +296,9 @@ public class TsmzServiceImpl implements TsmzService {
         }
     }
 
+    @Override
+    public Map<String, BigDecimal> queryYbAmount(String patientId, Integer times) {
+        return mzPatientMiMapper.selectYbAmount(patientId,times);
+    }
+
 }

+ 10 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/TsmzService.java

@@ -3,6 +3,7 @@ package cn.hnthyy.thmz.service.thmz;
 import cn.hnthyy.thmz.entity.thmz.PayInfo;
 import cn.hnthyy.thmz.entity.thmz.fetchSpcSlwinfo;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -85,5 +86,14 @@ public interface TsmzService {
     void directRegistration(String staffId, String patientId, Integer times,String readCardResult,Integer acctUsedFlag,String readCardType);
 
 
+    /**
+     * 根据门诊ID和就诊次数查询门诊统筹报销金额 包含统筹支付和个人账户支付金额
+     * @param patientId
+     * @param times
+     * @return
+     */
+    Map<String,BigDecimal>  queryYbAmount(String patientId, Integer times);
+
+
 
 }

+ 1 - 0
src/main/resources/static/js/mz/toll_administration.js

@@ -915,6 +915,7 @@ function confirmFeeModal(times, totalCharge, receiptNo) {
         $('#' + payTypeId).attr("disabled", true);
         $('#' + payTypeId).parent().parent().next().children(':first').attr("readonly", "readonly");
     }
+    $("#payTypeIndex").val(payTypeIndex);
     //总金额减医保报销
     var realMoney = Minus(data, fundPay);
     //减完医保报销后减个人医保卡支付金额