|
@@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -34,6 +35,7 @@ import javax.annotation.Resource;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.concurrent.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Description
|
|
* Description
|
|
@@ -371,6 +373,7 @@ public class OrderClubServiceImpl implements OrderClubService {
|
|
order.setStatus(31);
|
|
order.setStatus(31);
|
|
order.setReceiptStatus(3);
|
|
order.setReceiptStatus(3);
|
|
}
|
|
}
|
|
|
|
+ Integer count=0;
|
|
log.info("********************下单微信公众号消息推送***************************");
|
|
log.info("********************下单微信公众号消息推送***************************");
|
|
if (0 == order.getSecondHandOrderFlag() && 0 == order.getRebateFlag() && !orderClubMapper.getProductOrder(order.getOrderId()).contains(6060) && order.getOrderType() != 0) {
|
|
if (0 == order.getSecondHandOrderFlag() && 0 == order.getRebateFlag() && !orderClubMapper.getProductOrder(order.getOrderId()).contains(6060) && order.getOrderType() != 0) {
|
|
log.info("*******" + order.getSecondHandOrderFlag() + "**********" + order.getRebateFlag());
|
|
log.info("*******" + order.getSecondHandOrderFlag() + "**********" + order.getRebateFlag());
|
|
@@ -397,11 +400,62 @@ public class OrderClubServiceImpl implements OrderClubService {
|
|
for (String openid : openidList) {
|
|
for (String openid : openidList) {
|
|
// sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
// sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
weChatService.sendTemplateMsgs(accessToken, openid, associateTitle, name,orderno, money, remarkText, pagePath);
|
|
weChatService.sendTemplateMsgs(accessToken, openid, associateTitle, name,orderno, money, remarkText, pagePath);
|
|
|
|
+ count++;
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("【订单发货通知】获取微信公众号access_token异常!", e);
|
|
log.error("【订单发货通知】获取微信公众号access_token异常!", e);
|
|
}
|
|
}
|
|
|
|
+ //推送信息中心-交易物流
|
|
|
|
+ MessageCenter messageCenter=new MessageCenter();
|
|
|
|
+ messageCenter.setShopID(null);
|
|
|
|
+ messageCenter.setClubID(order.getClubId());
|
|
|
|
+ messageCenter.setUserType(1);
|
|
|
|
+ messageCenter.setMessageType(1);
|
|
|
|
+ messageCenter.setOrderMessageType(1);
|
|
|
|
+ messageCenter.setOrderID(orderId);
|
|
|
|
+ messageCenter.setContent(null);
|
|
|
|
+ messageCenter.setTime(curDateStr);
|
|
|
|
+ orderClubMapper.addMessageCenter(messageCenter);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ log.info(">>>>>>>>>>>>>>>>>>>>>>"+orderId);
|
|
|
|
+ log.info("********************确认订单短信消息推送***************************");
|
|
|
|
+ if(count<=0){
|
|
|
|
+ ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(2);
|
|
|
|
+ executorService.schedule(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+// String orderno = orderClubMapper.getOrderNo(orderId);
|
|
|
|
+ OrderVo orderVo=orderClubMapper.getOrderMess(orderId);
|
|
|
|
+
|
|
|
|
+ String bindMobile = baseMapper.getBindMobileByUserId(order.getBuyUserId());
|
|
|
|
+ log.info(">>>>>>>>>>>>>>>>>>>>>>"+orderId);
|
|
|
|
+
|
|
|
|
+ log.info(">>>>>>>>>>>>>>>>>>>>>>"+orderVo.getProCount());
|
|
|
|
+ String name=orderVo.getProName();
|
|
|
|
+ if (name.length() > 10) {
|
|
|
|
+ name = StringUtils.strip(name.substring(0, 11));
|
|
|
|
+ name += "...";
|
|
|
|
+ }
|
|
|
|
+ if(orderVo.getPayFlag()==1 && orderVo.getOnlinePayFlag()==0){
|
|
|
|
+ String shortLink = remoteCallService.getShortLink(8, 2, "https://www.caimei365.com");
|
|
|
|
+ String content = "您已成功下单“"+ name +"”等"+orderVo.getProCount()+"件商品,订单编号:"+orderVo.getOrderNo()+"订单等待支付,支付完成后采美将尽快安排发货。您可点击采美网址www.caimei365.com或使用微信小程序“采美采购商城”查看并支付订单。";
|
|
|
|
+ boolean sendSms = remoteCallService.getSendSms(2, bindMobile, content);
|
|
|
|
+ if (!sendSms) {
|
|
|
|
+ log.info("》》》》》》》》》》》》》》》》协销下单短信推送失败");
|
|
|
|
+ }else {
|
|
|
|
+ log.info("》》》》》》》》》》》》》》》》协销下单短信推送成功");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }, 300000, TimeUnit.MILLISECONDS);
|
|
|
|
+ }else {log.info("》》》》》推送了协销下单短信");}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
order.setUpdateDate(curDateStr);
|
|
order.setUpdateDate(curDateStr);
|
|
order.setConfirmTime(curDateStr);
|
|
order.setConfirmTime(curDateStr);
|
|
//确认订单状态
|
|
//确认订单状态
|
|
@@ -470,6 +524,19 @@ public class OrderClubServiceImpl implements OrderClubService {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ //推送信息中心-取消订单
|
|
|
|
+ MessageCenter messageCenter=new MessageCenter();
|
|
|
|
+ messageCenter.setShopID(null);
|
|
|
|
+ messageCenter.setClubID(order.getClubId());
|
|
|
|
+ messageCenter.setUserType(1);
|
|
|
|
+ messageCenter.setMessageType(1);
|
|
|
|
+ messageCenter.setOrderMessageType(4);
|
|
|
|
+ messageCenter.setOrderID(orderId);
|
|
|
|
+ messageCenter.setContent("您的订单已成功取消!");
|
|
|
|
+ messageCenter.setTime(curDateStr);
|
|
|
|
+ orderClubMapper.addMessageCenter(messageCenter);
|
|
|
|
+
|
|
|
|
+
|
|
// 退回 采美豆
|
|
// 退回 采美豆
|
|
if (null != order.getUserBeans() && order.getUserBeans() > 0) {
|
|
if (null != order.getUserBeans() && order.getUserBeans() > 0) {
|
|
UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
@@ -505,8 +572,6 @@ public class OrderClubServiceImpl implements OrderClubService {
|
|
productService.updateUserBeans(beansHistory, beans, note);
|
|
productService.updateUserBeans(beansHistory, beans, note);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
//取消订单短信推送(取消推送)
|
|
//取消订单短信推送(取消推送)
|
|
if(orderClubMapper.getProductOrder(orderId).contains(6060)) {
|
|
if(orderClubMapper.getProductOrder(orderId).contains(6060)) {
|
|
String bindMobile = baseMapper.getBindMobileByUserId(order.getUserId());
|
|
String bindMobile = baseMapper.getBindMobileByUserId(order.getUserId());
|