hurugang пре 2 година
родитељ
комит
9d7bf5ee33

+ 5 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/ChargeFeeVoController.java

@@ -97,6 +97,11 @@ public class ChargeFeeVoController {
         }
     }
 
+    /**
+     *
+     * @param chargeFeeVos
+     * @param fitEmpName 是否设置医生名称
+     */
     private void fomartChargeVo(List<ChargeFeeVo> chargeFeeVos, YesNoEnum fitEmpName) {
         if (chargeFeeVos != null && chargeFeeVos.size() > 0) {
             List<ZdChequeType> chequeTypes = zdChequeTypeService.queryAllZdChequeTypeForMz();

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/mz/ChargeFeeVoMapper.java

@@ -31,7 +31,7 @@ public interface ChargeFeeVoMapper {
             "   receipt_sn=r.receipt_sn , " +
             "   m.cheque_type, " +
             "   m.op_id,m.contract_id from mz_deposit_file  m WITH(NOLOCK) left join mz_receipt_serial r WITH(NOLOCK) on m.serial_no =r.serial_no where   r.pay_id=#{userIdCode} and" +
-            "   m.dcount_no=0 and m.cheque_type <>'Z'  " +
+            "   m.dcount_no=0 and m.cheque_type <>'Z' " +
             "  group by r.receipt_sn,r.receipt_bill,m.cheque_type,r.pay_mark,m.op_id,m.contract_id " +
             "   order by abs(r.receipt_sn),r.receipt_bill")
     List<ChargeFeeVo> selectChargeFeeVoUnAccount(@Param("userIdCode") String userIdCode);

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

@@ -3394,6 +3394,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         }
         //本院记账总额
         BigDecimal byjzAmount = BigDecimal.ZERO;
+        //医保记账总额
+        BigDecimal ybjzAmount = BigDecimal.ZERO;
         //非本院记账总额
         BigDecimal notByjzAmount = BigDecimal.ZERO;
         MzDepositFile temp = CloneUtil.clone(mzDepositFiles.get(0));
@@ -3423,7 +3425,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             }
             if (Constants.BYJZ.equals(ms.getChequeType())) {
                 byjzAmount = byjzAmount.add(ms.getAmount());
-            } else {
+            } else  if (Constants.YBJZ.equals(ms.getChequeType())) {
+                ybjzAmount = ybjzAmount.add(ms.getAmount());
+            }else {
                 notByjzAmount = notByjzAmount.add(ms.getAmount());
             }
         }
@@ -3436,6 +3440,14 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (byjzAmount.compareTo(BigDecimal.ZERO) == 1) {
             fullNewMzDepositFiles.add(byjzTemp);
         }
+        //复制一个医保记账的退款记录
+        MzDepositFile ybjzTemp = CloneUtil.clone(temp);
+        ybjzTemp.setChequeType(Constants.YBJZ);
+        ybjzTemp.setAmount(BigDecimal.ZERO.subtract(ybjzAmount));
+        //如果有医保记账的退款金额,医保记账记录保持入库
+        if (ybjzAmount.compareTo(BigDecimal.ZERO) == 1) {
+            fullNewMzDepositFiles.add(ybjzTemp);
+        }
         //如果有非本院记账的退款金额,非本院记账记录保持入库
         if (notByjzAmount.compareTo(BigDecimal.ZERO) == 1) {
             fullNewMzDepositFiles.add(temp);