Authored by LUOXC

fixbug

@@ -248,7 +248,7 @@ public class BuyerOrderCancelService { @@ -248,7 +248,7 @@ public class BuyerOrderCancelService {
248 // 通知卖家商品发货超时 248 // 通知卖家商品发货超时
249 .withNoticeSeller((soa, buyerOrder) -> sellerNoticeFacade.sellerDeliverWithTimes(soa, buyerOrder, 3, 0, null)).and() 249 .withNoticeSeller((soa, buyerOrder) -> sellerNoticeFacade.sellerDeliverWithTimes(soa, buyerOrder, 3, 0, null)).and()
250 // 通知买家卖家商品发货超时 250 // 通知买家卖家商品发货超时
251 - .withNoticeBuyer(inBoxFacade::noticeBuyerOfSellerSendOutTimeout).and() 251 + .withNoticeBuyer(buyerNoticeFacade::noticeBuyerOfSellerSendOutTimeout).and()
252 // 退优惠券 252 // 退优惠券
253 .withRefundCoupon(BuyerRefundCouponEvent.BizCase.SELLER_DELIVER_TIMEOUT) 253 .withRefundCoupon(BuyerRefundCouponEvent.BizCase.SELLER_DELIVER_TIMEOUT)
254 .withCacheCleaner(cacheCleaner::delete) 254 .withCacheCleaner(cacheCleaner::delete)
1 package com.yohoufo.order.service.proxy; 1 package com.yohoufo.order.service.proxy;
2 2
3 -import com.alibaba.fastjson.JSON;  
4 import com.yoho.message.sdk.common.constants.UFOMessageScene; 3 import com.yoho.message.sdk.common.constants.UFOMessageScene;
5 import com.yoho.message.sdk.service.ufo.IUFOSendService; 4 import com.yoho.message.sdk.service.ufo.IUFOSendService;
6 import com.yoho.message.sdk.service.ufo.UFOMessageService; 5 import com.yoho.message.sdk.service.ufo.UFOMessageService;
@@ -11,19 +10,14 @@ import com.yohoufo.dal.order.model.BuyerOrder; @@ -11,19 +10,14 @@ import com.yohoufo.dal.order.model.BuyerOrder;
11 import com.yohoufo.dal.order.model.SellerOrderGoods; 10 import com.yohoufo.dal.order.model.SellerOrderGoods;
12 import com.yohoufo.dal.product.ProductMapper; 11 import com.yohoufo.dal.product.ProductMapper;
13 import com.yohoufo.dal.product.model.Product; 12 import com.yohoufo.dal.product.model.Product;
14 -import com.yohoufo.inboxclient.model.InBoxResponse;  
15 -import com.yohoufo.inboxclient.model.InboxReqVO;  
16 import com.yohoufo.order.service.impl.function.BuyerNoticeSender; 13 import com.yohoufo.order.service.impl.function.BuyerNoticeSender;
17 import lombok.NonNull; 14 import lombok.NonNull;
18 import lombok.extern.slf4j.Slf4j; 15 import lombok.extern.slf4j.Slf4j;
19 -import org.apache.commons.lang3.StringUtils;  
20 import org.slf4j.Logger; 16 import org.slf4j.Logger;
21 import org.springframework.beans.factory.annotation.Autowired; 17 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.stereotype.Service; 18 import org.springframework.stereotype.Service;
23 19
24 -import java.util.Arrays;  
25 import java.util.LinkedHashMap; 20 import java.util.LinkedHashMap;
26 -import java.util.List;  
27 import java.util.Optional; 21 import java.util.Optional;
28 import java.util.function.Function; 22 import java.util.function.Function;
29 import java.util.function.Supplier; 23 import java.util.function.Supplier;
@@ -591,7 +585,24 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { @@ -591,7 +585,24 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
591 .withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER, goodsTypeTag, prdName, sizeName, productCode, orderCode) 585 .withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER, goodsTypeTag, prdName, sizeName, productCode, orderCode)
592 .send(); 586 .send();
593 } catch (Exception e) { 587 } catch (Exception e) {
594 - log.warn("buyer paid fast delivery fail, uid {}, orderCode {} ",uid, orderCode, e); 588 + log.warn("buyer paid fast delivery fail, uid {}, orderCode {} ", uid, orderCode, e);
  589 + }
  590 + }
  591 +
  592 +
  593 + public void noticeBuyerOfSellerSendOutTimeout(BuyerNoticeSender.Request request) {
  594 + Integer uid = request.getUid();
  595 + Long orderCode = request.getOrderCode();
  596 + try {
  597 + BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
  598 + newBuyerNotice(buyerOrder)
  599 + .withLogPrefix("notice buyer of seller send out timeout")
  600 + .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT, orderCode)
  601 + .withPush(() -> ufoSendService.sellerDeliverHours(String.valueOf(uid), String.valueOf(orderCode)))
  602 + .withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT, orderCode)
  603 + .send();
  604 + } catch (Exception e) {
  605 + log.warn("notice buyer of seller send out timeout fail,uid {}", uid, e);
595 } 606 }
596 } 607 }
597 608
@@ -472,36 +472,6 @@ public class InBoxFacade extends BaseNoticeFacade{ @@ -472,36 +472,6 @@ public class InBoxFacade extends BaseNoticeFacade{
472 472
473 473
474 474
475 - public void noticeBuyerOfSellerSendOutTimeout(BuyerNoticeSender.Request request){  
476 - Integer uid = request.getUid();  
477 - Long orderCode = request.getOrderCode();  
478 - String params = buildParams(orderCode);  
479 - InboxReqVO inboxMessage = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT);  
480 -  
481 -  
482 - String smsContent = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_SELLER_SEND_OUT_TIMEOUT.getContent(), orderCode);  
483 - try {  
484 - log.info("noticeBuyerOfSellerSendOutTimeout,uid {} request is {}", uid, request);  
485 - executorService.execute(() -> {  
486 - InBoxResponse inBoxResponse = inBoxSDK.addInbox(inboxMessage);  
487 - log.info("noticeBuyerOfSellerSendOutTimeout inbox send success, message is {} res is {}", inboxMessage, inBoxResponse);  
488 -  
489 - //发push  
490 - SendMessageRspBo bo = ufoSendService.sellerDeliverHours(String.valueOf(uid),String.valueOf(orderCode));  
491 - log.info("record noticeBuyerOfSellerSendOutTimeout push buyer uid is {}, orderCode is {}, result is {}", uid, orderCode, JSON.toJSONString(bo));  
492 -  
493 - String phone = userProxyService.getMobile(uid);  
494 - if (StringUtils.isBlank(phone)) {  
495 - log.warn("noticeBuyerOfSellerSendOutTimeout sms send fail,uid {} can not find phone", uid);  
496 - return;  
497 - }  
498 - sendSmsService.smsSendByMobile(smsContent, Arrays.asList(phone));  
499 - log.info("noticeBuyerOfSellerSendOutTimeout sms send success,uid {}", uid);  
500 - });  
501 - } catch (Exception e) {  
502 - log.warn("noticeBuyerOfSellerSendOutTimeout fail,uid {}", uid, e);  
503 - }  
504 - }  
505 475
506 476
507 477