...
|
...
|
@@ -6,6 +6,7 @@ import com.yohoufo.dal.order.model.SellerOrderGoods; |
|
|
import com.yohoufo.inboxclient.model.InBoxResponse;
|
|
|
import com.yohoufo.inboxclient.model.InboxReqVO;
|
|
|
import com.yohoufo.inboxclient.sdk.InBoxSDK;
|
|
|
import com.yohoufo.order.service.impl.function.BuyerNoticeSender;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
...
|
...
|
@@ -654,6 +655,87 @@ public class InBoxFacade { |
|
|
}
|
|
|
}
|
|
|
|
|
|
public void noticeSellerOfSellerShamSendOut(SellerOrderGoods sog,long orderCode){
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
// 发站内信
|
|
|
logger.info("record seller sham send out inbox sms msg for seller,sellerUid {}, prdName {}", sellerUid, prdName);
|
|
|
String params = buildParams(prdName, sizeName);
|
|
|
InboxReqVO req = buildInboxReqVO(sellerUid, params, InboxBusinessTypeEnum.NOTICE_SELLER_SELLER_SHAM_SEND_OUT);
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
logger.info("record seller sham send out inbox msg,sellerUid {}, prdName {},sizeName {} resp {}",
|
|
|
sellerUid, prdName, sizeName, resp);
|
|
|
// 发短信
|
|
|
String phone = userProxyService.getMobile(sellerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
logger.warn("seller sham send out sms send fail,sellerUid {}, prdName {}", sellerUid, prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_SELLER_SHAM_SEND_OUT.getContent(),prdName,orderCode);
|
|
|
sendSmsService.smsSendByMobile(content, mobileList);
|
|
|
logger.info("seller sham send out msg,sellerUid {}, prdName {}", sellerUid, prdName);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("InBoxFacade noticeSellerOfSellerShamSendOut error inbox msg, sellerUid {}, prdName {} ", sellerUid, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void noticeBuyerOfSellerShamSendOut(BuyerNoticeSender.Request request) {
|
|
|
Integer uid = request.getUid();
|
|
|
Long orderCode = request.getOrderCode();
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO inboxMessage = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.NOTICE_BUYER_SELLER_SHAM_SEND_OUT);
|
|
|
|
|
|
|
|
|
String smsContent = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_SELLER_SHAM_SEND_OUT.getContent(), orderCode);
|
|
|
try {
|
|
|
logger.info("noticeBuyerOfSellerShamSendOut,uid {} request is {}", uid, request);
|
|
|
executorService.execute(() -> {
|
|
|
InBoxResponse inBoxResponse = inBoxSDK.addInbox(inboxMessage);
|
|
|
logger.info("noticeBuyerOfSellerShamSendOut inbox send success, message is {} res is {}", inboxMessage, inBoxResponse);
|
|
|
String phone = userProxyService.getMobile(uid);
|
|
|
if (StringUtils.isBlank(phone)) {
|
|
|
logger.warn("noticeBuyerOfSellerShamSendOut sms send fail,uid {} can not find phone", uid);
|
|
|
return;
|
|
|
}
|
|
|
sendSmsService.smsSendByMobile(smsContent, Arrays.asList(phone));
|
|
|
logger.info("noticeBuyerOfSellerShamSendOut sms send success,uid {}", uid);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("noticeBuyerOfSellerShamSendOut fail,uid {}", uid, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void noticeBuyerOfSellerSendOutTimeout(BuyerNoticeSender.Request request){
|
|
|
Integer uid = request.getUid();
|
|
|
Long orderCode = request.getOrderCode();
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO inboxMessage = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT);
|
|
|
|
|
|
|
|
|
String smsContent = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT.getContent(), orderCode);
|
|
|
try {
|
|
|
logger.info("noticeBuyerOfSellerSendOutTimeout,uid {} request is {}", uid, request);
|
|
|
executorService.execute(() -> {
|
|
|
InBoxResponse inBoxResponse = inBoxSDK.addInbox(inboxMessage);
|
|
|
logger.info("noticeBuyerOfSellerSendOutTimeout inbox send success, message is {} res is {}", inboxMessage, inBoxResponse);
|
|
|
String phone = userProxyService.getMobile(uid);
|
|
|
if (StringUtils.isBlank(phone)) {
|
|
|
logger.warn("noticeBuyerOfSellerSendOutTimeout sms send fail,uid {} can not find phone", uid);
|
|
|
return;
|
|
|
}
|
|
|
sendSmsService.smsSendByMobile(smsContent, Arrays.asList(phone));
|
|
|
logger.info("noticeBuyerOfSellerSendOutTimeout sms send success,uid {}", uid);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("noticeBuyerOfSellerSendOutTimeout fail,uid {}", uid, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void sellerDeliverNotice(SellerOrderGoods sog,long orderCode, int times) {
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
...
|
...
|
@@ -666,10 +748,7 @@ public class InBoxFacade { |
|
|
} else if (times == 3) {
|
|
|
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_DELIVER_GOODS_FAIL;
|
|
|
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_NOTIFIED_SEND_FAILED;
|
|
|
} else if (times == 4) {
|
|
|
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_SELLER_SHAM_SEND_OUT;
|
|
|
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_SELLER_SHAM_SEND_OUT;
|
|
|
}else {
|
|
|
} else {
|
|
|
return;
|
|
|
}
|
|
|
try {
|
...
|
...
|
|