提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -2,6 +2,7 @@ package com.openhis.web.paymentmanage.appservice;
import java.util.Map;
import com.core.common.core.domain.R;
import com.openhis.web.paymentmanage.dto.ChargeSummaryDto;
public interface IChargeBillService {
@@ -51,4 +52,26 @@ public interface IChargeBillService {
* @return 结果
*/
Map getReceiptDetailsND(Long paymentId);
/**
* 医保 encounterType
* @param encounterId 就诊id
* @return 结果
*/
Map getYbEncounterType(Long encounterId);
/**
* 更新收费项目总价同一改单个收费项chargeItem的折扣价
* @return
*/
Map updateChargeItemTotalPrice();
/**
* 通过1312接口查询库里yb码有没有过期的
* @return
*/
R<?> checkYbNo();
}

View File

@@ -11,10 +11,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.openhis.web.chargemanage.dto.OutpatientRegistrationAddParam;
import com.openhis.web.chargemanage.dto.OutpatientRegistrationSettleParam;
<<<<<<< HEAD
import com.openhis.web.paymentmanage.dto.CancelPaymentDto;
import com.openhis.web.paymentmanage.dto.InpatientPreSettleResultDto;
import com.openhis.web.paymentmanage.dto.NenuBpcPayDto;
import com.openhis.web.paymentmanage.dto.PaymentVO;
=======
import com.openhis.web.paymentmanage.dto.*;
>>>>>>> v1.3
import com.openhis.yb.dto.PaymentDetailDto;
import com.openhis.yb.dto.PaymentDto;
import com.openhis.yb.dto.PaymentInpatientDto;
@@ -135,4 +139,9 @@ public interface IPaymentRecService {
* @return 结果
*/
String nenuBpcPay(NenuBpcPayDto nenuBpcPayDto);
<<<<<<< HEAD
=======
List<PaymentDetailDto> cancelPreReg(Long encounterId);
>>>>>>> v1.3
}

View File

@@ -3,6 +3,11 @@ package com.openhis.web.paymentmanage.appservice;
import com.core.common.core.domain.R;
import com.openhis.yb.dto.ThreePartPayDto;
<<<<<<< HEAD
=======
import javax.servlet.http.HttpServletRequest;
>>>>>>> v1.3
/**
* 第三方支付应用层Service
*
@@ -10,5 +15,72 @@ import com.openhis.yb.dto.ThreePartPayDto;
* @date 2025-03-29
*/
public interface ThreePartPayService {
<<<<<<< HEAD
R<?> payFor(ThreePartPayDto threePartPayDto);
=======
/**
* 付款
* @param threePartPayDto 前台参数
* @return 结果
*/
R<?> payFor(ThreePartPayDto threePartPayDto);
/**
* 签到
* @return 结果
*/
R<?> sign();
/**
* 签出
* @return 结果
*/
R<?> signOut();
/**
* 支付结果查询
* @param id 参数
* @return 结果
*/
R<?> payQuery(Long id);
/**
* 当天退费
* @param paymentId 参数
* @return 结果
*/
R<?> returnBill(Long paymentId);
/**
* 隔天退货
* @param paymentId 参数
* @return 结果
*/
R<?> returnGoods(Long paymentId);
/**
* 退费结果查询
* @param id
* @return
*/
R<?> returnQuery(Long id);
/**
* 网银支付记录
* @param searchKey 模糊查询
* @param pageNo 页码
* @param pageSize 页容量
* @param request 请求
* @return 结果
*/
R<?> getPage(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request);
/**
* 付款(师大中银)
* @param threePartPayDto 前台参数
* @return 结果
*/
R<?> payForNenu(ThreePartPayDto threePartPayDto);
>>>>>>> v1.3
}

View File

@@ -313,6 +313,10 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// 获取患者信息
EleInvoicePatientInfoDto patientInfo = eleInvoiceMapper.getPatientInfo(encounterId,
EncounterClass.AMB.getValue(), OrganizationClass.CLINIC.getValue());
//12.4 红旗医院现场字典没赋值
if(patientInfo.getGenderEnum_enumText()==null) {
patientInfo.setGenderEnum_enumText(patientInfo.getGenderEnumEnumText());
}
// 获取付款信息
EleInvoicePaymentInfoDto paymentInfo = eleInvoiceMapper.getPaymentInfo(paymentId, encounterId,
YbPayment.SELF_YB_ZH_PAY.getValue(), YbPayment.SELF_CASH_VALUE.getValue(),
@@ -368,7 +372,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// chargeDetail 收费项目明细 JSONArray 不限 是
// 获取收费项目明细
// 医疗收费项目类别 13挂号费
List<String> ybTypeList = new ArrayList<>(Arrays.asList("13"));
List<String> ybTypeList = new ArrayList<>(Arrays.asList("13","02"));
// 付款账单集合
List<Long> chargeItemIds = new ArrayList<>();
String[] parts = paymentInfo.getChargeItemIds().split(",");
@@ -415,7 +419,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
for (EleInvoiceListDetailDto detail : details) {
JSONObject listDetail = new JSONObject();
// listDetailNo 明细流水号 String 60 否
listDetail.put("listDetailNo", detail.getListDetailNo());
listDetail.put("listDetailNo", String.valueOf(detail.getListDetailNo()));
// chargeCode 收费项目代码 String 50 是
if (detail.getChargeCode() == null) {
listDetail.put("chargeCode", "YLMZ11");// 挂号费
@@ -452,6 +456,9 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
String srcmsg;
System.out.println(JSON.toJSONString(bill));
logger.info("************************************** 分 割 线 ***************************************");
logger.info("挂号请求参数:" + JSON.toJSONString(bill));
logger.info("———————————————————————————————————————————————————————————————————————————————————————");
JSONObject resobj;
if ("0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) {
resobj = PreInvoicePostForward(bill, "api/medical/invEBillRegistration");
@@ -488,7 +495,8 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// 电子票据外网H5页面URL
invoice.setPictureNetUrl(redata.getString("pictureNetUrl"));
// 票据营业日期
invoice.setBillBusDate(inputFormat.parse(redata.getString("billBusDate")));
// 12.4红旗返回值没这个字段
//invoice.setBillBusDate(inputFormat.parse(redata.getString("billBusDate")));
boolean flg = invoiceService.updateById(invoice);
if (!flg) {
@@ -546,6 +554,10 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// 获取患者信息
EleInvoicePatientInfoDto patientInfo = eleInvoiceMapper.getPatientInfo(encounterId,
EncounterClass.AMB.getValue(), OrganizationClass.CLINIC.getValue());
//12.4 红旗医院现场字典没赋值
if(patientInfo.getGenderEnum_enumText()==null) {
patientInfo.setGenderEnum_enumText(patientInfo.getGenderEnumEnumText());
}
// 获取付款信息
EleInvoicePaymentInfoDto paymentInfo = eleInvoiceMapper.getPaymentInfo(paymentId, encounterId,
YbPayment.SELF_YB_ZH_PAY.getValue(), YbPayment.SELF_CASH_VALUE.getValue(),
@@ -583,7 +595,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// patientCategoryCode 就诊科室编码 String 60 是
bill.put("patientCategoryCode", patientInfo.getPatientCategoryCode());
// patientNo 患者就诊编号 String 30 是 患者每次就诊一次就生成的一个新的编号。(患者登记号)
bill.put("patientNo", encounterId);
bill.put("patientNo", String.valueOf(encounterId));
// caseNumber 病历号 String 50 是
bill.put("caseNumber", patientInfo.getCaseNumber());
@@ -712,7 +724,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
for (EleInvoiceListDetailDto detail : details) {
JSONObject listDetail = new JSONObject();
// listDetailNo 明细流水号 String 60 否
listDetail.put("listDetailNo", detail.getListDetailNo());
listDetail.put("listDetailNo", String.valueOf(detail.getListDetailNo()));
// chargeCode 收费项目代码 String 50 是
listDetail.put("chargeCode", detail.getChargeCode());
// chargeName 收费项目名称 String 100 是
@@ -722,7 +734,13 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// name 药品名称 String 100 是
listDetail.put("name", detail.getName());
// unit 计量单位 String 20 是
listDetail.put("unit", detail.getUnit());
String unit = "";
if(detail.getUnit()==null||StringUtils.isEmpty(detail.getUnit())){
unit = "";
}else{
unit = detail.getUnit();
}
listDetail.put("unit", unit);
// std 单价 Number 14,4 是
listDetail.put("std", df.format(detail.getStd()));
// number 数量 Number 14,2 是
@@ -732,7 +750,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// // selfAmt 自费金额 Number 14,4 是
listDetail.put("selfAmt", ZERO);
// medicalCareType 医保药品分类 String 1 否
listDetail.put("medicalCareType", detail.getMedicalCareType());
listDetail.put("medicalCareType", String.valueOf(detail.getMedicalCareType()));
// medCareItemCode 医保项目编码 String 100 否
listDetail.put("medCareItemCode", detail.getYbCode() == null ? "" : detail.getYbCode());
// medCareItemName 医保项目名称 String 100 否
@@ -749,6 +767,12 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
String srcmsg;
System.out.println(JSON.toJSONString(bill));
JSONObject resobj;
<<<<<<< HEAD
=======
logger.info("************************************** 分 割 线 ***************************************");
logger.info("门诊信息入参:" + JSON.toJSONString(bill));
logger.info("———————————————————————————————————————————————————————————————————————————————————————");
>>>>>>> v1.3
if ("0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) {
resobj = PreInvoicePostForward(bill, "api/medical/invoiceEBillOutpatient");
} else {
@@ -783,7 +807,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// 电子票据外网H5页面URL
invoice.setPictureNetUrl(redata.getString("pictureNetUrl"));
// 票据营业日期
invoice.setBillBusDate(inputFormat.parse(redata.getString("billBusDate")));
//invoice.setBillBusDate(inputFormat.parse(redata.getString("billBusDate")));
boolean flg = invoiceService.updateById(invoice);
if (!flg) {
@@ -844,6 +868,10 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// 获取患者信息
EleInvoicePatientInfoDto patientInfo = eleInvoiceMapper.getPatientInfo(encounterId,
EncounterClass.IMP.getValue(), OrganizationClass.INPATIENT.getValue());
//12.4 红旗医院现场字典没赋值
if(patientInfo.getGenderEnum_enumText()==null) {
patientInfo.setGenderEnum_enumText(patientInfo.getGenderEnumEnumText());
}
// 获取付款信息
EleInvoicePaymentInfoDto paymentInfo = eleInvoiceMapper.getPaymentInfo(paymentId, encounterId,
YbPayment.SELF_YB_ZH_PAY.getValue(), YbPayment.SELF_CASH_VALUE.getValue(),
@@ -891,7 +919,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// patientId 患者唯一ID String 50 否
bill.put("patientId", patientInfo.getPayerId());
// patientNo 患者就诊编号 String 30 否
bill.put("patientNo", encounterId);
bill.put("patientNo", String.valueOf(encounterId));
// caseNumber 病历号 String 50 是
bill.put("caseNumber", patientInfo.getCaseNumber());
// inHospitalDate 住院日期 String 10 是 格式:yyyy-MM-dd
@@ -978,7 +1006,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
for (EleInvoiceListDetailDto detail : details) {
JSONObject listDetail = new JSONObject();
// listDetailNo 明细流水号 String 60 否
listDetail.put("listDetailNo", detail.getListDetailNo());
listDetail.put("listDetailNo", String.valueOf(detail.getListDetailNo()));
// chargeCode 收费项目代码 String 50 是
listDetail.put("chargeCode", detail.getChargeCode());
// chargeName 收费项目名称 String 100 是
@@ -988,7 +1016,13 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// name 药品名称 String 100 是
listDetail.put("name", detail.getName());
// unit 计量单位 String 20 是
listDetail.put("unit", detail.getUnit());
String unit = "";
if(detail.getUnit()==null||StringUtils.isEmpty(detail.getUnit())){
unit = "";
}else{
unit = detail.getUnit();
}
listDetail.put("unit", unit);
// std 单价 Number 14,4 是
listDetail.put("std", df.format(detail.getStd()));
// number 数量 Number 14,2 是
@@ -998,7 +1032,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// // selfAmt 自费金额 Number 14,4 是
listDetail.put("selfAmt", ZERO);
// medicalCareType 医保药品分类 String 1 否
listDetail.put("medicalCareType", detail.getMedicalCareType());
listDetail.put("medicalCareType", String.valueOf(detail.getMedicalCareType()));
// medCareItemCode 医保项目编码 String 100 否
listDetail.put("medCareItemCode", detail.getYbCode() == null ? "" : detail.getYbCode());
// medCareItemName 医保项目名称 String 100 否
@@ -1050,6 +1084,12 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
String srcmsg;
// JSONObject resobj = PreInvoicePostForward(bill, "api/medical/invEBillHospitalized");
JSONObject resobj;
<<<<<<< HEAD
=======
logger.info("************************************** 分 割 线 ***************************************");
logger.info("住院信息入参:" + JSON.toJSONString(bill));
logger.info("———————————————————————————————————————————————————————————————————————————————————————");
>>>>>>> v1.3
if ("0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) {
resobj = PreInvoicePostForward(bill, "api/medical/invEBillHospitalized");
} else {
@@ -1084,7 +1124,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// 电子票据外网H5页面URL
invoice.setPictureNetUrl(redata.getString("pictureNetUrl"));
// 票据营业日期
invoice.setBillBusDate(inputFormat.parse(redata.getString("billBusDate")));
//invoice.setBillBusDate(inputFormat.parse(redata.getString("billBusDate")));
boolean flg = invoiceService.updateById(invoice);
if (!flg) {
@@ -1292,14 +1332,20 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
clinicSettle.setAcctPay(clinicSettle.getAcctPay() == null ? ZERO : clinicSettle.getAcctPay());
// 医保统筹基金支付
clinicSettle.setHifpPay(clinicSettle.getHifpPay() == null ? ZERO : clinicSettle.getHifpPay());
// 自费金额
// 自费金额2025/12/25 朝阳红旗中医院:电子发票个人自费=医保丙类+超限价)
//BigDecimal fulamtOwnPayAmt = clinicSettle.getFulamtOwnpayAmt()==null?ZERO:clinicSettle.getFulamtOwnpayAmt();
//BigDecimal overLmtSelfpay = clinicSettle.getOverlmtSelfpay()==null?ZERO:clinicSettle.getOverlmtSelfpay();
//全自费
clinicSettle
.setFulamtOwnpayAmt(clinicSettle.getFulamtOwnpayAmt() == null ? ZERO : clinicSettle.getFulamtOwnpayAmt());
// 个人自负
clinicSettle.setPsnPartAmt(clinicSettle.getPsnPartAmt() == null ? ZERO : clinicSettle.getPsnPartAmt());
// 个人自付
// 超限价
clinicSettle
.setOverlmtSelfpay(clinicSettle.getOverlmtSelfpay() == null ? ZERO : clinicSettle.getOverlmtSelfpay());
//先行自付
clinicSettle
.setPreselfpayAmt(clinicSettle.getPreselfpayAmt() == null ? ZERO : clinicSettle.getPreselfpayAmt());
// 个人现金支付
clinicSettle.setPsnCashPay(clinicSettle.getPsnCashPay() == null ? ZERO : clinicSettle.getPsnCashPay());
// 医保报销总金额
@@ -1309,10 +1355,17 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
bill.put("accountPay", df.format(clinicSettle.getAcctPay()));
// fundPay 医保统筹基金支付 Number 14,2 是
bill.put("fundPay", df.format(clinicSettle.getHifpPay()));
// ownPay 自费金额 Number 14,2 是
bill.put("ownPay", df.format(clinicSettle.getFulamtOwnpayAmt()));
// selfConceitedAmt 个人自负 Number 14,2 是
bill.put("selfConceitedAmt", df.format(clinicSettle.getPsnPartAmt()));
// ownPay 自费金额 Number 14,2 是 2025/12/25 朝阳红旗中医院:电子发票个人自费=医保丙类+超限价)
// 2021-12-15 医保回复:个人自付 = PAY_COST医保账户+psn_part_amt个人现金+ (HIFMI_PAY)大病 -(fulamt_ownpay_amt)个人自费
BigDecimal acctPay = clinicSettle.getAcctPay()==null?ZERO:clinicSettle.getAcctPay();
BigDecimal psnPartAmt = clinicSettle.getPsnPartAmt()==null?ZERO:clinicSettle.getPsnPartAmt();
BigDecimal hifmiPay = clinicSettle.getHifmiPay()==null?ZERO:clinicSettle.getHifmiPay();
BigDecimal fulamtOwnpayAmt = clinicSettle.getFulamtOwnpayAmt()==null?ZERO:clinicSettle.getFulamtOwnpayAmt();
bill.put("ownPay", df.format(acctPay.add(psnPartAmt).add(hifmiPay).subtract(fulamtOwnpayAmt)));
// selfConceitedAmt 个人自负 Number 14,2 是 2025/12/25 朝阳红旗中医院:电子发票个人自付=医保乙类后患者自付的部分)
// 2021-12-15 医保回复:个人自费:全自费金额
bill.put("selfConceitedAmt", df.format(clinicSettle.getFulamtOwnpayAmt()));
// selfPayAmt 个人自付 Number 14,2 是
bill.put("selfPayAmt", df.format(clinicSettle.getOverlmtSelfpay()));
// selfCashPay 个人现金支付 Number 14,2 是
@@ -1328,7 +1381,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// 个人现金支付金额(支付宝)
paymentInfo.setAliPayAmount(paymentInfo.getAliPayAmount() == null ? ZERO : paymentInfo.getAliPayAmount());
// 个人现金支付金额(银联)
paymentInfo.setDebitPayAmount(paymentInfo.getAliPayAmount() == null ? ZERO : paymentInfo.getAliPayAmount());
paymentInfo.setDebitPayAmount(paymentInfo.getDebitPayAmount() == null ? ZERO : paymentInfo.getDebitPayAmount());
// 个人现金支付金额
paymentInfo
.setRmbCashPayAmount(paymentInfo.getRmbCashPayAmount() == null ? ZERO : paymentInfo.getRmbCashPayAmount());
@@ -1381,8 +1434,16 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
payChannelDetail.put("payChannelCode", "11");
// payChannelDetail.put("payChannelValue", df.format(paymentInfo.getYbFundPayAmount().add(paymentInfo
// .getOtherPayAmount().add(paymentInfo.getZhPayAmount()).add(paymentInfo.getAelfYbZhGjValue()))));
<<<<<<< HEAD
payChannelDetail.put("payChannelValue", df.format(paymentInfo.getYbFundPayAmount()
.add(paymentInfo.getZhPayAmount()).add(paymentInfo.getAelfYbZhGjValue())));
=======
//payChannelDetail.put("payChannelValue", df.format(paymentInfo.getYbFundPayAmount()
// .add(paymentInfo.getZhPayAmount()).add(paymentInfo.getAelfYbZhGjValue())));
// 根据这几个医院的实际情况,医保支付金额先后刨除掉其他支付共济支付金额两项
payChannelDetail.put("payChannelValue", df.format(paymentInfo.getYbFundPayAmount()
.add(paymentInfo.getZhPayAmount())));
>>>>>>> v1.3
payChannelDetails.add(payChannelDetail);
// 现金
@@ -1487,7 +1548,13 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// JSONObject resobj = PreInvoicePostForward(bill, "api/medical/writeOffEBill");
JSONObject resobj;
<<<<<<< HEAD
logger.info("冲红信息入参:" + JSON.toJSONString(bill));
=======
logger.info("************************************** 分 割 线 ***************************************");
logger.info("冲红信息入参:" + JSON.toJSONString(bill));
logger.info("———————————————————————————————————————————————————————————————————————————————————————");
>>>>>>> v1.3
if ("0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) {
resobj = PreInvoicePostForward(bill, "api/medical/writeOffEBill");
} else {
@@ -1560,8 +1627,8 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
// 电子票据外网H5页面URL
invoiceAdd.setPictureNetUrl(redata.getString("pictureNetUrl"));
// 票据营业日期
invoiceAdd.setBillBusDate(
redata.getString("billBusDate") == "" ? null : sdf.parse(redata.getString("billBusDate")));
//invoiceAdd.setBillBusDate(
//redata.getString("billBusDate") == "" ? null : sdf.parse(redata.getString("billBusDate")));
Long invoiceIdAdd = invoiceService.addInvoice(invoiceAdd);
if (invoiceIdAdd == null) {
@@ -1596,7 +1663,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
*/
private InvoiceBaseInfoDto getClinicSettleByPaymentId(Long paymentId) {
PaymentReconciliation paymentReconciliation = paymentReconciliationService.getById(paymentId);
//PaymentReconciliation paymentReconciliation = paymentReconciliationService.getById(paymentId);
List<PaymentRecDetail> details = paymentRecDetailService
.list(new LambdaQueryWrapper<PaymentRecDetail>().eq(PaymentRecDetail::getReconciliationId, paymentId));
@@ -1607,6 +1674,14 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
if (YbPayment.SELF_CASH_PAY.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setPsnCashPay(detail.getAmount());
}
// 个人现金
if (YbPayment.SELF_PAY.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setPsnPartAmt(detail.getAmount());
}
// 居民大病保险资金支出
if (YbPayment.YB_BC_JM_DB_VALUE.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setHifmiPay(detail.getAmount());
}
// 公务员补助
if (YbPayment.YB_BC_GWY_BZ_VALUE.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setCvlservPay(detail.getAmount());
@@ -1621,12 +1696,12 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
}
// 全自费金额
if (YbPayment.FULAMT_OWNPAY_AMT.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setPsnPartAmt(detail.getAmount());
}
// 个人负担总金额
if (YbPayment.SELF_PAY.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setFulamtOwnpayAmt(detail.getAmount());
}
// 个人负担总金额
//if (YbPayment.SELF_PAY.getValue().equals(detail.getPayEnum())) {
// invoiceBaseInfoDto.setFulamtOwnpayAmt(detail.getAmount());
//}
// 基金支付总额
if (YbPayment.YB_FUND_PAY.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setFundPaySumamt(detail.getAmount());
@@ -1643,6 +1718,13 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
if (YbPayment.OVERLMT_SELFPAY.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setOverlmtSelfpay(detail.getAmount());
}
<<<<<<< HEAD
=======
// 先行自付费用
if (YbPayment.PRESELFPAY_AMT.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setPreselfpayAmt(detail.getAmount());
}
>>>>>>> v1.3
// 学校垫支
if (YbPayment.SCHOOL_GF_PAY.getValue().equals(detail.getPayEnum())) {
invoiceBaseInfoDto.setGfRatio(detail.getAmount());

View File

@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.core.common.core.redis.RedisCache;
import com.core.common.enums.DelFlag;
import com.core.common.exception.ServiceException;
import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.MessageUtils;
@@ -53,7 +54,9 @@ import com.openhis.financial.model.PaymentedItemModel;
import com.openhis.financial.model.PrePaymentResult;
import com.openhis.financial.model.PrePaymentResultModel;
import com.openhis.financial.service.*;
import com.openhis.medication.domain.MedicationDefinition;
import com.openhis.medication.domain.MedicationRequest;
import com.openhis.medication.service.IMedicationDefinitionService;
import com.openhis.medication.service.IMedicationDispenseService;
import com.openhis.medication.service.IMedicationRequestService;
import com.openhis.nenu.domain.TransactionResponse;
@@ -71,7 +74,6 @@ import com.openhis.web.paymentmanage.dto.CancelPaymentDto;
import com.openhis.web.paymentmanage.dto.Clinic2207OrderResultDto;
import com.openhis.web.paymentmanage.mapper.PaymentMapper;
import com.openhis.web.personalization.dto.ActivityDeviceDto;
import com.openhis.workflow.domain.DeviceRequest;
import com.openhis.workflow.domain.ServiceRequest;
import com.openhis.workflow.service.IDeviceDispenseService;
import com.openhis.workflow.service.IDeviceRequestService;
@@ -176,6 +178,8 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
@Autowired
private IPaymentRecDetailService iPaymentRecDetailService;
@Autowired
private IMedicationDefinitionService medicationDefinitionService;
@Autowired
private YbManager ybManager;
@Autowired
private RedisCache redisCache;
@@ -374,6 +378,7 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
return R.fail("收费项目变动,请重新预结算");
}
<<<<<<< HEAD
//2025.11.4 长大发生异常相同的chargeItem存在两个payment并重复收费要求在此处增加校验
// 经研究最优解为在数据库中查询本次就诊的所有的chargeItemIds与现有chargeItemId进行匹配
List<PaymentReconciliation> paymentReconciliationList = paymentReconciliationService.getListByEncounterId(paymentDto.getEncounterId(), PaymentKind.OUTPATIENT_CLINIC);
@@ -397,12 +402,39 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if(first.isPresent()){
throw new ServiceException("收费项目id"+chargeItemId+"已经收费过了,请确认");
=======
// 2025.11.4 长大发生异常相同的chargeItem存在两个payment并重复收费要求在此处增加校验
// 经研究最优解为在数据库中查询本次就诊的所有的chargeItemIds与现有chargeItemId进行匹配
List<PaymentReconciliation> paymentReconciliationList = paymentReconciliationService
.getListByEncounterId(paymentDto.getEncounterId(), PaymentKind.OUTPATIENT_CLINIC);
List<Long> chargeItemIds = paymentDto.getChargeItemIds();
if (!paymentReconciliationList.isEmpty()) {
// 收集所有元素(包含重复)
List<String> allElements = paymentReconciliationList.stream().map(PaymentReconciliation::getChargeItemIds) // 获取逗号拼接的字符串
.filter(str -> str != null && !str.trim().isEmpty()) // 过滤空值
.flatMap(str -> Arrays.stream(str.split(","))) // 拆分成单个元素
.map(String::trim) // 去除空格
.filter(s -> !s.isEmpty()) // 过滤空字符串
.collect(Collectors.toList());
for (Long chargeItemId : chargeItemIds) {
Optional<String> first =
allElements.stream().filter(item -> item.equals(chargeItemId.toString())).findFirst();
if (first.isPresent()) {
throw new ServiceException("收费项目id" + chargeItemId + "已经收费过了,请确认");
>>>>>>> v1.3
}
}
}
<<<<<<< HEAD
=======
>>>>>>> v1.3
// 校验金额:前台输入金额与仍需支付的现金部分进行比较
BigDecimal sum = BigDecimal.ZERO;
PaymentRecDetail paymentRecDetailDemo = new PaymentRecDetail();
@@ -453,22 +485,55 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> devReqIdList.add(item.getServiceId());
}
});
// 根据药品请求计算本次结算应上传最小包装药品追溯码数量
if (!medReqIdList.isEmpty()) {
List<MedicationRequest> medicationRequestList = medicationRequestService
.list(new LambdaQueryWrapper<MedicationRequest>().in(MedicationRequest::getId, medReqIdList));
if (!medicationRequestList.isEmpty()) {
minpacuntDrugTracCnt = medicationRequestList.stream().map(MedicationRequest::getQuantity)
.map(BigDecimal::intValue).reduce(0, Integer::sum);
}
}
if (!devReqIdList.isEmpty()) {
List<DeviceRequest> deviceRequestList = deviceRequestService
.list(new LambdaQueryWrapper<DeviceRequest>().in(DeviceRequest::getId, devReqIdList));
if (!deviceRequestList.isEmpty()) {
mcsTracCnt = deviceRequestList.stream().map(DeviceRequest::getQuantity).map(BigDecimal::intValue)
.reduce(0, Integer::sum);
List<Long> medicationIdList =
medicationRequestList.stream().map(MedicationRequest::getMedicationId).distinct().toList();
// 根据药品id获取药品定义
List<MedicationDefinition> medicationDefinitionList =
medicationDefinitionService.listByIds(medicationIdList);
if (!medicationDefinitionList.isEmpty()) {
// 创建药品定义map
Map<Long, MedicationDefinition> medicationDefinitionMap = medicationDefinitionList.stream()
.collect(Collectors.toMap(MedicationDefinition::getId, definition -> definition));
// 用于累加总数量
BigDecimal totalQuantity = BigDecimal.ZERO;
for (MedicationRequest medicationRequest : medicationRequestList) {
MedicationDefinition medicationDefinition =
medicationDefinitionMap.get(medicationRequest.getMedicationId());
if (medicationDefinition != null) {
BigDecimal requestQuantity = medicationRequest.getQuantity();
// 根据是否拆零计算
if (medicationRequest.getUnitCode().equals(medicationDefinition.getUnitCode())) {
// 单位相同,直接累加
totalQuantity = totalQuantity.add(requestQuantity);
} else if (medicationRequest.getUnitCode().equals(medicationDefinition.getMinUnitCode())) {
// 除以拆零比
BigDecimal convertedQuantity = requestQuantity
.divide(medicationDefinition.getPartPercent(), 10, RoundingMode.HALF_UP);
// 向上取整(进一取整)
BigDecimal ceilingQuantity = convertedQuantity.setScale(0, RoundingMode.CEILING);
totalQuantity = totalQuantity.add(ceilingQuantity);
}
}
}
// 转换为整数返回
minpacuntDrugTracCnt += totalQuantity.intValue();
}
}
}
// if (!devReqIdList.isEmpty()) {
// List<DeviceRequest> deviceRequestList = deviceRequestService
// .list(new LambdaQueryWrapper<DeviceRequest>().in(DeviceRequest::getId, devReqIdList));
// if (!deviceRequestList.isEmpty()) {
// mcsTracCnt = deviceRequestList.stream().map(DeviceRequest::getQuantity).map(BigDecimal::intValue)
// .reduce(0, Integer::sum);
// }
// }
// 收费详情按照收费批次进行分组
Map<String, List<PaymentRecDetail>> payTransNoMap =
@@ -559,8 +624,8 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
chargeItemList.forEach(item -> {
switch (item.getServiceTable()) {
case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medicationRequestIdList
.add(item.getServiceId());
case CommonConstants.TableName.MED_MEDICATION_REQUEST ->
medicationRequestIdList.add(item.getServiceId());
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> deviceRequestIdList.add(item.getServiceId());
case CommonConstants.TableName.WOR_SERVICE_REQUEST -> serviceRequestIdList.add(item.getServiceId());
}
@@ -921,7 +986,11 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
*/
private List<PaymentRecDetail> savePaymentDetail(List<PrePaymentResult> prePaymentResults,
PaymentReconciliation payment) {
<<<<<<< HEAD
//11.11 paymentDetail的amount在11.7日按照同一的异常日结单要求改为保留两位小数后于11.11又被要求改为保留六位小数
=======
// 11.11 paymentDetail的amount在11.7日按照同一的异常日结单要求改为保留两位小数后于11.11又被要求改为保留六位小数
>>>>>>> v1.3
// 保存付款详情
List<PaymentRecDetail> paymentRecDetails = new ArrayList<>();
for (PrePaymentResult prePaymentResult : prePaymentResults) {
@@ -931,7 +1000,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (psnCashPay != null) {
PaymentRecDetail paymentRecDetail10 = new PaymentRecDetail();
paymentRecDetail10.setReconciliationId(payment.getId()).setPayEnum(YbPayment.SELF_CASH_PAY.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.SELF_CASH_PAY.getLevel()).setAmount(psnCashPay.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.SELF_CASH_PAY.getLevel())
.setAmount(psnCashPay.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail10);
@@ -942,7 +1016,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (psnPartAmt != null) {
PaymentRecDetail paymentRecDetail1 = new PaymentRecDetail();
paymentRecDetail1.setReconciliationId(payment.getId()).setPayEnum(YbPayment.SELF_PAY.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.SELF_PAY.getLevel()).setAmount(psnPartAmt.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.SELF_PAY.getLevel())
.setAmount(psnPartAmt.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail1);
@@ -953,9 +1032,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
PaymentRecDetail paymentRecDetail2 = new PaymentRecDetail();
paymentRecDetail2.setReconciliationId(payment.getId())
.setPayEnum(YbPayment.YB_TC_FUND_AMOUNT.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.YB_TC_FUND_AMOUNT.getLevel()).setAmount(hifpPay.setScale(6,RoundingMode.HALF_UP))
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
=======
.setPayLevelEnum(YbPayment.YB_TC_FUND_AMOUNT.getLevel())
.setAmount(hifpPay.setScale(6, RoundingMode.HALF_UP)).setPayTransNo(prePaymentResult.getChrgBchno())
.setResultEnum(PaymentResult.UNPAID.getValue()).setAccountId(prePaymentResult.getAccountId());
>>>>>>> v1.3
paymentRecDetails.add(paymentRecDetail2);
}
@@ -965,7 +1050,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
PaymentRecDetail paymentRecDetail3 = new PaymentRecDetail();
paymentRecDetail3.setReconciliationId(payment.getId())
.setPayEnum(YbPayment.YB_BC_GWY_BZ_VALUE.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.YB_BC_GWY_BZ_VALUE.getLevel()).setAmount(cvlservPay.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.YB_BC_GWY_BZ_VALUE.getLevel())
.setAmount(cvlservPay.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail3);
@@ -976,7 +1066,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
PaymentRecDetail paymentRecDetail4 = new PaymentRecDetail();
paymentRecDetail4.setReconciliationId(payment.getId())
.setPayEnum(YbPayment.YB_BC_FUND_AMOUNT.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.YB_BC_FUND_AMOUNT.getLevel()).setAmount(hifesPay.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.YB_BC_FUND_AMOUNT.getLevel())
.setAmount(hifesPay.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail4);
@@ -987,7 +1082,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
PaymentRecDetail paymentRecDetail5 = new PaymentRecDetail();
paymentRecDetail5.setReconciliationId(payment.getId())
.setPayEnum(YbPayment.YB_BC_JM_DB_VALUE.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.YB_BC_JM_DB_VALUE.getLevel()).setAmount(hifmiPay.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.YB_BC_JM_DB_VALUE.getLevel())
.setAmount(hifmiPay.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail5);
@@ -997,7 +1097,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (hifobPay != null) {
PaymentRecDetail paymentRecDetail6 = new PaymentRecDetail();
paymentRecDetail6.setReconciliationId(payment.getId()).setPayTransNo(prePaymentResult.getChrgBchno())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.YB_BC_ZG_DE_BZ_VALUE.getLevel()).setAmount(hifobPay.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.YB_BC_ZG_DE_BZ_VALUE.getLevel())
.setAmount(hifobPay.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayEnum(YbPayment.YB_BC_ZG_DE_BZ_VALUE.getValue())
.setResultEnum(PaymentResult.UNPAID.getValue()).setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail6);
@@ -1008,9 +1113,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
PaymentRecDetail paymentRecDetail7 = new PaymentRecDetail();
paymentRecDetail7.setReconciliationId(payment.getId())
.setPayEnum(YbPayment.YB_JZ_FUND_AMOUNT.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.YB_JZ_FUND_AMOUNT.getLevel()).setAmount(mafPay.setScale(6,RoundingMode.HALF_UP))
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
=======
.setPayLevelEnum(YbPayment.YB_JZ_FUND_AMOUNT.getLevel())
.setAmount(mafPay.setScale(6, RoundingMode.HALF_UP)).setPayTransNo(prePaymentResult.getChrgBchno())
.setResultEnum(PaymentResult.UNPAID.getValue()).setAccountId(prePaymentResult.getAccountId());
>>>>>>> v1.3
paymentRecDetails.add(paymentRecDetail7);
}
// 其他支出
@@ -1018,7 +1129,11 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (othPay != null) {
PaymentRecDetail paymentRecDetail8 = new PaymentRecDetail();
paymentRecDetail8.setReconciliationId(payment.getId()).setPayEnum(YbPayment.OTHER_PAY.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.OTHER_PAY.getLevel()).setAmount(othPay.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.OTHER_PAY.getLevel()).setAmount(othPay.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail8);
@@ -1028,7 +1143,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (fundPaySumamt != null) {
PaymentRecDetail paymentRecDetail9 = new PaymentRecDetail();
paymentRecDetail9.setReconciliationId(payment.getId()).setPayEnum(YbPayment.YB_FUND_PAY.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.YB_FUND_PAY.getLevel()).setAmount(fundPaySumamt.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.YB_FUND_PAY.getLevel())
.setAmount(fundPaySumamt.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail9);
@@ -1038,9 +1158,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (acctPay != null) {
PaymentRecDetail paymentRecDetail11 = new PaymentRecDetail();
paymentRecDetail11.setReconciliationId(payment.getId()).setPayEnum(YbPayment.SELF_YB_ZH_PAY.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.SELF_YB_ZH_PAY.getLevel()).setAmount(acctPay.setScale(6,RoundingMode.HALF_UP))
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
=======
.setPayLevelEnum(YbPayment.SELF_YB_ZH_PAY.getLevel())
.setAmount(acctPay.setScale(6, RoundingMode.HALF_UP)).setPayTransNo(prePaymentResult.getChrgBchno())
.setResultEnum(PaymentResult.UNPAID.getValue()).setAccountId(prePaymentResult.getAccountId());
>>>>>>> v1.3
paymentRecDetails.add(paymentRecDetail11);
}
// 医院负担金额
@@ -1048,7 +1174,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (hospPartAmt != null) {
PaymentRecDetail paymentRecDetail12 = new PaymentRecDetail();
paymentRecDetail12.setReconciliationId(payment.getId()).setPayEnum(YbPayment.HOSP_PART_AMT.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.HOSP_PART_AMT.getLevel()).setAmount(hospPartAmt.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.HOSP_PART_AMT.getLevel())
.setAmount(hospPartAmt.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail12);
@@ -1059,7 +1190,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
PaymentRecDetail paymentRecDetail13 = new PaymentRecDetail();
paymentRecDetail13.setReconciliationId(payment.getId())
.setPayEnum(YbPayment.SELF_YB_ZH_GJ_VALUE.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.SELF_YB_ZH_GJ_VALUE.getLevel()).setAmount(acctMulaidPay.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.SELF_YB_ZH_GJ_VALUE.getLevel())
.setAmount(acctMulaidPay.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail13);
@@ -1070,7 +1206,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
PaymentRecDetail paymentRecDetail14 = new PaymentRecDetail();
paymentRecDetail14.setReconciliationId(payment.getId())
.setPayEnum(YbPayment.FULAMT_OWNPAY_AMT.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.FULAMT_OWNPAY_AMT.getLevel()).setAmount(fulamtOwnpayAmt.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.FULAMT_OWNPAY_AMT.getLevel())
.setAmount(fulamtOwnpayAmt.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail14);
@@ -1080,7 +1221,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (overlmtSelfpay != null) {
PaymentRecDetail paymentRecDetail15 = new PaymentRecDetail();
paymentRecDetail15.setReconciliationId(payment.getId()).setPayEnum(YbPayment.OVERLMT_SELFPAY.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.OVERLMT_SELFPAY.getLevel()).setAmount(overlmtSelfpay.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.OVERLMT_SELFPAY.getLevel())
.setAmount(overlmtSelfpay.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail15);
@@ -1095,7 +1241,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (preselfpayAmt != null) {
PaymentRecDetail paymentRecDetail17 = new PaymentRecDetail();
paymentRecDetail17.setReconciliationId(payment.getId()).setPayEnum(YbPayment.PRESELFPAY_AMT.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.PRESELFPAY_AMT.getLevel()).setAmount(preselfpayAmt.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.PRESELFPAY_AMT.getLevel())
.setAmount(preselfpayAmt.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail17);
@@ -1104,7 +1255,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (inscpScpAmt != null) {
PaymentRecDetail paymentRecDetail18 = new PaymentRecDetail();
paymentRecDetail18.setReconciliationId(payment.getId()).setPayEnum(YbPayment.INSCP_SCP_AMT.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.INSCP_SCP_AMT.getLevel()).setAmount(inscpScpAmt.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.INSCP_SCP_AMT.getLevel())
.setAmount(inscpScpAmt.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail18);
@@ -1113,7 +1269,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (actPayDedc != null) {
PaymentRecDetail paymentRecDetail19 = new PaymentRecDetail();
paymentRecDetail19.setReconciliationId(payment.getId()).setPayEnum(YbPayment.ACT_PAY_DEDC.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.ACT_PAY_DEDC.getLevel()).setAmount(actPayDedc.setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(YbPayment.ACT_PAY_DEDC.getLevel())
.setAmount(actPayDedc.setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail19);
@@ -1122,9 +1283,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (gfRatio != null && gfRatio.compareTo(BigDecimal.ZERO) > 0) {
PaymentRecDetail paymentRecDetail20 = new PaymentRecDetail();
paymentRecDetail20.setReconciliationId(payment.getId()).setPayEnum(YbPayment.SCHOOL_GF_PAY.getValue())
<<<<<<< HEAD
.setPayLevelEnum(YbPayment.SCHOOL_GF_PAY.getLevel()).setAmount(gfRatio.setScale(6,RoundingMode.HALF_UP))
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
=======
.setPayLevelEnum(YbPayment.SCHOOL_GF_PAY.getLevel())
.setAmount(gfRatio.setScale(6, RoundingMode.HALF_UP)).setPayTransNo(prePaymentResult.getChrgBchno())
.setResultEnum(PaymentResult.UNPAID.getValue()).setAccountId(prePaymentResult.getAccountId());
>>>>>>> v1.3
paymentRecDetails.add(paymentRecDetail20);
}
if (prePaymentResult.getSetldetail() != null && !prePaymentResult.getSetldetail().isEmpty()) {
@@ -1137,7 +1304,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
}
paymentRecDetail20 = new PaymentRecDetail();
paymentRecDetail20.setReconciliationId(payment.getId()).setPayEnum(ybPayment.getValue())
<<<<<<< HEAD
.setPayLevelEnum(ybPayment.getLevel()).setAmount(clinic2206FundPaymentResult.getFundPayamt().setScale(6,RoundingMode.HALF_UP))
=======
.setPayLevelEnum(ybPayment.getLevel())
.setAmount(clinic2206FundPaymentResult.getFundPayamt().setScale(6, RoundingMode.HALF_UP))
>>>>>>> v1.3
.setPayTransNo(prePaymentResult.getChrgBchno()).setResultEnum(PaymentResult.UNPAID.getValue())
.setAccountId(prePaymentResult.getAccountId());
paymentRecDetails.add(paymentRecDetail20);
@@ -1654,16 +1826,26 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (healthcareService == null) {
throw new ServiceException("未查询到号源信息!");
}
<<<<<<< HEAD
if (healthcareService.getYbNo() == null) {
throw new ServiceException("该号源未对码或未查询到医保码信息!");
}
=======
>>>>>>> v1.3
Clinic2206OrderOutput clinic2206OrderResult;
String string = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH);
if ("1".equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))
&& !(CommonConstants.BusinessName.DEFAULT_CONTRACT_NO
.equals(outpatientRegistrationAddParam.getAccountFormData().getContractNo())
|| CommonConstants.BusinessName.DEFAULT_STUDENT_CONTRACT_NO
.equals(outpatientRegistrationAddParam.getAccountFormData().getContractNo()))) {
<<<<<<< HEAD
=======
if (healthcareService.getYbNo() == null) {
throw new ServiceException("该号源未对码或未查询到医保码信息!");
}
>>>>>>> v1.3
OutpatientRegistrationModel model = new OutpatientRegistrationModel();
model.setMdtrtCertType(outpatientRegistrationAddParam.getYbMdtrtCertType());
model.setBusiCardInfo(outpatientRegistrationAddParam.getBusiCardInfo());
@@ -1915,7 +2097,7 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
adviceBaseDto.setAdviceDefinitionId(activityDeviceDto.getDevActId());
// 对应的诊疗医嘱信息
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null,
null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(1, 2, 3)).getRecords().get(0);
null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(1, 2, 3), null).getRecords().get(0);
// 价格信息
if (activityAdviceBaseDto != null) {
// 费用定价
@@ -2162,8 +2344,12 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (!PaymentStatus.DRAFT.getValue().equals(paymentReconciliation.getStatusEnum())) {
return R.fail("该账单不是待支付账单");
}
if (!paymentDto.getChargeItemIds().stream().map(String::valueOf).collect(Collectors.joining(","))
.equals(paymentReconciliation.getChargeItemIds())) {
// 收费项一致校验
List<Long> chargeItemIds = paymentDto.getChargeItemIds().stream().sorted().toList();
List<Long> chargeItemIdList = Arrays.stream(paymentReconciliation.getChargeItemIds().split(","))
.map(String::trim).filter(s -> !s.isEmpty()).map(Long::valueOf).sorted().toList();
if (!chargeItemIds.equals(chargeItemIdList)) {
return R.fail("收费项目变动,请重新预结算");
}
@@ -2177,17 +2363,14 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
}
// 校验金额:前台输入金额与仍需支付的现金部分进行比较
if (newPayment != null) {
BigDecimal sum = newPayment.getTenderedAmount();
BigDecimal chargeAmount = BigDecimal.ZERO;
for (PaymentDetailDto paymentDetail : paymentDto.getPaymentDetails()) {
chargeAmount = chargeAmount.add(paymentDetail.getAmount());
}
// 前台传入数据可能会精度丢失,后台临时处理使用近似
if (sum.setScale(2, BigDecimal.ROUND_HALF_UP)
.compareTo(chargeAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) != 0) {
throw new ServiceException("交款金额与预结算金额不相等");
}
BigDecimal sum = paymentReconciliation.getTenderedAmount();
BigDecimal chargeAmount = BigDecimal.ZERO;
for (PaymentDetailDto paymentDetail : paymentDto.getPaymentDetails()) {
chargeAmount = chargeAmount.add(paymentDetail.getAmount());
}
// 前台传入数据可能会精度丢失,后台临时处理使用近似
if (sum.setScale(2, RoundingMode.HALF_UP).compareTo(chargeAmount.setScale(2, RoundingMode.HALF_UP)) != 0) {
throw new ServiceException("交款金额与预结算金额不相等");
}
// <2> 查询基础数据
@@ -2290,19 +2473,21 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
if (minAmountResult != null) {
// 账户余额
BigDecimal balc = minAmountResult.getBalc();
if (balc != null) {
PaymentRecDetail paymentRecDetail = new PaymentRecDetail();
paymentRecDetail.setReconciliationId(paymentReconciliation.getId())
.setPayEnum(YbPayment.BALC.getValue()).setPayLevelEnum(YbPayment.BALC.getLevel()).setAmount(balc)
.setPayTransNo(minAmountResult.getChrgBchno()).setResultEnum(PaymentResult.PAID.getValue())
.setAccountId(minAmountResult.getAccountId()).setPayTransText(minAmountResult.getSetlId());
iPaymentRecDetailService.save(paymentRecDetail);
}
PaymentRecDetail paymentRecDetail = new PaymentRecDetail();
paymentRecDetail.setReconciliationId(paymentReconciliation.getId()).setPayEnum(YbPayment.BALC.getValue())
.setPayLevelEnum(YbPayment.BALC.getLevel()).setAmount(balc)
.setPayTransNo(minAmountResult.getChrgBchno()).setResultEnum(PaymentResult.PAID.getValue())
.setAccountId(minAmountResult.getAccountId()).setPayTransText(minAmountResult.getSetlId());
iPaymentRecDetailService.save(paymentRecDetail);
}
// 更改chargeItem的状态
chargeItemService.updatePaymentStatus(paymentDto.getChargeItemIds(), ChargeItemStatus.BILLED.getValue());
// 更新住院患者状态:已结算出院
iEncounterService.updateEncounterStatus(paymentDto.getEncounterId(),
EncounterZyStatus.ALREADY_SETTLED.getValue());
// 保存付款快照信息 2025/08/08
paymentRecStaticService.savePaymentRecStatics(paymentReconciliation.getId(), PaymentType.PAY, null,
chargeItemService.getChargeItemDefInfoByIdList(paymentDto.getChargeItemIds()));
@@ -2314,32 +2499,6 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
.setChargeItemIds(paymentReconciliation.getChargeItemIds());
iInvoiceService.save(invoice);
// 获取收费项对应的项目请求id
List<Long> medicationRequestIdList = new ArrayList<>();
List<Long> deviceRequestIdList = new ArrayList<>();
List<Long> serviceRequestIdList = new ArrayList<>();
chargeItemBaseInfoByIds.forEach(item -> {
switch (item.getServiceTable()) {
case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medicationRequestIdList
.add(item.getServiceId());
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> deviceRequestIdList.add(item.getServiceId());
case CommonConstants.TableName.WOR_SERVICE_REQUEST -> serviceRequestIdList.add(item.getServiceId());
}
});
if (!medicationRequestIdList.isEmpty()) {
// 更新药品发放状态为待配药
medicationDispenseService.updatePreparationDispenseStatus(medicationRequestIdList);
}
if (!deviceRequestIdList.isEmpty()) {
// 更新耗材发放状态为待配药
deviceDispenseService.updatePreparationDispenseStatus(deviceRequestIdList);
}
if (!serviceRequestIdList.isEmpty()) {
// 更新服务请求状态为待执行
serviceRequestService.updateCompleteRequestStatus(serviceRequestIdList, null, null);
}
logger.info("收费成功payment" + JSON.toJSONString(paymentReconciliation));
// throw new ServiceException("");
return R.ok(paymentReconciliation,
@@ -2766,4 +2925,55 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
return r.getMsg();
}
<<<<<<< HEAD
=======
@Override
public List<PaymentDetailDto> cancelPreReg(Long encounterId) {
List<PaymentReconciliation> paymentReconciliationList = paymentReconciliationService
.list(new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getEncounterId, encounterId)
.eq(PaymentReconciliation::getDeleteFlag, DelFlag.NO.getCode())
.eq(PaymentReconciliation::getStatusEnum, PaymentStatus.SUCCESS.getValue()));
List<Long> chargeItemIdList = paymentReconciliationList.stream().map(item -> item.getChargeItemIds()) // 获取逗号分隔的字符串属性
.filter(str -> str != null && !str.trim().isEmpty()) // 过滤空值
.flatMap(str -> Arrays.stream(str.split(","))) // 按逗号分割并扁平化
.map(String::trim) // 去除空格
.filter(s -> !s.isEmpty()) // 过滤空字符串
.map(Long::valueOf) // 转换为Long
.collect(Collectors.toList());
List<ChargeItemBaseInfoDto> chargeItemBaseInfoByIds =
chargeItemService.getChargeItemBaseInfoByIds(chargeItemIdList);
// 查找第一个匹配的对象
Optional<ChargeItemBaseInfoDto> targetObject = chargeItemBaseInfoByIds.stream()
.filter(item -> CommonConstants.TableName.ADM_HEALTHCARE_SERVICE.equals(item.getServiceTable()))
.findFirst();
// 使用方式
long foundItemId;
if (targetObject.isPresent()) {
foundItemId = targetObject.get().getId();
} else {
throw new ServiceException("未找到挂号的付款记录提示信息encounterId" + encounterId);
}
long finalFoundItemId = foundItemId;
Optional<PaymentReconciliation> paymentReconciliation = paymentReconciliationList.stream()
.filter(item -> item.getChargeItemIds().contains(String.valueOf(finalFoundItemId))).findFirst();
long paymentId;
if (paymentReconciliation.isPresent()) {
paymentId = paymentReconciliation.get().getId();
} else {
throw new ServiceException("未找到挂号的付款记录提示信息encounterId" + encounterId);
}
List<PaymentDetailDto> detail = this.getDetail(new PaymentDto().setId(paymentId));
return detail;
}
>>>>>>> v1.3
}

View File

@@ -2,19 +2,42 @@ package com.openhis.web.paymentmanage.appservice.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
<<<<<<< HEAD
=======
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.constant.Constants;
>>>>>>> v1.3
import com.core.common.core.domain.R;
import com.core.common.enums.TenantOptionDict;
import com.core.common.exception.ServiceException;
import com.core.common.utils.SecurityUtils;
<<<<<<< HEAD
import com.core.web.util.TenantOptionUtil;
import com.openhis.administration.domain.Practitioner;
import com.openhis.administration.service.IPractitionerService;
=======
import com.core.common.utils.StringUtils;
import com.core.web.util.TenantOptionUtil;
import com.openhis.administration.domain.Practitioner;
import com.openhis.administration.service.IPractitionerService;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.enums.PaymentStatus;
import com.openhis.common.utils.HisQueryUtils;
>>>>>>> v1.3
import com.openhis.financial.domain.PaymentReconciliation;
import com.openhis.financial.domain.ThreePartPayCallBack;
import com.openhis.financial.service.IPaymentRecDetailService;
import com.openhis.financial.service.IPaymentReconciliationService;
import com.openhis.financial.service.ThreePartPayCallBackService;
import com.openhis.web.paymentmanage.appservice.ThreePartPayService;
<<<<<<< HEAD
=======
import com.openhis.web.paymentmanage.dto.PaymentVO;
import com.openhis.web.paymentmanage.dto.ThreePartCallBackVo;
import com.openhis.web.paymentmanage.mapper.PaymentMapper;
>>>>>>> v1.3
import com.openhis.yb.dto.BaseInfo;
import com.openhis.yb.dto.BaseParam;
import com.openhis.yb.dto.PaymentDetailDto;
@@ -29,6 +52,7 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
<<<<<<< HEAD
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -36,16 +60,42 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
=======
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.function.Consumer;
>>>>>>> v1.3
@Component
@Slf4j
public class ThreePartPayServiceImpl implements ThreePartPayService {
<<<<<<< HEAD
=======
Logger logger = LoggerFactory.getLogger(ThreePartPayServiceImpl.class);
>>>>>>> v1.3
@Autowired
private IPractitionerService practitionerService;
@Autowired
private IPaymentRecDetailService paymentRecDetailService;
@Autowired
<<<<<<< HEAD
=======
private PaymentMapper paymentMapper;
@Autowired
>>>>>>> v1.3
private IPaymentReconciliationService paymentReconciliationService;
@Autowired
private ThreePartPayCallBackService threePartPayCallBackService;
@@ -54,12 +104,83 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
@Override
<<<<<<< HEAD
public R<?> payFor(ThreePartPayDto threePartPayDto) {
String threePartUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_URL);
//String threePartUrl = "http://127.0.0.1:19994/?MSG=EXEC&yylx=02&posjh=&posygh=&jylx=00&je={je}&yjyrq=&yjyckh=&ypzh=&lrcjy=&cm={cm}&ysddh=&erpddh=&body=";
String threePartParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PARAM);
JSONObject jsonObject = JSON.parseObject(threePartParam);
=======
public R<?> sign() {
// A.获取配置信息
String threePartUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_SIGN_URL);
String requestMethod = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_SIGN_MAPPING_METHOD);
String activeParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_SIGN_ACTIVE_PARAM);
String staticParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_SIGN_STATIC_PARAM);
JSONObject jsonObject = JSON.parseObject(activeParam);
//B.基础信息查询
//款员信息查询
Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
//获取动态参数
Map<String, String> paramMap = this.getParamMap(jsonObject, practitioner, null, null, null, null);
System.out.println("三方支付【签到】:");
logger.info("三方支付【签到】:");
//执行请求
String requestResult = executeRequest(requestMethod, threePartUrl, staticParam, paramMap);
if(StringUtils.isEmpty(requestResult)){
throw new ServiceException("三方支付签到失败!");
}
return R.ok();
}
@Override
public R<?> signOut() {
// A.获取配置信息
String threePartUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_SIGN_OUT_URL);
String requestMethod = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_SIGN_OUT_MAPPING_METHOD);
String activeParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_SIGN_OUT_ACTIVE_PARAM);
String staticParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_SIGN_OUT_STATIC_PARAM);
JSONObject jsonObject = JSON.parseObject(activeParam);
//B.基础信息查询
//款员信息查询
Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
//获取动态参数
Map<String, String> paramMap = this.getParamMap(jsonObject, practitioner, null, null, null, null);
System.out.println("三方支付【签出】:");
logger.info("三方支付【签出】:");
//执行请求
String requestResult = executeRequest(requestMethod, threePartUrl, staticParam, paramMap);
if(StringUtils.isEmpty(requestResult)){
throw new ServiceException("三方支付签出失败!");
}
return R.ok();
}
@Override
public R<?> payFor(ThreePartPayDto threePartPayDto) {
// A.获取配置信息
String threePartUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_URL);
//String threePartUrl = "http://127.0.0.1:19994/?MSG=EXEC&yylx=02&posjh=&posygh=&jylx=00&je={je}&yjyrq=&yjyckh=&ypzh=&lrcjy=&cm={cm}&ysddh=&erpddh=&body=";
String requestMethod = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_MAPPING_METHOD);
String activeParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_ACTIVE_PARAM);
String staticParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_STATIC_PARAM);
JSONObject jsonObject = JSON.parseObject(activeParam);
//B.基础信息查询
>>>>>>> v1.3
//订单号及订单信息
Long paymentId = threePartPayDto.getId();
PaymentReconciliation paymentReconciliation = paymentReconciliationService.getById(paymentId);
@@ -67,12 +188,21 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
//金额处理
BigDecimal amount = BigDecimal.ZERO;
for (PaymentDetailDto paymentDetail : threePartPayDto.getPaymentDetails()) {
<<<<<<< HEAD
if(threePartPayDto.getIndex().equals(paymentDetail.getPayEnum())){
amount = paymentDetail.getAmount();
}
}
amount = amount.multiply(new BigDecimal("100"));
String amountResult = String.format("%010d", Integer.parseInt(amount.toString()));
=======
//if(threePartPayDto.getIndex().equals(paymentDetail.getPayEnum())){
amount = amount.add(paymentDetail.getAmount());
//}
}
amount = amount.multiply(new BigDecimal("100"));
String amountResult = String.format("%010d", amount.intValue());
>>>>>>> v1.3
//款员信息查询
Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
@@ -80,6 +210,7 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
//获取支付码
String txtCode = threePartPayDto.getTxtCode();
<<<<<<< HEAD
//获取参数
Map<String, String> paramMap = this.getParamMap(jsonObject, practitioner, null, paymentReconciliation, amountResult, txtCode);
@@ -95,6 +226,237 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
return R.ok();
}
=======
//C.根据不同的请求方式处理参数
//获取动态参数
Map<String, String> paramMap = this.getParamMap(jsonObject, practitioner, null, paymentReconciliation, amountResult, txtCode);
//执行请求
String requestResult = executeRequest(requestMethod, threePartUrl, staticParam, paramMap);
if(StringUtils.isEmpty(requestResult)){
throw new ServiceException("三方支付失败!");
}
//映射实体
String threePartMapping = threePartSimpleFieldMappingService.reverseMap("three-part-mapping", requestResult);
//保存实体
ThreePartPayCallBack threePartPayCallBack = JSON.parseObject(threePartMapping, ThreePartPayCallBack.class);
//红旗临时处理这个if后续可删除
if(threePartPayDto.getId()==null){
threePartPayDto.setId(1l);
}
threePartPayCallBack.setPaymentId(threePartPayDto.getId());
threePartPayCallBackService.save(threePartPayCallBack);
if(threePartPayCallBack!=null&&threePartPayCallBack.getPayResult()!=null&&"00".equals(threePartPayCallBack.getPayResult())){
return R.ok("成功支付"+new BigDecimal(threePartPayCallBack.getTxnAmt()).divide(new BigDecimal("100"),2, RoundingMode.HALF_UP)+"");
}
return R.fail(threePartPayCallBack==null?"支付失败,详见日志文件":threePartPayCallBack.getErrMsg());
}
@Override
public R<?> payQuery(Long paymentId) {
// A.获取配置信息
String threePartUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_QUERY_URL);
//String threePartUrl = "http://127.0.0.1:19994/?MSG=EXEC&yylx=02&posjh=&posygh=&jylx=00&je={je}&yjyrq=&yjyckh=&ypzh=&lrcjy=&cm={cm}&ysddh=&erpddh=&body=";
String requestMethod = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_QUERY_MAPPING_METHOD);
String activeParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_QUERY_ACTIVE_PARAM);
String staticParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_PAY_QUERY_STATIC_PARAM);
JSONObject jsonObject = JSON.parseObject(activeParam);
//B.基础信息查询
//订单号及订单信息
//Long paymentId = id;
PaymentReconciliation paymentReconciliation = paymentReconciliationService.getById(paymentId);
ThreePartPayCallBack threePartPayCallBack = threePartPayCallBackService.getByPayment(paymentId);
//款员信息查询
Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
//C.根据不同的请求方式处理参数
//获取动态参数
Map<String, String> paramMap = this.getParamMap(jsonObject, practitioner, threePartPayCallBack, paymentReconciliation, null, null);
//执行请求
String requestResult = executeRequest(requestMethod, threePartUrl, staticParam, paramMap);
if(StringUtils.isEmpty(requestResult)){
throw new ServiceException("三方平台http失败");
}
//映射实体
String threePartMapping = threePartSimpleFieldMappingService.reverseMap("three-part-mapping", requestResult);
//保存实体
ThreePartPayCallBack threePartPayCallBack1 = JSON.parseObject(threePartMapping, ThreePartPayCallBack.class);
//ThreePartPayCallBack threePartPayCallBack1 = JSON.parseObject(threePartMapping, ThreePartPayCallBack.class);
//threePartPayCallBackService.save(threePartPayCallBack1);
if(threePartPayCallBack1!=null&&threePartPayCallBack1.getPayResult()!=null&&"00".equals(threePartPayCallBack1.getPayResult())){
return R.ok("成功支付"+new BigDecimal(threePartPayCallBack1.getTxnAmt()).divide(new BigDecimal("100"),2, RoundingMode.HALF_UP)+"");
}
return R.fail(threePartPayCallBack1==null?"查询失败,详见日志文件":threePartPayCallBack1.getErrMsg());
}
@Override
public R<?> returnBill(Long paymentId) {
// A.获取配置信息
String threePartUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_RETURN_URL);
//String threePartUrl = "http://127.0.0.1:19994/?MSG=EXEC&yylx=02&posjh=&posygh=&jylx=00&je={je}&yjyrq=&yjyckh=&ypzh=&lrcjy=&cm={cm}&ysddh=&erpddh=&body=";
String requestMethod = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_RETURN_MAPPING_METHOD);
String activeParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_RETURN_ACTIVE_PARAM);
String staticParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_RETURN_STATIC_PARAM);
JSONObject jsonObject = JSON.parseObject(activeParam);
//B.基础信息查询
PaymentReconciliation paymentReconciliation = paymentReconciliationService.getById(paymentId);
ThreePartPayCallBack threePartPayCallBack = threePartPayCallBackService.getByPayment(paymentId);
//款员信息查询
Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
//C.根据不同的请求方式处理参数
//获取动态参数
Map<String, String> paramMap = this.getParamMap(jsonObject, practitioner, threePartPayCallBack, paymentReconciliation, null, null);
//执行请求
String requestResult = executeRequest(requestMethod, threePartUrl, staticParam, paramMap);
if(StringUtils.isEmpty(requestResult)){
throw new ServiceException("三方平台http失败");
}
//映射实体
String threePartMapping = threePartSimpleFieldMappingService.reverseMap("three-part-mapping", requestResult);
//保存实体
ThreePartPayCallBack threePartPayCallBack1 = JSON.parseObject(threePartMapping, ThreePartPayCallBack.class);
threePartPayCallBackService.save(threePartPayCallBack1);
if(threePartPayCallBack1!=null&&threePartPayCallBack1.getPayResult()!=null&&"00".equals(threePartPayCallBack1.getPayResult())){
return R.ok("成功退费"+new BigDecimal(threePartPayCallBack1.getTxnAmt()).divide(new BigDecimal("100"),2, RoundingMode.HALF_UP)+"");
}
return R.fail(threePartPayCallBack1==null?"退费失败,详见日志文件":threePartPayCallBack1.getErrMsg());
}
@Override
public R<?> returnGoods(Long paymentId) {
// A.获取配置信息
String threePartUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_NEXT_DAY_RETURN_URL);
//String threePartUrl = "http://127.0.0.1:19994/?MSG=EXEC&yylx=02&posjh=&posygh=&jylx=00&je={je}&yjyrq=&yjyckh=&ypzh=&lrcjy=&cm={cm}&ysddh=&erpddh=&body=";
String requestMethod = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_NEXT_DAY_RETURN_MAPPING_METHOD);
String activeParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_NEXT_DAY_RETURN_ACTIVE_PARAM);
String staticParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_NEXT_DAY_RETURN_STATIC_PARAM);
JSONObject jsonObject = JSON.parseObject(activeParam);
//B.基础信息查询
PaymentReconciliation paymentReconciliation = paymentReconciliationService.getById(paymentId);
ThreePartPayCallBack threePartPayCallBack = threePartPayCallBackService.getByPayment(paymentId);
//款员信息查询
Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
//C.根据不同的请求方式处理参数
//获取动态参数
Map<String, String> paramMap = this.getParamMap(jsonObject, practitioner, threePartPayCallBack, paymentReconciliation, null, null);
//执行请求
String requestResult = executeRequest(requestMethod, threePartUrl, staticParam, paramMap);
if(StringUtils.isEmpty(requestResult)){
throw new ServiceException("三方平台http失败");
}
//映射实体
String threePartMapping = threePartSimpleFieldMappingService.reverseMap("three-part-mapping", requestResult);
//保存实体
//threePartPayCallBackService.save(JSON.parseObject(threePartMapping,ThreePartPayCallBack.class));
ThreePartPayCallBack threePartPayCallBack1 = JSON.parseObject(threePartMapping, ThreePartPayCallBack.class);
threePartPayCallBackService.save(threePartPayCallBack1);
if("00".equals(threePartPayCallBack1.getPayResult())){
return R.ok();
}
return R.fail(threePartPayCallBack1.getErrMsg());
}
@Override
public R<?> returnQuery(Long id) {
// A.获取配置信息
String threePartUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_RETURN_QUERY_URL);
//String threePartUrl = "http://127.0.0.1:19994/?MSG=EXEC&yylx=02&posjh=&posygh=&jylx=00&je={je}&yjyrq=&yjyckh=&ypzh=&lrcjy=&cm={cm}&ysddh=&erpddh=&body=";
String requestMethod = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_RETURN_QUERY_MAPPING_METHOD);
String activeParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_RETURN_QUERY_ACTIVE_PARAM);
String staticParam = TenantOptionUtil.getOptionContent(TenantOptionDict.THREE_PART_RETURN_QUERY_STATIC_PARAM);
JSONObject jsonObject = JSON.parseObject(activeParam);
//B.基础信息查询
//PaymentReconciliation paymentReconciliation = paymentReconciliationService.getById(paymentId);
ThreePartPayCallBack threePartPayCallBack = threePartPayCallBackService.getById(id);
//款员信息查询
Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
//C.根据不同的请求方式处理参数
//获取动态参数
Map<String, String> paramMap = this.getParamMap(jsonObject, practitioner, threePartPayCallBack, null, null, null);
//执行请求
String requestResult = executeRequest(requestMethod, threePartUrl, staticParam, paramMap);
if(StringUtils.isEmpty(requestResult)){
throw new ServiceException("三方平台http失败");
}
//映射实体
String threePartMapping = threePartSimpleFieldMappingService.reverseMap("three-part-mapping", requestResult);
//保存实体
//threePartPayCallBackService.save(JSON.parseObject(threePartMapping,ThreePartPayCallBack.class));
ThreePartPayCallBack threePartPayCallBack1 = JSON.parseObject(threePartMapping, ThreePartPayCallBack.class);
if(threePartPayCallBack1!=null&&threePartPayCallBack1.getPayResult()!=null&&"00".equals(threePartPayCallBack1.getPayResult())){
return R.ok("成功退费:"+new BigDecimal(threePartPayCallBack1.getTxnAmt()).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP)+"");
}
return R.ok(threePartPayCallBack1==null?"退费失败详见日志!":threePartPayCallBack1.getErrMsg());
}
@Override
public R<?> getPage(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
// 构建查询条件
QueryWrapper<ThreePartCallBackVo> queryWrapper = HisQueryUtils.buildQueryWrapper(new ThreePartCallBackVo(), searchKey,
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PaymentNo)),
request);
IPage<ThreePartCallBackVo> ThreePartCallBackVoIPage =
paymentMapper.getThreePartCallBackVoPage(new Page<>(pageNo, pageSize), queryWrapper);
ThreePartCallBackVoIPage.getRecords().forEach(e->{
e.setIdStr(e.getId().toString());
//e.setPaymentIdStr(e.getPaymentId()==null?null:e.getPaymentId().toString());
});
return R.ok(ThreePartCallBackVoIPage);
}
>>>>>>> v1.3
/**
* 拼接参数
@@ -154,6 +516,17 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
if(payWayOrderIdKey!=null){
paramMap.put(merTradeNoKey,threePartPayCallBack.getMerTradeNo());//商户系统订单号
}
<<<<<<< HEAD
=======
String tradeNoKey = jsonObject.getString("tradeNo");
if(tradeNoKey!=null){
paramMap.put(tradeNoKey,threePartPayCallBack.getTradeNo());//商户系统订单号
}
String txnAmtKey = jsonObject.getString("txnAmt");
if(txnAmtKey!=null){
paramMap.put(txnAmtKey,threePartPayCallBack.getTxnAmt());//金额
}
>>>>>>> v1.3
}
if(paymentReconciliation!=null){
@@ -193,6 +566,55 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
}
/**
<<<<<<< HEAD
=======
* 执行请求
* @param method 请求类型
* @param threePartUrl 路径参数
* @param staticParam 静态参数
* @param map 可变参数
* @return
*/
private String executeRequest(String method,String threePartUrl,String staticParam,Map<String,String> map){
String requestResult = "";
if(CommonConstants.Common.REQUEST_MAPPING_METHOD_GET.equals(method)){
//获取完整url
String url = renderTemplateSafe(threePartUrl, map);
System.out.println("三方支付请求入参:"+url);
logger.info("三方支付请求入参:"+url);
//发送请求
requestResult = httpGet(url);
}else if(CommonConstants.Common.REQUEST_MAPPING_METHOD_POST.equals(method)){
JSONObject data = new JSONObject();
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
data.put(stringStringEntry.getKey(),stringStringEntry.getValue());
}
if(staticParam!=null&& !StringUtils.isEmpty(staticParam)){
JSONObject staticDta = JSON.parseObject(staticParam);
data.putAll(staticDta);
}
System.out.println("三方支付请求入参:"+data.toJSONString());
logger.info("三方支付请求入参:"+data.toJSONString());
requestResult = httpPost(threePartUrl,data.toJSONString());
}
System.out.println("三方支付请求出参:"+requestResult);
logger.info("三方支付请求出参:"+requestResult);
return requestResult;
}
/**
>>>>>>> v1.3
* 发送http请求2025/05/02经测试若以自带的工具类发送请求失败故使用原peis系统中成功调用的写法重新封装
*
* @param url 路径
@@ -210,6 +632,10 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
HttpGet httpGet = new HttpGet(url);
// 执行http请求
response = httpClient.execute(httpGet);
<<<<<<< HEAD
=======
System.out.println("回复信息:"+JSON.toJSONString(response));
>>>>>>> v1.3
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
} catch (Exception e) {
e.printStackTrace();
@@ -223,4 +649,51 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
}
return resultString;
}
<<<<<<< HEAD
=======
/**
* 发送http请求2025/05/02经测试若以自带的工具类发送请求失败故使用原peis系统中成功调用的写法重新封装
*
* @param url 路径
* @param jsonString 参数
* @return
*/
private String httpPost(String url, String jsonString) {
String resultString = "";
// 创建Http请求2025/10/13 师大会超时故此由30000-》60000
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(90000).setConnectionRequestTimeout(90000)
.setSocketTimeout(90000).build();
CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();
CloseableHttpResponse response = null;
// 发送请求
try {
HttpPost httpPost = new HttpPost(url);
StringEntity stringEntity = new StringEntity(jsonString, ContentType.APPLICATION_JSON);
httpPost.setEntity(stringEntity);
// 执行http请求
response = httpClient.execute(httpPost);
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
} catch (Exception e) {
e.printStackTrace();
throw new ServiceException("Http请求异常请稍后再试。");
} finally {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return resultString;
}
@Override
public R<?> payForNenu(ThreePartPayDto threePartPayDto) {
return null;
}
>>>>>>> v1.3
}

