...
|
...
|
@@ -166,103 +166,6 @@ public class InBoxFacade { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 平台发货给买家
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public void noticeBuyerWhenDeliveryGoodsToBuyer(int buyerUid, long orderCode, SellerOrderGoods psog,Product product) {
|
|
|
|
|
|
executorService.execute(()->{
|
|
|
|
|
|
try {
|
|
|
logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer inbox msg, buyerUid {}, orderCode {}, psog {},SellerOrderGoods {} product {}",
|
|
|
buyerUid, orderCode, psog, JSON.toJSONString(psog), JSON.toJSONString(product));
|
|
|
String skupTypeText=SkupType.getSkupType(psog.getAttributes()).attrName();
|
|
|
String prdName = psog.getProductName();
|
|
|
String sizeName = psog.getSizeName();
|
|
|
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
|
|
|
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_SENDED;
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer inbox msg, buyerUid {}, orderCode {}, prdName {},SellerOrderGoods {} resp {}",
|
|
|
buyerUid, orderCode, prdName, JSON.toJSONString(psog), resp);
|
|
|
|
|
|
//发push
|
|
|
SendMessageRspBo bo = ufoSendService.platformDeliverBuyer(String.valueOf(buyerUid),String.valueOf(orderCode));
|
|
|
logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer push buyer uid is {}, orderCode is {}, result is {}", buyerUid, orderCode, JSON.toJSONString(bo));
|
|
|
|
|
|
|
|
|
//seller notice
|
|
|
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(buyerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
logger.warn("in noticeBuyerWhenDeliveryGoodsToBuyer notice buyer sms fail, buyerUid {} orderCode {} prdName {} ", buyerUid, orderCode,prdName);
|
|
|
}else{
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_SEND.getContent(),skupTypeText,prdName,sizeName,productCode,orderCode);
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer notice buyer sms msg, buyerUid {}, orderCode {}, prdName {} phone {}",
|
|
|
buyerUid, orderCode,prdName, phone);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("InBoxFacade noticeBuyerWhenDeliveryGoodsToBuyer error inbox msg, buyerUid {}, orderCode {} ,psog {}",
|
|
|
buyerUid, orderCode, psog, e);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 平台发货给买家
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public void noticeBuyerWhenDeliveryDepositGoodsToBuyer(int buyerUid, String wayBillCode, Supplier<SellerOrderGoods> psogSupplier, Function<SellerOrderGoods,Product> productFunction) {
|
|
|
|
|
|
executorService.execute(()->{
|
|
|
|
|
|
try {
|
|
|
SellerOrderGoods psog = psogSupplier.get();
|
|
|
Product product = productFunction.apply(psog);
|
|
|
logger.info("noticeBuyerWhenDeliveryDepositGoodsToBuyer, buyerUid {}, wayBillCode {}, psog {},SellerOrderGoods {} product {}",
|
|
|
buyerUid, wayBillCode, psog, JSON.toJSONString(psog), JSON.toJSONString(product));
|
|
|
String prdName = psog.getProductName();
|
|
|
String sizeName = psog.getSizeName();
|
|
|
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
|
|
|
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DEPOSIT_GOODS_PURCHASE_SENDED;
|
|
|
String params = buildParams(prdName,sizeName,productCode);
|
|
|
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
logger.info("noticeBuyerWhenDeliveryDepositGoodsToBuyer, buyerUid {}, wayBillCode {}, prdName {},SellerOrderGoods {} resp {}",
|
|
|
buyerUid, wayBillCode, prdName, JSON.toJSONString(psog), resp);
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(buyerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
logger.warn("noticeBuyerWhenDeliveryDepositGoodsToBuyer notice buyer sms fail, buyerUid {} wayBillCode {} prdName {} ",
|
|
|
buyerUid, wayBillCode,prdName);
|
|
|
}else{
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DEPOSIT_GOODS_PURCHASE_SENDED.getContent(),prdName,sizeName,productCode,wayBillCode);
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
logger.info("noticeBuyerWhenDeliveryDepositGoodsToBuyer notice buyer sms msg, buyerUid {}, wayBillCode {}, prdName {} phone {}",
|
|
|
buyerUid, wayBillCode,prdName, phone);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("noticeBuyerWhenDeliveryDepositGoodsToBuyer fail, buyerUid {}, wayBillCode {}", buyerUid, wayBillCode, e);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 平台已发货给买家
|
|
|
*
|
|
|
* @return
|
...
|
...
|
|