Fix Bug #550: AI修复

This commit is contained in:
2026-05-27 03:00:08 +08:00
parent 8e6cb5c79f
commit 16c42ca108
5433 changed files with 171 additions and 778731 deletions

View File

@@ -1,15 +0,0 @@
package com.openhis.web.paymentmanage.appservice;
import com.github.pagehelper.PageInfo;
import com.openhis.web.paymentmanage.dto.ChangePriceListDto;
/**
* Desc:
* @Author raymond
* @Date 16:09 2025/10/15
* @return
**/
public interface IChangePriceService {
PageInfo<ChangePriceListDto> searchMedicationList(Integer pageNo, Integer pageSize);
}

View File

@@ -1,77 +0,0 @@
package com.openhis.web.paymentmanage.appservice;
import com.core.common.core.domain.R;
import com.openhis.web.paymentmanage.dto.ChargeSummaryDto;
import java.util.Map;
public interface IChargeBillService {
/**
* 小票信息
*
* @param paymentId 入参
* @return 结果
*/
Map getDetail(Long paymentId);
/**
* 日结账单报表
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param entererId 收款员
* @param contractNo 合同
* @return 结果
*/
Map getTotal(String startTime, String endTime, Long entererId, String contractNo);
Map getTotalCcu(String startTime, String endTime, Long entererId);
Map getTotalCommen(String startTime, String endTime, Long entererId, String contractNo);
/**
* 医保保障金的相关接口(弃用)
*
* @param paymentId 付款id
* @return 结果
*/
Map getMedicalExpenseCoverageSummary(Long paymentId);
/**
* 按照科室营收情况
*
* @param chargeSummaryDto 入参
* @return 结果
*/
Map getChargeItemByOrg(ChargeSummaryDto chargeSummaryDto);
/**
* 小票信息(农大)
*
* @param paymentId 付款id
* @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

@@ -1,75 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.appservice;
import com.core.common.core.domain.R;
import com.openhis.administration.domain.Invoice;
/**
* 电子发票接口Service
*
* @author yuxj
* @date 2025-04-22
*/
public interface IEleInvoiceService {
/**
* 电子票据补开接口
*
* @param paymentId 支付ID
* @param encounterId 就诊ID
* @return
*/
R<?> invoiceReissue(Long paymentId, Long encounterId);
/**
* 医疗挂号电子票据开具接口
*
* @param paymentId 支付ID
* @param encounterId 就诊ID
* @return
*/
R<?> invoiceRegMake(Long paymentId, Long encounterId);
/**
* 医疗门诊电子票据开具接口
*
* @param paymentId 支付ID
* @param encounterId 就诊ID
* @return
*/
R<?> invoiceMZMake(Long paymentId, Long encounterId);
/**
* 医疗住院电子票据开具接口
*
* @param paymentId 支付ID
* @param encounterId 就诊ID
* @return
*/
R<?> invoiceZYMake(Long paymentId, Long encounterId);
/**
* 医疗电子票据红冲接口
*
* @param paymentId 原付款id
* @param reason 取消理由
* @return
*/
R<?> invoiceWriteoff(Long paymentId, String reason);
/**
* 获取发票HTML
* @param busNo 业务流水号
* @return HTML字符串
*/
String getInvoiceHtml(String busNo);
/**
* 查询已开发票
* @param invoiceId 主键id
* @return
*/
Invoice getInvoiceById(Long invoiceId);
}

View File

@@ -1,140 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.appservice;
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;
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.yb.dto.PaymentDetailDto;
import com.openhis.yb.dto.PaymentDto;
import com.openhis.yb.dto.PaymentInpatientDto;
import com.openhis.yb.dto.PrePaymentDto;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* 付款应用层Service
*
* @author SunJQ
* @date 2025-03-29
*/
public interface IPaymentRecService {
/**
* 付款
*
* @param paymentDto 入参
* @return 结果
*/
R<?> savePayment(PaymentDto paymentDto);
/**
* 取消付款
*
* @param cancelPaymentDto 入参
* @return 结果
*/
R<?> cancelPayment(CancelPaymentDto cancelPaymentDto);
/**
* 取消付款
*
* @param cancelPaymentDto 入参
* @return 结果
*/
R<?> cancelRegPayment(CancelPaymentDto cancelPaymentDto);
/**
* 支付列表
*
* @param searchKey 查询条件
* @param pageNo 分页参数
* @param pageSize 分页参数
* @param request 请求参数
* @return 结果
*/
IPage<PaymentVO> getPage(String searchKey, Integer kingEnum, String invoiceNo, Integer pageNo, Integer pageSize,
HttpServletRequest request);
/**
* 获取支付详情
*
* @param paymentDto 入参
* @return 结果
*/
List<PaymentDetailDto> getDetail(PaymentDto paymentDto);
/**
* 预结算
*
* @param prePaymentDto 预结算入参
* @return 预结算结果
*/
R<?> prePayment(PrePaymentDto prePaymentDto);
/**
* 挂号预结算
*
* @param outpatientRegistrationAddParam 挂号参数
* @return 预结算结果
*/
R<?> regPrePay(OutpatientRegistrationAddParam outpatientRegistrationAddParam);
/**
* 挂号结算
*
* @param outpatientRegistrationSettleParam 挂号参数
* @return 预结算结果
*/
R<?> regPay(OutpatientRegistrationSettleParam outpatientRegistrationSettleParam, String chrgBchno,
List<PaymentDetailDto> paymentDetails);
/**
* 取消预结算
*
* @param encounterId 就诊id
* @return 操作结果
*/
R<?> unPrePayment(Long encounterId);
/**
* 住院预结算
*
* @param prePaymentDto 预结算参数
* @return 预结算结果
*/
InpatientPreSettleResultDto inpatientPreSettle(PrePaymentDto prePaymentDto);
/**
* 住院结算
*
* @param paymentDto 住院结算参数
* @return 操作结果
*/
R<?> inpatientSettle(PaymentInpatientDto paymentDto);
/**
* 【取消住院结算】
*
* @param paymentId 付款id
* @return 操作结果
*/
R<?> inpatientUnPay(Long paymentId);
/**
* BPC支付
*
* @param nenuBpcPayDto bpc支付参数
* @return 结果
*/
String nenuBpcPay(NenuBpcPayDto nenuBpcPayDto);
List<PaymentDetailDto> cancelPreReg(Long encounterId);
}

View File

@@ -1,88 +0,0 @@
package com.openhis.web.paymentmanage.appservice;
import com.core.common.core.domain.R;
import com.openhis.yb.dto.ThreePartPayDto;
import javax.servlet.http.HttpServletRequest;
/**
* 第三方支付应用层Service
*
* @author SunJQ
* @date 2025-03-29
*/
public interface ThreePartPayService {
/**
* 付款
*
* @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);
}

View File

@@ -1,32 +0,0 @@
package com.openhis.web.paymentmanage.appservice.impl;
import com.github.pagehelper.PageInfo;
import com.openhis.medication.domain.MedicationDefinition;
import com.openhis.web.paymentmanage.appservice.IChangePriceService;
import com.openhis.web.paymentmanage.dto.ChangePriceListDto;
import com.openhis.web.paymentmanage.mapper.ChangePriceMapper;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
* @ClassName ChangePriceImpl
* @Description TODO
* @Author raymond
* @Date 2025/10/15 16:10
* @Version 1.0
**/
@Component
public class ChangePriceImpl implements IChangePriceService {
@Resource
private ChangePriceMapper changePriceMapper;
@Override
public PageInfo<ChangePriceListDto> searchMedicationList(Integer pageNo, Integer pageSize) {
// PageHelper.startPage(pageNo,pageSize);
List<MedicationDefinition> medicationDefinitions = this.changePriceMapper.searchMedicationList();
// PageInfo<ChangePriceListDto> pageInfo = new PageInfo<>(list);
return null;
}
}

View File

@@ -1,616 +0,0 @@
package com.openhis.web.paymentmanage.appservice.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
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.core.domain.R;
import com.core.common.enums.TenantOptionDict;
import com.core.common.exception.ServiceException;
import com.core.common.utils.SecurityUtils;
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.utils.HisQueryUtils;
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;
import com.openhis.web.paymentmanage.dto.ThreePartCallBackVo;
import com.openhis.web.paymentmanage.mapper.PaymentMapper;
import com.openhis.yb.dto.PaymentDetailDto;
import com.openhis.yb.dto.ThreePartPayDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
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;
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;
@Component
@Slf4j
public class ThreePartPayServiceImpl implements ThreePartPayService {
Logger logger = LoggerFactory.getLogger(ThreePartPayServiceImpl.class);
@Autowired
private IPractitionerService practitionerService;
@Autowired
private IPaymentRecDetailService paymentRecDetailService;
@Autowired
private PaymentMapper paymentMapper;
@Autowired
private IPaymentReconciliationService paymentReconciliationService;
@Autowired
private ThreePartPayCallBackService threePartPayCallBackService;
@Autowired
private ThreePartSimpleFieldMappingService threePartSimpleFieldMappingService;
@Override
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.基础信息查询
//订单号及订单信息
Long paymentId = threePartPayDto.getId();
PaymentReconciliation paymentReconciliation = paymentReconciliationService.getById(paymentId);
//金额处理
BigDecimal amount = BigDecimal.ZERO;
for (PaymentDetailDto paymentDetail : threePartPayDto.getPaymentDetails()) {
//if(threePartPayDto.getIndex().equals(paymentDetail.getPayEnum())){
amount = amount.add(paymentDetail.getAmount());
//}
}
amount = amount.multiply(new BigDecimal("100"));
String amountResult = String.format("%010d", amount.intValue());
//款员信息查询
Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
//获取支付码
String txtCode = threePartPayDto.getTxtCode();
//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);
}
/**
* 拼接参数
*
* @param jsonObject 配置信息
* @param practitioner 款员信息
* @param threePartPayCallBack 原订单
* @param amountResult 金额
* @param txtCode 支付码
* @return
*/
private Map<String, String> getParamMap(JSONObject jsonObject, Practitioner practitioner, ThreePartPayCallBack threePartPayCallBack, PaymentReconciliation paymentReconciliation, String amountResult, String txtCode) {
Map<String, String> paramMap = new HashMap<>();
//款员信息
if (practitioner != null) {
String posNoKey = jsonObject.getString("posNo");//pos机编码
if (posNoKey != null) {
paramMap.put(posNoKey, practitioner.getPosNo());
}
String userIdKey = jsonObject.getString("userId");
if (userIdKey != null) {
paramMap.put(userIdKey, practitioner.getId().toString());
}
String userNameKey = jsonObject.getString("userName");
if (userNameKey != null) {
paramMap.put(userNameKey, practitioner.getName());
}
}
//原账单信息
if (threePartPayCallBack != null) {
String bankOrderIdKey = jsonObject.getString("bankOrderId");
if (bankOrderIdKey != null) {
paramMap.put(bankOrderIdKey, threePartPayCallBack.getTradeNo());//银行订单号
}
String payWayOrderIdKey = jsonObject.getString("payWayOrderId");
if (payWayOrderIdKey != null) {
paramMap.put(payWayOrderIdKey, threePartPayCallBack.getTransNo());//支付渠道订单号
}
String tranTypeKey = jsonObject.getString("tranType");
if (tranTypeKey != null) {
paramMap.put(tranTypeKey, threePartPayCallBack.getTranType());//交易类型
}
String payTypeKey = jsonObject.getString("payType");
if (payTypeKey != null) {
paramMap.put(payTypeKey, threePartPayCallBack.getPayType());//支付方式
}
String traceNoKey = jsonObject.getString("traceNo");
if (payWayOrderIdKey != null) {
paramMap.put(traceNoKey, threePartPayCallBack.getTraceNo());//终端流水号
}
String txnTimeKey = jsonObject.getString("txnTime");
if (payWayOrderIdKey != null) {
paramMap.put(txnTimeKey, threePartPayCallBack.getTxnTime());//交易时间
}
String merTradeNoKey = jsonObject.getString("merTradeNo");
if (payWayOrderIdKey != null) {
paramMap.put(merTradeNoKey, threePartPayCallBack.getMerTradeNo());//商户系统订单号
}
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());//金额
}
}
if (paymentReconciliation != null) {
String paymentIdKey = jsonObject.getString("paymentId");
if (paymentIdKey != null) {
paramMap.put(paymentIdKey, paymentReconciliation.getId().toString());//his系统订单号
}
}
String amountResultKey = jsonObject.getString("amountResult");
String txtCodeKey = jsonObject.getString("txtCode");
if (amountResult != null) {
paramMap.put(amountResultKey, amountResult);//金额
}
if (txtCode != null) {
paramMap.put(txtCodeKey, txtCode);//扫码
}
return paramMap;
}
/**
* 安全替换,避免空指针
*/
private String renderTemplateSafe(String template, Map<String, String> params) {
if (template == null) {
return "";
}
if (params == null) {
params = new HashMap<>();
}
String result = template;
for (Map.Entry<String, String> entry : params.entrySet()) {
String placeholder = "{" + entry.getKey() + "}";
String value = entry.getValue() != null ? entry.getValue().toString() : "";
// 使用 replace 而不是 replaceAll避免正则表达式特殊字符问题
result = result.replace(placeholder, value);
}
return result;
}
/**
* 执行请求
*
* @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;
}
/**
* 发送http请求2025/05/02经测试若以自带的工具类发送请求失败故使用原peis系统中成功调用的写法重新封装
*
* @param url 路径
* @return
*/
private String httpGet(String url) {
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 {
HttpGet httpGet = new HttpGet(url);
// 执行http请求
response = httpClient.execute(httpGet);
System.out.println("回复信息:" + JSON.toJSONString(response));
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
} catch (Exception e) {
log.error("Http请求异常, url: {}", url, e);
throw new ServiceException("Http请求异常请稍后再试。");
} finally {
try {
response.close();
} catch (IOException e) {
log.error("关闭响应失败", e);
}
}
return resultString;
}
/**
* 发送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) {
log.error("Http请求异常, url: {}", url, e);
throw new ServiceException("Http请求异常请稍后再试。");
} finally {
try {
response.close();
} catch (IOException e) {
log.error("关闭响应失败", e);
}
}
return resultString;
}
@Override
public R<?> payForNenu(ThreePartPayDto threePartPayDto) {
return null;
}
}

View File

@@ -1,121 +0,0 @@
package com.openhis.web.paymentmanage.appservice.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.openhis.web.paymentmanage.util.ReverseMappingProperties;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@Service
@Data
@Slf4j
public class ThreePartSimpleFieldMappingService {
@Autowired
private ReverseMappingProperties properties;
private final ObjectMapper objectMapper = new ObjectMapper();
/**
* 执行反向映射三方JSON -> 我方JSON
*/
public String reverseMap(String businessType, String sourceJson) {
try {
// 1. 获取映射配置
Map<String, String> mappingConfig = properties.getReverseMappings().get(businessType);
if (mappingConfig.isEmpty()) {
log.warn("未找到业务类型[{}]的映射配置", businessType);
return sourceJson; // 返回原JSON
}
// 2. 解析源JSON
Map<String, Object> sourceMap;
// 修复BOM问题
if (sourceJson.startsWith("\uFEFF")) {
sourceJson = sourceJson.substring(1);
}
sourceMap = objectMapper.readValue(sourceJson, new TypeReference<Map<String, Object>>() {
});
// 3. 执行反向映射
Map<String, Object> resultMap = reverseMap(mappingConfig, sourceMap);
// 4. 生成结果JSON
return objectMapper.writeValueAsString(resultMap);
} catch (Exception e) {
log.error("反向映射失败,业务类型: {}, JSON: {}", businessType, sourceJson, e);
throw new RuntimeException("反向映射失败", e);
}
}
/**
* 执行反向映射Map版本
*/
public Map<String, Object> reverseMap(String businessType, Map<String, Object> sourceMap) {
Map<String, String> mappingConfig = properties.getMappingConfig(businessType);
return reverseMap(mappingConfig, sourceMap);
}
/**
* 核心映射逻辑
*/
private Map<String, Object> reverseMap(Map<String, String> mappingConfig,
Map<String, Object> sourceMap) {
Map<String, Object> resultMap = new HashMap<>();
for (Map.Entry<String, Object> entry : sourceMap.entrySet()) {
String sourceField = entry.getKey();
Object value = entry.getValue();
// 查找映射关系
String targetField = mappingConfig.get(sourceField);
if (targetField != null) {
// 执行映射
resultMap.put(targetField, value);
} else {
// 未配置映射的字段,可以选择保留或忽略
// resultMap.put(sourceField, value); // 取消注释则保留未映射字段
log.debug("字段[{}]未配置映射,已忽略", sourceField);
}
}
log.debug("反向映射完成: {} -> {}", sourceMap.keySet(), resultMap.keySet());
return resultMap;
}
/**
* 批量处理
*/
public List<Map<String, Object>> reverseMapBatch(String businessType,
List<Map<String, Object>> sourceList) {
return sourceList.stream()
.map(source -> reverseMap(businessType, source))
.collect(Collectors.toList());
}
/**
* 检查字段是否已配置映射
*/
public boolean isFieldMapped(String businessType, String fieldName) {
Map<String, String> mappingConfig = properties.getMappingConfig(businessType);
return mappingConfig.containsKey(fieldName);
}
/**
* 获取所有已配置的映射字段
*/
public Set<String> getMappedFields(String businessType) {
Map<String, String> mappingConfig = properties.getMappingConfig(businessType);
return mappingConfig.keySet();
}
}

