|
@@ -24,6 +24,8 @@ import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
+import static com.caimei.module.pay.util.PayUtils.CHARSET;
|
|
|
+
|
|
|
/**
|
|
|
* Description
|
|
|
*
|
|
@@ -566,9 +568,34 @@ public class PayServiceImpl implements PayService {
|
|
|
}
|
|
|
payDao.updateUserBeans(order.getUserID(), userBeans);
|
|
|
}
|
|
|
+ //已支付短信推送
|
|
|
+ if (user != null && StringUtils.isNotBlank(user.getBindMobile()) && user.getBindMobile().length() == 11 && "3".equals(order.getReceiptStatus())) {
|
|
|
+ String shortLink = getShortLink(8, 6, "https://www.caimei365.com/user/order/detail.html?orderId=" + order.getOrderID());
|
|
|
+ String content = "您已成功支付订单(订单编号:" + order.getOrderNo() + ")全部款项,支付总金额¥" + order.getPayTotalFee() + ",采美平台将立即安排发货。您可关注采美公众号或者访问采美微信小程序和网站查看订单。" +
|
|
|
+ "平台公众号:微信搜索“采美365网”; 微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
|
|
|
+ Map<String, String> map = new HashMap<>(2);
|
|
|
+ map.put("content", content);
|
|
|
+ map.put("mobile", user.getBindMobile());
|
|
|
+ String result = HttpClient4Utils.httpPost("https://core.caimei365.com/tools/sms/send", map, CHARSET, 60);
|
|
|
+ JSONObject parseObject = JSONObject.parseObject(result);
|
|
|
+ Integer code = parseObject.getInteger("code");
|
|
|
+ if (code != 0) {
|
|
|
+ log.info("已支付短信推送失败,订单id>>>>" + order.getOrderID());
|
|
|
+ }
|
|
|
+ }
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
|
|
|
+ public String getShortLink(int length, int markId, String url) {
|
|
|
+ String shortLink = RandomCodeGenerator.generateShortLink(length);
|
|
|
+ Integer id = payDao.findBYShortLink(shortLink);
|
|
|
+ if (id != null && id > 0) {
|
|
|
+ getShortLink(length, markId, url);
|
|
|
+ }
|
|
|
+ payDao.insertShortLink(markId, shortLink, url);
|
|
|
+ return shortLink;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 判断是否是充值商品
|
|
|
*
|