后端最新版本同步
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.model.PaymentReconciliationAccountDel;
|
||||
|
||||
/**
|
||||
* 付款管理Mapper接口
|
||||
@@ -14,4 +18,19 @@ import com.openhis.financial.domain.PaymentReconciliation;
|
||||
@Repository
|
||||
public interface PaymentReconciliationMapper extends BaseMapper<PaymentReconciliation> {
|
||||
|
||||
/**
|
||||
* 查询实体集合
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param entererId 款员id
|
||||
* @param contractNo 合同编号
|
||||
* @param success 状态
|
||||
* @param returnAll 状态
|
||||
* @param clinic 类型
|
||||
* @return 集合
|
||||
*/
|
||||
List<PaymentReconciliationAccountDel> getPaymentAccountContract(@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime, @Param("entererId") Long entererId, @Param("contractNo") String contractNo,
|
||||
@Param("success") Integer success, @Param("returnAll") Integer returnAll, @Param("clinic") Integer clinic);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.openhis.financial.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 付款管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PaymentReconciliationAccountDel extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 关联ID */
|
||||
private Long relationId;
|
||||
|
||||
/** 支付的业务标识符 */
|
||||
private String paymentNo;
|
||||
|
||||
/** 付款类别 */
|
||||
private Integer paymentEnum;
|
||||
|
||||
/** 付款实体ID */
|
||||
private Long paymentReconciliationId;
|
||||
|
||||
/** 发起支付的工作流程类别 */
|
||||
private Integer kindEnum;
|
||||
|
||||
/** 收款员 */
|
||||
private Long entererId;
|
||||
|
||||
/** 支付发起人类型 */
|
||||
private Integer issuerEnum;
|
||||
|
||||
/** 支付的患者ID */
|
||||
private Long patientId;
|
||||
|
||||
/** 请求支付责任人ID */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 付款结果 */
|
||||
private Integer outcomeEnum;
|
||||
|
||||
/** 支付位置 */
|
||||
private Long locationId;
|
||||
|
||||
/** 到期时间 */
|
||||
private Date expirationDate;
|
||||
|
||||
/** 应收金额 */
|
||||
private BigDecimal tenderedAmount;
|
||||
|
||||
/** 找零金额 */
|
||||
private BigDecimal returnedAmount;
|
||||
|
||||
/** 付款总额 */
|
||||
private BigDecimal displayAmount;
|
||||
|
||||
/** 打印标识 */
|
||||
private Integer printCount;
|
||||
|
||||
/** 合同编码 */
|
||||
private String contractNo;// 2025/05/08李:自付和医保同时付费时只生成一条payment,故此该字段在insert时先为null
|
||||
|
||||
/** 处方号集合 */
|
||||
private String chargeItemIds;
|
||||
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
/** 结算时间 */
|
||||
private Date billDate;
|
||||
|
||||
/** 发票编号 */
|
||||
private Long invoiceId;
|
||||
|
||||
/** 关联账户Id */
|
||||
private Long accountId;// 2025/05/08李:自付和医保同时付费时只生成一条payment,故此该字段在insert时先为null
|
||||
|
||||
/** 医保结算id */
|
||||
private String ybSettleIds;// 记录医保结算id
|
||||
|
||||
/** 医保清算标志 */
|
||||
private Integer ybClearFlag;// 默认值0 未清算
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String accountContractNo;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.openhis.common.enums.PaymentStatus;
|
||||
import com.openhis.common.enums.ybenums.YbMdtrtCertType;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.model.PaymentReconciliationAccountDel;
|
||||
import com.openhis.financial.model.PaymentResult;
|
||||
import com.openhis.financial.model.PaymentedItemModel;
|
||||
import com.openhis.financial.model.PrePaymentResult;
|
||||
@@ -77,7 +78,8 @@ public interface IPaymentReconciliationService extends IService<PaymentReconcili
|
||||
* @param success 付款状态
|
||||
* @param settleId 医保结算id
|
||||
*/
|
||||
void updatePaymentStatusAndSettleIdsById(Long id, PaymentStatus success, List<String> settleId);
|
||||
void updatePaymentStatusAndSettleIdsById(Long id, PaymentStatus success, Integer outcomeEnum,
|
||||
List<String> settleId);
|
||||
|
||||
/**
|
||||
* 【住院结算】
|
||||
@@ -95,4 +97,28 @@ public interface IPaymentReconciliationService extends IService<PaymentReconcili
|
||||
* @return 付款实体
|
||||
*/
|
||||
PaymentReconciliation getByEncounterId(Long encounterId, PaymentKind kindEnum);
|
||||
|
||||
/**
|
||||
* 判断是否已退费
|
||||
*
|
||||
* @param paymentId 原单id
|
||||
* @return 结果
|
||||
*/
|
||||
boolean isReturn(Long paymentId);
|
||||
|
||||
/**
|
||||
* 查询实体集合
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param entererId 款员id
|
||||
* @param contractNo 合同编号
|
||||
* @param success 状态
|
||||
* @param returnAll 状态
|
||||
* @param clinic 类型
|
||||
* @return 集合
|
||||
*/
|
||||
List<PaymentReconciliationAccountDel> getPaymentAccountContract(String startTime, String endTime, Long entererId,
|
||||
String contractNo, Integer success, Integer returnAll, Integer clinic);
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.openhis.common.enums.ybenums.YbMedType;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.mapper.PaymentReconciliationMapper;
|
||||
import com.openhis.financial.model.PaymentReconciliationAccountDel;
|
||||
import com.openhis.financial.model.PaymentResult;
|
||||
import com.openhis.financial.model.PaymentedItemModel;
|
||||
import com.openhis.financial.model.PrePaymentResult;
|
||||
@@ -243,14 +244,16 @@ public class PaymentReconciliationServiceImpl extends ServiceImpl<PaymentReconci
|
||||
* @param settleId 医保结算id
|
||||
*/
|
||||
@Override
|
||||
public void updatePaymentStatusAndSettleIdsById(Long id, PaymentStatus success, List<String> settleId) {
|
||||
if (settleId.isEmpty()) {
|
||||
baseMapper.update(new PaymentReconciliation().setStatusEnum(success.getValue()),
|
||||
public void updatePaymentStatusAndSettleIdsById(Long id, PaymentStatus success, Integer paymentOutcome,
|
||||
List<String> settleId) {
|
||||
if (settleId == null || settleId.isEmpty()) {
|
||||
baseMapper.update(
|
||||
new PaymentReconciliation().setStatusEnum(success.getValue()).setOutcomeEnum(paymentOutcome),
|
||||
new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getId, id));
|
||||
} else {
|
||||
baseMapper.update(
|
||||
new PaymentReconciliation().setStatusEnum(success.getValue())
|
||||
.setYbSettleIds(String.join(",", settleId)),
|
||||
new PaymentReconciliation().setStatusEnum(success.getValue()).setYbSettleIds(String.join(",", settleId))
|
||||
.setOutcomeEnum(paymentOutcome),
|
||||
new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getId, id));
|
||||
}
|
||||
}
|
||||
@@ -268,4 +271,42 @@ public class PaymentReconciliationServiceImpl extends ServiceImpl<PaymentReconci
|
||||
.eq(PaymentReconciliation::getKindEnum, PaymentKind.HOSPITAL_DEPOSIT.getValue())
|
||||
.eq(PaymentReconciliation::getDeleteFlag, DelFlag.NO.getCode()).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否已退费
|
||||
*
|
||||
* @param paymentId 原单id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean isReturn(Long paymentId) {
|
||||
List<PaymentReconciliation> paymentReconciliations = baseMapper.selectList(
|
||||
new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getRelationId, paymentId)
|
||||
.in(PaymentReconciliation::getStatusEnum, PaymentStatus.REFUNDING.getValue(),
|
||||
PaymentStatus.REFUND_ALL.getValue(), PaymentStatus.REFUND_PART.getValue())
|
||||
.eq(PaymentReconciliation::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
if (paymentReconciliations != null && paymentReconciliations.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询实体集合
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param entererId 款员id
|
||||
* @param contractNo 合同编号
|
||||
* @param success 状态
|
||||
* @param returnAll 状态
|
||||
* @param clinic 类型
|
||||
* @return 集合
|
||||
*/
|
||||
@Override
|
||||
public List<PaymentReconciliationAccountDel> getPaymentAccountContract(String startTime, String endTime,
|
||||
Long entererId, String contractNo, Integer success, Integer returnAll, Integer clinic) {
|
||||
return baseMapper.getPaymentAccountContract(startTime, endTime, entererId, contractNo, success, returnAll,
|
||||
clinic);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user