|
@@ -3670,6 +3670,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
BigDecimal byjzAmount = BigDecimal.ZERO;
|
|
|
//医保记账总额
|
|
|
BigDecimal ybjzAmount = BigDecimal.ZERO;
|
|
|
+ //省医保个人账户总额
|
|
|
+ BigDecimal pGrzhAmount = BigDecimal.ZERO;
|
|
|
+ //市医保个人账户总额
|
|
|
+ BigDecimal tGrzhAmount = BigDecimal.ZERO;
|
|
|
//非本院记账总额
|
|
|
BigDecimal notByjzAmount = BigDecimal.ZERO;
|
|
|
MzDepositFile temp = null;
|
|
@@ -3681,6 +3685,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
byjzAmount = byjzAmount.add(ms.getAmount());
|
|
|
} else if (Constants.YBJZ.equals(ms.getChequeType())) {
|
|
|
ybjzAmount = ybjzAmount.add(ms.getAmount());
|
|
|
+ } else if (Constants.SHENYGZ.equals(ms.getChequeType())) {
|
|
|
+ pGrzhAmount = pGrzhAmount.add(ms.getAmount());
|
|
|
+ } else if (Constants.SSHIYBGZ.equals(ms.getChequeType())) {
|
|
|
+ tGrzhAmount = tGrzhAmount.add(ms.getAmount());
|
|
|
} else {
|
|
|
notByjzAmount = notByjzAmount.add(ms.getAmount());
|
|
|
}
|
|
@@ -3729,6 +3737,22 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
ybjzTemp.setAmount(BigDecimal.ZERO.subtract(ybjzAmount));
|
|
|
fullNewMzDepositFiles.add(ybjzTemp);
|
|
|
}
|
|
|
+ //如果有省医保个账的退款金额,医保记账记录保持入库
|
|
|
+ if (pGrzhAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
+ //复制一个省医保个账的退款记录
|
|
|
+ MzDepositFile pGrzhTemp = CloneUtil.clone(temp);
|
|
|
+ pGrzhTemp.setChequeType(Constants.SHENYGZ);
|
|
|
+ pGrzhTemp.setAmount(BigDecimal.ZERO.subtract(pGrzhAmount));
|
|
|
+ fullNewMzDepositFiles.add(pGrzhTemp);
|
|
|
+ }
|
|
|
+ //如果有市医保个账的退款金额,医保记账记录保持入库
|
|
|
+ if (tGrzhAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
+ //复制一个市医保个账的的退款记录
|
|
|
+ MzDepositFile tGrzhTemp = CloneUtil.clone(temp);
|
|
|
+ tGrzhTemp.setChequeType(Constants.SSHIYBGZ);
|
|
|
+ tGrzhTemp.setAmount(BigDecimal.ZERO.subtract(tGrzhAmount));
|
|
|
+ fullNewMzDepositFiles.add(tGrzhTemp);
|
|
|
+ }
|
|
|
//如果有非本院记账的退款金额,非本院记账记录保持入库
|
|
|
if (notByjzAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
temp.setChequeType(Constants.CASH);
|
|
@@ -4466,7 +4490,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
}
|
|
|
if (cashRefundMzDepositFile != null && !(Constants.BYJZ.equals(mf.getChequeType()) || Constants.YBJZ.equals(mf.getChequeType()))) {
|
|
|
cashRefundMzDepositFile.setAmount(cashRefundMzDepositFile.getAmount().subtract(mf.getAmount()));
|
|
|
- continue;
|
|
|
+ continue;
|
|
|
}
|
|
|
mf.setReceiptNo(0 - mf.getReceiptNo());
|
|
|
mf.setAmount(BigDecimal.ZERO.subtract(mf.getAmount()));
|