付款模块
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.payment.appservice;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.financial.domain.PaymentRecDetail;
|
||||||
|
import com.openhis.financial.domain.PaymentReconciliation;
|
||||||
|
import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordDto;
|
||||||
|
import com.openhis.web.payment.dto.PaymentDetailDto;
|
||||||
|
import com.openhis.web.payment.dto.PaymentDto;
|
||||||
|
|
||||||
|
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 paymentDto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<?> cancelPayment(PaymentDto paymentDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付列表
|
||||||
|
* @param searchKey
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<PaymentDto> getPage(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||||
|
|
||||||
|
List<PaymentDetailDto> getDetail(PaymentDto paymentDto);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.payment.appservice.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
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.utils.AgeCalculatorUtil;
|
||||||
|
import com.core.common.utils.AssignSeqUtil;
|
||||||
|
import com.core.common.utils.DateUtils;
|
||||||
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
|
import com.openhis.common.constant.CommonConstants;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.*;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.financial.domain.Contract;
|
||||||
|
import com.openhis.financial.domain.PaymentRecDetail;
|
||||||
|
import com.openhis.financial.domain.PaymentReconciliation;
|
||||||
|
import com.openhis.financial.service.IContractService;
|
||||||
|
import com.openhis.financial.service.IPaymentRecDetailService;
|
||||||
|
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||||
|
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto;
|
||||||
|
import com.openhis.web.payment.appservice.IPaymentRecService;
|
||||||
|
import com.openhis.web.payment.dto.PaymentDetailDto;
|
||||||
|
import com.openhis.web.payment.dto.PaymentDto;
|
||||||
|
import com.openhis.web.payment.mapper.PaymentMapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款应用层Service
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class PaymentRecServiceImpl implements IPaymentRecService {
|
||||||
|
@Resource
|
||||||
|
IPaymentReconciliationService paymentReconciliationService;
|
||||||
|
@Resource
|
||||||
|
IPaymentRecDetailService paymentRecDetailService;
|
||||||
|
@Resource
|
||||||
|
IContractService contractService;
|
||||||
|
@Resource
|
||||||
|
AssignSeqUtil assignSeqUtil;
|
||||||
|
@Resource
|
||||||
|
PaymentMapper paymentMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public R<?> savePayment(PaymentDto paymentDto) {
|
||||||
|
Contract contract = contractService.getOne(new LambdaQueryWrapper<Contract>().eq(Contract::getBusNo, paymentDto.getContractNo()));
|
||||||
|
if (contract == null) {
|
||||||
|
//todo:sjq 返回提示信息
|
||||||
|
R.fail();
|
||||||
|
}
|
||||||
|
Category categoryEnum = Category.getByValue(contract.getCategoryEnum());
|
||||||
|
//todo:sjq 医保支付与普通门诊支付多2207操作
|
||||||
|
switch (categoryEnum) {
|
||||||
|
case SELF:
|
||||||
|
case PUBLIC:
|
||||||
|
return normalCharge(paymentDto);
|
||||||
|
case PROVINCIAL_INSURANCE:
|
||||||
|
case MUNICIPAL_INSURANCE:
|
||||||
|
return insuranceCharge(paymentDto);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保支付
|
||||||
|
* @param paymentDto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private R<?> insuranceCharge(PaymentDto paymentDto) {
|
||||||
|
normalCharge(paymentDto);
|
||||||
|
//todo:sjq 调用2207
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自费支付
|
||||||
|
* @param paymentDto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private R<?> normalCharge(PaymentDto paymentDto) {
|
||||||
|
//获取参数
|
||||||
|
List<PaymentDetailDto> paymentDetails = paymentDto.getPaymentDetails();
|
||||||
|
PaymentReconciliation paymentReconciliation = new PaymentReconciliation();
|
||||||
|
BigDecimal sum = BigDecimal.ZERO;
|
||||||
|
//数额校验
|
||||||
|
ArrayList<PaymentRecDetail> paymentRecDetails = new ArrayList<>();
|
||||||
|
for (PaymentDetailDto paymentDetail : paymentDetails) {
|
||||||
|
PaymentRecDetail paymentRecDetail = new PaymentRecDetail();
|
||||||
|
BeanUtils.copyProperties(paymentDetail,paymentRecDetail);
|
||||||
|
paymentRecDetail.setPredecessorId(paymentReconciliation.getId());
|
||||||
|
paymentRecDetail.setAccountId(paymentDetail.getAccountId()==null?0:paymentDetail.getAccountId());
|
||||||
|
paymentRecDetail.setResultEnum(PaymentResult.PAID.getValue());
|
||||||
|
paymentRecDetails.add(paymentRecDetail);
|
||||||
|
sum = sum.add(paymentRecDetail.getAmount());
|
||||||
|
}
|
||||||
|
if(sum.compareTo(paymentReconciliation.getTenderedAmount()) != 0){
|
||||||
|
//todo:sjq 返回文字提示:实收金额合计不等于应收金额
|
||||||
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
BeanUtils.copyProperties(paymentDto, paymentReconciliation);
|
||||||
|
paymentReconciliation.setStatusEnum(PaymentStatus.SUCCESS.getValue())
|
||||||
|
.setPaymentNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.PAYMENT_NO.getPrefix(), 20))
|
||||||
|
.setPaymentEnum(PaymentType.PAY.getValue());
|
||||||
|
|
||||||
|
//保存付款
|
||||||
|
paymentReconciliationService.save(paymentReconciliation);
|
||||||
|
|
||||||
|
//保存付款详情
|
||||||
|
paymentRecDetailService.saveBatch(paymentRecDetails);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> cancelPayment(PaymentDto paymentDto) {
|
||||||
|
//todo:sjq 退费方法
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<PaymentDto> getPage(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||||
|
// 构建查询条件
|
||||||
|
QueryWrapper<PaymentDto> queryWrapper =
|
||||||
|
HisQueryUtils.buildQueryWrapper(new PaymentDto(), searchKey,
|
||||||
|
new HashSet<>(Arrays.asList(CommonConstants.FieldName.encouterId,
|
||||||
|
CommonConstants.FieldName.contractNo, CommonConstants.FieldName.paymentNo)),
|
||||||
|
request);
|
||||||
|
|
||||||
|
IPage<PaymentDto> paymentDtoIPage =
|
||||||
|
paymentMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
|
|
||||||
|
//todo:sjq 1.是否联表查询患者名字,收款员姓名等信息 2.赋值
|
||||||
|
// paymentDtoIPage.getRecords().forEach(e -> {
|
||||||
|
// // 性别
|
||||||
|
// e.setKindEnum_enumText(EnumUtils.getInfoByValue(PaymentKind.class, e.getKindEnum()));
|
||||||
|
// // 计算年龄
|
||||||
|
// e.setAgeString(AgeCalculatorUtil.getAge(DateUtils.parseDate(e.getBirthDate())));
|
||||||
|
// });
|
||||||
|
|
||||||
|
return paymentDtoIPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PaymentDetailDto> getDetail(PaymentDto paymentDto) {
|
||||||
|
return paymentMapper.getPaymentDetailList(paymentDto.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.payment.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.web.payment.appservice.IPaymentRecService;
|
||||||
|
import com.openhis.web.payment.dto.PaymentDto;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款管理
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/payment/payment")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PaymentReconciliationController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPaymentRecService paymentReconciliationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款
|
||||||
|
*
|
||||||
|
* @param paymentDto 付款实体
|
||||||
|
*/
|
||||||
|
@PostMapping("/charge")
|
||||||
|
public R<?> savePayment(@Validated @RequestBody PaymentDto paymentDto) {
|
||||||
|
return paymentReconciliationService.savePayment(paymentDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消付款
|
||||||
|
*
|
||||||
|
* @param paymentDto 付款实体
|
||||||
|
*/
|
||||||
|
@PostMapping("/uncharge")
|
||||||
|
public R<?> cancelPayment(@RequestBody PaymentDto paymentDto) {
|
||||||
|
return paymentReconciliationService.cancelPayment(paymentDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付列表
|
||||||
|
* @param searchKey
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/page")
|
||||||
|
public R<?> paymentPage(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request){
|
||||||
|
return R
|
||||||
|
.ok(paymentReconciliationService.getPage(searchKey, pageNo, pageSize, request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付详情
|
||||||
|
* @param paymentDto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/detail")
|
||||||
|
public R<?> paymentDetail(@RequestBody PaymentDto paymentDto){
|
||||||
|
return R.ok(paymentReconciliationService.getDetail(paymentDto));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.payment.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付详情
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class PaymentDetailDto {
|
||||||
|
|
||||||
|
/** 付款类型 */
|
||||||
|
private Integer targetEnum;
|
||||||
|
|
||||||
|
/** 账户 */
|
||||||
|
private Long accountId;
|
||||||
|
|
||||||
|
/** 账户类型 */
|
||||||
|
private Integer accountEnum;
|
||||||
|
|
||||||
|
/** 支付类型 */
|
||||||
|
private Integer payEnum;
|
||||||
|
|
||||||
|
/** 支付类型等级 */
|
||||||
|
private Integer payLevelEnum;
|
||||||
|
|
||||||
|
/** 金额 */
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
/** 找零 */
|
||||||
|
private BigDecimal returnAmount;
|
||||||
|
|
||||||
|
/** 交款 */
|
||||||
|
private BigDecimal chargeAmount;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.payment.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款入参
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class PaymentDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 发起支付的工作流程类别 */
|
||||||
|
@NotNull
|
||||||
|
private Integer kindEnum;
|
||||||
|
private String kindEnum_enumText;
|
||||||
|
|
||||||
|
/** 付款类别 */
|
||||||
|
@NotNull
|
||||||
|
private Integer paymentEnum;
|
||||||
|
private String paymentEnum_enumText;
|
||||||
|
|
||||||
|
/** 收款员 */
|
||||||
|
private Long entererId;
|
||||||
|
|
||||||
|
/** 支付的患者ID */
|
||||||
|
@NotNull
|
||||||
|
private Long patientId;
|
||||||
|
|
||||||
|
/** 应收金额 */
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal tenderedAmount;
|
||||||
|
|
||||||
|
/** 找零金额 */
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal returnedAmount;
|
||||||
|
|
||||||
|
/** 付款总额 */
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal displayAmount;
|
||||||
|
|
||||||
|
/** 合同编码 */
|
||||||
|
@NotNull
|
||||||
|
private String contractNo;
|
||||||
|
|
||||||
|
/** 就诊ID */
|
||||||
|
@NotBlank
|
||||||
|
private Long encounterId;
|
||||||
|
|
||||||
|
/** 收费项 */
|
||||||
|
@NotBlank
|
||||||
|
private String chargeItemIds;
|
||||||
|
|
||||||
|
/** 支付详细 */
|
||||||
|
@NotEmpty
|
||||||
|
private List<PaymentDetailDto> paymentDetails;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.payment.mapper;
|
||||||
|
|
||||||
|
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.openhis.web.payment.dto.PaymentDetailDto;
|
||||||
|
import com.openhis.web.payment.dto.PaymentDto;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款Dao
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
public interface PaymentMapper {
|
||||||
|
/**
|
||||||
|
* 付款列表
|
||||||
|
* @param page
|
||||||
|
* @param queryWrapper
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<PaymentDto> getPage(Page<Object> page, QueryWrapper<PaymentDto> queryWrapper);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PaymentDetailDto> getPaymentDetailList(@Param("id") Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.openhis.web.cliniccharge.mapper.ChargeItemBizMapper">
|
||||||
|
|
||||||
|
<select id="getChargeItemPage" resultType="com.openhis.web.cliniccharge.dto.ChargeItemPageDto">
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,status_enum
|
||||||
|
,patient_id
|
||||||
|
,encounter_id
|
||||||
|
,quantity_value
|
||||||
|
,quantity_unit
|
||||||
|
,unit_price
|
||||||
|
,total_price
|
||||||
|
,service_table
|
||||||
|
,service_id
|
||||||
|
FROM adm_charge_item
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.openhis.web.payment.mapper.PaymentMapper">
|
||||||
|
|
||||||
|
<select id="getPage" resultType="com.openhis.web.payment.dto.PaymentDto">
|
||||||
|
SELECT T1.id,
|
||||||
|
T1.status_enum,
|
||||||
|
T1.relation_id,
|
||||||
|
T1.payment_no,
|
||||||
|
T1.payment_enum,
|
||||||
|
T1.payment_reconciliation_id,
|
||||||
|
T1.kind_enum,
|
||||||
|
T1.enterer_id,
|
||||||
|
T1.issuer_enum,
|
||||||
|
T1.patient_id,
|
||||||
|
T1.practitioner_id,
|
||||||
|
T1.outcome_enum,
|
||||||
|
T1.location_id,
|
||||||
|
T1.expiration_date,
|
||||||
|
T1.tendered_amount,
|
||||||
|
T1.returned_amount,
|
||||||
|
T1.display_amount,
|
||||||
|
T1.print_count,
|
||||||
|
T1.contract_no,
|
||||||
|
T1.charge_item_ids,
|
||||||
|
T1.encouter_id,
|
||||||
|
T1.yb_clear_flag,
|
||||||
|
T1.account_id,
|
||||||
|
T1.tenant_id,
|
||||||
|
T1.delete_flag,
|
||||||
|
T1.create_by,
|
||||||
|
T1.create_time,
|
||||||
|
T1.update_by,
|
||||||
|
T1.update_time
|
||||||
|
FROM (SELECT t.relation_id,
|
||||||
|
t.status_enum,
|
||||||
|
t.payment_no,
|
||||||
|
t.payment_enum,
|
||||||
|
t.payment_reconciliation_id,
|
||||||
|
t.kind_enum,
|
||||||
|
t.enterer_id,
|
||||||
|
t.issuer_enum,
|
||||||
|
t.patient_id,
|
||||||
|
t.practitioner_id,
|
||||||
|
t.outcome_enum,
|
||||||
|
t.location_id,
|
||||||
|
t.expiration_date,
|
||||||
|
t.tendered_amount,
|
||||||
|
t.returned_amount,
|
||||||
|
t.display_amount,
|
||||||
|
t.print_count,
|
||||||
|
t.contract_no,
|
||||||
|
t.charge_item_ids,
|
||||||
|
t.encouter_id,
|
||||||
|
t.yb_clear_flag,
|
||||||
|
t.account_id,
|
||||||
|
t.tenant_id,
|
||||||
|
t.delete_flag,
|
||||||
|
t.create_by,
|
||||||
|
t.create_time,
|
||||||
|
t.update_by,
|
||||||
|
t.update_time
|
||||||
|
FROM fin_payment_reconciliation t
|
||||||
|
WHERE 1 = 1
|
||||||
|
ORDER BY create_time) as T1
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
<select id="getPaymentDetailList" resultType="com.openhis.web.payment.dto.PaymentDetailDto">
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
predecessor_id,
|
||||||
|
target_enum,
|
||||||
|
account_id,
|
||||||
|
account_enum,
|
||||||
|
pay_enum,
|
||||||
|
pay_level_enum,
|
||||||
|
amount,
|
||||||
|
return_amount,
|
||||||
|
charge_amount,
|
||||||
|
pay_trans_no,
|
||||||
|
pay_trans_text,
|
||||||
|
pay_trans_date,
|
||||||
|
before_balance,
|
||||||
|
after_balance,
|
||||||
|
result_enum,
|
||||||
|
tenant_id,
|
||||||
|
delete_flag,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
FROM fin_payment_rec_detail WHERE
|
||||||
|
predecessor_id = #{id}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -166,6 +166,21 @@ public class CommonConstants {
|
|||||||
* 药品id
|
* 药品id
|
||||||
*/
|
*/
|
||||||
String MedicationId = "medication_id";
|
String MedicationId = "medication_id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊Id
|
||||||
|
*/
|
||||||
|
String encouterId = "encouter_id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同编码
|
||||||
|
*/
|
||||||
|
String contractNo = "contract_no";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付流水
|
||||||
|
*/
|
||||||
|
String paymentNo = "payment_no";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -59,7 +59,12 @@ public enum AssignSeqEnum {
|
|||||||
/**
|
/**
|
||||||
* 器材项目编码
|
* 器材项目编码
|
||||||
*/
|
*/
|
||||||
DEVICE_NUM("10", "项目编码", "DD");
|
DEVICE_NUM("10", "项目编码", "DD"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付编码
|
||||||
|
*/
|
||||||
|
PAYMENT_NO("11", "支付编码", "SF");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String info;
|
private final String info;
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Category 合同类别(结算类别)
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum Category {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MEMBER_FIRST
|
||||||
|
*/
|
||||||
|
SELF(0, "自费"),
|
||||||
|
/**
|
||||||
|
* MEMBER_SECOND
|
||||||
|
*/
|
||||||
|
PROVINCIAL_INSURANCE(1, "MEMBER_SECOND"),
|
||||||
|
/**
|
||||||
|
* MEMBER_SECOND
|
||||||
|
*/
|
||||||
|
MUNICIPAL_INSURANCE(1, "MEMBER_SECOND"),
|
||||||
|
/**
|
||||||
|
* MEMBER_SECOND
|
||||||
|
*/
|
||||||
|
PUBLIC(1, "MEMBER_SECOND");
|
||||||
|
@EnumValue
|
||||||
|
private Integer value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
public static Category getByValue(Integer value) {
|
||||||
|
if (value==null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (Category val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付类型
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum Payment {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金支付
|
||||||
|
*/
|
||||||
|
CASH(1, 1, "现金支付"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付
|
||||||
|
*/
|
||||||
|
VX_PAY(2, 1, "微信支付"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝支付
|
||||||
|
*/
|
||||||
|
ALI_PAY(3, 1, "支付宝支付"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银联支付
|
||||||
|
*/
|
||||||
|
UNION_PAY(4, 1, "银联支付"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保账户支付
|
||||||
|
*/
|
||||||
|
YB_ZH_PAY(5, 1, "医保账户支付"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保统筹支付合计
|
||||||
|
*/
|
||||||
|
YB_TC_SUM_PAY(6, 1, "医保统筹支付合计"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保统筹支付
|
||||||
|
*/
|
||||||
|
YB_TC_PAY(7, 2, "医保统筹支付"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保公务员补助
|
||||||
|
*/
|
||||||
|
YB_GWY_PAY(8, 2, "医保公务员补助"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 先行自付金额
|
||||||
|
*/
|
||||||
|
XX_SELF_PAY(9, 2, "先行自付金额"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全自费金额
|
||||||
|
*/
|
||||||
|
ALL_SELF_PAY(10, 2, "先行自付金额"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医疗工伤支付
|
||||||
|
*/
|
||||||
|
YL_GS_PAY(11, 2, "医疗工伤支付"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 老红军支付
|
||||||
|
*/
|
||||||
|
YB_HJ_PAY(12, 2, "老红军支付"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 离休人员医疗保障基金支付金额
|
||||||
|
*/
|
||||||
|
YB_LTX_PAY(13, 2, "离休人员医疗保障基金支付金额"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 居民统筹
|
||||||
|
*/
|
||||||
|
YB_JM_TC_PAY(14, 2, "居民统筹"),
|
||||||
|
/**
|
||||||
|
* 居民大病
|
||||||
|
*/
|
||||||
|
YB_JM_DB_PAY(15, 2, "居民大病"),
|
||||||
|
/**
|
||||||
|
* 补充医疗补助基金支付金额
|
||||||
|
*/
|
||||||
|
YB_BC_PAY(16, 2, "补充医疗补助基金支付金额"),
|
||||||
|
/**
|
||||||
|
* 其他扶贫报销金额
|
||||||
|
*/
|
||||||
|
YB_OTHER_FP_PAY(17, 2, "其他扶贫报销金额"),
|
||||||
|
/**
|
||||||
|
* 健康扶贫医疗基金
|
||||||
|
*/
|
||||||
|
YB_JK_FP_PAY(18, 2, "健康扶贫医疗基金"),
|
||||||
|
/**
|
||||||
|
* 精准脱贫保险金额
|
||||||
|
*/
|
||||||
|
YB_JZ_TP_PAY(19, 2, "精准脱贫保险金额"),
|
||||||
|
/**
|
||||||
|
* 提交医保总额
|
||||||
|
*/
|
||||||
|
YB_SUM_FEE(20, 2, "提交医保总额"),
|
||||||
|
/**
|
||||||
|
* 二乙医疗专项医疗基金支出
|
||||||
|
*/
|
||||||
|
YB_EY_PAY(21, 2, "二乙医疗专项医疗基金支出"),
|
||||||
|
/**
|
||||||
|
* 慢特病支付
|
||||||
|
*/
|
||||||
|
YB_TM_PAY(22, 2, "补充医疗补助基金支付金额"),
|
||||||
|
/**
|
||||||
|
* 定点医疗机构垫支
|
||||||
|
*/
|
||||||
|
YB_ORG_PAY(23, 2, "定点医疗机构垫支"),
|
||||||
|
/**
|
||||||
|
* 起付线公务员返还
|
||||||
|
*/
|
||||||
|
YB_RETURN_GWY_PAY(24, 2, "起付线公务员返还"),
|
||||||
|
/**
|
||||||
|
* 大额理赔金额
|
||||||
|
*/
|
||||||
|
YB_DELP_PAY(25, 2, "大额理赔金额"),
|
||||||
|
/**
|
||||||
|
* 民政救助金额
|
||||||
|
*/
|
||||||
|
YB_MZJZ_PAY(26, 2, "民政救助金额"),
|
||||||
|
/**
|
||||||
|
* 生育基金支付
|
||||||
|
*/
|
||||||
|
BIRTH_TC_PAY_AMOUNT(27, 1, "生育基金支付"),
|
||||||
|
/**
|
||||||
|
* 生育账户支付
|
||||||
|
*/
|
||||||
|
BIRTH_ZH_PAY_AMOUNT(28, 1, "生育账户支付"),
|
||||||
|
/**
|
||||||
|
* 符合范围金额
|
||||||
|
*/
|
||||||
|
YB_FHFW_AMOUNT(29, 2, "符合范围金额"),
|
||||||
|
/**
|
||||||
|
* 财政兜底基金支出
|
||||||
|
*/
|
||||||
|
YB_CZDD_AMOUNT(30, 2, "财政兜底基金支出");
|
||||||
|
@EnumValue
|
||||||
|
private Integer value;
|
||||||
|
private Integer level;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static Payment getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (Payment val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PaymentKind (0: MEMBER_FIRST; 1: MEMBER_SECOND;)
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PaymentKind {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住院存款
|
||||||
|
*/
|
||||||
|
HOSPITAL_DEPOSIT(0, "住院存款"),
|
||||||
|
/**
|
||||||
|
* 门诊收费
|
||||||
|
*/
|
||||||
|
OUTPATIENT_CLINIC(1, "门诊收费"),
|
||||||
|
/**
|
||||||
|
* 住院费用
|
||||||
|
*/
|
||||||
|
INPATIENT_CLINIC(2, "住院费用");
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
private Integer value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
public static PaymentKind getByValue(String value) {
|
||||||
|
if(value==null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (PaymentKind val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PaymentResult (0: MEMBER_FIRST; 1: MEMBER_SECOND;)
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PaymentResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未支付
|
||||||
|
*/
|
||||||
|
UNPAID(0, "未支付"),
|
||||||
|
/**
|
||||||
|
* 已支付
|
||||||
|
*/
|
||||||
|
PAID(1, "已支付"),
|
||||||
|
/**
|
||||||
|
* 已退费
|
||||||
|
*/
|
||||||
|
refunded(-2, "已退费");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
public static PaymentResult getByValue(String value) {
|
||||||
|
if (value==null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (PaymentResult val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PaymentType (0: MEMBER_FIRST; 1: MEMBER_SECOND;)
|
||||||
|
*
|
||||||
|
* @author SunJQ
|
||||||
|
* @date 2025-03-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PaymentType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付费
|
||||||
|
*/
|
||||||
|
PAY(0, "付费"),
|
||||||
|
/**
|
||||||
|
* 退费
|
||||||
|
*/
|
||||||
|
UN_PAY(1, "退费");
|
||||||
|
@EnumValue
|
||||||
|
private Integer value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
public static PaymentType getByValue(String value) {
|
||||||
|
if(value==null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (PaymentType val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user