🎨 修改微信医保支付模块的规范性问题,主要涉及字段命名标准化、数据类型调整和 API 方法签名优化
This commit is contained in:
@@ -12,6 +12,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 医保自费混合收款下单请求
|
||||
@@ -25,6 +26,7 @@ import lombok.NoArgsConstructor;
|
||||
@Builder(builderMethodName = "newBuilder")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class MedInsOrdersRequest {
|
||||
|
||||
/**
|
||||
@@ -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>
|
||||
@@ -462,6 +464,11 @@ public class MedInsOrdersRequest {
|
||||
* 支付人身份信息
|
||||
* </pre>
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class PersonIdentification {
|
||||
/**
|
||||
* <pre>
|
||||
@@ -507,18 +514,23 @@ public class MedInsOrdersRequest {
|
||||
* 现金增加明细实体
|
||||
* </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>
|
||||
@@ -538,18 +550,23 @@ public class MedInsOrdersRequest {
|
||||
* 现金减少明细实体
|
||||
* </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>
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MedInsOrdersResult {
|
||||
* </pre>
|
||||
*/
|
||||
@SerializedName("med_ins_pay_status")
|
||||
public MedInsPayStatusEnum medInsPayStatusEnum;
|
||||
public MedInsPayStatusEnum medInsPayStatus;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
@@ -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>
|
||||
|
||||
@@ -20,16 +20,6 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
public class MedInsRefundNotifyRequest {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:医保自费混合订单号
|
||||
* 必填:是
|
||||
* 类型:string(32)
|
||||
* 描述:医保自费混合订单号
|
||||
* </pre>
|
||||
*/
|
||||
private String mixTradeNo;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:医疗机构的商户号
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ public class MiPayServiceImpl implements MiPayService {
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
|
||||
@@ -131,13 +131,12 @@ public class MiPayServiceImplTest {
|
||||
|
||||
// 解析请求参数
|
||||
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) {
|
||||
// 预期会抛出异常,因为是模拟数据
|
||||
|
||||
Reference in New Issue
Block a user