|
|
@@ -0,0 +1,28 @@
|
|
|
+package com.kym.service.wechat.impl;
|
|
|
+
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
+import com.kym.entity.RefundLog;
|
|
|
+import com.kym.service.cache.KymCache;
|
|
|
+import com.kym.service.wechat.TemplateParamBuilder;
|
|
|
+
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 退款申请消息模板参数构建器
|
|
|
+ */
|
|
|
+public class RefundApplyParamBuilder implements TemplateParamBuilder {
|
|
|
+ @Override
|
|
|
+ public Map<String, String> buildParams(Object... args) {
|
|
|
+ if (args.length == 0 || !(args[0] instanceof RefundLog)) {
|
|
|
+ throw new IllegalArgumentException("需要传入有效的参数");
|
|
|
+ }
|
|
|
+ RefundLog refundLog = (RefundLog) args[0];
|
|
|
+ return Map.of(
|
|
|
+ "character_string3", refundLog.getRefundId(),
|
|
|
+ "phone_number1", StpUtil.getSession().getString("mobilePhone"),
|
|
|
+ "amount2", refundLog.getRefund() / 100 + "元",
|
|
|
+ "time4", refundLog.getCreateTime().format(formatter),
|
|
|
+ "thing5", KymCache.INSTANCE.getUserStationName(refundLog.getUserId())
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|