View File

@@ -18,7 +18,10 @@ import java.util.stream.Collectors;
@Service
<<<<<<< HEAD
@ConfigurationProperties(prefix = "threepart.mapping")
=======
>>>>>>> v1.3
@Data
@Slf4j
public class ThreePartSimpleFieldMappingService {
@@ -35,7 +38,11 @@ public class ThreePartSimpleFieldMappingService {
public String reverseMap(String businessType, String sourceJson) {
try {
// 1. 获取映射配置
<<<<<<< HEAD
Map<String, String> mappingConfig = properties.getMappingConfig(businessType);
=======
Map<String, String> mappingConfig = properties.getReverseMappings().get(businessType);
>>>>>>> v1.3
if (mappingConfig.isEmpty()) {
log.warn("未找到业务类型[{}]的映射配置", businessType);
return sourceJson; // 返回原JSON
@@ -43,6 +50,13 @@ public class ThreePartSimpleFieldMappingService {
// 2. 解析源JSON
Map<String, Object> sourceMap;
<<<<<<< HEAD
=======
// 修复BOM问题
if (sourceJson.startsWith("\uFEFF")) {
sourceJson = sourceJson.substring(1);
}
>>>>>>> v1.3
sourceMap = objectMapper.readValue(sourceJson, new TypeReference<Map<String,Object>>(){});
// 3. 执行反向映射

View File

@@ -91,4 +91,30 @@ public class ChargeBillController {
// return null;
}
/**
* 获取省市医保字符串
*/
@GetMapping("/get-encounter-type")
public R<?> getYbEncounterType(@RequestParam(name = "encounterId") Long encounterId) {
return R.ok(iChargeBillService.getYbEncounterType(encounterId));
}
/**
* 获取省市医保字符串
*/
@GetMapping("/update-chargeItem-totalPrice")
@Anonymous
public R<?> updateChargeItemTotalPrice() {
return R.ok(iChargeBillService.updateChargeItemTotalPrice());
}
/**
* 红旗校验诊疗项目的医保码是否过期
*/
@GetMapping("/checkYbNo")
@Anonymous
public R<?> checkYbNo() {
return iChargeBillService.checkYbNo();
}
}

View File

@@ -179,7 +179,7 @@ public class PaymentReconciliationController {
* @return 操做结果
*/
@PostMapping("/reg-pay")
public R<?> regPay(@Valid @RequestBody OutpatientRegistrationSettleParam outpatientRegistrationAddParam) {
public R<?> regPay(@Valid @RequestBody OutpatientRegistrationSettleParam outpatientRegistrationAddParam){
R<?> result = paymentReconciliationService.regPay(outpatientRegistrationAddParam,
outpatientRegistrationAddParam.getChrgBchno(), outpatientRegistrationAddParam.getPaymentDetails());
// 付款成功后,开具发票
@@ -277,4 +277,18 @@ public class PaymentReconciliationController {
public R<?> nenuBpcPay(@RequestBody NenuBpcPayDto nenuBpcPayDto) {
return R.ok(paymentReconciliationService.nenuBpcPay(nenuBpcPayDto));
}
<<<<<<< HEAD
=======
/**
* 退号查询
*
* @param encounterId 付款参数
* @return 操作结果
*/
@GetMapping("/pre-cancel-reg")
public R<?> cancelPreReg(@RequestParam(name = "encounterId" ) Long encounterId) {
return R.ok(paymentReconciliationService.cancelPreReg(encounterId));
}
>>>>>>> v1.3
}

View File

@@ -20,11 +20,17 @@ import com.openhis.yb.dto.ThreePartPayDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
<<<<<<< HEAD
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
=======
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
>>>>>>> v1.3
import java.math.BigDecimal;
import java.security.Security;
import java.util.HashMap;
@@ -49,11 +55,94 @@ public class ThreePartPayController {
* 扫码付款
* @return
*/
<<<<<<< HEAD
=======
@PostMapping("/sign")
public R<?> sign(){
return threePartPayService.sign();
}
/**
* 扫码付款
* @return
*/
@PostMapping("/sign-out")
public R<?> signOut(){
return threePartPayService.signOut();
}
/**
* 扫码付款
* @return
*/
>>>>>>> v1.3
@PostMapping("/pay-for")
public R<?> payFor(@RequestBody ThreePartPayDto threePartPayDto){
return threePartPayService.payFor(threePartPayDto);
}
<<<<<<< HEAD
=======
/**
* 扫码付款(师大)
* @return
*/
@PostMapping("/pay-for-nenu")
public R<?> payForNenu(@RequestBody ThreePartPayDto threePartPayDto){
return threePartPayService.payForNenu(threePartPayDto);
}
/**
* 扫码付款结果查询(预结算窗口)
* @return
*/
@GetMapping("/pay-query")
public R<?> payQuery(@RequestParam("paymentId") Long paymentId){
return threePartPayService.payQuery(paymentId);
//return threePartPayService.returnQuery(threePartPayDto.getId());
}
/**
* 当天退费
* @return
*/
@GetMapping("/return-bill")
public R<?> returnBill(@RequestParam("paymentId") Long paymentId){
return threePartPayService.returnBill(paymentId);
}
/**
* 隔天退费
* @return
*/
@GetMapping("/return-goods")
public R<?> returnGoods(@RequestParam("paymentId") Long paymentId){
return threePartPayService.returnGoods(paymentId);
}
/**
* 退费结果查询
* @return
*/
@GetMapping("/return-query")
public R<?> returnQuery(@RequestParam("id") Long id){
return threePartPayService.returnQuery(id);
}
/**
* 网银支付参数
* @return
*/
@GetMapping("/page")
public R<?> page(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request){
return threePartPayService.getPage(searchKey,pageNo,pageSize,request);
}
>>>>>>> v1.3
}

View File

@@ -11,11 +11,13 @@ import java.math.BigDecimal;
@Accessors(chain = true)
public class ChargeItemDetailVO {
@Dict(dictCode = "chrgitm_lv")
private String dirClass;//医保等级
private String chargeItemName;//医保等级
/** 规格 */
private String totalVolume;
/** 数量 */
private BigDecimal quantityValue;

View File

@@ -28,6 +28,7 @@ public class EleInvoicePatientInfoDto {
// 性别
private Integer genderEnum;
private String genderEnumEnumText;
private String genderEnum_enumText;
// 生日

View File

@@ -0,0 +1,24 @@
package com.openhis.web.paymentmanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.financial.domain.ThreePartPayCallBack;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ThreePartCallBackVo extends ThreePartPayCallBack {
@JsonSerialize(using = ToStringSerializer.class)
private String idStr;
/*
* 患者名称
*/
private String patientName;
/*
* 支付单号
*/
private String paymentNo;
}

View File

@@ -5,6 +5,7 @@ package com.openhis.web.paymentmanage.mapper;
import java.util.List;
import com.openhis.web.paymentmanage.dto.ThreePartCallBackVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@@ -73,4 +74,14 @@ public interface PaymentMapper {
* @return 发放数量
*/
DispenseQuantityDto selectDispenseQuantity(@Param("chargeItemIds") List<Long> chargeItemIds);
/**
* 查询网银支付列表
*
* @param objectPage 分页信息
* @param queryWrapper 查询条件
* @return 结果
*/
IPage<ThreePartCallBackVo> getThreePartCallBackVoPage(@Param("page")Page<Object> objectPage, @Param(Constants.WRAPPER)QueryWrapper<ThreePartCallBackVo> queryWrapper);
}

View File

@@ -8,7 +8,11 @@ import java.util.HashMap;
import java.util.Map;
@Configuration
<<<<<<< HEAD
@ConfigurationProperties(prefix = "threepaymapping")
=======
@ConfigurationProperties(prefix = "mapping.reverse-mappings")
>>>>>>> v1.3
@Data
public class ReverseMappingProperties {