Authored by LUOXC

fixbug

@@ -286,7 +286,7 @@ public class AppraiseService { @@ -286,7 +286,7 @@ public class AppraiseService {
286 //清缓存 286 //清缓存
287 SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid()); 287 SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
288 Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null); 288 Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
289 - inBoxFacade.noticeBuyerWhenDeliveryGoodsToBuyer(buyerOrder.getUid(), buyerOrder.getOrderCode(), sellerOrderGoods, product); 289 + inBoxFacade.noticeBuyerWhenDeliveryDepositGoodsToBuyer(buyerOrder.getUid(), appraiseExpressInfoBo.getWayBillCode(), sellerOrderGoods, product);
290 }else { 290 }else {
291 LOGGER.warn("in deliveryGoodsToBuyer, buyer Deposit Order orderCode {}", buyerOrder.getOrderCode()); 291 LOGGER.warn("in deliveryGoodsToBuyer, buyer Deposit Order orderCode {}", buyerOrder.getOrderCode());
292 throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE); 292 throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
@@ -216,6 +216,51 @@ public class InBoxFacade { @@ -216,6 +216,51 @@ public class InBoxFacade {
216 } 216 }
217 217
218 /** 218 /**
  219 + * 平台发货给买家
  220 + *
  221 + * @return
  222 + */
  223 + public void noticeBuyerWhenDeliveryDepositGoodsToBuyer(int buyerUid, String wayBillCode, SellerOrderGoods psog,Product product) {
  224 +
  225 + executorService.execute(()->{
  226 +
  227 + try {
  228 + logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer inbox msg, buyerUid {}, wayBillCode {}, psog {},SellerOrderGoods {} product {}",
  229 + buyerUid, wayBillCode, psog, JSON.toJSONString(psog), JSON.toJSONString(product));
  230 + String skupTypeText=SkupType.getSkupType(psog.getAttributes()).attrName();
  231 + String prdName = psog.getProductName();
  232 + String sizeName = psog.getSizeName();
  233 + String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
  234 +
  235 + InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DEPOSIT_GOODS_PURCHASE_SENDED;
  236 + String params = buildParams(prdName,sizeName,productCode);
  237 + InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
  238 +
  239 + InBoxResponse resp = inBoxSDK.addInbox(req);
  240 + logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer inbox msg, buyerUid {}, wayBillCode {}, prdName {},SellerOrderGoods {} resp {}",
  241 + buyerUid, wayBillCode, prdName, JSON.toJSONString(psog), resp);
  242 +
  243 + //短信
  244 + String phone = userProxyService.getMobile(buyerUid);
  245 + if (StringUtils.isBlank(phone)){
  246 + logger.warn("in noticeBuyerWhenDeliveryGoodsToBuyer notice buyer sms fail, buyerUid {} wayBillCode {} prdName {} ",
  247 + buyerUid, wayBillCode,prdName);
  248 + }else{
  249 + List<String> mobileList = Arrays.asList(phone);
  250 + String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DEPOSIT_GOODS_PURCHASE_SENDED.getContent(),prdName,sizeName,productCode,wayBillCode);
  251 + sendSmsService.smsSendByMobile(content,mobileList);
  252 + logger.info("record noticeBuyerWhenDeliveryGoodsToBuyer notice buyer sms msg, buyerUid {}, wayBillCode {}, prdName {} phone {}",
  253 + buyerUid, wayBillCode,prdName, phone);
  254 + }
  255 + } catch (Exception e) {
  256 + logger.warn("InBoxFacade noticeBuyerWhenDeliveryGoodsToBuyer error inbox msg, buyerUid {}, wayBillCode {} ,psog {}",
  257 + buyerUid, wayBillCode, psog, e);
  258 + }
  259 + });
  260 +
  261 + }
  262 +
  263 + /**
219 * 平台已发货给买家 264 * 平台已发货给买家
220 * 265 *
221 * @return 266 * @return