...
|
...
|
@@ -120,128 +120,15 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 瑕疵不接受,卖家消息
|
|
|
*/
|
|
|
public void sellerMiniFaultUnAccept(SellerOrderGoods sog,long orderCode,boolean outTimeFlag) {
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
|
|
|
|
|
|
boolean isFastDelivery = fastDeliveryProxyService.isFastDeliveryGoods(sog.getId());
|
|
|
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_MINI_FAULT_UN_ACCEPT;
|
|
|
if(outTimeFlag){
|
|
|
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_MINI_FAULT_UN_ACCEPT_OUT_TIME;
|
|
|
}
|
|
|
String params = buildParams(goodsTypeTag,prdName, sizeName,productCode);
|
|
|
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record sellerMiniFaultUnAccept inbox msg, SellerOrderGoods {} ,sellerUid {}, prdName {}, sizeName {},resp {}",
|
|
|
JSON.toJSONString(sog),sellerUid, prdName, sizeName, resp);
|
|
|
|
|
|
if (!isFastDelivery){
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(sellerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("sellerMiniFaultUnAccept sms send fail,sellerUid {}, prdName {}", sellerUid, prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
InboxBusinessTypeEnum sms=InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_MINI_FAULT_UN_ACCEPT;
|
|
|
if(outTimeFlag){
|
|
|
sms = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_MINI_FAULT_UN_ACCEPT_OUT_TIME;
|
|
|
}
|
|
|
String content = getReplacedContent(sms.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode);
|
|
|
sendSmsService.smsSendByMobile(content, mobileList);
|
|
|
log.info("record sellerMiniFaultUnAccept inbox sms msg,sellerUid {}, prdName {},orderCode {}",
|
|
|
sellerUid, prdName,orderCode);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade sellerMiniFaultUnAccept error inbox msg, sellerUid {}, prdName {} ",
|
|
|
sellerUid, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 提醒买家支付成功&卖家已经发货
|
|
|
*
|
|
|
* @param sog SellerOrderGoods
|
|
|
* @param buyerOrder
|
|
|
*/
|
|
|
public void buyerPaidFastDelivery(SellerOrderGoods sog, BuyerOrder buyerOrder) {
|
|
|
Integer uid = buyerOrder.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
long orderCode = buyerOrder.getOrderCode();
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
|
|
|
// 买家支付成功通知
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.FAST_DELIVERY_NOTIFIED_SELLER;
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO req = buildInboxReqVO(uid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("buyerPaidFastDelivery buyer paied orderCode {}, resp {}", orderCode, JSON.toJSONString(resp));
|
|
|
|
|
|
String goodsTypeTag = buildGoodsTypeTag(sog, buyerOrder, TabType.BUY);
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(uid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("buyerPaidFastDelivery sms send fail,sellerUid {}, prdName {}",uid, prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER.getContent(),
|
|
|
goodsTypeTag, prdName, sizeName, productCode, orderCode);
|
|
|
sendSmsService.smsSendByMobile(content, mobileList);
|
|
|
log.info("record buyerPaidFastDelivery inbox sms msg, uid {},orderCode {}", uid, orderCode);
|
|
|
});
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade buyerPaidFastDelivery error inbox msg, uid {}, orderCode {} ",uid, orderCode, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 卖家发货提醒,买家支付购买后
|
|
|
*
|
|
|
* @param sog
|
|
|
*/
|
|
|
public void sellerSkupPaidByBuyerFastDelivery(SellerOrderGoods sog, BuyerOrder orderInfo) {
|
|
|
String logPrefix = "seller skup paid by buyer fast delivery";
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
try {
|
|
|
String goodsTypeTag = buildGoodsTypeTag(sog, orderInfo, TabType.SELL);
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
newSellerNotice(sog)
|
|
|
.withLogPrefix(logPrefix)
|
|
|
.withInBox(InboxBusinessTypeEnum.FAST_DELIVERY_SALE_SEND, goodsTypeTag, prdName, sizeName, productCode)
|
|
|
.send();
|
|
|
} catch (Exception e) {
|
|
|
log.warn("{} fail, sellerUid {}, prdName {} ", logPrefix, sellerUid, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 卖家发货提醒,买家支付购买后
|
...
|
...
|
|