|
|
@@ -50,6 +50,7 @@ import cn.hnthyy.thmz.vo.MzPrescriptionVo;
|
|
|
import cn.hnthyy.thmz.vo.TcMzPrescriptionVo;
|
|
|
import cn.hnthyy.thmz.vo.ThmzmxsrParamsVo;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.bean.DynaBean;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
|
@@ -1006,8 +1007,18 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
jzdjMzReceiptSerial.setChequeType(Constants.GCP);
|
|
|
mzReceiptSerialMapper.insertMzReceiptSerial(jzdjMzReceiptSerial);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ //抖音团购
|
|
|
+ if (receiptSerialFee.getDytgjzje() != null && receiptSerialFee.getDytgjzje().compareTo(BigDecimal.ZERO) == 1) {
|
|
|
+ MzReceiptSerial jzdjMzReceiptSerial = CloneUtil.clone(mzReceiptSerial);
|
|
|
+ //当前联合支付方式中,没有自付金额,则不清空发票明细
|
|
|
+ if (receiptSerialFee.getZfTotalPayable().compareTo(BigDecimal.ZERO) == 1) {
|
|
|
+ //resetParams(jzMzReceiptSerial);
|
|
|
+ jzdjMzReceiptSerial.resetParams();
|
|
|
+ }
|
|
|
+ jzdjMzReceiptSerial.setTotalCharge(receiptSerialFee.getDytgjzje());
|
|
|
+ jzdjMzReceiptSerial.setChequeType(Constants.DY_TG);
|
|
|
+ mzReceiptSerialMapper.insertMzReceiptSerial(jzdjMzReceiptSerial);
|
|
|
+ }
|
|
|
//聚合支付金额
|
|
|
if (receiptSerialFee.getJhzfje() != null && receiptSerialFee.getJhzfje().compareTo(BigDecimal.ZERO) == 1) {
|
|
|
MzReceiptSerial jhzfMzReceiptSerial = CloneUtil.clone(mzReceiptSerial);
|
|
|
@@ -4752,6 +4763,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
BigDecimal yhhdAmount = BigDecimal.ZERO;
|
|
|
//GCP
|
|
|
BigDecimal gcpAmount = BigDecimal.ZERO;
|
|
|
+ //抖音团购
|
|
|
+ BigDecimal dytgAmount = BigDecimal.ZERO;
|
|
|
MzDepositFile temp = null;
|
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
|
//需要调用银行接口退费的集合
|
|
|
@@ -4776,6 +4789,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
yhhdAmount = yhhdAmount.add(ms.getAmount());
|
|
|
} else if (Constants.GCP.equals(ms.getChequeType())) {
|
|
|
gcpAmount = gcpAmount.add(ms.getAmount());
|
|
|
+ }else if (Constants.DY_TG.equals(ms.getChequeType())) {
|
|
|
+ dytgAmount = dytgAmount.add(ms.getAmount());
|
|
|
}
|
|
|
|
|
|
else if (YesNoEnum.YES.code.equals(mzDepositFileVo.getRefundType()) && (Constants.YLK.equals(ms.getChequeType()) || Constants.JHZF.equals(ms.getChequeType()) )) {
|
|
|
@@ -4888,6 +4903,14 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
fullNewMzDepositFiles.add(gcpTemp);
|
|
|
relationMap.put(gcpTemp.getChequeType(), gcpTemp);
|
|
|
}
|
|
|
+ if (dytgAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
+ //复制一个抖音团购的的退款记录
|
|
|
+ MzDepositFile dytgTemp = CloneUtil.clone(temp);
|
|
|
+ dytgTemp.setChequeType(Constants.DY_TG);
|
|
|
+ dytgTemp.setAmount(BigDecimal.ZERO.subtract(dytgAmount));
|
|
|
+ fullNewMzDepositFiles.add(dytgTemp);
|
|
|
+ relationMap.put(dytgTemp.getChequeType(), dytgTemp);
|
|
|
+ }
|
|
|
|
|
|
//如果有非本院记账的退款金额,非本院记账记录保持入库
|
|
|
if (notByjzAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
@@ -4958,6 +4981,17 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
setRefundData(refundMzDepositFiles, m, Constants.GCP, gcpAmount.add(tempTotalFee));
|
|
|
}
|
|
|
}
|
|
|
+ //抖音团购
|
|
|
+ if(dytgAmount.compareTo(BigDecimal.ZERO) == 1 && dytgAmount.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ tempTotalFee = tempTotalFee.subtract(dytgAmount);
|
|
|
+ if(tempTotalFee.compareTo(BigDecimal.ZERO) >=0){
|
|
|
+ addNewDepositFile(fullNewMzDepositFiles,newMzDepositFiles,m,dytgAmount,Constants.DY_TG);
|
|
|
+ }else {
|
|
|
+ addNewDepositFile(fullNewMzDepositFiles,newMzDepositFiles,m,dytgAmount.add(tempTotalFee),Constants.DY_TG);
|
|
|
+ removeByChequeType(refundMzDepositFiles,Constants.DY_TG);
|
|
|
+ setRefundData(refundMzDepositFiles, m, Constants.DY_TG, dytgAmount.add(tempTotalFee));
|
|
|
+ }
|
|
|
+ }
|
|
|
//部分退费添加医保报销收费方式
|
|
|
if(ybFlag && tempTotalFee.compareTo(BigDecimal.ZERO) > 0){
|
|
|
List<MzDepositFile> ybMzDepositFile = getMzChargeDetailService().getYbMzDepositFile(m,mzDepositFileVo);
|
|
|
@@ -5768,6 +5802,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
BigDecimal yhhdjzje = BigDecimal.ZERO;
|
|
|
//GCP的金额
|
|
|
BigDecimal gcpjzje = BigDecimal.ZERO;
|
|
|
+ //抖音团购金额
|
|
|
+ BigDecimal dytgjzje = BigDecimal.ZERO;
|
|
|
//银联卡的金额
|
|
|
BigDecimal ylkje = BigDecimal.ZERO;
|
|
|
//聚合支付的金额
|
|
|
@@ -5823,6 +5859,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
yhhdjzje = yhhdjzje.add(m.getAmount());
|
|
|
} else if (Constants.GCP.equals(m.getChequeType())) {
|
|
|
gcpjzje = gcpjzje.add(m.getAmount());
|
|
|
+ }else if (Constants.DY_TG.equals(m.getChequeType())) {
|
|
|
+ dytgjzje = dytgjzje.add(m.getAmount());
|
|
|
}
|
|
|
else if (setPosAmont && Constants.JHZF.equals(m.getChequeType())) {
|
|
|
jhzfje = jhzfje.add(m.getAmount());
|
|
|
@@ -5841,6 +5879,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
receiptSerialFee.setDjqjzje(djqjzje.setScale(2, BigDecimal.ROUND_FLOOR));
|
|
|
receiptSerialFee.setYhhdjzje(yhhdjzje.setScale(2, BigDecimal.ROUND_FLOOR));
|
|
|
receiptSerialFee.setGcpjzje(gcpjzje.setScale(2, BigDecimal.ROUND_FLOOR));
|
|
|
+ receiptSerialFee.setDytgjzje(dytgjzje.setScale(2, BigDecimal.ROUND_FLOOR));
|
|
|
receiptSerialFee.setJhzfje(jhzfje.setScale(2, BigDecimal.ROUND_FLOOR));
|
|
|
receiptSerialFee.setYlkje(ylkje.setScale(2, BigDecimal.ROUND_FLOOR));
|
|
|
receiptSerialFee.setZfTotalPayable(zfTotalPayable.setScale(2, BigDecimal.ROUND_FLOOR));
|