Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
* 医保自费混合收款下单请求
Expand All @@ -25,6 +26,7 @@
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class MedInsOrdersRequest {

/**
Expand Down Expand Up @@ -282,72 +284,72 @@ public class MedInsOrdersRequest {
* 字段名:总金额
* 变量名:total_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:总金额
* </pre>
*/
@SerializedName("total_fee")
public Long totalFee;
public Integer totalFee;

/**
* <pre>
* 字段名:医保统筹基金支付金额
* 变量名:med_ins_gov_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:医保统筹基金支付金额
* </pre>
*/
@SerializedName("med_ins_gov_fee")
public Long medInsGovFee;
public Integer medInsGovFee;

/**
* <pre>
* 字段名:医保个人账户支付金额
* 变量名:med_ins_self_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:医保个人账户支付金额
* </pre>
*/
@SerializedName("med_ins_self_fee")
public Long medInsSelfFee;
public Integer medInsSelfFee;

/**
* <pre>
* 字段名:医保其他基金支付金额
* 变量名:med_ins_other_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:医保其他基金支付金额
* </pre>
*/
@SerializedName("med_ins_other_fee")
public Long medInsOtherFee;
public Integer medInsOtherFee;

/**
* <pre>
* 字段名:医保现金支付金额
* 变量名:med_ins_cash_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:医保现金支付金额
* </pre>
*/
@SerializedName("med_ins_cash_fee")
public Long medInsCashFee;
public Integer medInsCashFee;

/**
* <pre>
* 字段名:微信支付现金支付金额
* 变量名:wechat_pay_cash_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:微信支付现金支付金额
* </pre>
*/
@SerializedName("wechat_pay_cash_fee")
public Long wechatPayCashFee;
public Integer wechatPayCashFee;

/**
* <pre>
Expand Down Expand Up @@ -462,6 +464,11 @@ public class MedInsOrdersRequest {
* 支付人身份信息
* </pre>
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public static class PersonIdentification {
/**
* <pre>
Expand Down Expand Up @@ -507,18 +514,23 @@ public static class PersonIdentification {
* 现金增加明细实体
* </pre>
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public static class CashAddEntity {
/**
* <pre>
* 字段名:现金增加金额
* 变量名:cash_add_fee
* 必填:是
* 类型:long
* 类型:Integer
* 描述:现金增加金额
* </pre>
*/
@SerializedName("cash_add_fee")
public Long cashAddFee;
public Integer cashAddFee;

/**
* <pre>
Expand All @@ -538,18 +550,23 @@ public static class CashAddEntity {
* 现金减少明细实体
* </pre>
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public static class CashReduceEntity {
/**
* <pre>
* 字段名:现金减少金额
* 变量名:cash_reduce_fee
* 必填:是
* 类型:long
* 类型:Integer
* 描述:现金减少金额
* </pre>
*/
@SerializedName("cash_reduce_fee")
public Long cashReduceFee;
public Integer cashReduceFee;

/**
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class MedInsOrdersResult {
* </pre>
*/
@SerializedName("med_ins_pay_status")
public MedInsPayStatusEnum medInsPayStatusEnum;
public MedInsPayStatusEnum medInsPayStatus;

/**
* <pre>
Expand Down Expand Up @@ -320,72 +320,72 @@ public class MedInsOrdersResult {
* 字段名:总金额
* 变量名:total_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:总金额
* </pre>
*/
@SerializedName("total_fee")
public Long totalFee;
public Integer totalFee;

/**
* <pre>
* 字段名:医保统筹基金支付金额
* 变量名:med_ins_gov_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:医保统筹基金支付金额
* </pre>
*/
@SerializedName("med_ins_gov_fee")
public Long medInsGovFee;
public Integer medInsGovFee;

/**
* <pre>
* 字段名:医保个人账户支付金额
* 变量名:med_ins_self_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:医保个人账户支付金额
* </pre>
*/
@SerializedName("med_ins_self_fee")
public Long medInsSelfFee;
public Integer medInsSelfFee;

/**
* <pre>
* 字段名:医保其他基金支付金额
* 变量名:med_ins_other_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:医保其他基金支付金额
* </pre>
*/
@SerializedName("med_ins_other_fee")
public Long medInsOtherFee;
public Integer medInsOtherFee;

/**
* <pre>
* 字段名:医保现金支付金额
* 变量名:med_ins_cash_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:医保现金支付金额
* </pre>
*/
@SerializedName("med_ins_cash_fee")
public Long medInsCashFee;
public Integer medInsCashFee;

/**
* <pre>
* 字段名:微信支付现金支付金额
* 变量名:wechat_pay_cash_fee
* 必填:否
* 类型:long
* 类型:Integer
* 描述:微信支付现金支付金额
* </pre>
*/
@SerializedName("wechat_pay_cash_fee")
public Long wechatPayCashFee;
public Integer wechatPayCashFee;

/**
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@
@AllArgsConstructor
public class MedInsRefundNotifyRequest {

/**
* <pre>
* 字段名:医保自费混合订单号
* 必填:是
* 类型:string(32)
* 描述:医保自费混合订单号
* </pre>
*/
private String mixTradeNo;

/**
* <pre>
* 字段名:医疗机构的商户号
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ public interface MiPayService {
* </pre>
*
* @param request 医保退款通知请求参数
* @param mixTradeNo 【医保自费混合订单号】 医保自费混合订单号
* @throws WxPayException the wx pay exception
*/
void medInsRefundNotify(MedInsRefundNotifyRequest request) throws WxPayException;
void medInsRefundNotify(MedInsRefundNotifyRequest request, String mixTradeNo) throws WxPayException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public MiPayNotifyV3Result parseMiPayNotifyV3Result(String notifyData, Signature
}

@Override
public void medInsRefundNotify(MedInsRefundNotifyRequest request) throws WxPayException {
String url = String.format("%s/v3/med-ins/refunds/notify?mix_trade_no=%s", this.payService.getPayBaseUrl(), request.getMixTradeNo());
public void medInsRefundNotify(MedInsRefundNotifyRequest request, String mixTradeNo) throws WxPayException {
String url = String.format("%s/v3/med-ins/refunds/notify?mix_trade_no=%s", this.payService.getPayBaseUrl(), mixTradeNo);
this.payService.postV3(url, GSON.toJson(request));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,12 @@ public void medInsRefundNotify() throws WxPayException {

// 解析请求参数
MedInsRefundNotifyRequest request = GSON.fromJson(requestParamStr, MedInsRefundNotifyRequest.class);
request.setMixTradeNo(mixTradeNo);

MiPayService miPayService = wxPayService.getMiPayService();

try {
// 调用医保退款通知方法,预期会失败,因为是模拟数据
miPayService.medInsRefundNotify(request);
miPayService.medInsRefundNotify(request,mixTradeNo);
log.info("医保退款通知调用成功");
} catch (WxPayException e) {
// 预期会抛出异常,因为是模拟数据
Expand Down