|
@@ -1,9 +1,12 @@
|
|
|
package org.springblade.gateway.web_gateway.controller;
|
|
package org.springblade.gateway.web_gateway.controller;
|
|
|
|
|
|
|
|
import cn.hutool.core.convert.Convert;
|
|
import cn.hutool.core.convert.Convert;
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.common.cache.PaymentCache;
|
|
import org.springblade.common.cache.PaymentCache;
|
|
@@ -23,6 +26,10 @@ import org.springblade.payment.event.UserPayEvent;
|
|
|
import org.springblade.payment.event.UserWithdrawEvent;
|
|
import org.springblade.payment.event.UserWithdrawEvent;
|
|
|
import org.springblade.payment.handle.Trade;
|
|
import org.springblade.payment.handle.Trade;
|
|
|
import org.springblade.payment.handle.entity.Order;
|
|
import org.springblade.payment.handle.entity.Order;
|
|
|
|
|
+import org.springblade.wx.config.ConfigForShop;
|
|
|
|
|
+import org.springblade.wx.constant.MessageTemplate;
|
|
|
|
|
+import org.springblade.wx.constant.MiniProgramType;
|
|
|
|
|
+import org.springblade.wx.service.WeChatService;
|
|
|
import org.springblade.yeePay.common.YeePayConst;
|
|
import org.springblade.yeePay.common.YeePayConst;
|
|
|
import org.springblade.yeePay.common.YeepayApiConstant;
|
|
import org.springblade.yeePay.common.YeepayApiConstant;
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
@@ -53,6 +60,8 @@ public class PressureTestController {
|
|
|
private ApplicationEventPublisher eventPublisher;
|
|
private ApplicationEventPublisher eventPublisher;
|
|
|
private ILoginUserService loginUserService;
|
|
private ILoginUserService loginUserService;
|
|
|
private Trade trade;
|
|
private Trade trade;
|
|
|
|
|
+ private ConfigForShop configForShop;
|
|
|
|
|
+ private WeChatService weChatService;
|
|
|
|
|
|
|
|
@PostMapping("/userBalanceWithdraw")
|
|
@PostMapping("/userBalanceWithdraw")
|
|
|
@ApiOperation(value = "用户余额提现(结算)")
|
|
@ApiOperation(value = "用户余额提现(结算)")
|
|
@@ -186,4 +195,13 @@ public class PressureTestController {
|
|
|
return R.data(successParams);
|
|
return R.data(successParams);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/sendWXMessage")
|
|
|
|
|
+ @ApiModelProperty("测试发送微信收款信息")
|
|
|
|
|
+ public void sendWXMessage() {
|
|
|
|
|
+ String openId = "ofVsB40EmE24bQP-ZhUV5I5hBB0M";
|
|
|
|
|
+ String contentStr = String.format(MessageTemplate.PAYMENT_NOTICE.getContentString(), BigDecimal.valueOf(0.01), "已完结", "1457649143315988481", DateUtil.format(LocalDateTime.now(), "yyyy年MM月dd日 HH:mm:ss"));
|
|
|
|
|
+ JSONObject content = JSON.parseObject(contentStr);
|
|
|
|
|
+ weChatService.sendTemplateMessage(openId, MessageTemplate.PAYMENT_NOTICE, content, configForShop.getPaymentPage(), MiniProgramType.SHOP);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|