|
|
@@ -23,6 +23,7 @@ import com.simple.service.WxOrderService; |
|
|
import com.simple.service.WxPayOrderService; |
|
|
import com.simple.service.WxPayOrderService; |
|
|
import com.simple.utils.*; |
|
|
import com.simple.utils.*; |
|
|
import me.chanjar.weixin.common.error.WxErrorException; |
|
|
import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.log4j.Logger; |
|
|
import org.apache.log4j.Logger; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
@@ -506,6 +507,23 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
*/ |
|
|
*/ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void sendPaySuccess() { |
|
|
|
|
|
/* |
|
|
|
|
|
WxAppinfo appinfoQ = new WxAppinfo(); |
|
|
|
|
|
appinfoQ.setTenantId("234"); |
|
|
|
|
|
appinfoQ.setType(EnumAppType.C.getCode()); |
|
|
|
|
|
List<WxAppinfo> appinfoList= wxAppinfoMapper.select(appinfoQ); |
|
|
|
|
|
WxAppinfo appinfo = appinfoList.get(0); |
|
|
|
|
|
|
|
|
|
|
|
String payOrderIdStr = "196936823522459648"; |
|
|
|
|
|
Long payOrderId = Long.valueOf(payOrderIdStr); |
|
|
|
|
|
WxPayOrder updateOrder = wxPayOrderMapper.selectByPrimaryKey(payOrderId); |
|
|
|
|
|
WxOrder order = wxOrderMapper.selectByPrimaryKey(updateOrder.getOrderId()); |
|
|
|
|
|
sendPaySuccessMsg(appinfo, order, updateOrder); |
|
|
|
|
|
*/ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 微信模板通知用户 |
|
|
* 微信模板通知用户 |
|
|
* @param updateOrder |
|
|
* @param updateOrder |
|
|
@@ -549,13 +567,19 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(updateOrder.getPrepayId())) { |
|
|
|
|
|
logger.error("prepayId为空"); |
|
|
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
WxMaService wxMaService = MaUtil.getWeappService(appInfo); |
|
|
WxMaService wxMaService = MaUtil.getWeappService(appInfo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
|
|
WxMaTemplateMessage templateMessage = WxMaTemplateMessage.builder() |
|
|
WxMaTemplateMessage templateMessage = WxMaTemplateMessage.builder() |
|
|
.toUser(user.getOpenId()) |
|
|
.toUser(user.getOpenId()) |
|
|
.formId(updateOrder.getPrepayId()) // 微信支付的formId是prepayId |
|
|
.formId(updateOrder.getPrepayId()) // 微信支付的formId是prepayId |
|
|
.page("index") |
|
|
|
|
|
|
|
|
.page("pages/index/index") |
|
|
.data(Lists.newArrayList( |
|
|
.data(Lists.newArrayList( |
|
|
new WxMaTemplateMessage.Data("keyword1", dateFormat.format(new Date()), "#173177"), |
|
|
new WxMaTemplateMessage.Data("keyword1", dateFormat.format(new Date()), "#173177"), |
|
|
new WxMaTemplateMessage.Data("keyword2", "微信支付", "#173177"), |
|
|
new WxMaTemplateMessage.Data("keyword2", "微信支付", "#173177"), |
|
|
|