remove monitor 增加充值管理 修复拼团等轮播不能修改的问题

This commit is contained in:
hupeng
2020-03-02 23:46:12 +08:00
parent 7bfdc8ad76
commit d38a482173
54 changed files with 668 additions and 737 deletions

View File

@ -40,7 +40,7 @@ public class YxPayService {
* @throws WxPayException
*/
public WxPayMpOrderResult wxPay(String orderId, String openId, String body,
Integer totalFee,int type) throws WxPayException {
Integer totalFee,String attach) throws WxPayException {
String apiUrl = redisHandler.getVal("api_url");
if (StrUtil.isBlank(apiUrl)) throw new ErrorRequestException("请配置api地址");
@ -54,11 +54,8 @@ public class YxPayService {
orderRequest.setOutTradeNo(orderId);
orderRequest.setTotalFee(totalFee);
orderRequest.setSpbillCreateIp("127.0.0.1");
if(type == 2){
orderRequest.setNotifyUrl(apiUrl + "/api/wechat/renotify");
}else{
orderRequest.setNotifyUrl(apiUrl + "/api/wechat/notify");
}
orderRequest.setNotifyUrl(apiUrl + "/api/wechat/notify");
orderRequest.setAttach(attach);
WxPayMpOrderResult orderResult = wxPayService.createOrder(orderRequest);
@ -78,7 +75,7 @@ public class YxPayService {
* @throws WxPayException
*/
public WxPayMwebOrderResult wxH5Pay(String orderId, String body,
Integer totalFee,int type) throws WxPayException {
Integer totalFee,String attach) throws WxPayException {
String apiUrl = redisHandler.getVal("api_url");
if (StrUtil.isBlank(apiUrl)) throw new ErrorRequestException("请配置api地址");
@ -91,11 +88,8 @@ public class YxPayService {
orderRequest.setOutTradeNo(orderId);
orderRequest.setTotalFee(totalFee);
orderRequest.setSpbillCreateIp("127.0.0.1");
if(type == 2){
orderRequest.setNotifyUrl(apiUrl + "/api/wechat/renotify");
}else{
orderRequest.setNotifyUrl(apiUrl + "/api/wechat/notify");
}
orderRequest.setNotifyUrl(apiUrl + "/api/wechat/notify");
orderRequest.setAttach(attach);
WxPayMwebOrderResult orderResult = wxPayService.createOrder(orderRequest);

View File

@ -0,0 +1,90 @@
package co.yixiang.mp.service;
import co.yixiang.mp.domain.YxWechatTemplate;
import co.yixiang.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassName 微信公众号模板通知
* @Author hupeng <610796224@qq.com>
* @Date 2020/3/2
**/
@Service
public class YxTemplateService {
private final String PAY_SUCCESS_KEY = "OPENTM207791277"; //pay
private final String DELIVERY_SUCCESS_KEY = "OPENTM200565259"; //Delivery
private final String REFUND_SUCCESS_KEY = "OPENTM410119152"; //Refund
@Autowired
private YxWechatTemplateService templateService;
@Autowired
private WxMpTemplateMessageService templateMessageService;
/**
* 支付成功通知
* @param orderId
* @param price
* @param openid
*/
public void paySuccessNotice(String orderId,String price,String openid){
String siteUrl = RedisUtil.get("site_url");
YxWechatTemplate WechatTemplate = templateService.findByTempkey(PAY_SUCCESS_KEY);
Map<String,String> map = new HashMap<>();
map.put("first","您的订单已支付成功,我们会尽快为您发货。");
map.put("keyword1",orderId);//订单号
map.put("keyword2",price);
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( openid
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderId,map);
}
/**
* 退款成功通知
* @param orderId
* @param price
* @param openid
* @param time
*/
public void refundSuccessNotice(String orderId,String price,String openid,String time){
String siteUrl = RedisUtil.get("site_url");
YxWechatTemplate WechatTemplate = templateService.findByTempkey(REFUND_SUCCESS_KEY);
Map<String,String> map = new HashMap<>();
map.put("first","您在yshop的订单退款申请被通过钱款将很快还至您的支付账户。");
map.put("keyword1",orderId);//订单号
map.put("keyword2",price);
map.put("keyword3", time);
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( openid
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderId,map);
}
/**
* 发货成功通知
* @param orderId
* @param deliveryName
* @param deliveryId
* @param openid
*/
public void deliverySuccessNotice(String orderId,String deliveryName,String deliveryId,String openid){
String siteUrl = RedisUtil.get("site_url");
YxWechatTemplate WechatTemplate = templateService.findByTempkey(DELIVERY_SUCCESS_KEY);
Map<String,String> map = new HashMap<>();
map.put("first","亲,宝贝已经启程了,好想快点来到你身边。");
map.put("keyword1",orderId);//订单号
map.put("keyword2",deliveryName);
map.put("keyword3",deliveryId);
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( openid
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderId,map);
}
}