|
|
|
|
@ -167,7 +167,7 @@ public class MedicalService { |
|
|
|
|
String ordStas = result.getDataMapString("OrdStas"); //
|
|
|
|
|
BigDecimal deposit = result.getDataMapBigDecimal("Deposit"); // 住院押金(医保6202返回)
|
|
|
|
|
|
|
|
|
|
log.info("[医保-住院结算]HIS费用上传明细接口返回 payAuthNo={}, payOrdId={}, payToken={}, mdtrtId={}, chrgBchno={}, userIdYBZF={}", payAuthNo, payOrdId, payToken, mdTrtId, chrgBchno, mdUserId); |
|
|
|
|
log.info("[医保-住院结算]HIS费用上传明细接口返回-授权信息 payAuthNo={}, payOrdId={}, payToken={}, mdtrtId={}, chrgBchno={}, userIdYBZF={}", payAuthNo, payOrdId, payToken, mdTrtId, chrgBchno, mdUserId); |
|
|
|
|
if (payOrdId == null || payToken == null || mdTrtId == null || chrgBchno == null) { |
|
|
|
|
throw new ServiceException("[医保]费用明细上传参数缺失"); |
|
|
|
|
} |
|
|
|
|
@ -181,32 +181,33 @@ public class MedicalService { |
|
|
|
|
medicalInfo.setMdUserId(mdUserId); |
|
|
|
|
|
|
|
|
|
BigDecimal totalFee = result.getDataMapBigDecimal("FeeSumamt"); // 订单总金额医保返回
|
|
|
|
|
BigDecimal hifpFee = result.getDataMapBigDecimal("FundPay"); // 统筹金额[基金金额]
|
|
|
|
|
BigDecimal hisOwnPayAmt = result.getDataMapBigDecimal("OwnPayAmt"); // 现金支付(医保6202返回)
|
|
|
|
|
BigDecimal hisPsnAcctPay = result.getDataMapBigDecimal("PsnAcctPay"); // 个人账户支出(医保6202返回)
|
|
|
|
|
log.info("[医保-住院结算]HIS费用上传明细接口返回2 payOrdId={}, hifpFee={}, hisOwnPayAmt={}, hisPsnAcctPay={}", |
|
|
|
|
payOrdId, hifpFee, hisOwnPayAmt, hisPsnAcctPay); |
|
|
|
|
BigDecimal cashFee = result.getDataMapBigDecimal("OwnPayAmt"); // 现金支付(医保6202返回)
|
|
|
|
|
BigDecimal hifpFee = result.getDataMapBigDecimal("FundPay"); // 统筹金额[基金金额]
|
|
|
|
|
BigDecimal acctPay = result.getDataMapBigDecimal("PsnAcctPay"); // 个人账户支出(医保6202返回)
|
|
|
|
|
log.info("[医保-住院结算]HIS费用上传明细接口返回-费用明细 payOrdId={}, totalFee={}, cashFee={}, hifpFee={}, acctPay={}", |
|
|
|
|
payOrdId, totalFee, cashFee, hifpFee, acctPay); |
|
|
|
|
|
|
|
|
|
String extData = result.getDataMapString("ExtData"); |
|
|
|
|
log.info("[医保-住院结算]扩展数据 extData={}", extData); |
|
|
|
|
if (extData == null || totalFee == null) { |
|
|
|
|
throw new ServiceException("[上传明细失败]响应参数缺失 extData is null"); |
|
|
|
|
|
|
|
|
|
if (totalFee == null) { |
|
|
|
|
throw new ServiceException("[上传明细失败]订单总金额为空"); |
|
|
|
|
} |
|
|
|
|
if (ObjectUtils.isEmpty(extData)) { |
|
|
|
|
throw new ServiceException("[上传明细失败]响应参数ExtData缺失"); |
|
|
|
|
} |
|
|
|
|
JSONObject extDataJson = JsonHelper.parseObject(extData); |
|
|
|
|
JSONObject preSetl = extDataJson.getJSONObject("preSetl"); |
|
|
|
|
|
|
|
|
|
medicalInfo.setMedFeeSumAmt(new BigDecimal(preSetl.getString("medfee_sumamt"))); // 医保金额
|
|
|
|
|
|
|
|
|
|
medicalInfo.setCashFee(new BigDecimal(preSetl.getString("psn_cash_pay"))); // 现金支付
|
|
|
|
|
BigDecimal acctPay = new BigDecimal(preSetl.getString("acct_pay")); // 个人账户支付
|
|
|
|
|
// BigDecimal hifpPay = new BigDecimal(preSetl.getString("hifp_pay"));
|
|
|
|
|
medicalInfo.setAcctFee(acctPay); // 个人账户支付
|
|
|
|
|
medicalInfo.setHifpFee(hifpFee); // 统筹支付金额
|
|
|
|
|
medicalInfo.setTotalFee(totalFee); // 医保订单总金额
|
|
|
|
|
medicalInfo.setCashFee(cashFee); // 现金部分
|
|
|
|
|
medicalInfo.setHifpFee(hifpFee); // 统筹支付金额
|
|
|
|
|
medicalInfo.setAcctFee(acctPay); // 个人账户支付
|
|
|
|
|
|
|
|
|
|
medicalInfo.setInsuranceFee(acctPay.add(hifpFee)); // (个账 + 统筹)
|
|
|
|
|
medicalInfo.setInsuranceFee(acctPay.add(hifpFee)); // 医保支付(个账 + 统筹)
|
|
|
|
|
|
|
|
|
|
log.info("[医保-住院结算]结算完成返回数据 medicalFee={}", medicalInfo); |
|
|
|
|
log.info("[医保-住院结算]结算完成返回数据 medicalFee={}", JsonHelper.toJsonString(medicalInfo)); |
|
|
|
|
return medicalInfo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -299,7 +300,7 @@ public class MedicalService { |
|
|
|
|
String medicalCardId = order.getMedicalCardId(); |
|
|
|
|
|
|
|
|
|
log.info("[医保][{}]下单 hasDBOrder={}, payOpenId={}, msgOpenId={}, patientId={}, treatNum={}, outTradeNo={}, payOrdId={}, payAuthNo={}, totalFee={}, acctFee={}, hifpFee={}, cashFee={}, idCardNo={}, realName={}, familyType={}, familyName={}, medicalCardId={}, medicalCardInstId={}", |
|
|
|
|
serverEnum.NAME, hasDBOrder, payOpenId, msgOpenId, order.getPatientId(), order.getTreatNum(), outTradeNo, payOrdId, payAuthNo, totalFee, order.getAcctFee(), order.getHifpFee(), order.getPayMoney(), ParamHelper.hideIdCardNo(order.getIdCardNo()), order.getPatientName(), familyType, familyName, medicalCardId,medicalCardInstId); |
|
|
|
|
serverEnum.NAME, hasDBOrder, payOpenId, msgOpenId, order.getPatientId(), order.getTreatNum(), outTradeNo, payOrdId, payAuthNo, totalFee, order.getAcctFee(), order.getHifpFee(), order.getPayMoney(), ParamHelper.hideIdCardNo(order.getIdCardNo()), order.getPatientName(), familyType, familyName, medicalCardId, medicalCardInstId); |
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(payOpenId)) { |
|
|
|
|
payOpenId = msgOpenId; |
|
|
|
|
@ -368,7 +369,7 @@ public class MedicalService { |
|
|
|
|
String outTradeNo = order.getOutTradeNo(); |
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(outTradeNo) || ObjectUtils.isEmpty(payOrdId) || ObjectUtils.isEmpty(treatNum)) { |
|
|
|
|
log.info("[医保][处方]参数缺失 outTradeNo={}, payOrdId={}, treatNum={}", outTradeNo, payOrdId, treatNum); |
|
|
|
|
log.info("[医保][处方]参数缺失 outTradeNo={}, payOrdId={}, treatNum={}", outTradeNo, payOrdId, treatNum); |
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|