View File

@@ -1,118 +0,0 @@
package com.openhis.web.paymentmanage.controller;
import com.core.common.annotation.Anonymous;
import com.core.common.core.domain.R;
import com.openhis.web.paymentmanage.appservice.IChargeBillService;
import com.openhis.web.paymentmanage.dto.ChargeSummaryDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 报表
*
* @author SunJQ
* @date 2025-03-29
*/
@RestController
@RequestMapping("/payment/bill")
@Slf4j
public class ChargeBillController {
@Autowired
private IChargeBillService iChargeBillService;
/**
* 单次结算账单
*
* @param paymentId 付款实体
*/
@GetMapping("/getDetail")
public R<?> getDetail(@RequestParam("paymentId") Long paymentId) {
return R.ok(iChargeBillService.getDetail(paymentId));
}
/**
* 单次结算账单
*
* @param paymentId 付款实体
*/
@GetMapping("/receipt-details-nd")
@Anonymous
public R<?> getReceiptDetailsND(@RequestParam("paymentId") Long paymentId) {
return R.ok(iChargeBillService.getReceiptDetailsND(paymentId));
}
/**
* 日结算账单
*
* @param startTime 结算参数
* @param endTime 结算参数
* @param entererId 结算参数
*/
@GetMapping("/getTotal")
public R<?> getTotal(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime,
@RequestParam("entererId") Long entererId,
@RequestParam(value = "contractNo", required = false) String contractNo) {
return R.ok(iChargeBillService.getTotal(startTime, endTime, entererId, contractNo));
}
/**
* 日结算账单(长大版本)
*
* @param startTime 结算参数
* @param endTime 结算参数
* @param entererId 结算参数
*/
@GetMapping("/getTotalCcu")
@Anonymous
public R<?> getTotalCcu(@RequestParam(value = "startTime") String startTime,
@RequestParam("endTime") String endTime, @RequestParam(value = "entererId", required = false) Long entererId,
@RequestParam(value = "contractNo", required = false) String contractNo) {
return R.ok(iChargeBillService.getTotalCommen(startTime, endTime, entererId, contractNo));
}
/**
* 获取医疗保障金清单(门诊慢病用)
*/
@PostMapping("/get-med-exp-cov-sum")
public R<?> getMedicalExpenseCoverageSummary(Long paymentId) {
return R.ok(iChargeBillService.getMedicalExpenseCoverageSummary(paymentId));
}
/**
* 获取各科室营收信息
*/
@PostMapping("/charge-summary")
public R<?> getChargeSummary(@RequestBody ChargeSummaryDto chargeSummaryDto) {
return R.ok(iChargeBillService.getChargeItemByOrg(chargeSummaryDto));
// 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

@@ -1,117 +0,0 @@
package com.openhis.web.paymentmanage.controller;
import com.core.common.core.domain.R;
import com.core.common.exception.ServiceException;
import com.openhis.administration.domain.Invoice;
import com.openhis.common.enums.ybenums.YbEncounterClass;
import com.openhis.web.paymentmanage.appservice.IChargeBillService;
import com.openhis.web.paymentmanage.appservice.IEleInvoiceService;
import com.openhis.web.paymentmanage.dto.InvoiceWriteOffDto;
import com.openhis.web.paymentmanage.dto.MakeInvoiceDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 电子发票
*
* @author yuxj
* @date 2025-05-28
*/
@RestController
@RequestMapping("/invoice")
@Slf4j
public class EleInvoiceController {
@Autowired
private IEleInvoiceService eleInvoiceService;
@Autowired
private IChargeBillService iChargeBillService;
/**
* 电子票据补开接口
*
* @param makeInvoiceDto 发票开具dto
* @return
*/
@PostMapping("/invoiceReissue")
public R<?> invoiceReissue(@RequestBody MakeInvoiceDto makeInvoiceDto) {
// 付款成功后,开具发票
R<?> result = eleInvoiceService.invoiceReissue(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
R<?> eleResult = null;
if (result.getCode() == 200) {
if (result.getData() == YbEncounterClass.REG.getValue()) {
// 付款成功后,开具发票
eleResult = eleInvoiceService.invoiceRegMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
if (eleResult.getCode() != 200) {
return R.ok(" 挂号电子发票开具失败 :" + eleResult.getMsg());
}
} else if (result.getData() == YbEncounterClass.AMB.getValue()) {
// 付款成功后,开具发票
eleResult = eleInvoiceService.invoiceMZMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
if (eleResult.getCode() != 200) {
return R.ok(" 门诊电子发票开具失败 :" + eleResult.getMsg());
}
} else if (result.getData() == YbEncounterClass.IMP.getValue()) {
// 付款成功后,开具发票
eleResult = eleInvoiceService.invoiceZYMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
if (eleResult.getCode() != 200) {
return R.ok(" 住院电子发票开具失败 :" + eleResult.getMsg());
}
} else {
return R.ok("电子发票类型不明确!");
}
}
Map<String, Object> detail = iChargeBillService.getDetail(makeInvoiceDto.getPaymentId());
if (eleResult != null && eleResult.getCode() == 200 && eleResult.getData() instanceof Invoice) {
Invoice invoice = (Invoice) eleResult.getData();
detail.put("pictureUrl", invoice.getPictureUrl());
}
return R.ok(detail);
}
/**
* 医疗电子票据红冲接口
*
* @param invoiceWriteOffDto 原付款id
* @return
*/
@PostMapping("/invoiceWriteoff")
public R<?> invoiceWriteoff(@RequestBody InvoiceWriteOffDto invoiceWriteOffDto) {
// 退款成功后,开具发票
R<?> eleResult = eleInvoiceService.invoiceWriteoff(Long.parseLong(invoiceWriteOffDto.getPaymentId()), invoiceWriteOffDto.getReason());
if (eleResult.getCode() != 200) {
return R.ok(" 电子票据红冲失败 :" + eleResult.getMsg());
}
Map detail = iChargeBillService.getDetail(Long.parseLong(invoiceWriteOffDto.getPaymentId()));
return R.ok(detail);
}
/**
* 医疗电子票据红冲接口
*
* @param invoiceId 原付款id
* @return
*/
@PutMapping("/invoiceOpen")
public R<?> invoiceOpen(@RequestParam("invoiceId") String invoiceId) {
// 退款成功后,开具发票
Invoice invoice = eleInvoiceService.getInvoiceById(Long.parseLong(invoiceId));
if (invoice == null) {
throw new ServiceException("未查询到发票信息");
}
return R.ok(invoice.getPictureUrl());
}
/**
* 获取发票HTML凭条预览
*/
@GetMapping(value = "/view", produces = "text/html;charset=UTF-8")
@ResponseBody
public String viewInvoice(@RequestParam("busNo") String busNo) {
return eleInvoiceService.getInvoiceHtml(busNo);
}
}

View File

@@ -1,95 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.openhis.financial.domain.Contract;
import com.openhis.financial.service.IContractService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
/**
* 付款合同管理
*
* @author SunJQ
* @date 2025-06-23
*/
@RestController
@RequestMapping("/payment/contract")
@Slf4j
@AllArgsConstructor
public class PaymentContractController {
@Autowired
private IContractService contractService;
/**
* 查询租户合同信息分页
*
* @param tenantId 租户ID
* @param pageNum 当前页
* @param pageSize 每页条数
* @return 租户合同信息分页
*/
@PreAuthorize("@ss.hasPermi('system:tenant:operate')")
@GetMapping("/page")
public R<IPage<Contract>> getTenantContractPage(@RequestParam Integer tenantId,
@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize) {
return R.ok(contractService.getTenantContractPage(tenantId, pageNum, pageSize));
}
/**
* 查询租户合同信息详情
*
* @param id 合同ID
* @return 租户合同信息详情
*/
@PreAuthorize("@ss.hasPermi('system:tenant:operate')")
@GetMapping("/{id}")
public R<Contract> getTenantContractDetail(@PathVariable Long id) {
return R.ok(contractService.getTenantContractDetail(id));
}
/**
* 新增租户合同信息
*
* @param contract 合同管理实体
*/
@PreAuthorize("@ss.hasPermi('system:tenant:operate')")
@PostMapping
public R<?> addTenantContract(@RequestBody Contract contract) {
contractService.addTenantContract(contract);
return R.ok();
}
/**
* 编辑租户合同信息
*
* @param contract 合同管理实体
*/
@PreAuthorize("@ss.hasPermi('system:tenant:operate')")
@PutMapping
public R<?> editTenantContract(@RequestBody Contract contract) {
contractService.editTenantContract(contract);
return R.ok();
}
/**
* 删除租户合同信息
*
* @param id ID
* @return 结果
*/
@PreAuthorize("@ss.hasPermi('system:tenant:operate')")
@DeleteMapping("/{id}")
public R<?> delTenantContract(@PathVariable Long id) {
contractService.delTenantContract(id);
return R.ok();
}
}

View File

@@ -1,299 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.controller;
import com.core.common.core.domain.R;
import com.core.common.enums.TenantOptionDict;
import com.core.web.util.TenantOptionUtil;
import com.openhis.administration.domain.Invoice;
import com.openhis.financial.domain.PaymentReconciliation;
import com.openhis.web.chargemanage.dto.OutpatientRegistrationAddParam;
import com.openhis.web.chargemanage.dto.OutpatientRegistrationSettleParam;
import com.openhis.web.paymentmanage.appservice.IChargeBillService;
import com.openhis.web.paymentmanage.appservice.IEleInvoiceService;
import com.openhis.web.paymentmanage.appservice.IPaymentRecService;
import com.openhis.web.paymentmanage.dto.CancelPaymentDto;
import com.openhis.web.paymentmanage.dto.CancelPaymentInpatientDto;
import com.openhis.web.paymentmanage.dto.NenuBpcPayDto;
import com.openhis.yb.dto.PaymentDto;
import com.openhis.yb.dto.PaymentInpatientDto;
import com.openhis.yb.dto.PrePaymentDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Map;
/**
* 付款管理
*
* @author SunJQ
* @date 2025-03-29
*/
@RestController
@RequestMapping("/payment/payment")
@Slf4j
@AllArgsConstructor
public class PaymentReconciliationController {
@Autowired
private IPaymentRecService paymentReconciliationService;
@Autowired
private IEleInvoiceService eleInvoiceService;
@Autowired
private IChargeBillService iChargeBillService;
/**
* 预付款
*
* @param prePaymentDto 付款实体
*/
@PostMapping("/precharge")
public R<?> savePrePayment(@Validated @RequestBody PrePaymentDto prePaymentDto) {
return paymentReconciliationService.prePayment(prePaymentDto);
}
/**
* 取消预付款(该接口未被调用)
*
* @param encounterId 就诊id
* @return 操作结果
*/
@PostMapping("/unprecharge")
public R<?> unPrePayment(Long encounterId) {
return paymentReconciliationService.unPrePayment(encounterId);
}
/**
* 付款
*
* @param paymentDto 付款实体
*/
@PostMapping("/charge")
public R<?> savePayment(@Validated @RequestBody PaymentDto paymentDto) {
R<?> result = paymentReconciliationService.savePayment(paymentDto);
// 付款成功后,开具发票
if (result.getCode() == 200) {
PaymentReconciliation paymentRecon = null;
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
paymentRecon = (PaymentReconciliation) result.getData();
}
Map detail = iChargeBillService.getDetail(paymentRecon.getId());
if ("0".equals(TenantOptionUtil.getOptionContent(TenantOptionDict.INVOICE_SWITCH))) {
return R.ok(detail);
} else {
R<?> eleResult = eleInvoiceService.invoiceMZMake(paymentRecon.getId(), paymentDto.getEncounterId());
if (eleResult.getCode() != 200) {
// 因收费成功前端需要关闭弹窗此处信息仅用于提示所以返回ok
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
} else if (eleResult.getData() instanceof Invoice) {
Invoice invoice = (Invoice) eleResult.getData();
detail.put("pictureUrl", invoice.getPictureUrl());
}
return R.ok(detail);
}
}
return result;
}
/**
* 取消付款
*
* @param cancelPaymentDto 付款实体
*/
@PostMapping("/uncharge")
public R<?> cancelPayment(@RequestBody CancelPaymentDto cancelPaymentDto) {
R<?> result = paymentReconciliationService.cancelPayment(cancelPaymentDto);
// 取消付款成功后,开具发票
if (result.getCode() == 200) {
PaymentReconciliation paymentRecon = null;
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
paymentRecon = (PaymentReconciliation) result.getData();
}
if ("0".equals(TenantOptionUtil.getOptionContent(TenantOptionDict.INVOICE_SWITCH))) {
return result;
} else {
R<?> eleResult
= eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelPaymentDto.getReason());
if (eleResult.getCode() != 200) {
// 因取消付款成功前端需要关闭弹窗此处信息仅用于提示所以返回ok
return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg());
}
}
}
return result;
}
/**
* 支付列表
*
* @param searchKey 模糊查寻
* @param pageNo 页号
* @param pageSize 页容量
* @param request 请求体
* @return 查询结果
*/
@GetMapping("/page")
public R<?> paymentPage(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "kinsEnum", defaultValue = "") Integer kinsEnum,
@RequestParam(value = "invoiceNo", defaultValue = "") String invoiceNo,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
return R.ok(paymentReconciliationService.getPage(searchKey, kinsEnum, invoiceNo, pageNo, pageSize, request));
}
/**
* 支付详情
*
* @param paymentDto 付款信息
* @return 查询结果
*/
@PostMapping("/detail")
public R<?> paymentDetail(@RequestBody PaymentDto paymentDto) {
return R.ok(paymentReconciliationService.getDetail(paymentDto));
}
/**
* 挂号收费(挂号收费先医保挂号,收费成功后再本系统挂号)
*
* @param outpatientRegistrationAddParam 挂号信息
* @return 操做结果
*/
@PostMapping("/reg-pre-pay")
public R<?> regPrePay(@Valid @RequestBody OutpatientRegistrationAddParam outpatientRegistrationAddParam) {
return paymentReconciliationService.regPrePay(outpatientRegistrationAddParam);
}
/**
* 挂号收费(挂号收费先医保挂号,收费成功后再本系统挂号)
*
* @param outpatientRegistrationSettleParam 挂号信息
* @return 操做结果
*/
@PostMapping("/reg-pay")
public R<?> regPay(@Valid @RequestBody OutpatientRegistrationSettleParam outpatientRegistrationAddParam) {
R<?> result = paymentReconciliationService.regPay(outpatientRegistrationAddParam,
outpatientRegistrationAddParam.getChrgBchno(), outpatientRegistrationAddParam.getPaymentDetails());
// 付款成功后,开具发票
if (result.getCode() == 200) {
PaymentReconciliation paymentRecon = null;
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
paymentRecon = (PaymentReconciliation) result.getData();
}
Map detail = iChargeBillService.getDetail(paymentRecon.getId());
Long encounterId = paymentRecon.getEncounterId();
if ("0".equals(TenantOptionUtil.getOptionContent(TenantOptionDict.INVOICE_SWITCH))) {
return R.ok(detail);
} else {
R<?> eleResult = eleInvoiceService.invoiceRegMake(paymentRecon.getId(), encounterId);
if (eleResult.getCode() != 200) {
// 因收费成功前端需要关闭弹窗此处信息仅用于提示所以返回ok
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
} else if (eleResult.getData() instanceof Invoice) {
Invoice invoice = (Invoice) eleResult.getData();
detail.put("pictureUrl", invoice.getPictureUrl());
}
return R.ok(detail);
}
}
return result;
}
/**
* 【住院预结算】
*
* @param prePaymentDto 预结算参数
* @return 操作结果
*/
@PostMapping("/inpa-pre-pay")
public R<?> inpatientPrePay(@RequestBody PrePaymentDto prePaymentDto) {
return R.ok(paymentReconciliationService.inpatientPreSettle(prePaymentDto));
}
/**
* 【住院结算】
*
* @param paymentDto 预结算参数
* @return 操作结果
*/
@PostMapping("/inpa-pay")
public R<?> inpatientPay(@RequestBody PaymentInpatientDto paymentDto) {
R<?> r = paymentReconciliationService.inpatientSettle(paymentDto);
// 付款成功后,开具发票
if (r.getCode() == 200) {
PaymentReconciliation paymentRecon = null;
if (PaymentReconciliation.class.isAssignableFrom(r.getData().getClass())) {
paymentRecon = (PaymentReconciliation) r.getData();
}
Long encounterId = paymentRecon.getEncounterId();
R<?> eleResult = eleInvoiceService.invoiceZYMake(paymentRecon.getId(), encounterId);
Map detail = iChargeBillService.getDetail(paymentRecon.getId());
if (eleResult.getCode() != 200) {
// 因收费成功前端需要关闭弹窗此处信息仅用于提示所以返回ok
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
} else if (eleResult.getData() instanceof Invoice) {
Invoice invoice = (Invoice) eleResult.getData();
detail.put("pictureUrl", invoice.getPictureUrl());
}
return R.ok(detail);
}
return R.ok("收费未成功,请确认实际收款情况");
}
/**
* 【取消住院结算】
*
* @param cancelPaymentInpatientDto 退款参数
* @return 操作结果
*/
@PostMapping("/inpa-un-pay")
public R<?> inpatientUnPay(@RequestBody CancelPaymentInpatientDto cancelPaymentInpatientDto) {
R<?> r = paymentReconciliationService.inpatientUnPay(cancelPaymentInpatientDto.getId());
// 付款成功后,开具发票
if (r.getCode() == 200) {
PaymentReconciliation paymentRecon = null;
if (PaymentReconciliation.class.isAssignableFrom(r.getData().getClass())) {
paymentRecon = (PaymentReconciliation) r.getData();
}
R<?> eleResult
= eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelPaymentInpatientDto.getReason());
if (eleResult.getCode() != 200) {
// 因取消付款成功前端需要关闭弹窗此处信息仅用于提示所以返回ok
return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg());
}
return R.ok("取消结算成功");
}
return R.fail("取消结算失败,请确认");
}
/**
* 师大bpc支付
*
* @param nenuBpcPayDto 付款参数
* @return 操作结果
*/
@PostMapping("/nenu-bpc-pay")
public R<?> nenuBpcPay(@RequestBody NenuBpcPayDto nenuBpcPayDto) {
return R.ok(paymentReconciliationService.nenuBpcPay(nenuBpcPayDto));
}
/**
* 退号查询
*
* @param encounterId 付款参数
* @return 操作结果
*/
@GetMapping("/pre-cancel-reg")
public R<?> cancelPreReg(@RequestParam(name = "encounterId") Long encounterId) {
return R.ok(paymentReconciliationService.cancelPreReg(encounterId));
}
}

