微信后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.4 KiB

package com.ynxbd.jy.bean;
import com.ynxbd.common.bean.pay.ReqOrder;
import com.ynxbd.jy.bean.enums.JYBusinessTypeEnum;
import com.ynxbd.jy.bean.enums.JYOrderTypeDetailEnum;
import com.ynxbd.jy.bean.enums.JYOrderTypeEnum;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
@Slf4j
@Getter
@Setter
@ToString
@NoArgsConstructor
public class JYOrder extends ReqOrder {
private String clinicNo;
private String hisTransDoneTime;
private String hisOperatorNo;
private String hisOperatorName;
private String receiptNo;
// ==================================
private String applicationId;
private String merchantId;
// 应用方订单号
private String merOrderNum;
// 支付平台订单号
private String orderId;
// 支付平台支付流水号
private String orderTransId;
// 支付网关订单号
private String threeTradeNo;
// 银行流水号
private String finalTransNo;
// 订单金额
private String orderAmt;
// 退款金额
private String refundAmt;
// 支付交易发起时间
private String tranDateTime;
// 支付时间-YYYYMMDDHHMMSS(订单支付时间)未支付时,为空字符串
private String paymentTime;
// 支付方式
private String payType;
// 订单状态[详见字典数据5.2 没有发生过退款业务的数据会包含此字段,如果发生过退款业务,则不会返回此字段,请以退款明细中状态为准;]
private String orderState;
// 订单状态描述
private String orderStateMessage;
// 订单费用类型[如:001:挂号费 002:医疗费 详见字典数据5.2订单费用类型]
private String orderType;
// 微信公众号用户标识
private String openId;
// 订单最后退款次数,未退款时无此字段。
private String refundCount;
// 订单最后退款时间,未退款时无此字段。
private String refundTime;
// 商户ID
private String appId;
// 商户号
private String merchantNo;
// 医保局返回信息
private String responseContent;
// 由接入方生成的签名
private String signValue;
// ====================================
// 支付类型明细
private String orderTypeDetail;
public JYOrderTypeEnum orderTypeEnum;
public JYBusinessTypeEnum businessTypeEnum;
// 支付类型明细
public JYOrderTypeDetailEnum orderTypeDetailEnum;
public int toInsurancePayType() {
int payType = 0;
if (super.totalFee.compareTo(super.insuranceFee) == 0) {
payType = 2; // 医保
} else if (super.totalFee.compareTo(super.cashFee) == 0) {
payType = 1; // 现金(1)
} else {
payType = 3; // 医保+现金
}
return payType;
}
public int toConsumeType() {
if (acctFee == null || insuranceFee == null) {
return 0;
}
if (acctFee.compareTo(BigDecimal.ZERO) > 0 && insuranceFee.compareTo(BigDecimal.ZERO) > 0) {
return 0; // 0:统筹+个账
}
if (acctFee.compareTo(BigDecimal.ZERO) > 0 && insuranceFee.compareTo(BigDecimal.ZERO) == 0) {
return 1; // 1:个账
}
if (acctFee.compareTo(BigDecimal.ZERO) == 0 && insuranceFee.compareTo(BigDecimal.ZERO) > 0) {
return 2; // 2:统筹
}
return 0;
}
}