Authored by LUOXC

fixbug

... ... @@ -286,7 +286,7 @@ public class AppraiseService {
//清缓存
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
inBoxFacade.noticeBuyerWhenDeliveryGoodsToBuyer(buyerOrder.getUid(), buyerOrder.getOrderCode(), sellerOrderGoods, product);
inBoxFacade.noticeBuyerWhenDeliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(), sellerOrderGoods, product);
}else {
LOGGER.warn("in deliveryGoodsToBuyer, buyer Deposit Order orderCode {}", buyerOrder.getOrderCode());
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
... ...
... ... @@ -216,6 +216,51 @@ public class InBoxFacade {
}
/**
* 平台发货给买家
*
* @return
*/
public void noticeBuyerWhenDeliveryDepositGoodsToBuyer(int buyerUid, String wayBillCode, SellerOrderGoods psog,Product product) {
executorService.execute(()->{
try {
logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer inbox msg, buyerUid {}, wayBillCode {}, psog {},SellerOrderGoods {} product {}",
buyerUid, wayBillCode, 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.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("record noticeBuyerWhenDeliveryGoodsToBuyer inbox msg, buyerUid {}, wayBillCode {}, prdName {},SellerOrderGoods {} resp {}",
buyerUid, wayBillCode, prdName, JSON.toJSONString(psog), resp);
//短信
String phone = userProxyService.getMobile(buyerUid);
if (StringUtils.isBlank(phone)){
logger.warn("in noticeBuyerWhenDeliveryGoodsToBuyer 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("record noticeBuyerWhenDeliveryGoodsToBuyer notice buyer sms msg, buyerUid {}, wayBillCode {}, prdName {} phone {}",
buyerUid, wayBillCode,prdName, phone);
}
} catch (Exception e) {
logger.warn("InBoxFacade noticeBuyerWhenDeliveryGoodsToBuyer error inbox msg, buyerUid {}, wayBillCode {} ,psog {}",
buyerUid, wayBillCode, psog, e);
}
});
}
/**
* 平台已发货给买家
*
* @return
... ...