View File

@@ -1,121 +0,0 @@
package com.openhis.web.paymentmanage.controller;
import com.core.common.core.domain.R;
import com.openhis.web.paymentmanage.appservice.ThreePartPayService;
import com.openhis.yb.dto.ThreePartPayDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* 第三方支付管理
*
* @author SunJQ
* @date 2025-03-29
*/
@RestController
@RequestMapping("/three-part/pay")
@Slf4j
@AllArgsConstructor
public class ThreePartPayController {
@Autowired
private ThreePartPayService threePartPayService;
/**
* 扫码付款
*
* @return
*/
@PostMapping("/sign")
public R<?> sign() {
return threePartPayService.sign();
}
/**
* 扫码付款
*
* @return
*/
@PostMapping("/sign-out")
public R<?> signOut() {
return threePartPayService.signOut();
}
/**
* 扫码付款
*
* @return
*/
@PostMapping("/pay-for")
public R<?> payFor(@RequestBody ThreePartPayDto threePartPayDto) {
return threePartPayService.payFor(threePartPayDto);
}
/**
* 扫码付款(师大)
*
* @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);
}
}

View File

@@ -1,44 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.openhis.yb.dto.PaymentDetailDto;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* 退费入参
*
* @author SunJQ
* @date 2025-05-08
*/
@Data
@Accessors(chain = true)
public class CancelPaymentDto {
/**
* id
*/
private Long id;
/** 收费项 */
private List<Long> chargeItemIds;// 收费时传收费的项目,退费时传退费的项目,2025/05/07去掉notEmpty的注解与前端约定此字段必传可以是空集合
/** 支付详细 */
@NotEmpty
private List<PaymentDetailDto> paymentDetails;
/** 支付批次号 */
private String chrgBchno;// 医保预结算时返回,医保结算时必传,否则结算时一直预结算(弃用)
private String ybMdtrtCertType;// 社保卡/身份证/电子医保码
private String busiCardInfo;// 社保卡号/身份证号/ecToken
private String reason;// 退款理由
private String setlId;// 结算id
}

View File

@@ -1,24 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
/**
* 住院取消结算
*
* @author SunJQ
* @date 2025-08-15
*/
@Data
public class CancelPaymentInpatientDto {
/**
* paymentId
*/
private Long id;
/**
* 退费原因
*/
private String reason;
}

View File

@@ -1,53 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.yb.dto.PaymentDetailDto;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
@Data
@Accessors(chain = true)
public class CancelRegPaymentDto {
/**
* id
*/
private Long id;
/** 收款员 */
private Long entererId;
/** 支付的患者ID */
@NotNull
private Long patientId;
/** 应收金额 */
private BigDecimal tenderedAmount;
/** 找零金额 */
private BigDecimal returnedAmount;
/** 付款总额 */
private BigDecimal displayAmount;
/** 就诊ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/** 收费项 */
private List<Long> chargeItemIds;// 收费时传收费的项目,退费时传退费的项目,2025/05/07去掉notEmpty的注解与前端约定此字段必传可以是空集合
/** 支付详细 */
@NotEmpty
private List<PaymentDetailDto> paymentDetails;
/** 支付批次号 */
private String chrgBchno;// 医保预结算时返回,医保结算时必传,否则结算时一直预结算
private String reason;// 退号理由
}

View File

@@ -1,83 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
/**
* @ClassName ChangePriceListDto
* @Description 药品调价dto
* @Author raymond
* @Date 2025/10/15 14:09
* @Version 1.0
**/
@Data
@Accessors(chain = true)
public class ChangePriceListDto {
/**
* 药品ID
*/
private Long medicationId;
/**
* 药品编号
*/
private Long busNo;
/**
* 供应商ID
*/
private Long supplyId;
/**
* 供应商名字
*/
private String supplyName;
/**
* 药品规格
*/
private String totalVolume;
/**
* 当前价格
*/
private BigDecimal curPrice;
/**
* 调整后价格
*/
private BigDecimal retailPrice;
/**
* 调价描述
*/
private String description;
/**
* 调整时间
*/
private Date retailTime;
/**
* 药品名称
*/
private String name;
/**
* 药品英文名
*/
private String nameEn;
/**
* 拼音
*/
private String pyStr;
/**
* 五笔
*/
private String wbStr;
/**
* 商品名
*/
private String merchandiseName;
/**
* 商品名拼音
*/
private String merchandisePyStr;
/**
* 商品名五笔
*/
private String merchandiseWbStr;
}

View File

@@ -1,32 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import com.openhis.common.annotation.Dict;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
@Data
@Accessors(chain = true)
public class ChargeItemDetailVO {
private String dirClass;//医保等级
private String chargeItemName;//医保等级
/** 规格 */
private String totalVolume;
/** 数量 */
private BigDecimal quantityValue;
/** 单位 */
@Dict(dictCode = "prcunt_type")
private String quantityUnit;
/** 单价 */
private BigDecimal unitPrice;
/** 总价 */
private BigDecimal totalPrice;
}

View File

@@ -1,22 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.openhis.administration.domain.ChargeItem;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 收费项目
*
* @author SunJQ
* @date 2025-03-31
*/
@Data
@Accessors(chain = true)
public class ChargeItemDto extends ChargeItem {
private String typeCode;
}

View File

@@ -1,13 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ChargeItemExtendInfoDto {
private Long orgId;
private String orgName;
private BigDecimal totalPrice;
private String ybType;
}

View File

@@ -1,30 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.openhis.administration.domain.ChargeItem;
import com.openhis.financial.domain.Contract;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
/**
* chargeItem分组
*
* @author SunJQ
* @date 2025-05-08
*/
@Data
@Accessors(chain = true)
public class ChargeItemGroupDto {
/**
* 合同
*/
Contract contract;
/**
* 收费项
*/
List<ChargeItem> chargeItemList;
}

View File

@@ -1,13 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import java.util.List;
@Data
public class ChargeSummaryDto {
private String startTime;
private String endTime;
private List<Long> orgIdList;
}

View File

@@ -1,90 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 预结算结果集
*
* @author SunJQ
* @date 2025-05-08
*/
@Data
@Accessors(chain = true)
public class Clinic2206OrderResultDto {
@JSONField(name = "medfee_sumamt")
private BigDecimal medfeeSumamt; // 医疗费总额
@JSONField(name = "fulamt_ownpay_amt")
private BigDecimal fulamtOwnpayAmt; // 全自费金额
@JSONField(name = "overlmt_selfpay")
private BigDecimal overlmtSelfpay; // 超限价自费费用
@JSONField(name = "preselfpay_amt")
private BigDecimal preselfpayAmt; // 先行自付金额
@JSONField(name = "inscp_scp_amt")
private BigDecimal inscpScpAmt; // 符合政策范围金额
@JSONField(name = "act_pay_dedc")
private BigDecimal actPayDedc; // 实际支付起付线
@JSONField(name = "hifp_pay")
private BigDecimal hifpPay; // 基本医疗保险统筹基金支出
@JSONField(name = "pool_prop_selfpay")
private BigDecimal poolPropSelfpay; // 基本医疗保险统筹基金支付比例
@JSONField(name = "cvlserv_pay")
private BigDecimal cvlservPay; // 公务员医疗补助资金支出
@JSONField(name = "hifes_pay")
private BigDecimal hifesPay; // 企业补充医疗保险基金支出
@JSONField(name = "hifmi_pay")
private BigDecimal hifmiPay; // 居民大病保险资金支出
@JSONField(name = "hifob_pay")
private BigDecimal hifobPay; // 职工大额医疗费用补助基金支出
@JSONField(name = "maf_pay")
private BigDecimal mafPay; // 医疗救助基金支出
@JSONField(name = "oth_pay")
private BigDecimal othPay; // 其他支出
@JSONField(name = "fund_pay_sumamt")
private BigDecimal fundPaySumamt; // 基金支付总额
@JSONField(name = "psn_part_amt")
private BigDecimal psnPartAmt; // 个人负担总金额
@JSONField(name = "acct_pay")
private BigDecimal acctPay; // 个人账户支出
@JSONField(name = "psn_cash_pay")
private BigDecimal psnCashPay; // 个人现金支出
@JSONField(name = "hosp_part_amt")
private BigDecimal hospPartAmt; // 医院负担金额
@JSONField(name = "hifdm_pay")
private BigDecimal hifdmPay;
@JSONField(name = "acct_mulaid_pay")
private BigDecimal acctMulaidPay; // 个人账户共济支付金额
private String chrgBchno;//收费批次号
private Long accountId;//账户id
private String medType;//医疗类型
}

View File

@@ -1,15 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import com.openhis.yb.dto.Clinic2207OrderResult;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@Getter
@Setter
@Accessors(chain = true)
public class Clinic2207OrderResultDto extends Clinic2207OrderResult {
private Long accountId;
}

View File

@@ -1,75 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.alibaba.fastjson2.annotation.JSONField;
import com.openhis.yb.dto.Clinic2206FundPaymentResult;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 结算基础信息
*
* @author SunJQ
* @date 2025-05-08
*/
@Data
@Accessors(chain = true)
public class Clinic2207OrderResultInfoDto {
// 主键字段
@JSONField(name = "mdtrt_id")
private String mdtrtId; // 就诊ID
@JSONField(name = "psn_no")
private String psnNo; // 人员编号
@JSONField(name = "psn_name")
private String psnName; // 人员姓名
@JSONField(name = "psn_cert_type")
private String psnCertType; // 人员证件类型
@JSONField(name = "certno")
private String certno; // 证件号码
@JSONField(name = "gend")
private String gend; // 性别
@JSONField(name = "naty")
private String naty; // 民族
@JSONField(name = "brdy")
private Date brdy; // 出生日期
@JSONField(name = "age")
private BigDecimal age; // 年龄
@JSONField(name = "insutype")
private String insutype; // 险种类型
@JSONField(name = "psn_type")
private String psnType; // 人员类别
@JSONField(name = "cvlserv_flag")
private String cvlservFlag; // 公务员标志
@JSONField(name = "setl_time")
private Date setlTime; // 结算时间
@JSONField(name = "mdtrt_cert_type")
private String mdtrtCertType; // 就诊凭证类型
@JSONField(name = "med_type")
private String medType; // 医疗类别
@JSONField(name = "medins_setl_id")
private String medinsSetlId; // 医药机构结算ID 存放发送方报文ID
@JSONField(name = "setldetail")
private List<Clinic2206FundPaymentResult> setldetail;// 结算详细信息
}

View File

@@ -1,28 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 发放数量 dto
*
* @author zwh
* @date 2025-06-04
*/
@Data
@Accessors(chain = true)
public class DispenseQuantityDto {
/*
* 本次结算应上传最小包装药品追溯码数量
*/
private Integer minpacuntDrugTracCnt;
/*
* 本次结算应上传耗材追溯码数量
*/
private Integer mcsTracCnt;
}

View File

@@ -1,18 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
@Data
public class EleInvioceBillDto {
JSONObject jsonObject;
String endpoint;
String baseUrl;
String appID;
String appKey;
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 收费项目明细
*
* @author yuxj
* @date 2025-04-22
*/
@Data
@Accessors(chain = true)
public class EleInvoiceChargeDetailDto {
// 医疗收费项目类别;
private String ybType;
// 数量
private Integer number;
// 金额
private BigDecimal amt;
// 自费金额
private BigDecimal selfAmt;
// 收费项目名称
private String chargeName;
// 收费项目代码
private String chargeCode;
}

View File

@@ -1,46 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 清单项目明细
*
* @author yuxj
* @date 2025-04-22
*/
@Data
@Accessors(chain = true)
public class EleInvoiceListDetailDto {
// 明细流水号
private Long listDetailNo;
// 医疗收费项目类别;
private String ybType;
// 药品编码
private String code;
// 药品名称
private String name;
// 医保项目编码
private String ybCode;
// 计量单位
private String unit;
// 单价
private BigDecimal std;
// 数量
private Integer number;
// 金额
private BigDecimal amt;
// 自费金额
private BigDecimal selfAmt;
// 医保药品分类
private Integer medicalCareType;
// 收费项目名称
private String chargeName;
// 收费项目代码
private String chargeCode;
}

View File

@@ -1,76 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 患者信息
*
* @author yuxj
* @date 2025-04-22
*/
@Data
@Accessors(chain = true)
public class EleInvoicePatientInfoDto {
// 患者id
private Long payerId;
// 患者姓名
private String payer;
// 患者院内编码/病历号
private String caseNumber;
// 性别
private Integer genderEnum;
private String genderEnumEnumText;
private String genderEnum_enumText;
// 生日
private Date birthDate;
// 电话
private String tel;
// 身份证号
private String cardNo;
// 就诊编码
private String encounterBusNo;
// 就诊日期
private String consultationDate;
// 住院日期
private String inHospitalDate;
// 出院日期
private String outHospitalDate;
// 就诊科室名称
private String patientCategory;
// 就诊科室编码
private String patientCategoryCode;
// 医疗机构类型
private String medicalInstitution;
// 医保区域编码
private String medCareAreaCode;
// 入院科室编码
private String categoryCode;
// 入院科室名称
private String category;
// 出院科室编码
private String leaveCategoryCode;
// 出院科室名称
private String leaveCategory;
}

View File

@@ -1,63 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 付款信息
*
* @author yuxj
* @date 2025-04-22
*/
@Data
@Accessors(chain = true)
public class EleInvoicePaymentInfoDto {
// 付款状态
private Integer paymentStatus;
// 发票id
private Long invoiceId;
// 发票状态
private Integer invoiceStatus;
// 结算id
private Long paymentId;
// 支付的业务标识符(用于显示,支付流水号)
private String busNo;
// 收费员
private String payee;
// 开票总金额
private BigDecimal totalAmt;
// 个人现金支付金额
private BigDecimal rmbCashPayAmount;
// 个人现金支付金额(微信)
private BigDecimal wxPayAmount;
// 个人现金支付金额(支付宝)
private BigDecimal aliPayAmount;
// 个人现金支付金额(银联)
private BigDecimal debitPayAmount;
// 个人医保账户支付
private BigDecimal zhPayAmount;
// 基金支付总额
private BigDecimal ybFundPayAmount;
// 其他(如医院负担金额)
private BigDecimal otherPayAmount;
// 账户共济支付金额
private BigDecimal aelfYbZhGjValue;
// 付款账单集合
private String chargeItemIds;
//结算时间
private String billDate;
}

View File

@@ -1,73 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.openhis.common.enums.InvoiceStatus;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 返回信息
*
* @author yuxj
* @date 2025-04-22
*/
@Data
@Accessors(chain = true)
public class EleInvoiceResultDto {
private Long id;
/** 患者ID */
private Long patientId;
/** 状态 */
private InvoiceStatus statusEnum;
/** 类别 */
private String typeCode;
/** 取消原因 */
private String cancelledReason;
/** 收费项 */
private String chargeItemIds;
/** 发票净额总记 */
private BigDecimal totalNet;
/** 发票总计金额 */
private BigDecimal totalGross;
/** 付款详情 */
private String paymentTerms;
/** 账单批次号 */
private String batchCode;
/** 结算批次号 */
private String qrCode;
/** 发票编号 */
private String busNo;
/** 开票员 */
private Long invoicingStaffId;
/** 电子票据代码 */
private String billBatchCode;
/** 电子票据号码 */
private String billNo;
/** 电子校验码 */
private String random;
/** 电子票据生成时间 */
private String billCreateTime;
/** 电子票据二维码图片数据 */
private String billQrCode;
/** 电子票据H5页面URL */
private String pictureUrl;
/** 电子票据外网H5页面URL */
private String pictureNetUrl;
}

View File

@@ -1,312 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.openhis.yb.dto.Clinic2206FundPaymentResult;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* TODO:请概括描述当前类的主要用途和注意事项
*
* @author SunJQ
* @date 2025-08-11
*/
@Data
@Accessors(chain = true)
public class InpatientPreSettleDto {
/**
* 就诊ID
*/
@JsonProperty("mdtrt_id")
private String mdtrtId;
/**
* 人员编号
*/
@JsonProperty("psn_no")
private String psnNo;
/**
* 人员姓名
*/
@JsonProperty("psn_name")
private String psnName;
/**
* 人员证件类型
*/
@JsonProperty("psn_cert_type")
private String psnCertType;
/**
* 证件号码
*/
@JsonProperty("certno")
private String certno;
/**
* 性别
*/
@JsonProperty("gend")
private String gend;
/**
* 民族
*/
@JsonProperty("naty")
private String naty;
/**
* 出生日期 格式yyyy-MM-dd
*/
@JsonProperty("brdy")
private Date brdy;
/**
* 年龄
*/
@JsonProperty("age")
private BigDecimal age;
/**
* 险种类型
*/
@JsonProperty("insutype")
private String insutype;
/**
* 人员类别
*/
@JsonProperty("psn_type")
private String psnType;
/**
* 公务员标志
*/
@JsonProperty("cvlserv_flag")
private String cvlservFlag;
/**
* 结算时间 格式yyyy-MM-dd HH:mm:ss
*/
@JsonProperty("setl_time")
private Date setlTime;
/**
* 就诊凭证类型
*/
@JsonProperty("mdtrt_cert_type")
private String mdtrtCertType;
/**
* 医疗类别
*/
@JsonProperty("med_type")
private String medType;
/**
* 医疗费总额
*/
@JsonProperty("medfee_sumamt")
private BigDecimal medfeeSumamt;
/**
* 全自费金额
*/
@JsonProperty("fulamt_ownpay_amt")
private BigDecimal fulamtOwnpayAmt;
/**
* 超限价自费费用
*/
@JsonProperty("overlmt_selfpay")
private BigDecimal overlmtSelfpay;
/**
* 先行自付金额
*/
@JsonProperty("preselfpay_amt")
private BigDecimal preselfpayAmt;
/**
* 符合政策范围金额
*/
@JsonProperty("inscp_scp_amt")
private BigDecimal inscpScpAmt;
/**
* 实际支付起付线
*/
@JsonProperty("act_pay_dedc")
private BigDecimal actPayDedc;
/**
* 基本医疗保险统筹基金支出
*/
@JsonProperty("hifp_pay")
private BigDecimal hifpPay;
/**
* 基本医疗保险统筹基金支付比例
*/
@JsonProperty("pool_prop_selfpay")
private BigDecimal poolPropSelfpay;
/**
* 公务员医疗补助资金支出
*/
@JsonProperty("cvlserv_pay")
private BigDecimal cvlservPay;
/**
* 企业补充医疗保险基金支出
*/
@JsonProperty("hifes_pay")
private BigDecimal hifesPay;
/**
* 居民大病保险资金支出
*/
@JsonProperty("hifmi_pay")
private BigDecimal hifmiPay;
/**
* 职工大额医疗费用补助基金支出
*/
@JsonProperty("hifob_pay")
private BigDecimal hifobPay;
/**
* 医疗救助基金支出
*/
@JsonProperty("maf_pay")
private BigDecimal mafPay;
/**
* 其他支出
*/
@JsonProperty("oth_pay")
private BigDecimal othPay;
/**
* 基金支付总额
*/
@JsonProperty("fund_pay_sumamt")
private BigDecimal fundPaySumamt;
/**
* 个人负担总金额
*/
@JsonProperty("psn_part_amt")
private BigDecimal psnPartAmt;
/**
* 个人账户支出
*/
@JsonProperty("acct_pay")
private BigDecimal acctPay;
/**
* 个人现金支出
*/
@JsonProperty("psn_cash_pay")
private BigDecimal psnCashPay;
/**
* 医院负担金额
*/
@JsonProperty("hosp_part_amt")
private BigDecimal hospPartAmt;
/**
* 余额
*/
@JsonProperty("balc")
private BigDecimal balc;
/**
* 个人账户共济支付金额
*/
@JsonProperty("acct_mulaid_pay")
private BigDecimal acctMulaidPay;
/**
* 医药机构结算ID 存放发送方报文ID
*/
@JsonProperty("medins_setl_id")
private String medinsSetlId;
/**
* 清算经办机构
*/
@JsonProperty("clr_optins")
private String clrOptins;
/**
* 清算方式
*/
@JsonProperty("clr_way")
private String clrWay;
/**
* 清算类别
*/
@JsonProperty("clr_type")
private String clrType;
/**
* 伤残人员医疗保障基金支出 1.5.4新增
*/
@JsonProperty("hifdm_pay")
private BigDecimal hifdmPay;
@JSONField(name = "setldetail")
private List<Clinic2206FundPaymentResult> setldetail;
/**
* 账户id
*/
private Long accountId;
public InpatientPreSettleDto() {
this.medfeeSumamt = BigDecimal.ZERO;
this.fulamtOwnpayAmt = BigDecimal.ZERO;
this.overlmtSelfpay = BigDecimal.ZERO;
this.preselfpayAmt = BigDecimal.ZERO;
this.inscpScpAmt = BigDecimal.ZERO;
this.actPayDedc = BigDecimal.ZERO;
this.hifpPay = BigDecimal.ZERO;
this.poolPropSelfpay = BigDecimal.ZERO;
this.cvlservPay = BigDecimal.ZERO;
this.hifesPay = BigDecimal.ZERO;
this.hifmiPay = BigDecimal.ZERO;
this.hifobPay = BigDecimal.ZERO;
this.mafPay = BigDecimal.ZERO;
this.othPay = BigDecimal.ZERO;
this.fundPaySumamt = BigDecimal.ZERO;
this.psnPartAmt = BigDecimal.ZERO;
this.acctPay = BigDecimal.ZERO;
this.psnCashPay = BigDecimal.ZERO;
this.hospPartAmt = BigDecimal.ZERO;
this.balc = BigDecimal.ZERO;
this.acctMulaidPay = BigDecimal.ZERO;
this.hifdmPay = BigDecimal.ZERO;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
}

View File

@@ -1,48 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.openhis.financial.domain.PaymentReconciliation;
import com.openhis.financial.model.PaymentRecDetailDto;
import lombok.Data;
import java.util.List;
/**
* 住院预结算回显数据
*
* @author SunJQ
* @date 2025-08-11
*/
@Data
public class InpatientPreSettleResultDto {
/**
* 收费详情
*/
List<PaymentRecDetailDto> paymentRecDetailDtoList;
/**
* 付款实体业务payment
*/
PaymentReconciliation paymentReconciliation;
/**
* 付款实体(多退少补)
*/
PaymentReconciliation newPayment;
/**
* 付款实体(预交金)
*/
PaymentReconciliation oldPayment;
/**
* 付款id业务单
*/
private String id;// paymentId
/**
* 付款id(预交金原单)
*/
private String oldId;
/**
* 付款id(多退少补单)
*/
private String newId;
}

View File

@@ -1,106 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
/**
* 电子发票基础信息查询实体
*
* @author SunJQ
* @date 2025-05-09
*/
@Data
@Accessors(chain = true)
public class InvoiceBaseInfoDto {
// 主键
@TableId(type = IdType.ASSIGN_ID)
@JSONField(serialize = false)
private String id;
private String setlId;// 结算id
private String mdtrtId; // 就诊ID
private String psnName; // 人员姓名
private String psnCertType; // 人员证件类型
private String certno; // 证件号码
private String insutype; // 险种类型
private String psnType; // 人员类别
private String cvlservFlag; // 公务员标志
private Date setlTime; // 结算时间
private String mdtrtCertType; // 就诊凭证类型
private String medType; // 医疗类别
private BigDecimal medfeeSumamt; // 医疗费总额
private BigDecimal fulamtOwnpayAmt; // 全自费金额
private BigDecimal overlmtSelfpay; // 超限价自费费用
private BigDecimal preselfpayAmt; // 先行自付金额
private BigDecimal inscpScpAmt; // 符合政策范围金额
private BigDecimal actPayDedc; // 实际支付起付线
private BigDecimal hifpPay; // 基本医疗保险统筹基金支出
private BigDecimal poolPropSelfpay; // 基本医疗保险统筹基金支付比例
private BigDecimal cvlservPay; // 公务员医疗补助资金支出
private BigDecimal hifesPay; // 企业补充医疗保险基金支出
private BigDecimal hifmiPay; // 居民大病保险资金支出
private BigDecimal hifobPay; // 职工大额医疗费用补助基金支出
private BigDecimal mafPay; // 医疗救助基金支出
private BigDecimal othPay; // 其他支出
private BigDecimal fundPaySumamt; // 基金支付总额
private BigDecimal psnPartAmt; // 个人负担总金额
private BigDecimal acctPay; // 个人账户支出
private BigDecimal psnCashPay; // 个人现金支出
private BigDecimal hospPartAmt; // 医院负担金额
private BigDecimal balc; // 余额
private BigDecimal acctMulaidPay; // 个人账户共济支付金额
private String medinsSetlId; // 医药机构结算ID
private String clrOptins; // 清算经办机构
private String clrWay; // 清算方式
private String clrType; // 清算类别
private BigDecimal hifdmPay; // 伤残人员医疗保障基金支出
private String paymentNo;// 结算业务流水号 Payment与ClinicSettle是1N
private BigDecimal gfRatio; // 伤残人员医疗保障基金支出
}

View File

@@ -1,9 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
@Data
public class InvoiceWriteOffDto {
private String paymentId;
private String reason;
}

View File

@@ -1,9 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
@Data
public class MakeInvoiceDto {
private Long paymentId;
private Long encounterId;
}

View File

@@ -1,37 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 师大Bpc支付入参
*
* @author SunJQ
* @date 2025-10-28
*/
@Data
@Accessors(chain = true)
public class NenuBpcPayDto {
/**
* 二维码
*/
private String bpcCode;
/**
* 金额
*/
private BigDecimal bpcPayAmount;
/**
* 付款id
*/
private Long paymentId;
/**
* 序号
*/
private Long index;
}

View File

@@ -1,55 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
@Getter
@Setter
public class OrgIncomeDto {
/**
* 人次
*/
private Integer personCnt;
/**
* 应收
*/
private BigDecimal amount;
/**
* 实收
*/
private BigDecimal receivedAmount;
/**
* 药品金额
*/
private BigDecimal medFee;
/**
* 处置费
*/
private BigDecimal serviceFee;
/**
* 耗材费
*/
private BigDecimal deviceFee;
// private BigDecimal receivedAmount;
/**
* 挂号费
*/
private BigDecimal registrationFee;
/**
* 科室名称
*/
private String orgName;
public OrgIncomeDto() {
this.personCnt = 0;
this.amount = BigDecimal.ZERO;
this.receivedAmount = BigDecimal.ZERO;
this.medFee = BigDecimal.ZERO;
this.serviceFee = BigDecimal.ZERO;
this.registrationFee = BigDecimal.ZERO;
this.deviceFee = BigDecimal.ZERO;
// this.orgName = orgName;
}
}

View File

@@ -1,19 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@Accessors(chain = true)
public class PaymentSettleDto {
private Date endTime;
private Date startTime;
private Long enterId;
private String contractNo;
}

View File

@@ -1,96 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.annotation.Dict;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 映射对象
*
* @author SunJQ
* @date 2025-05-06
*/
@Data
public class PaymentVO {
/** ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long id;// 付款id
/** 状态 */
@Dict(dictCode = "payment_status")
private Integer statusEnum;
private String statusEnum_dictText;// 状态
/** 支付的业务标识符 */
private String paymentNo;// 业务流水
/** 付费/退款 */
@Dict(dictCode = "payment_enum")
private String paymentEnum;// 付费/退款
private String paymentEnum_dictText;
/** 关联ID */
private Long relationId;
private String relationIdStr;
/** 收款员 */
private Long entererId;// 收款员
/** 收款员 */
private String entererName;// 收款员
/** 支付的患者ID */
private Long patientId;// 支付患者
/** 支付的患者 */
private String patientName;// 支付患者
/** 付款结果 */
@Dict(dictCode = "outcome_enum")
private Integer outcomeEnum;// 付款结果
private String outcomeEnum_dictText;
/** 应收金额 */
private BigDecimal tenderedAmount;// 应收
/** 找零金额 */
private BigDecimal returnedAmount;// 找零
/** 付款总额 */
private BigDecimal displayAmount;// 付款总额
/** 打印标识 */
private Integer printCount;// 打印标志
/** 结算时间 */
private Date billDate;// 结算时间
/** 发票编号 */
@JsonSerialize(using = ToStringSerializer.class)
private Long invoiceId;// 发票id
/** 发票no */
private String invoiceNo;// 发票no
/** 发票no */
private String encounterBusNo;// 发票no
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;// 就诊id
private String encounterIdStr;// 就诊id
@JsonSerialize(using = ToStringSerializer.class)
private String paymentId;// 付款id
private String ybSettleIds;// 医保付款id
private Integer invoiceStatus;// 发票状态
}

View File

@@ -1,21 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class ReportVo {
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;// 开始时间
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;// 结束时间
private Long entererId;// 收款员
}

View File

@@ -1,16 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* 日结单返回实体
*/
@Data
public class ReturnBillVO {
private String paymentNo;//收费单
private BigDecimal totalAmount;//应收
private BigDecimal paidAmount;//实收
private String invoiceNo;//发票编号
}

View File

@@ -1,22 +0,0 @@
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;
@Data
public class ThreePartCallBackVo extends ThreePartPayCallBack {
@JsonSerialize(using = ToStringSerializer.class)
private String idStr;
/*
* 患者名称
*/
private String patientName;
/*
* 支付单号
*/
private String paymentNo;
}

View File

@@ -1,18 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import java.util.List;
@Data
public class ThreePartCompareDto {
/**
* 待比较的付款单
*/
private List<ThreePartComparePaymentDto> payments;
/**
* 待比较的付款请求
*/
private List<ThreePartCompareRequestDto> paymentRequests;
}

View File

@@ -1,29 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
@Data
public class ThreePartComparePaymentDto {
@JsonSerialize(using = ToStringSerializer.class)
private Long paymentId;// 支付单id
private String paymentNo;// 支付单号
private String patientName;// 患者名称
private BigDecimal tenderedAmount;// 应收
private BigDecimal paidAmount;// 实收
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date billDate;// 支付时间
}

View File

@@ -1,17 +0,0 @@
package com.openhis.web.paymentmanage.dto;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ThreePartCompareRequestDto {
private Long requestId;// 请求ID
private String paymentId;//paymentId
private BigDecimal amount;//请求金额
private String requestType;//退or付款
}

View File

@@ -1,19 +0,0 @@
package com.openhis.web.paymentmanage.mapper;
import com.openhis.medication.domain.MedicationDefinition;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* Desc:
* @Author raymond
* @Date 14:37 2025/10/15
* @return
**/
@Component
public interface ChangePriceMapper {
List<MedicationDefinition> searchMedicationList();
}

View File

@@ -1,17 +0,0 @@
package com.openhis.web.paymentmanage.mapper;
import com.openhis.web.paymentmanage.dto.ChargeItemExtendInfoDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public interface ChargeBillMapper {
/**
* 获取收费项的统计信息
* @param chargeItemIds 收费项的ID
* @return 查询信息
*/
List<ChargeItemExtendInfoDto> selectChargeItemExtendInfoList(@Param("list") List<Long> chargeItemIds, @Param("orgIdList")List<Long> orgIdList);
}

View File

@@ -1,78 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.mapper;
import com.openhis.web.paymentmanage.dto.EleInvoiceChargeDetailDto;
import com.openhis.web.paymentmanage.dto.EleInvoiceListDetailDto;
import com.openhis.web.paymentmanage.dto.EleInvoicePatientInfoDto;
import com.openhis.web.paymentmanage.dto.EleInvoicePaymentInfoDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 电子发票
*
* @author yuxj
* @date 2025-04-22
*/
public interface EleInvoiceMapper {
/**
* 获取付款信息
*
* @param paymentId 付款ID
* @param encounterId 就诊ID
*/
EleInvoicePaymentInfoDto getPaymentInfo(@Param("paymentId") Long paymentId,@Param("encounterId") Long encounterId,@Param("selfYbZhPay") Integer selfYbZhPay, @Param("selfCashPay") Integer selfCashPay,
@Param("selfCashVxValue") Integer selfCashVxValue, @Param("selfCashAliValue") Integer selfCashAliValue,
@Param("selfCashUnionValue") Integer selfCashUnionValue, @Param("ybFundPay") Integer ybFundPay, @Param("otherPay") Integer otherPay, @Param("selfYbZhGjValue") Integer selfYbZhGjValue);
/**
* 获取患者信息
*
* @param encounterId 就诊ID
* @param encClassEnum 类别编码
* @param orgClassEnum 类别编码
*/
EleInvoicePatientInfoDto getPatientInfo(@Param("encounterId") Long encounterId,
@Param("encClassEnum") Integer encClassEnum, @Param("orgClassEnum") Integer orgClassEnum);
/**
* 获取收费项目明细
*
* @param encounterId 就诊ID
* @param ybTypeList 医疗收费项目类别
* @param chrgitmType 字典类型
* @param contrastType 对照类型
*/
List<EleInvoiceChargeDetailDto> getChargeDetail(@Param("encounterId") Long encounterId,
@Param("ybTypeList") List<String> ybTypeList, @Param("chrgitmType") String chrgitmType,
@Param("contrastType") Integer contrastType,@Param("chargeItemIds") List<Long> chargeItemIds);
/**
* 获取清单项目明细
*
* @param encounterId 就诊ID
* @param ybTypeList 医疗收费项目类别
* @param chrgitmType 字典类型
* @param contrastType 对照类型
*/
List<EleInvoiceListDetailDto> getListDetail(@Param("encounterId") Long encounterId,
@Param("ybTypeList") List<String> ybTypeList, @Param("chrgitmType") String chrgitmType,
@Param("contrastType") Integer contrastType,@Param("chargeItemIds") List<Long> chargeItemIds);
/**
* 获取挂号清单项目明细
*
* @param encounterId 就诊ID
* @param ybTypeList 医疗收费项目类别
* @param chrgitmType 字典类型
* @param contrastType 对照类型
*/
List<EleInvoiceListDetailDto> getRegListDetail(@Param("encounterId") Long encounterId,
@Param("ybTypeList") List<String> ybTypeList, @Param("chrgitmType") String chrgitmType,
@Param("contrastType") Integer contrastType,@Param("chargeItemIds") List<Long> chargeItemIds);
}

View File

@@ -1,86 +0,0 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.paymentmanage.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.paymentmanage.dto.ChargeItemDto;
import com.openhis.web.paymentmanage.dto.DispenseQuantityDto;
import com.openhis.web.paymentmanage.dto.PaymentVO;
import com.openhis.web.paymentmanage.dto.ThreePartCallBackVo;
import com.openhis.yb.dto.PaymentDetailDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 付款Dao
*
* @author SunJQ
* @date 2025-03-29
*/
@Repository
public interface PaymentMapper {
/**
* 付款列表
*
* @param page
* @param queryWrapper
* @return
*/
IPage<PaymentVO> getPage(@Param("page") Page<Object> page, @Param("kindEnum") Integer kindEnum, @Param("invoiceNo") String invoiceNo,
@Param(Constants.WRAPPER) QueryWrapper<PaymentVO> queryWrapper);
/**
* 付款详情
*
* @param id
* @return
*/
List<PaymentDetailDto> getPaymentDetailList(@Param("id") Long id);
/**
* 查找某一类型的chargeItem
*
* @param collect
* @param s
*/
List<ChargeItemDto> getChargeItemList(@Param("collect") String collect, @Param("s") String s);
/**
* 查找chargeItem集合
*
* @param collect
*/
List<ChargeItemDto> getChargeItems(@Param("collect") String collect);
/**
* 根据就诊ID查找收费项
*
* @param encounterId
* @return
*/
List<ChargeItemDto> getChargeItemListByEncounterId(Long encounterId);
/**
* 查询发放数量
*
* @param chargeItemIds 收费项ids
* @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

@@ -1,28 +0,0 @@
package com.openhis.web.paymentmanage.mapper;
import com.openhis.web.paymentmanage.dto.ThreePartComparePaymentDto;
import com.openhis.web.paymentmanage.dto.ThreePartCompareRequestDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@Repository
public interface ThreePartPayMapper {
/**
* 获取支付数据
* @param startTime
* @param endTime
* @return
*/
List<ThreePartComparePaymentDto> getThreePartComparePaymentDtoList(@Param("startTime") String startTime,@Param("endTime") String endTime);
/**
* 获取第三方支付请求数据
* @param paymentIds
* @return
*/
List<ThreePartCompareRequestDto> getThreePartCompareRequestDtoList(@Param("paymentIds")List<Long> paymentIds);
}

View File

@@ -1,45 +0,0 @@
package com.openhis.web.paymentmanage.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* 加密工具类
*
* @author
*
*/
public class MD5Util {
/**
* md5加密
*
* @param str
* @return
*/
public static String md5(String str) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
byte[] byteDigest = md.digest();
int i;
StringBuffer buf = new StringBuffer("");
for (int offset = 0; offset < byteDigest.length; offset++) {
i = byteDigest[offset];
if (i < 0)
i += 256;
if (i < 16)
buf.append("0");
buf.append(Integer.toHexString(i));
}
// 32位加密
return buf.toString();
// 16位的加密
// return buf.toString().substring(8, 24);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
}
}

View File

@@ -1,30 +0,0 @@
package com.openhis.web.paymentmanage.util;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
@Configuration
@ConfigurationProperties(prefix = "mapping.reverse-mappings")
@Data
public class ReverseMappingProperties {
private Map<String, Map<String, String>> reverseMappings = new HashMap<>();
/**
* 获取特定业务类型的映射配置
*/
public Map<String, String> getMappingConfig(String businessType) {
return reverseMappings.getOrDefault(businessType, new HashMap<>());
}
/**
* 获取所有映射配置
*/
public Map<String, Map<String, String>> getAllMappings() {
return reverseMappings;
}
}