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.

2.4 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

原始需求

  • 没有参加充值活动并且账户余额小于50元后台可以设置,系统自动退款原路返回。
  • 个人用户----用户充值 ---- 充电消费----余额到用户钱包,可以下次消费,如果没有参加充值送券活动,则该笔充值可以申请退款。后骒审核信息无误,可以原路退回。

开发思路

  • 微信小程序端调用 /financeapi/userRefund/recDataListNew 获取可以退款的订单列表。

解释:原来就有的接口,必须小程序来调用

  • 微信小程序将拿到的订单ids传递给后端接口 xxxxx:

接口逻辑如下:

(1) 获取允许退款的余额阀值,如果小于这个阀值才可以自动退款

(2) 没有参加过充值活动的

删除一些无效ID后生成一个新的ids列表返回给微信小程序,告诉小程序,这些是真的可以自动恳求的订单。

  • 微信小程序循环所有ids,调用 /financeapi/userRefund/apply 发起此笔订单的退款申请,这样,在数据库中就生成了这些有效的退款申请单。

解释:原来就有的接口,必须小程序来调用

  • 微信小程序调用 后端接口yyyyy,将ids作为参数让后端接口把此人的所有已申请的退款记录通过审核。
http://10.10.14.77:7003/financeapi/userRefund/agreeV2?rechargeId=431052&memo=%E6%88%91%E5%90%8C%E6%84%8F&rechargeOperer=superadmin&refundFee=171.03

下面是相关的一些细节

阀值

tkMoneyFaZhi

tkMoneyFaZhi 退款金额阀值 50
D:\dsWork\YltProject\Ylt\ms-finance\src\main\java\com\charge\finance\controller\RecManageController.java

Q:如何知道一条充值订单是不是可以退款?

用户在申请退款时,如果这笔充值参加了活动,用户就不能选择这笔充值退款。

refund\_state 6款状态0未退款 1已退款 2 退款失败 3退款申请审核 4未退款驳回 5建帮活动不可退款

select * from t_account_recharge where user_id=53958 and refund_state=6 order by id desc