@@ -0,0 +1,64 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.openhis.common.enums.ClaimUse;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 索赔管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("fin_claim")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class Claim extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 交易号 */
|
||||
private String traceNumber;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 类别 */
|
||||
private String typeCode;
|
||||
|
||||
/** (详细)索赔类别 */
|
||||
private String subtypeCode;
|
||||
|
||||
/** 用途 */
|
||||
private ClaimUse useEnum;
|
||||
|
||||
/** 索赔指向 */
|
||||
private Integer insurerEnum;
|
||||
|
||||
/** condition_dis */
|
||||
private String conditionDis;
|
||||
|
||||
/** procedure_id */
|
||||
private String procedureIds;
|
||||
|
||||
/** item_ids */
|
||||
private String itemIds;
|
||||
|
||||
/** 索赔涵盖时间 */
|
||||
private Date billablePeriodStart;
|
||||
|
||||
/** 索赔涵盖时间 */
|
||||
private Date billablePeriodEnd;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 索赔响应管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("fin_claim_response")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ClaimResponse extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 交易号 */
|
||||
private Long traceNumber;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 类别 */
|
||||
private String typeCode;
|
||||
|
||||
/** (详细)索赔类别 */
|
||||
private String subtypeCode;
|
||||
|
||||
/** 用途 */
|
||||
private Integer useEnum;
|
||||
|
||||
/** 索赔指向 */
|
||||
private Integer insurer;
|
||||
|
||||
/** 最终结果 */
|
||||
private Integer outcomeEnum;
|
||||
|
||||
/** 索赔结果的额外文本信息 */
|
||||
private String disposition;
|
||||
|
||||
/** 索赔结果 */
|
||||
private Integer claimResult;
|
||||
|
||||
/** 索赔金额 */
|
||||
private BigDecimal total;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
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
|
||||
@TableName("fin_contract")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class Contract extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 合同名称 */
|
||||
private String contractName;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 合同的类别 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 合同编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 机构 */
|
||||
private Long orgId;
|
||||
|
||||
/** 是否医保 */
|
||||
private Integer ybFlag;
|
||||
|
||||
/** 優先使用標志 */
|
||||
private Integer sort;
|
||||
|
||||
/** 医保区划 */
|
||||
private String admVs;
|
||||
|
||||
//2025-06-18 新加字段,医保相关配置信息从sys_option表迁移至本表
|
||||
/** 医保PrvKey */
|
||||
private String cliPrvKey;
|
||||
|
||||
/** 医保PubKey */
|
||||
private String cliPubKey;
|
||||
|
||||
/** */
|
||||
private String serverPubKey;//暂时不知用处
|
||||
|
||||
/** 医保终端授权范围 */
|
||||
private String scope;
|
||||
|
||||
/** 医保终端授权类型 */
|
||||
private String grantType;
|
||||
|
||||
/** 医保密码 */
|
||||
private String password;
|
||||
|
||||
/** 医保账号 */
|
||||
private String username;
|
||||
|
||||
/** 医保客户端密钥 */
|
||||
private String clientSecret;
|
||||
|
||||
/** 医保客户端Id */
|
||||
private String clientId;
|
||||
|
||||
/** fixmedinsCode */
|
||||
private String fixmedinsCode;
|
||||
|
||||
/** fixmedinsName */
|
||||
private String fixmedinsName;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 合同管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("fin_payment_notice")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PaymentNotice extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 支付通知类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 付款实体ID */
|
||||
private Long paypmentReconciliationId;
|
||||
|
||||
/** 被支付方 */
|
||||
private Long payeeId;
|
||||
|
||||
/** 通知方式 */
|
||||
private String wayCode;
|
||||
|
||||
/** 通知内容 */
|
||||
private String contentText;
|
||||
|
||||
/** 被通知方 */
|
||||
private String recipient;
|
||||
|
||||
/** 金额 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 支付状态 */
|
||||
private Integer payStatus;
|
||||
|
||||
/** 机构 */
|
||||
private Integer orgId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 付款管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("fin_payment_rec_detail")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PaymentRecDetail extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 先前支付明细id */
|
||||
private Long predecessorId;
|
||||
|
||||
/** 付款id */
|
||||
private Long reconciliationId;
|
||||
|
||||
/** 付款类型 */
|
||||
private Integer targetEnum;//暂时没用
|
||||
|
||||
/** 账户 */
|
||||
private Long accountId;
|
||||
|
||||
/** 账户类型 */
|
||||
private String accountCode;
|
||||
|
||||
/** 支付类型 */
|
||||
private Integer payEnum;
|
||||
|
||||
/** 支付类型等级 */
|
||||
private Integer payLevelEnum;
|
||||
|
||||
/** 金额 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 找零 */
|
||||
private BigDecimal returnAmount;
|
||||
|
||||
/** 交款 */
|
||||
private BigDecimal chargeAmount;
|
||||
|
||||
/** 支付平台返回交易号 医保批次号*/
|
||||
private String payTransNo;
|
||||
|
||||
/** 支付平台返回交易信息 医保结算ID*/
|
||||
private String payTransText;
|
||||
|
||||
/** 支付平台返回交易时间 */
|
||||
private Date payTransDate;
|
||||
|
||||
/** 支付平台账前余额 */
|
||||
private BigDecimal beforeBalance;
|
||||
|
||||
/** 支付平台账后余额 */
|
||||
private BigDecimal afterBalance;
|
||||
|
||||
/** 单笔交易结果 */
|
||||
private Integer resultEnum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 付款记录的快照(用于统计报表等使用)
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-08-08
|
||||
*/
|
||||
@Data
|
||||
@TableName("fin_payment_rec_static")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PaymentRecStatic extends HisBaseEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 付款id
|
||||
*/
|
||||
private Long reconciliationId;
|
||||
|
||||
/**
|
||||
* 统计方式:1-字典fin_type_code;2-医保十四项med_chrgitm_type 默认值为2
|
||||
*/
|
||||
private Integer countBy;
|
||||
|
||||
/**
|
||||
* 编码(字典码):1时用财富分类字典,2时用医保分类的字典
|
||||
*/
|
||||
private String typeCode;
|
||||
|
||||
/**
|
||||
* 编码名称(字典名称)
|
||||
*/
|
||||
private String typeName;// 2025/08/08 李要求加此字段,但是实际使用的时候该字段可能不好用,要查字典然后save
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 关联收费项Id
|
||||
*/
|
||||
private String chargeItemIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 付款管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("fin_payment_reconciliation")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PaymentReconciliation extends HisBaseEntity {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_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 refundReason;
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 退号日志表
|
||||
*/
|
||||
@TableName(value = "refund_log")
|
||||
@Data
|
||||
public class RefundLog implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@TableField(value = "order_id")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 患者ID
|
||||
*/
|
||||
@TableField(value = "patient_id")
|
||||
private String patientId;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
@TableField(value = "patient_name")
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
@TableField(value = "refund_amount")
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 退款原因
|
||||
*/
|
||||
@TableField(value = "refund_reason")
|
||||
private String refundReason;
|
||||
|
||||
/**
|
||||
* 退款类型(FULL-全额退号,PART-部分退号)
|
||||
*/
|
||||
@TableField(value = "refund_type")
|
||||
private String refundType;
|
||||
|
||||
/**
|
||||
* 退款方式
|
||||
*/
|
||||
@TableField(value = "refund_method")
|
||||
private String refundMethod;
|
||||
|
||||
/**
|
||||
* 原交易流水号
|
||||
*/
|
||||
@TableField(value = "original_trade_no")
|
||||
private String originalTradeNo;
|
||||
|
||||
/**
|
||||
* 退款交易流水号
|
||||
*/
|
||||
@TableField(value = "refund_trade_no")
|
||||
private String refundTradeNo;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
@TableField(value = "refund_time")
|
||||
private LocalDateTime refundTime;
|
||||
|
||||
/**
|
||||
* 操作用户ID
|
||||
*/
|
||||
@TableField(value = "op_user_id")
|
||||
private String opUserId;
|
||||
|
||||
/**
|
||||
* 操作用户名
|
||||
*/
|
||||
@TableField(value = "op_user_name")
|
||||
private String opUserName;
|
||||
|
||||
/**
|
||||
* 操作角色
|
||||
*/
|
||||
@TableField(value = "op_role")
|
||||
private String opRole;
|
||||
|
||||
/**
|
||||
* 状态(0-失败,1-成功,2-处理中)
|
||||
*/
|
||||
@TableField(value = "state")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
@TableField(value = "fail_reason")
|
||||
private String failReason;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "created_at")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updated_at")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 第三方支付回调实体(下方备注信息以中银支付为模板,其中会产生冗余字段或者重复字段,这些字段均以第三方平台返回内容为主)
|
||||
*/
|
||||
@Data
|
||||
@TableName("fin_three_part_pay_call_back")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ThreePartPayCallBack extends HisBaseEntity {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal id;
|
||||
|
||||
/**
|
||||
* 响应码:(枚举RespCode)00 表示成功,其它表示失败
|
||||
*/
|
||||
private String respCode;
|
||||
|
||||
/**
|
||||
* 响应码解释信息(需要Base64解密)
|
||||
*/
|
||||
private String respMsg;
|
||||
|
||||
/**
|
||||
* 交易类型:(枚举TranType)
|
||||
*/
|
||||
private String tranType;
|
||||
|
||||
/**
|
||||
* 交易金额
|
||||
*/
|
||||
private String txnAmt;
|
||||
|
||||
/**
|
||||
* 支付方式:
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 终端流水号:终端号系统跟踪号,同请求报文原值返回,客户端收到应答报文需要验证traceNo字段值,需与请求报文值一致,如果不一致则丢包交易失败
|
||||
*/
|
||||
private String traceNo;
|
||||
|
||||
/**
|
||||
* 交易时间:(yyyyMMddHHmmss)
|
||||
*/
|
||||
private String txnTime;
|
||||
|
||||
/**
|
||||
* 支付订单号:银行返回系统订单号,需要保存该支付交易订单号
|
||||
*/
|
||||
private String tradeNo;
|
||||
|
||||
/**
|
||||
* 第三方支付订单号
|
||||
*/
|
||||
private String transNo;
|
||||
|
||||
/**
|
||||
* 商户号
|
||||
*/
|
||||
private String mid;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
private String merName;
|
||||
|
||||
/**
|
||||
* 终端号
|
||||
*/
|
||||
private String tid;
|
||||
|
||||
/**
|
||||
* 商户系统订单号:同请求一致
|
||||
*/
|
||||
private String merTradeNo;
|
||||
|
||||
/**
|
||||
* 商户系统退款授权单号:同请求一致
|
||||
*/
|
||||
private String vfTradeNo;
|
||||
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private String discountAmt;
|
||||
|
||||
/**
|
||||
* 有效时间:二维码本身的有效时间,是相对时间,单位为秒,以接收方收到报文时间为起始点计时。不同类型的订单以及不同的订单状况会对应不同的默认有效时间和最大有效时间(可以为空)
|
||||
*/
|
||||
private String qrValidTime;
|
||||
|
||||
/**
|
||||
* 二维码信息:主扫支付二维码,以二维码形式显示,手机APP扫二维码码消费
|
||||
*/
|
||||
private String scanCode;
|
||||
|
||||
/**
|
||||
* 原交易类型:1、订单查询类交易填写原交易类型(被扫交易必填)2、非订单查询填写交易类型与tranType一致(可以为空)
|
||||
*/
|
||||
private String orgTranType;
|
||||
|
||||
/**
|
||||
* 原交易名称:订单查询类交易填写原交易名称,非订单查询填写交易名称(被扫交易必填)
|
||||
*/
|
||||
private String orgTxnName;
|
||||
|
||||
/**
|
||||
* 订单数据:当tranType为F时,payType 值为ZFBA或WEIX时支付宝返回的tradeNo 或者微信返回的prepayId
|
||||
*/
|
||||
private String payData;
|
||||
|
||||
/**
|
||||
* POS机号
|
||||
*/
|
||||
private String posNo;
|
||||
|
||||
/**
|
||||
* 付款主键ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long paymentId;
|
||||
|
||||
/**
|
||||
* 前台UI序号
|
||||
*/
|
||||
private Long payIndex;
|
||||
|
||||
/**
|
||||
* 时间戳(中银建议)
|
||||
*/
|
||||
private Long payTime;
|
||||
|
||||
/**
|
||||
* 交易日
|
||||
*/
|
||||
private String settleDate;
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
private String settleTime;
|
||||
/**
|
||||
* 清算时间
|
||||
*/
|
||||
private String clearDate;
|
||||
/**
|
||||
* 校验数据
|
||||
*/
|
||||
private String secretKey;
|
||||
/**
|
||||
* 卡类型
|
||||
*/
|
||||
private String cardType;
|
||||
/**
|
||||
* 第三方优惠说明
|
||||
*/
|
||||
private String otherMsg;
|
||||
/**
|
||||
* 第三方平台
|
||||
*/
|
||||
private String otherPlatform;
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
private String payMethod;
|
||||
/**
|
||||
* 查询结果
|
||||
*/
|
||||
private String queryResult;
|
||||
/**
|
||||
* 查询结果
|
||||
*/
|
||||
private String queryResultMsg;
|
||||
/**
|
||||
* 请求执行结果
|
||||
*/
|
||||
private String executeResult;
|
||||
/**
|
||||
* 支付结果
|
||||
*/
|
||||
private String payResult;
|
||||
/**
|
||||
* 卡号
|
||||
*/
|
||||
private String accountNo;
|
||||
/**
|
||||
* 凭证号
|
||||
*/
|
||||
private String receiptNo;
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String errMsg;
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.openhis.financial.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 第三方支付请求实体
|
||||
*/
|
||||
@Data
|
||||
@TableName("fin_three_part_pay_request")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ThreePartPayRequest extends HisBaseEntity {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal id;
|
||||
|
||||
/**
|
||||
* payment表主键Id
|
||||
*/
|
||||
private Long paymentId;
|
||||
|
||||
/**
|
||||
* 请求金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 扫码信息
|
||||
*/
|
||||
private String scanKey;
|
||||
|
||||
/**
|
||||
* 请求时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date requestDate;
|
||||
|
||||
/**
|
||||
* 请求费用类型(1.挂号;2.门诊;3,住院;4.预交金;5,其他)暂时用不上这个字段
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 请求类型,暂时用PaymentType枚举
|
||||
*/
|
||||
private String requestType;
|
||||
|
||||
/**
|
||||
* 请求人ID
|
||||
*/
|
||||
private Long requestPersonId;
|
||||
|
||||
/**
|
||||
* pos机号码
|
||||
*/
|
||||
private String posNo;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.Claim;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 索赔管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ClaimMapper extends BaseMapper<Claim> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.ClaimResponse;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 索赔响应管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ClaimResponseMapper extends BaseMapper<ClaimResponse> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 合同管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ContractMapper extends BaseMapper<Contract> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.PaymentNotice;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 合同管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface PaymentNoticeMapper extends BaseMapper<PaymentNotice> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.PaymentRecDetail;
|
||||
import com.openhis.financial.model.PaymentRecDetailAccountResult;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface PaymentRecDetailMapper extends BaseMapper<PaymentRecDetail> {
|
||||
|
||||
/**
|
||||
* 根据paymentId集合查询详情信息
|
||||
*
|
||||
* @param paymentIdList 集合
|
||||
* @return 集合
|
||||
*/
|
||||
List<PaymentRecDetailAccountResult> getListByReconciliationIds(@Param("paymentIdList") List<Long> paymentIdList,@Param("kindEnum") Integer kindEnum);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.PaymentRecStatic;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 付款管理Mapper接口
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-08-08
|
||||
*/
|
||||
@Repository
|
||||
public interface PaymentRecStaticMapper extends BaseMapper<PaymentRecStatic> {}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.model.PaymentReconciliationAccountDel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@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,10 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.RefundLog;
|
||||
|
||||
/**
|
||||
* 退号日志 Mapper接口
|
||||
*/
|
||||
public interface RefundLogMapper extends BaseMapper<RefundLog> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openhis.financial.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.financial.domain.ThreePartPayCallBack;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface ThreePartPayCallBackMapper extends BaseMapper<ThreePartPayCallBack> {
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.financial.model;
|
||||
|
||||
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-08-05
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PaymentRecDetailAccountResult {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 先前支付明细id */
|
||||
private Long predecessorId;
|
||||
|
||||
/** 付款id */
|
||||
private Long reconciliationId;
|
||||
|
||||
/** 付款类型 */
|
||||
private Integer targetEnum;// 暂时没用
|
||||
|
||||
/** 账户 */
|
||||
private Long accountId;
|
||||
|
||||
/** 账户类型 */
|
||||
private String accountCode;
|
||||
|
||||
/** 支付类型 */
|
||||
private Integer payEnum;
|
||||
|
||||
/** 支付类型等级 */
|
||||
private Integer payLevelEnum;
|
||||
|
||||
/** 金额 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 找零 */
|
||||
private BigDecimal returnAmount;
|
||||
|
||||
/** 交款 */
|
||||
private BigDecimal chargeAmount;
|
||||
|
||||
/** 支付平台返回交易号 医保批次号 */
|
||||
private String payTransNo;
|
||||
|
||||
/** 支付平台返回交易信息 医保结算ID */
|
||||
private String payTransText;
|
||||
|
||||
/** 支付平台返回交易时间 */
|
||||
private Date payTransDate;
|
||||
|
||||
/** 支付平台账前余额 */
|
||||
private BigDecimal beforeBalance;
|
||||
|
||||
/** 支付平台账后余额 */
|
||||
private BigDecimal afterBalance;
|
||||
|
||||
/** 单笔交易结果 */
|
||||
private Integer resultEnum;
|
||||
|
||||
/** 状态枚举 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 结账状态枚举 */
|
||||
private Integer billingStatusEnum;
|
||||
|
||||
// 2025.04.10 经确认此处原有的【1 CASH 个人现金账户 | 2 医保账户】改为【01医保电子凭证 | 02 居民身份证 | 03 社会保障卡 | 04 个人现金账户】
|
||||
/** 账户类型编码 */
|
||||
private String typeCode;
|
||||
|
||||
/** 编码 */
|
||||
private String no;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 患者id */
|
||||
private Long patientId;
|
||||
|
||||
/** 就诊id */
|
||||
private Long encounterId;
|
||||
|
||||
/** 账户余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 医保区域编码 */
|
||||
private String ybAreaNo;
|
||||
|
||||
/** 合同编码 */
|
||||
private String contractNo;
|
||||
|
||||
/** 欠费限制额度 */
|
||||
private BigDecimal limitAccount;
|
||||
|
||||
/** 是否为就诊登记使用 */
|
||||
private Integer encounterFlag;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.openhis.financial.model;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PaymentRecDetailDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
/** 账户 */
|
||||
private Long accountId;
|
||||
|
||||
/** 支付类型 */
|
||||
private Integer payEnum;
|
||||
|
||||
/** 支付类型 */
|
||||
private String payEnumText;
|
||||
|
||||
/** 金额 */
|
||||
private BigDecimal amount;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.openhis.financial.model;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 付款管理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;
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.openhis.financial.model;
|
||||
|
||||
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;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PaymentResult {
|
||||
// 主键字段
|
||||
private String mdtrtId; // 就诊ID
|
||||
|
||||
private String setlId;// 结算id
|
||||
|
||||
private String psnNo; // 人员编号
|
||||
|
||||
private String psnName; // 人员姓名
|
||||
|
||||
private String psnCertType; // 人员证件类型
|
||||
|
||||
private String certno; // 证件号码
|
||||
|
||||
private String gend; // 性别
|
||||
|
||||
private String naty; // 民族
|
||||
|
||||
private Date brdy; // 出生日期
|
||||
|
||||
private BigDecimal age; // 年龄
|
||||
|
||||
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 存放发送方报文ID
|
||||
|
||||
private String clrOptins; // 清算经办机构
|
||||
|
||||
private String clrWay; // 清算方式
|
||||
|
||||
private String clrType; // 清算类别
|
||||
|
||||
private BigDecimal hifdmPay; // 伤残人员医疗保障基金支出
|
||||
|
||||
private String expContent; // 字段扩展
|
||||
|
||||
private List<Clinic2206FundPaymentResult> setldetail;// 结算详细信息
|
||||
|
||||
private String chrgBchno; // 收费批次号
|
||||
private String paymentNo; // 收费批次号
|
||||
|
||||
private Long accountId; // 收费批次号
|
||||
|
||||
public PaymentResult() {
|
||||
this.setMedfeeSumamt(new BigDecimal("0.0")).setFulamtOwnpayAmt(new BigDecimal("0.0"))
|
||||
.setOverlmtSelfpay(new BigDecimal("0.0")).setPreselfpayAmt(new BigDecimal("0.0"))
|
||||
.setInscpScpAmt(new BigDecimal("0.0")).setActPayDedc(new BigDecimal("0.0"))
|
||||
.setHifpPay(new BigDecimal("0.0")).setPoolPropSelfpay(new BigDecimal("0.0"))
|
||||
.setCvlservPay(new BigDecimal("0.0")).setHifesPay(new BigDecimal("0.0")).setHifmiPay(new BigDecimal("0.0"))
|
||||
.setHifobPay(new BigDecimal("0.00")).setMafPay(new BigDecimal("0.0")).setOthPay(new BigDecimal("0.0"))
|
||||
.setFundPaySumamt(new BigDecimal("0.0")).setPsnPartAmt(new BigDecimal("0.0"))
|
||||
.setAcctPay(new BigDecimal("0.0")).setPsnCashPay(new BigDecimal("0.0"))
|
||||
.setHospPartAmt(new BigDecimal("0.0")).setBalc(new BigDecimal("0.0"))
|
||||
.setAcctMulaidPay(new BigDecimal("0.0")).setHifdmPay(new BigDecimal("0.0"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.openhis.financial.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class PaymentedItemModel {
|
||||
/** 就诊id */
|
||||
private Long encounterId;
|
||||
|
||||
/** 层级 */
|
||||
private String busNo;
|
||||
|
||||
/** 医疗类型 */
|
||||
private String medType;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 总价 */
|
||||
private Long chargeItemId;
|
||||
|
||||
/** 医疗服务所在表 */
|
||||
private String serviceTable;
|
||||
|
||||
/** 医疗服务ID */
|
||||
private Long serviceId;
|
||||
|
||||
/** 产品所在表 */
|
||||
private String productTable;
|
||||
|
||||
/** 产品ID */
|
||||
private Long productId;
|
||||
|
||||
/** 开立人ID */
|
||||
private Long entererId;
|
||||
|
||||
/** 开立科室 */
|
||||
private Long requestingOrgId;
|
||||
|
||||
/** 开立时间 */
|
||||
private Date enteredDate;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal quantityValue;
|
||||
|
||||
/** 单位 */
|
||||
private String quantityUnit;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** chargeItem定义id */
|
||||
private Long definitionId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.openhis.financial.model;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.openhis.yb.dto.Clinic2206FundPaymentResult;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PrePaymentResult {
|
||||
|
||||
@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 List<Clinic2206FundPaymentResult> setldetail;// 结算详细信息
|
||||
|
||||
private String mdtrtCertNo; // 就诊凭证编号
|
||||
|
||||
private String chrgBchno; // 收费批次号
|
||||
|
||||
private String busNo; // 挂号采访码
|
||||
|
||||
private Long accountId; // 账号ID码
|
||||
|
||||
private BigDecimal gfRatio;// 学校垫付金额
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.financial.model;
|
||||
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PrePaymentResultModel {
|
||||
|
||||
private List<PaymentRecDetailDto> details;
|
||||
|
||||
private PaymentReconciliation paymentReconciliation;
|
||||
|
||||
private String paymentId;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.openhis.financial.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class StudentPaymentItemModel extends PaymentedItemModel {
|
||||
|
||||
/**
|
||||
* 医保等级
|
||||
*/
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/**
|
||||
* 医保分类
|
||||
*/
|
||||
private String ybType;
|
||||
|
||||
/**
|
||||
* 自付比例
|
||||
*/
|
||||
private BigDecimal selfRatio;
|
||||
|
||||
/**
|
||||
* 公费一次报销金额
|
||||
*/
|
||||
private BigDecimal oncePrice;
|
||||
|
||||
/**
|
||||
* 医保折扣部分金额
|
||||
*/
|
||||
private BigDecimal ybRatio;
|
||||
|
||||
/**
|
||||
* 学校垫付部分金额
|
||||
*/
|
||||
private BigDecimal studentRatio;
|
||||
|
||||
/**
|
||||
* 自付比例
|
||||
*/
|
||||
private BigDecimal twiceRatio;
|
||||
|
||||
/**
|
||||
* 公费二次报销金额
|
||||
*/
|
||||
private BigDecimal twicePrice;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.financial.domain.ClaimResponse;
|
||||
|
||||
/**
|
||||
* 索赔响应管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IClaimResponseService extends IService<ClaimResponse> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.financial.domain.Claim;
|
||||
|
||||
/**
|
||||
* 索赔管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IClaimService extends IService<Claim> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 合同管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IContractService extends IService<Contract> {
|
||||
|
||||
/**
|
||||
* 根据医保码找合同信息
|
||||
*
|
||||
* @param contractNo 医保码
|
||||
* @return 合同实体
|
||||
*/
|
||||
Contract getByContractNo(String contractNo);
|
||||
|
||||
/**
|
||||
* 查询租户合同信息分页
|
||||
*
|
||||
* @param tenantId 租户ID
|
||||
* @param pageNum 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 租户合同信息分页
|
||||
*/
|
||||
IPage<Contract> getTenantContractPage(Integer tenantId, Integer pageNum, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 查询租户合同信息详情
|
||||
*
|
||||
* @param id ID
|
||||
* @return 租户合同信息详情
|
||||
*/
|
||||
Contract getTenantContractDetail(Long id);
|
||||
|
||||
/**
|
||||
* 新增租户合同信息
|
||||
*
|
||||
* @param contract 合同管理实体
|
||||
*/
|
||||
void addTenantContract(Contract contract);
|
||||
|
||||
/**
|
||||
* 编辑租户合同信息
|
||||
*
|
||||
* @param contract 合同管理实体
|
||||
*/
|
||||
void editTenantContract(Contract contract);
|
||||
|
||||
/**
|
||||
* 删除租户合同信息
|
||||
*
|
||||
* @param id ID
|
||||
*/
|
||||
void delTenantContract(Long id);
|
||||
|
||||
/**
|
||||
* 查詢合同的集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Contract> getContractList();
|
||||
|
||||
/**
|
||||
* 查詢合同的集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Contract> getRedisContractList();
|
||||
|
||||
/**
|
||||
* 通過合同編碼查詢合同
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Contract getContract(String contractNo);
|
||||
|
||||
/**
|
||||
* 根据参保地信息找到对应的合同
|
||||
*
|
||||
* @param insuplcAdmdvs
|
||||
* @return
|
||||
*/
|
||||
Contract getContractByInsuplcAdmdvs(String insuplcAdmdvs);
|
||||
|
||||
/**
|
||||
* 查詢合同的集合
|
||||
*
|
||||
* @return 合同集合
|
||||
*/
|
||||
List<Contract> getContractListByYb();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.financial.domain.PaymentNotice;
|
||||
|
||||
/**
|
||||
* 合同管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IPaymentNoticeService extends IService<PaymentNotice> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.common.enums.PaymentResult;
|
||||
import com.openhis.financial.domain.PaymentRecDetail;
|
||||
import com.openhis.financial.model.PaymentRecDetailAccountResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IPaymentRecDetailService extends IService<PaymentRecDetail> {
|
||||
|
||||
/**
|
||||
* 根据paymentId更改结算结果
|
||||
*
|
||||
* @param id id
|
||||
* @param paid PaymentResult
|
||||
*/
|
||||
void updateResultByPaymentId(Long id, PaymentResult paid);
|
||||
|
||||
/**
|
||||
* 根据paymentId集合查询详情信息
|
||||
*
|
||||
* @param paymentIdList 集合
|
||||
* @return 集合
|
||||
*/
|
||||
List<PaymentRecDetailAccountResult> getListByReconciliationIds(List<Long> paymentIdList,Integer kindEnum);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.dto.ChargeItemDefInfo;
|
||||
import com.openhis.common.enums.PaymentStatisticalMethod;
|
||||
import com.openhis.common.enums.PaymentType;
|
||||
import com.openhis.financial.domain.PaymentRecStatic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款管理Service接口
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-08-08
|
||||
*/
|
||||
public interface IPaymentRecStaticService extends IService<PaymentRecStatic> {
|
||||
/**
|
||||
* 批量保存付款快照信息
|
||||
*
|
||||
* @param paymentId 付款id
|
||||
* @param paymentType 付款/退款
|
||||
* @param paymentStatisticalMethod 统计方式:字典/医保分类
|
||||
* @param chargeItemDefInfoList chargeItem基础信息
|
||||
*/
|
||||
void savePaymentRecStatics(Long paymentId, PaymentType paymentType,
|
||||
PaymentStatisticalMethod paymentStatisticalMethod, List<ChargeItemDefInfo> chargeItemDefInfoList);
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.common.enums.PaymentKind;
|
||||
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;
|
||||
import com.openhis.yb.dto.PaymentInpatientDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IPaymentReconciliationService extends IService<PaymentReconciliation> {
|
||||
|
||||
/**
|
||||
* 根据支付id获取对应收费项目的id列表
|
||||
*
|
||||
* @param paymentIdList 支付id列表
|
||||
* @return 收费项目的id列表
|
||||
*/
|
||||
List<Long> getChargeItemIdListByPayment(List<Long> paymentIdList);
|
||||
|
||||
/**
|
||||
* 更新付款状态:退款中
|
||||
*
|
||||
* @param paymentIdList 支付id列表
|
||||
*/
|
||||
void updateRefundingStatus(List<Long> paymentIdList);
|
||||
|
||||
/**
|
||||
* 【门诊预结算】
|
||||
*
|
||||
* @param ybMdtrtCertType 医保凭证类型
|
||||
* @param busiCardInfo 读卡获取的密钥
|
||||
* @param contractBusNo 合同编号
|
||||
* @param paymentedItemList 收费项
|
||||
* @return 结果
|
||||
*/
|
||||
PrePaymentResult preSettle(YbMdtrtCertType ybMdtrtCertType, String busiCardInfo, String contractBusNo,
|
||||
List<PaymentedItemModel> paymentedItemList);
|
||||
|
||||
/**
|
||||
* 【门诊结算】
|
||||
*
|
||||
* @param contract 合同
|
||||
* @param payTransNo 收费批次号
|
||||
* @param byValue 医保凭证类型
|
||||
* @param busiCardInfo 读卡获取的密钥
|
||||
* @param minpacuntDrugTracCnt 追溯码相关
|
||||
* @param mcsTracCnt 追溯码相关
|
||||
* @return 结算结果
|
||||
*/
|
||||
PaymentResult settle(Contract contract, String payTransNo, YbMdtrtCertType byValue, String busiCardInfo,
|
||||
Integer minpacuntDrugTracCnt, Integer mcsTracCnt);
|
||||
|
||||
/**
|
||||
* 更改付款状态
|
||||
*
|
||||
* @param id paymentId
|
||||
* @param success 付款状态
|
||||
*/
|
||||
void updatePaymentStatusById(Long id, PaymentStatus success);
|
||||
|
||||
/**
|
||||
* 更改状态
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param success 付款状态
|
||||
* @param settleId 医保结算id
|
||||
*/
|
||||
void updatePaymentStatusAndSettleIdsById(Long id, PaymentStatus success, Integer outcomeEnum,
|
||||
List<String> settleId);
|
||||
|
||||
/**
|
||||
* 【住院结算】
|
||||
*
|
||||
* @param contract 合同
|
||||
* @param paymentDto 收费参数
|
||||
* @return 结算结果
|
||||
*/
|
||||
PaymentResult inpatientSettle(Contract contract, PaymentInpatientDto paymentDto);
|
||||
|
||||
/**
|
||||
* 查询付款实体
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 付款实体
|
||||
*/
|
||||
PaymentReconciliation getByEncounterId(Long encounterId, PaymentKind kindEnum);
|
||||
|
||||
/**
|
||||
* 查询付款实体
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 付款实体
|
||||
*/
|
||||
List<PaymentReconciliation> getListByEncounterId(Long encounterId, PaymentKind paymentKind);
|
||||
|
||||
/**
|
||||
* 判断是否已退费
|
||||
*
|
||||
* @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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.financial.domain.RefundLog;
|
||||
|
||||
/**
|
||||
* 退号日志 Service接口
|
||||
*/
|
||||
public interface IRefundLogService extends IService<RefundLog> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.financial.domain.ThreePartPayCallBack;
|
||||
|
||||
public interface ThreePartPayCallBackService extends IService<ThreePartPayCallBack> {
|
||||
|
||||
ThreePartPayCallBack getByPayment(Long paymentId);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.financial.domain.ClaimResponse;
|
||||
import com.openhis.financial.mapper.ClaimResponseMapper;
|
||||
import com.openhis.financial.service.IClaimResponseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 索赔响应管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ClaimResponseServiceImpl extends ServiceImpl<ClaimResponseMapper, ClaimResponse> implements IClaimResponseService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.financial.domain.Claim;
|
||||
import com.openhis.financial.mapper.ClaimMapper;
|
||||
import com.openhis.financial.service.IClaimService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 索赔管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ClaimServiceImpl extends ServiceImpl<ClaimMapper, Claim> implements IClaimService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.core.redis.RedisCache;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.constant.YbCommonConstants;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
import com.openhis.financial.mapper.ContractMapper;
|
||||
import com.openhis.financial.service.IContractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 合同管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> implements IContractService {
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param contractNo 医保码
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Contract getByContractNo(String contractNo) {
|
||||
return baseMapper.selectOne(new LambdaUpdateWrapper<Contract>().eq(Contract::getBusNo, contractNo)
|
||||
.last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户合同信息分页
|
||||
*
|
||||
* @param tenantId 租户ID
|
||||
* @param pageNum 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 租户合同信息分页
|
||||
*/
|
||||
@Override
|
||||
public IPage<Contract> getTenantContractPage(Integer tenantId, Integer pageNum, Integer pageSize) {
|
||||
return baseMapper.selectPage(new Page<>(pageNum, pageSize), new LambdaQueryWrapper<Contract>()
|
||||
.eq(Contract::getTenantId, tenantId).eq(Contract::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户合同信息详情
|
||||
*
|
||||
* @param id ID
|
||||
* @return 租户合同信息详情
|
||||
*/
|
||||
@Override
|
||||
public Contract getTenantContractDetail(Long id) {
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户合同信息
|
||||
*
|
||||
* @param contract 合同管理实体
|
||||
*/
|
||||
@Override
|
||||
public void addTenantContract(Contract contract) {
|
||||
baseMapper.insert(contract);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑租户合同信息
|
||||
*
|
||||
* @param contract 合同管理实体
|
||||
*/
|
||||
@Override
|
||||
public void editTenantContract(Contract contract) {
|
||||
baseMapper.updateById(contract);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户合同信息
|
||||
*
|
||||
* @param id ID
|
||||
*/
|
||||
@Override
|
||||
public void delTenantContract(Long id) {
|
||||
baseMapper.update(new Contract(), new LambdaUpdateWrapper<Contract>().eq(Contract::getId, id)
|
||||
.set(Contract::getDeleteFlag, DelFlag.YES.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查詢合同的集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Contract> getContractList() {
|
||||
return baseMapper.selectList(
|
||||
new LambdaQueryWrapper<Contract>().eq(Contract::getTenantId, SecurityUtils.getLoginUser().getTenantId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查詢合同的集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Cacheable(value = "contractListCache", key = "'contractList'")
|
||||
public List<Contract> getRedisContractList() {
|
||||
return getContractList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查詢合同的集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Contract getContract(String contractNo) {
|
||||
// 先从缓存中查找
|
||||
List<Contract> contractList = getRedisContractList();
|
||||
for (Contract contract : contractList) {
|
||||
if (contractNo.equals(contract.getBusNo())) {
|
||||
return contract;
|
||||
}
|
||||
}
|
||||
|
||||
// 缓存中找不到时,直接从数据库查询,支持contractNo动态变化
|
||||
return getByContractNo(contractNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参保地信息找到对应的合同
|
||||
*
|
||||
* @param insuplcAdmdvs
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Contract getContractByInsuplcAdmdvs(String insuplcAdmdvs) {
|
||||
List<Contract> contractList = getRedisContractList();
|
||||
for (Contract contract : contractList) {
|
||||
if (insuplcAdmdvs.equals(contract.getBusNo())) {
|
||||
return contract;
|
||||
}
|
||||
}
|
||||
if (!contractList.isEmpty()) {
|
||||
Optional<Contract> max = contractList.stream().max(Comparator.comparingInt(Contract::getSort));
|
||||
if (max.isPresent()) {
|
||||
return max.get();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查詢合同的集合
|
||||
*
|
||||
* @return 合同集合
|
||||
*/
|
||||
@Override
|
||||
public List<Contract> getContractListByYb() {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<Contract>().eq(Contract::getYbFlag, Whether.YES.getValue())
|
||||
.eq(Contract::getTenantId, SecurityUtils.getLoginUser().getTenantId()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.financial.domain.PaymentNotice;
|
||||
import com.openhis.financial.mapper.PaymentNoticeMapper;
|
||||
import com.openhis.financial.service.IPaymentNoticeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 合同管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class PaymentNoticeServiceImpl extends ServiceImpl<PaymentNoticeMapper, PaymentNotice> implements IPaymentNoticeService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.PaymentResult;
|
||||
import com.openhis.financial.domain.PaymentRecDetail;
|
||||
import com.openhis.financial.mapper.PaymentRecDetailMapper;
|
||||
import com.openhis.financial.model.PaymentRecDetailAccountResult;
|
||||
import com.openhis.financial.service.IPaymentRecDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class PaymentRecDetailServiceImpl extends ServiceImpl<PaymentRecDetailMapper, PaymentRecDetail>
|
||||
implements IPaymentRecDetailService {
|
||||
|
||||
/**
|
||||
* 根据paymentId更改结算结果
|
||||
*
|
||||
* @param id id
|
||||
* @param paid PaymentResult
|
||||
*/
|
||||
@Override
|
||||
public void updateResultByPaymentId(Long id, PaymentResult paid) {
|
||||
baseMapper.update(new PaymentRecDetail().setResultEnum(PaymentResult.PAID.getValue()),
|
||||
new LambdaQueryWrapper<PaymentRecDetail>().eq(PaymentRecDetail::getReconciliationId, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据paymentId集合查询详情信息
|
||||
*
|
||||
* @param paymentIdList 集合
|
||||
* @return 集合
|
||||
*/
|
||||
@Override
|
||||
public List<PaymentRecDetailAccountResult> getListByReconciliationIds(List<Long> paymentIdList,Integer kindEnum) {
|
||||
return baseMapper.getListByReconciliationIds(paymentIdList,kindEnum);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.dto.ChargeItemDefInfo;
|
||||
import com.openhis.common.enums.PaymentStatisticalMethod;
|
||||
import com.openhis.common.enums.PaymentType;
|
||||
import com.openhis.financial.domain.PaymentRecStatic;
|
||||
import com.openhis.financial.mapper.PaymentRecStaticMapper;
|
||||
import com.openhis.financial.service.IPaymentRecStaticService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 付款管理Service业务层处理
|
||||
*
|
||||
* @author SunJQ
|
||||
* @date 2025-08-08
|
||||
*/
|
||||
@Service
|
||||
public class PaymentRecStaticServiceImpl extends ServiceImpl<PaymentRecStaticMapper, PaymentRecStatic>
|
||||
implements IPaymentRecStaticService {
|
||||
|
||||
/**
|
||||
* 批量保存付款快照信息
|
||||
*
|
||||
* @param paymentId 付款id
|
||||
* @param paymentType 付款/退款
|
||||
* @param paymentStatisticalMethod 统计方式:字典/医保分类
|
||||
* @param chargeItemDefInfoList chargeItem基础信息
|
||||
*/
|
||||
@Override
|
||||
public void savePaymentRecStatics(Long paymentId, PaymentType paymentType,
|
||||
PaymentStatisticalMethod paymentStatisticalMethod, List<ChargeItemDefInfo> chargeItemDefInfoList) {
|
||||
if (chargeItemDefInfoList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<String, List<ChargeItemDefInfo>> collect;
|
||||
List<PaymentRecStatic> paymentRecStatics = new ArrayList<>();
|
||||
if (paymentStatisticalMethod == PaymentStatisticalMethod.FIN_TYPE_CODE) {
|
||||
collect = chargeItemDefInfoList.stream()
|
||||
.filter(info -> info.getTypeCode() != null)
|
||||
.collect(Collectors.groupingBy(ChargeItemDefInfo::getTypeCode));
|
||||
getPaymentRecStaticList(paymentId, paymentType, paymentStatisticalMethod, collect, paymentRecStatics);
|
||||
} else if (paymentStatisticalMethod == PaymentStatisticalMethod.MED_CHRGITM_TYPE) {
|
||||
collect = chargeItemDefInfoList.stream()
|
||||
.filter(info -> info.getYbType() != null)
|
||||
.collect(Collectors.groupingBy(ChargeItemDefInfo::getYbType));
|
||||
getPaymentRecStaticList(paymentId, paymentType, paymentStatisticalMethod, collect, paymentRecStatics);
|
||||
} else {
|
||||
collect = chargeItemDefInfoList.stream()
|
||||
.filter(info -> info.getTypeCode() != null)
|
||||
.collect(Collectors.groupingBy(ChargeItemDefInfo::getTypeCode));
|
||||
getPaymentRecStaticList(paymentId, paymentType, PaymentStatisticalMethod.FIN_TYPE_CODE, collect,
|
||||
paymentRecStatics);
|
||||
collect = chargeItemDefInfoList.stream()
|
||||
.filter(info -> info.getYbType() != null)
|
||||
.collect(Collectors.groupingBy(ChargeItemDefInfo::getYbType));
|
||||
getPaymentRecStaticList(paymentId, paymentType, PaymentStatisticalMethod.MED_CHRGITM_TYPE, collect,
|
||||
paymentRecStatics);
|
||||
}
|
||||
saveBatch(paymentRecStatics);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param paymentId 付款id
|
||||
* @param paymentType 付款/退款
|
||||
* @param paymentStatisticalMethod 统计方式:字典/医保分类
|
||||
* @param collect map
|
||||
* @param paymentRecStatics 集合
|
||||
*/
|
||||
public void getPaymentRecStaticList(Long paymentId, PaymentType paymentType,
|
||||
PaymentStatisticalMethod paymentStatisticalMethod, Map<String, List<ChargeItemDefInfo>> collect,
|
||||
List<PaymentRecStatic> paymentRecStatics) {
|
||||
PaymentRecStatic paymentRecStatic;
|
||||
BigDecimal bigDecimal;
|
||||
for (Map.Entry<String, List<ChargeItemDefInfo>> stringListEntry : collect.entrySet()) {
|
||||
paymentRecStatic = new PaymentRecStatic();
|
||||
bigDecimal = BigDecimal.ZERO;
|
||||
for (ChargeItemDefInfo chargeItemDefInfo : stringListEntry.getValue()) {
|
||||
bigDecimal = bigDecimal.add(chargeItemDefInfo.getTotalPrice().multiply(paymentType.getMultiplier()));
|
||||
}
|
||||
paymentRecStatic.setAmount(bigDecimal).setReconciliationId(paymentId).setTypeCode(stringListEntry.getKey())
|
||||
.setChargeItemIds(JSON.toJSONString(
|
||||
stringListEntry.getValue().stream().map(ChargeItemDefInfo::getId).collect(Collectors.toList())))
|
||||
.setCountBy(paymentStatisticalMethod.getValue());
|
||||
paymentRecStatics.add(paymentRecStatic);
|
||||
}
|
||||
// return paymentRecStatics;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,632 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.DeviceDefinition;
|
||||
import com.openhis.administration.domain.HealthcareService;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.administration.service.IDeviceDefinitionService;
|
||||
import com.openhis.administration.service.IHealthcareServiceService;
|
||||
import com.openhis.administration.service.impl.PatientServiceImpl;
|
||||
import com.openhis.administration.service.impl.PatientStudentServiceImpl;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.YbCommonConstants;
|
||||
import com.openhis.common.enums.ItemType;
|
||||
import com.openhis.common.enums.PaymentKind;
|
||||
import com.openhis.common.enums.PaymentStatus;
|
||||
import com.openhis.common.enums.ybenums.YbChrgitmLv;
|
||||
import com.openhis.common.enums.ybenums.YbMdtrtCertType;
|
||||
import com.openhis.common.enums.ybenums.YbMedChrgItmType;
|
||||
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.*;
|
||||
import com.openhis.financial.service.IContractService;
|
||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
import com.openhis.medication.domain.MedicationDefinition;
|
||||
import com.openhis.medication.service.IMedicationDefinitionService;
|
||||
import com.openhis.nenu.dto.GfTypeRatioDto;
|
||||
import com.openhis.nenu.service.impl.GfRatioServiceImpl;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import com.openhis.yb.dto.Clinic2206OrderOutput;
|
||||
import com.openhis.yb.dto.ClinicReg2201Output;
|
||||
import com.openhis.yb.dto.PaymentInpatientDto;
|
||||
import com.openhis.yb.dto.Yb2304OutputSetlInfo;
|
||||
import com.openhis.yb.model.Clinic2207OrderModel;
|
||||
import com.openhis.yb.service.YbManager;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 付款管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class PaymentReconciliationServiceImpl extends ServiceImpl<PaymentReconciliationMapper, PaymentReconciliation>
|
||||
implements IPaymentReconciliationService {
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
@Autowired
|
||||
private IContractService iContractService;
|
||||
@Autowired
|
||||
private YbManager ybManager;
|
||||
@Autowired
|
||||
private GfRatioServiceImpl gfRatioService;
|
||||
@Autowired
|
||||
private PatientServiceImpl patientService;
|
||||
@Autowired
|
||||
private PatientStudentServiceImpl patientStudentService;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
private IChargeItemDefinitionService chargeItemDefinitionService;
|
||||
@Autowired
|
||||
private IDeviceDefinitionService deviceDefinitionService;
|
||||
@Autowired
|
||||
private IActivityDefinitionService activityDefinitionService;
|
||||
@Autowired
|
||||
private IMedicationDefinitionService medicationDefinitionService;
|
||||
@Autowired
|
||||
private IHealthcareServiceService healthcareServiceService;
|
||||
|
||||
/**
|
||||
* 根据支付id获取对应收费项目的id列表
|
||||
*
|
||||
* @param paymentIdList 支付id列表
|
||||
* @return 收费项目的id列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getChargeItemIdListByPayment(List<Long> paymentIdList) {
|
||||
|
||||
// 根据支付id获取支付信息
|
||||
List<PaymentReconciliation> paymentReconciliationList
|
||||
= baseMapper.selectList(new LambdaQueryWrapper<PaymentReconciliation>()
|
||||
.select(PaymentReconciliation::getChargeItemIds).in(PaymentReconciliation::getId, paymentIdList));
|
||||
if (paymentReconciliationList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 拆解所有的chargeItemId,拼装成一个集合
|
||||
List<String> chargeItemIdList = paymentReconciliationList.stream().map(PaymentReconciliation::getChargeItemIds)
|
||||
.collect(Collectors.toList());
|
||||
List<Long> chargeItemIds = new ArrayList<>();
|
||||
for (String chargeItemId : chargeItemIdList) {
|
||||
if (StringUtils.isNotEmpty(chargeItemId)) {
|
||||
chargeItemIds.addAll(Arrays
|
||||
.stream(
|
||||
chargeItemId.replaceAll("\\[", "").replaceAll("\\]", "").split(CommonConstants.Common.COMMA))
|
||||
.map(Long::parseLong).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
// 将收费项目集合转换成列表
|
||||
return chargeItemIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新付款状态:退款中
|
||||
*
|
||||
* @param paymentIdList 支付id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateRefundingStatus(List<Long> paymentIdList) {
|
||||
baseMapper.update(new PaymentReconciliation().setStatusEnum(PaymentStatus.REFUNDING.getValue()),
|
||||
new LambdaUpdateWrapper<PaymentReconciliation>().in(PaymentReconciliation::getId, paymentIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* PS:对chargeItem分付款方式 2025/05/23
|
||||
* ChargeItem分完付款方式之后,医保支付的ChargeItem还要分特慢病和普通门诊,特慢病等支付与常规门诊支付传参不一样
|
||||
*/
|
||||
/**
|
||||
* 【预结算】
|
||||
*
|
||||
* @param ybMdtrtCertType 医保凭证类型
|
||||
* @param busiCardInfo 读卡获取的密钥
|
||||
* @param contractBusNo 合同编号
|
||||
* @param paymentedItemList 收费项
|
||||
* @return 预结算结果
|
||||
*/
|
||||
@Override
|
||||
public PrePaymentResult preSettle(YbMdtrtCertType ybMdtrtCertType, String busiCardInfo, String contractBusNo,
|
||||
List<PaymentedItemModel> paymentedItemList) {
|
||||
|
||||
PrePaymentResult prePaymentResult = null;
|
||||
String ybSwitchFlag = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH);
|
||||
if (ybSwitchFlag.equals("0")) {
|
||||
contractBusNo = CommonConstants.BusinessName.DEFAULT_CONTRACT_NO;
|
||||
}
|
||||
|
||||
Contract contract = iContractService.getContract(contractBusNo);
|
||||
|
||||
switch (contractBusNo) {
|
||||
case CommonConstants.BusinessName.DEFAULT_CONTRACT_NO:
|
||||
prePaymentResult = new PrePaymentResult();
|
||||
BigDecimal sumAmount = BigDecimal.ZERO;
|
||||
for (PaymentedItemModel item : paymentedItemList) {
|
||||
sumAmount = sumAmount.add(item.getTotalPrice());
|
||||
}
|
||||
prePaymentResult.setMedfeeSumamt(sumAmount);
|
||||
prePaymentResult.setFulamtOwnpayAmt(sumAmount);
|
||||
prePaymentResult.setPsnPartAmt(sumAmount);
|
||||
prePaymentResult.setPsnCashPay(sumAmount);
|
||||
prePaymentResult.setChrgBchno(CommonConstants.BusinessName.DEFAULT_CONTRACT_NO);
|
||||
break;
|
||||
case "229900":// 吉林省医保
|
||||
case "220199":// 长春市医保(农大)
|
||||
case "220100":// 长春市医保(长大)
|
||||
Map<String, List<PaymentedItemModel>> collect
|
||||
= paymentedItemList.stream().collect(Collectors.groupingBy(PaymentedItemModel::getMedType));
|
||||
if (collect.entrySet().size() > 1) {
|
||||
throw new ServiceException("医保只接受同种医疗类型结算(普通门诊与慢病等不可以同时结算)!");
|
||||
}
|
||||
PrePaymentResult result;
|
||||
for (Map.Entry<String, List<PaymentedItemModel>> medTypeKV : collect.entrySet()) {
|
||||
Clinic2206OrderOutput clinic2206OrderOutput = null;
|
||||
ClinicReg2201Output reg2201Output = null;
|
||||
if (!medTypeKV.getKey().equals(YbMedType.GENERAL_OUTPATIENT.getValue()) && "1".equals(
|
||||
SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))) {
|
||||
// 不是普通门诊就诊类型,补充挂号信息
|
||||
reg2201Output = ybManager.createRegWithMedType(contract, ybMdtrtCertType, busiCardInfo,
|
||||
medTypeKV.getValue().get(0).getEncounterId(),
|
||||
YbMedType.getByValue(medTypeKV.getValue().get(0).getMedType()));
|
||||
reg2201Output.setMedType(medTypeKV.getKey());// 2025/06/05慢病挂号后上传2206信息报错,2201返回值没有medType,此处更正赋值
|
||||
} else {
|
||||
// 从数据库里取reg2201
|
||||
reg2201Output
|
||||
= ybManager.getClinicRegByEncounterId(medTypeKV.getValue().get(0).getEncounterId());
|
||||
}
|
||||
// 调用预结算
|
||||
clinic2206OrderOutput = ybManager.preSettle(contract, medTypeKV.getValue().get(0).getEncounterId(),
|
||||
ybMdtrtCertType, busiCardInfo, reg2201Output, "01", medTypeKV.getValue(),
|
||||
YbMedType.getByValue(medTypeKV.getKey()));
|
||||
prePaymentResult = new PrePaymentResult();
|
||||
BeanUtils.copyProperties(clinic2206OrderOutput, prePaymentResult);
|
||||
}
|
||||
break;
|
||||
case "STUDENT0000":
|
||||
prePaymentResult = this.studentSelfPay(paymentedItemList);
|
||||
break;
|
||||
case "STUDENT220100":
|
||||
case "STUDENT229900":
|
||||
case "STUDENT220199":
|
||||
prePaymentResult = this.studentYbPay(contract, ybMdtrtCertType, busiCardInfo, "01", paymentedItemList);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return prePaymentResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生二次报销
|
||||
*
|
||||
* @param contract 合同
|
||||
* @param ybMdtrtCertType 医疗类别
|
||||
* @param busiCardInfo 电子码
|
||||
* @param s 按项目收费还是按病种收费(该字段目前在系统里面没用上,默认都是01)
|
||||
* @param paymentedItemList 收费项
|
||||
* @return 预结算结果
|
||||
*/
|
||||
private PrePaymentResult studentYbPay(Contract contract, YbMdtrtCertType ybMdtrtCertType, String busiCardInfo,
|
||||
String s, List<PaymentedItemModel> paymentedItemList) {
|
||||
|
||||
// 查比例及分类信息(PaymentedItemModel在chargeItem表中不是一定存在的所以此处改用单独查询)
|
||||
List<StudentPaymentItemModel> allPaymentItemList = getStudentPaymentItemModelList(paymentedItemList);
|
||||
|
||||
// 拟定使用公费医疗的情况下实收金额
|
||||
BigDecimal onceReceivedAmount = BigDecimal.ZERO;
|
||||
for (StudentPaymentItemModel studentPaymentItemModel : allPaymentItemList) {
|
||||
// 获取折扣比例
|
||||
BigDecimal ratio = studentPaymentItemModel.getTwiceRatio() == null ? studentPaymentItemModel.getSelfRatio()
|
||||
: studentPaymentItemModel.getTwiceRatio();
|
||||
|
||||
// 计算金额
|
||||
onceReceivedAmount = onceReceivedAmount.add(studentPaymentItemModel.getTotalPrice()
|
||||
.multiply(ratio.divide(new BigDecimal("100"), 6, RoundingMode.HALF_UP)));
|
||||
}
|
||||
|
||||
// 医保结算
|
||||
PrePaymentResult prePaymentResult
|
||||
= this.studentPreSettleYb(contract, ybMdtrtCertType, busiCardInfo, paymentedItemList);
|
||||
if (prePaymentResult == null) {
|
||||
throw new ServiceException("医生开具的收费项未分配对应的医疗类型!");
|
||||
}
|
||||
|
||||
BigDecimal psnPartAmt = prePaymentResult.getPsnPartAmt();
|
||||
|
||||
if (psnPartAmt.compareTo(onceReceivedAmount) > 0) {
|
||||
prePaymentResult.setGfRatio(psnPartAmt.subtract(onceReceivedAmount));
|
||||
prePaymentResult.setPsnCashPay(onceReceivedAmount);
|
||||
} else {
|
||||
prePaymentResult.setGfRatio(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
return prePaymentResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生一次报销
|
||||
*
|
||||
* @param paymentedItemList 收费项
|
||||
* @return 预结算结果
|
||||
*/
|
||||
private PrePaymentResult studentSelfPay(List<PaymentedItemModel> paymentedItemList) {
|
||||
|
||||
List<StudentPaymentItemModel> allPaymentItemList = getStudentPaymentItemModelList(paymentedItemList);
|
||||
|
||||
// 拟定使用公费医疗的情况下实收金额
|
||||
BigDecimal onceReceivedAmount = BigDecimal.ZERO;
|
||||
for (StudentPaymentItemModel studentPaymentItemModel : allPaymentItemList) {
|
||||
// 获取折扣比例
|
||||
BigDecimal ratio = studentPaymentItemModel.getTwiceRatio() == null ? studentPaymentItemModel.getSelfRatio()
|
||||
: studentPaymentItemModel.getTwiceRatio();
|
||||
|
||||
// 计算金额
|
||||
onceReceivedAmount = onceReceivedAmount.add(studentPaymentItemModel.getTotalPrice().multiply(ratio));
|
||||
}
|
||||
|
||||
PrePaymentResult prePaymentResult = new PrePaymentResult();
|
||||
BigDecimal sumAmount = BigDecimal.ZERO;
|
||||
for (PaymentedItemModel item : paymentedItemList) {
|
||||
sumAmount = sumAmount.add(item.getTotalPrice());
|
||||
}
|
||||
prePaymentResult.setMedfeeSumamt(sumAmount);
|
||||
prePaymentResult.setFulamtOwnpayAmt(sumAmount);
|
||||
prePaymentResult.setPsnPartAmt(sumAmount);
|
||||
prePaymentResult.setPsnCashPay(onceReceivedAmount.divide(new BigDecimal("100"), 6, RoundingMode.HALF_UP));
|
||||
prePaymentResult.setGfRatio(sumAmount.subtract(prePaymentResult.getPsnCashPay()));
|
||||
prePaymentResult.setChrgBchno(CommonConstants.BusinessName.DEFAULT_STUDENT_CONTRACT_NO);
|
||||
return prePaymentResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 【门诊结算】
|
||||
*
|
||||
* @param contract 合同
|
||||
* @param payTransNo 支付批次号
|
||||
* @param ybMdtrtCertType 凭证类型
|
||||
* @param busiCardInfo 读卡获取到的凭证
|
||||
* @param minpacuntDrugTracCnt 追溯码相关信息
|
||||
* @param mcsTracCnt 追溯码相关信息
|
||||
* @return 结算结果
|
||||
*/
|
||||
@Override
|
||||
public PaymentResult settle(Contract contract, String payTransNo, YbMdtrtCertType ybMdtrtCertType,
|
||||
String busiCardInfo, Integer minpacuntDrugTracCnt, Integer mcsTracCnt) {
|
||||
PaymentResult paymentResult = null;
|
||||
if (!(CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(payTransNo)
|
||||
|| CommonConstants.BusinessName.DEFAULT_STUDENT_CONTRACT_NO.equals(payTransNo))) {
|
||||
// 医保支付 todo:支付的详细信息在于结算中已经存好了,但是还没有存储卡余额
|
||||
Clinic2207OrderModel clinic2207OrderModel
|
||||
= ybManager.settle(contract, payTransNo, busiCardInfo, ybMdtrtCertType, minpacuntDrugTracCnt, mcsTracCnt);
|
||||
paymentResult = new PaymentResult();
|
||||
BeanUtils.copyProperties(clinic2207OrderModel, paymentResult);
|
||||
} else {
|
||||
// 自费返回new实体
|
||||
paymentResult = new PaymentResult();
|
||||
}
|
||||
return paymentResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 【住院结算】
|
||||
*
|
||||
* @param contract 合同
|
||||
* @param paymentDto 收费参数
|
||||
* @return 结算结果
|
||||
*/
|
||||
@Override
|
||||
public PaymentResult inpatientSettle(Contract contract, PaymentInpatientDto paymentDto) {
|
||||
PaymentResult paymentResult = null;
|
||||
if (!CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(contract.getBusNo())) {
|
||||
// 医保支付 todo:支付的详细信息在于结算中已经存好了,但是还没有存储卡余额
|
||||
Yb2304OutputSetlInfo yb2304OutputSetlInfo = ybManager.inpatientSettle(contract, paymentDto);
|
||||
paymentResult = new PaymentResult();
|
||||
BeanUtils.copyProperties(yb2304OutputSetlInfo, paymentResult);
|
||||
} else {
|
||||
// 自费返回new实体
|
||||
paymentResult = new PaymentResult();
|
||||
}
|
||||
return paymentResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改付款状态
|
||||
*
|
||||
* @param id paymentId
|
||||
* @param success 付款状态
|
||||
*/
|
||||
@Override
|
||||
public void updatePaymentStatusById(Long id, PaymentStatus success) {
|
||||
baseMapper.update(new PaymentReconciliation().setStatusEnum(success.getValue()),
|
||||
new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getId, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改payment状态以及医保支付结算id
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param success 状态
|
||||
* @param settleId 医保结算id
|
||||
*/
|
||||
@Override
|
||||
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))
|
||||
.setOutcomeEnum(paymentOutcome),
|
||||
new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getId, id));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询付款实体
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 付款实体
|
||||
*/
|
||||
@Override
|
||||
public PaymentReconciliation getByEncounterId(Long encounterId, PaymentKind paymentKind) {
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<PaymentReconciliation>()
|
||||
.eq(PaymentReconciliation::getEncounterId, encounterId)
|
||||
.eq(PaymentReconciliation::getKindEnum, PaymentKind.HOSPITAL_DEPOSIT.getValue())
|
||||
.eq(PaymentReconciliation::getDeleteFlag, DelFlag.NO.getCode()).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已收费付款实体
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 付款实体
|
||||
*/
|
||||
@Override
|
||||
public List<PaymentReconciliation> getListByEncounterId(Long encounterId, PaymentKind paymentKind) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<PaymentReconciliation>()
|
||||
.eq(PaymentReconciliation::getEncounterId, encounterId)
|
||||
.in(PaymentReconciliation::getStatusEnum, PaymentStatus.SUCCESS.getValue(), PaymentStatus.REFUNDING.getValue())
|
||||
.eq(PaymentReconciliation::getKindEnum, PaymentKind.HOSPITAL_DEPOSIT.getValue())
|
||||
.eq(PaymentReconciliation::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否已退费
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询自付比例等
|
||||
*
|
||||
* @param paymentedItemList 收款明细
|
||||
* @return 学生付款实体
|
||||
*/
|
||||
private List<StudentPaymentItemModel> getStudentPaymentItemModelList(List<PaymentedItemModel> paymentedItemList) {
|
||||
|
||||
// 大项比例
|
||||
List<GfTypeRatioDto> typeRatioList = gfRatioService.getTypeRatioList();
|
||||
Map<String, Map<String, List<GfTypeRatioDto>>> result = typeRatioList.stream().collect(
|
||||
// 第一次分组:按 ybClass 分组(外层 key 为 ybClass)
|
||||
Collectors.groupingBy(GfTypeRatioDto::getYbClass,
|
||||
// 第二次分组:对每个分组的 List 再按 subType 分组(内层 key 为 subType)
|
||||
Collectors.groupingBy(GfTypeRatioDto::getYbLv)));
|
||||
|
||||
List<StudentPaymentItemModel> allPaymentItemList = new ArrayList<>();
|
||||
|
||||
Map<String, List<PaymentedItemModel>> paymentedItemListByServiceTableMap
|
||||
= paymentedItemList.stream().collect(Collectors.groupingBy(PaymentedItemModel::getServiceTable));
|
||||
|
||||
for (Map.Entry<String, List<PaymentedItemModel>> stringListEntry : paymentedItemListByServiceTableMap
|
||||
.entrySet()) {
|
||||
|
||||
String key = stringListEntry.getKey();
|
||||
ItemType itemType;
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(key)) {
|
||||
itemType = ItemType.MEDICINE;
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(key)) {
|
||||
itemType = ItemType.ACTIVITY;
|
||||
} else {
|
||||
throw new ServiceException("除药品和诊疗项目外不存在其他公费项目,请确认!");
|
||||
}
|
||||
List<PaymentedItemModel> value = stringListEntry.getValue();
|
||||
List<StudentPaymentItemModel> paymentItemList = gfRatioService.getGfRatioList(itemType, value);
|
||||
|
||||
for (StudentPaymentItemModel studentPaymentItemModel : paymentItemList) {
|
||||
|
||||
// 如果自付比例有值,就continue掉
|
||||
if (studentPaymentItemModel.getSelfRatio() != null && studentPaymentItemModel.getTwiceRatio() != null) {
|
||||
continue;
|
||||
}
|
||||
// 查定价分类
|
||||
ChargeItemDefinition chargeItemDefinition
|
||||
= chargeItemDefinitionService.getById(studentPaymentItemModel.getDefinitionId());
|
||||
|
||||
// 查医保等级
|
||||
if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(studentPaymentItemModel.getProductTable())) {
|
||||
DeviceDefinition deviceDefinition
|
||||
= deviceDefinitionService.getById(studentPaymentItemModel.getProductId());
|
||||
if (deviceDefinition != null && chargeItemDefinition != null) {
|
||||
// 约定大项目的自付比例获取条件
|
||||
YbMedChrgItmType medChrgItmType = YbMedChrgItmType.getByValue(chargeItemDefinition.getYbType());
|
||||
if (medChrgItmType == null) {
|
||||
throw new ServiceException(chargeItemDefinition.getChargeName() + "未配置正确的医保分类!请检查!!!");
|
||||
}
|
||||
YbChrgitmLv chrgitmLv = YbChrgitmLv.getByValue(deviceDefinition.getChrgitmLv());
|
||||
if (chrgitmLv == null) {
|
||||
throw new ServiceException(chargeItemDefinition.getChargeName() + "未配置正确的医保等级!请检查!!!");
|
||||
}
|
||||
List<GfTypeRatioDto> gfTypeRatioDtos
|
||||
= result.get(chargeItemDefinition.getYbType()).get(chrgitmLv.getCode());
|
||||
if (gfTypeRatioDtos == null || gfTypeRatioDtos.isEmpty()) {
|
||||
throw new ServiceException(
|
||||
"医保分类:" + medChrgItmType.getInfo() + "医保等级:" + chrgitmLv.getInfo() + "未配置自付比例!请检查!!!");
|
||||
}
|
||||
|
||||
studentPaymentItemModel.setSelfRatio(gfTypeRatioDtos.get(0).getSelfRatio());
|
||||
studentPaymentItemModel.setTwiceRatio(gfTypeRatioDtos.get(0).getSelfRatio());
|
||||
|
||||
}
|
||||
} else if (CommonConstants.TableName.WOR_ACTIVITY_DEFINITION
|
||||
.equals(studentPaymentItemModel.getProductTable())) {
|
||||
ActivityDefinition activityDefinition
|
||||
= activityDefinitionService.getById(studentPaymentItemModel.getProductId());
|
||||
if (activityDefinition != null && chargeItemDefinition != null) {
|
||||
// 约定大项目的自付比例获取条件
|
||||
YbMedChrgItmType medChrgItmType = YbMedChrgItmType.getByValue(chargeItemDefinition.getYbType());
|
||||
if (medChrgItmType == null) {
|
||||
throw new ServiceException(chargeItemDefinition.getChargeName() + "未配置正确的医保分类!请检查!!!");
|
||||
}
|
||||
YbChrgitmLv chrgitmLv = YbChrgitmLv.getByValue(activityDefinition.getChrgitmLv());
|
||||
if (chrgitmLv == null) {
|
||||
throw new ServiceException(chargeItemDefinition.getChargeName() + "未配置正确的医保等级!请检查!!!");
|
||||
}
|
||||
List<GfTypeRatioDto> gfTypeRatioDtos
|
||||
= result.get(chargeItemDefinition.getYbType()).get(chrgitmLv.getCode());
|
||||
if (gfTypeRatioDtos == null || gfTypeRatioDtos.isEmpty()) {
|
||||
throw new ServiceException(
|
||||
"医保分类:" + medChrgItmType.getInfo() + "医保等级:" + chrgitmLv.getInfo() + "未配置自付比例!请检查!!!");
|
||||
}
|
||||
|
||||
studentPaymentItemModel.setSelfRatio(gfTypeRatioDtos.get(0).getSelfRatio());
|
||||
studentPaymentItemModel.setTwiceRatio(gfTypeRatioDtos.get(0).getSelfRatio());
|
||||
}
|
||||
} else if (CommonConstants.TableName.MED_MEDICATION_DEFINITION
|
||||
.equals(studentPaymentItemModel.getProductTable())) {
|
||||
MedicationDefinition medicationDefinition
|
||||
= medicationDefinitionService.getById(studentPaymentItemModel.getProductId());
|
||||
if (medicationDefinition != null && chargeItemDefinition != null) {
|
||||
// 约定大项目的自付比例获取条件
|
||||
YbMedChrgItmType medChrgItmType = YbMedChrgItmType.getByValue(chargeItemDefinition.getYbType());
|
||||
if (medChrgItmType == null) {
|
||||
throw new ServiceException(chargeItemDefinition.getChargeName() + "未配置正确的医保分类!请检查!!!");
|
||||
}
|
||||
YbChrgitmLv chrgitmLv = YbChrgitmLv.getByValue(medicationDefinition.getChrgitmLv());
|
||||
if (chrgitmLv == null) {
|
||||
throw new ServiceException(chargeItemDefinition.getChargeName() + "未配置正确的医保等级!请检查!!!");
|
||||
}
|
||||
List<GfTypeRatioDto> gfTypeRatioDtos
|
||||
= result.get(chargeItemDefinition.getYbType()).get(chrgitmLv.getCode());
|
||||
if (gfTypeRatioDtos == null || gfTypeRatioDtos.isEmpty()) {
|
||||
throw new ServiceException(
|
||||
"医保分类:" + medChrgItmType.getInfo() + "医保等级:" + chrgitmLv.getInfo() + "未配置自付比例!请检查!!!");
|
||||
}
|
||||
|
||||
studentPaymentItemModel.setSelfRatio(gfTypeRatioDtos.get(0).getSelfRatio());
|
||||
studentPaymentItemModel.setTwiceRatio(gfTypeRatioDtos.get(0).getSelfRatio());
|
||||
}
|
||||
} else {
|
||||
HealthcareService healthcareService
|
||||
= healthcareServiceService.getById(studentPaymentItemModel.getServiceId());
|
||||
if (healthcareService != null && chargeItemDefinition != null) {
|
||||
// 约定大项目的自付比例获取条件 医疗服务没有定义医保等级,默认百分百还是直接抛异常?
|
||||
studentPaymentItemModel.setSelfRatio(new BigDecimal("100"));
|
||||
studentPaymentItemModel.setTwiceRatio(new BigDecimal("100"));
|
||||
}
|
||||
}
|
||||
allPaymentItemList.addAll(paymentItemList);
|
||||
}
|
||||
}
|
||||
return allPaymentItemList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保预结算
|
||||
*
|
||||
* @param contract 合同b
|
||||
* @param ybMdtrtCertType 证件类型
|
||||
* @param busiCardInfo 电子密钥
|
||||
* @param paymentedItemList 收款明细
|
||||
* @return 预结算参数
|
||||
*/
|
||||
private PrePaymentResult studentPreSettleYb(Contract contract, YbMdtrtCertType ybMdtrtCertType, String busiCardInfo,
|
||||
List<PaymentedItemModel> paymentedItemList) {
|
||||
Map<String, List<PaymentedItemModel>> collect
|
||||
= paymentedItemList.stream().collect(Collectors.groupingBy(PaymentedItemModel::getMedType));
|
||||
// 一次医保结算只能支持一种医疗类型的结算
|
||||
for (Map.Entry<String, List<PaymentedItemModel>> medTypeKV : collect.entrySet()) {
|
||||
Clinic2206OrderOutput clinic2206OrderOutput = null;
|
||||
ClinicReg2201Output reg2201Output = null;
|
||||
if (!medTypeKV.getKey().equals(YbMedType.GENERAL_OUTPATIENT.getValue()) && "1"
|
||||
.equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))) {
|
||||
// 不是普通门诊就诊类型,补充挂号信息
|
||||
reg2201Output = ybManager.createRegWithMedType(contract, ybMdtrtCertType, busiCardInfo,
|
||||
medTypeKV.getValue().get(0).getEncounterId(),
|
||||
YbMedType.getByValue(medTypeKV.getValue().get(0).getMedType()));
|
||||
reg2201Output.setMedType(medTypeKV.getKey());// 2025/06/05慢病挂号后上传2206信息报错,2201返回值没有medType,此处更正赋值
|
||||
} else {
|
||||
// 从数据库里取reg2201
|
||||
reg2201Output = ybManager.getClinicRegByEncounterId(medTypeKV.getValue().get(0).getEncounterId());
|
||||
}
|
||||
if (reg2201Output == null) {
|
||||
throw new ServiceException("未查询到医保挂号信息");
|
||||
}
|
||||
// 调用预结算
|
||||
clinic2206OrderOutput
|
||||
= ybManager.preSettle(contract, medTypeKV.getValue().get(0).getEncounterId(), ybMdtrtCertType,
|
||||
busiCardInfo, reg2201Output, "01", medTypeKV.getValue(), YbMedType.getByValue(medTypeKV.getKey()));
|
||||
PrePaymentResult prePaymentResult = new PrePaymentResult();
|
||||
BeanUtils.copyProperties(clinic2206OrderOutput, prePaymentResult);
|
||||
return prePaymentResult;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.financial.domain.RefundLog;
|
||||
import com.openhis.financial.mapper.RefundLogMapper;
|
||||
import com.openhis.financial.service.IRefundLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 退号日志 Service实现类
|
||||
*/
|
||||
@Service
|
||||
public class RefundLogServiceImpl extends ServiceImpl<RefundLogMapper, RefundLog> implements IRefundLogService {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.common.constant.YbCommonConstants;
|
||||
import com.openhis.financial.domain.ThreePartPayCallBack;
|
||||
import com.openhis.financial.mapper.ThreePartPayCallBackMapper;
|
||||
import com.openhis.financial.service.ThreePartPayCallBackService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ThreePartPayCallBackServiceImpl extends ServiceImpl<ThreePartPayCallBackMapper, ThreePartPayCallBack>
|
||||
implements ThreePartPayCallBackService {
|
||||
|
||||
@Override
|
||||
public ThreePartPayCallBack getByPayment(Long paymentId) {
|
||||
return baseMapper
|
||||
.selectOne(new LambdaQueryWrapper<ThreePartPayCallBack>().eq(ThreePartPayCallBack::getPaymentId, paymentId)
|
||||
.eq(ThreePartPayCallBack::getDeleteFlag, DelFlag.NO.getCode()).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user