Showing
4 changed files
with
51 additions
and
66 deletions
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; | @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; | ||
4 | import com.yoho.core.rabbitmq.YhConsumer; | 4 | import com.yoho.core.rabbitmq.YhConsumer; |
5 | import com.yohobuy.ufo.model.promotion.response.CrmCouponSendResultBean; | 5 | import com.yohobuy.ufo.model.promotion.response.CrmCouponSendResultBean; |
6 | import com.yohoufo.order.service.impl.function.BuyerNoticeSender; | 6 | import com.yohoufo.order.service.impl.function.BuyerNoticeSender; |
7 | -import com.yohoufo.order.service.proxy.InBoxFacade; | 7 | +import com.yohoufo.order.service.proxy.BuyerNoticeFacade; |
8 | import com.yohoufo.order.utils.LoggerUtils; | 8 | import com.yohoufo.order.utils.LoggerUtils; |
9 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -22,7 +22,7 @@ public class BuyerCouponSendResultForAppraiseUnsureConsumer implements YhConsume | @@ -22,7 +22,7 @@ public class BuyerCouponSendResultForAppraiseUnsureConsumer implements YhConsume | ||
22 | private Logger logger = LoggerUtils.getMqConsumerLogger(); | 22 | private Logger logger = LoggerUtils.getMqConsumerLogger(); |
23 | 23 | ||
24 | @Autowired | 24 | @Autowired |
25 | - private InBoxFacade inBoxFacade; | 25 | + private BuyerNoticeFacade buyerNoticeFacade; |
26 | 26 | ||
27 | @Override | 27 | @Override |
28 | public void handleMessage(Object o) throws Exception { | 28 | public void handleMessage(Object o) throws Exception { |
@@ -45,7 +45,7 @@ public class BuyerCouponSendResultForAppraiseUnsureConsumer implements YhConsume | @@ -45,7 +45,7 @@ public class BuyerCouponSendResultForAppraiseUnsureConsumer implements YhConsume | ||
45 | throw new RuntimeException("parse message params result is null"); | 45 | throw new RuntimeException("parse message params result is null"); |
46 | } | 46 | } |
47 | // 通知买家商品无法鉴定 | 47 | // 通知买家商品无法鉴定 |
48 | - inBoxFacade.noticeBuyerAppraiseUnsure(request); | 48 | + buyerNoticeFacade.noticeBuyerAppraiseUnsure(request); |
49 | } catch (Exception e) { | 49 | } catch (Exception e) { |
50 | logger.info("BuyerCouponSendResultForAppraiseUnsureConsumer fail receive msg:{}", o, e); | 50 | logger.info("BuyerCouponSendResultForAppraiseUnsureConsumer fail receive msg:{}", o, e); |
51 | } | 51 | } |
@@ -1841,7 +1841,7 @@ public class AppraiseService { | @@ -1841,7 +1841,7 @@ public class AppraiseService { | ||
1841 | * @param request | 1841 | * @param request |
1842 | */ | 1842 | */ |
1843 | private void noticeBuyerDetectNotPass(BuyerNoticeSender.Request request) { | 1843 | private void noticeBuyerDetectNotPass(BuyerNoticeSender.Request request) { |
1844 | - inBoxFacade.noticeBuyerDetectNotPass(request); | 1844 | + buyerNoticeFacade.noticeBuyerDetectNotPass(request); |
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | /** | 1847 | /** |
@@ -42,6 +42,7 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | @@ -42,6 +42,7 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | ||
42 | public Logger getLogger() { | 42 | public Logger getLogger() { |
43 | return log; | 43 | return log; |
44 | } | 44 | } |
45 | + | ||
45 | /** | 46 | /** |
46 | * 买家订单未付款 | 47 | * 买家订单未付款 |
47 | * | 48 | * |
@@ -61,10 +62,11 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | @@ -61,10 +62,11 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | ||
61 | 62 | ||
62 | /** | 63 | /** |
63 | * 鉴定订单 | 64 | * 鉴定订单 |
65 | + * | ||
64 | * @param uid | 66 | * @param uid |
65 | * @param orderCode | 67 | * @param orderCode |
66 | */ | 68 | */ |
67 | - public void sellerDepositOrderNotPaidNotice(int uid, long orderCode){ | 69 | + public void sellerDepositOrderNotPaidNotice(int uid, long orderCode) { |
68 | log.info("sellerDepositOrderNotPaidNotice uid {} orderCode {}", uid, orderCode); | 70 | log.info("sellerDepositOrderNotPaidNotice uid {} orderCode {}", uid, orderCode); |
69 | newNotice(uid) | 71 | newNotice(uid) |
70 | .withLogPrefix("notice seller DepositOrder not paid") | 72 | .withLogPrefix("notice seller DepositOrder not paid") |
@@ -483,7 +485,6 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | @@ -483,7 +485,6 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | ||
483 | 485 | ||
484 | 486 | ||
485 | /** | 487 | /** |
486 | - * | ||
487 | * @param buyerOrder | 488 | * @param buyerOrder |
488 | * @param inbox | 489 | * @param inbox |
489 | * @param sms | 490 | * @param sms |
@@ -520,4 +521,48 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | @@ -520,4 +521,48 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | ||
520 | 521 | ||
521 | } | 522 | } |
522 | 523 | ||
524 | + /** | ||
525 | + * 通知买家商品无法鉴定 | ||
526 | + * | ||
527 | + * @param request | ||
528 | + */ | ||
529 | + public void noticeBuyerAppraiseUnsure(@NonNull BuyerNoticeSender.Request request) { | ||
530 | + String logPrefix = "notice buyer appraise unsure"; | ||
531 | + Integer uid = request.getUid(); | ||
532 | + Long orderCode = request.getOrderCode(); | ||
533 | + try { | ||
534 | + BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode); | ||
535 | + newBuyerNotice(buyerOrder) | ||
536 | + .withLogPrefix(logPrefix) | ||
537 | + .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_APPRAISE_UNSURE, orderCode) | ||
538 | + .withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_APPRAISE_UNSURE, orderCode) | ||
539 | + .withPush(() -> ufoSendService.identifyFail(String.valueOf(uid), String.valueOf(orderCode))) | ||
540 | + .send(); | ||
541 | + } catch (Exception e) { | ||
542 | + log.warn("{} fail,uid {}", logPrefix, uid, e); | ||
543 | + } | ||
544 | + } | ||
545 | + | ||
546 | + /** | ||
547 | + * 通知买家商品无法鉴定 | ||
548 | + * | ||
549 | + * @param request | ||
550 | + */ | ||
551 | + public void noticeBuyerDetectNotPass(@NonNull BuyerNoticeSender.Request request) { | ||
552 | + String logPrefix = "notice buyer detect not pass"; | ||
553 | + Integer uid = request.getUid(); | ||
554 | + Long orderCode = request.getOrderCode(); | ||
555 | + try { | ||
556 | + BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode); | ||
557 | + newBuyerNotice(buyerOrder) | ||
558 | + .withLogPrefix(logPrefix) | ||
559 | + .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DETECTION_NOT_PASS, orderCode) | ||
560 | + .withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DETECTION_NOT_PASS, orderCode) | ||
561 | + .send(); | ||
562 | + } catch (Exception e) { | ||
563 | + log.warn("{} fail,uid {}", logPrefix, uid, e); | ||
564 | + } | ||
565 | + } | ||
566 | + | ||
567 | + | ||
523 | } | 568 | } |
@@ -706,70 +706,10 @@ public class InBoxFacade extends BaseNoticeFacade{ | @@ -706,70 +706,10 @@ public class InBoxFacade extends BaseNoticeFacade{ | ||
706 | } | 706 | } |
707 | } | 707 | } |
708 | 708 | ||
709 | - /** | ||
710 | - * 通知买家商品无法鉴定 | ||
711 | - * @param request | ||
712 | - */ | ||
713 | - public void noticeBuyerAppraiseUnsure(@NonNull BuyerNoticeSender.Request request){ | ||
714 | - Integer uid = request.getUid(); | ||
715 | - Long orderCode = request.getOrderCode(); | ||
716 | - String params = buildParams(orderCode); | ||
717 | - InboxReqVO inboxMessage = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_APPRAISE_UNSURE); | ||
718 | - String smsContent = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_APPRAISE_UNSURE.getContent(), orderCode); | ||
719 | - try { | ||
720 | - log.info("noticeBuyerAppraiseUnsure,uid {} request is {}", uid, request); | ||
721 | - executorService.execute(() -> { | ||
722 | - InBoxResponse inBoxResponse = inBoxSDK.addInbox(inboxMessage); | ||
723 | - log.info("noticeBuyerAppraiseUnsure inbox send success, message is {} res is {}", inboxMessage, inBoxResponse); | ||
724 | - | ||
725 | - //发push | ||
726 | - SendMessageRspBo bo = ufoSendService.identifyFail(String.valueOf(uid),String.valueOf(orderCode)); | ||
727 | - log.info("noticeBuyerAppraiseUnsure push buyer uid is {}, orderCode is {}, result is {}", uid, orderCode, JSON.toJSONString(bo)); | ||
728 | 709 | ||
729 | - //sms | ||
730 | - String phone = userProxyService.getMobile(uid); | ||
731 | - if (StringUtils.isBlank(phone)) { | ||
732 | - log.warn("noticeBuyerAppraiseUnsure sms send fail,uid {} can not find phone", uid); | ||
733 | - return; | ||
734 | - } | ||
735 | - sendSmsService.smsSendByMobile(smsContent, Arrays.asList(phone)); | ||
736 | - log.info("noticeBuyerAppraiseUnsure sms send success,uid {}", uid); | ||
737 | - }); | ||
738 | - } catch (Exception e) { | ||
739 | - log.warn("noticeBuyerAppraiseUnsure fail,uid {}", uid, e); | ||
740 | - } | ||
741 | - } | ||
742 | 710 | ||
743 | 711 | ||
744 | - /** | ||
745 | - * 通知买家商品无法鉴定 | ||
746 | - * @param request | ||
747 | - */ | ||
748 | - public void noticeBuyerDetectNotPass(@NonNull BuyerNoticeSender.Request request){ | ||
749 | - Integer uid = request.getUid(); | ||
750 | - Long orderCode = request.getOrderCode(); | ||
751 | - String params = buildParams(orderCode); | ||
752 | - InboxReqVO inboxMessage = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DETECTION_NOT_PASS); | ||
753 | - String smsContent = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DETECTION_NOT_PASS.getContent(), orderCode); | ||
754 | - try { | ||
755 | - log.info("noticeBuyerDetectNotPass,uid {} request is {}", uid, request); | ||
756 | - executorService.execute(() -> { | ||
757 | - InBoxResponse inBoxResponse = inBoxSDK.addInbox(inboxMessage); | ||
758 | - log.info("noticeBuyerDetectNotPass inbox send success, message is {} res is {}", inboxMessage, inBoxResponse); | ||
759 | 712 | ||
760 | - //sms | ||
761 | - String phone = userProxyService.getMobile(uid); | ||
762 | - if (StringUtils.isBlank(phone)) { | ||
763 | - log.warn("noticeBuyerDetectNotPass sms send fail,uid {} can not find phone", uid); | ||
764 | - return; | ||
765 | - } | ||
766 | - sendSmsService.smsSendByMobile(smsContent, Arrays.asList(phone)); | ||
767 | - log.info("noticeBuyerDetectNotPass sms send success,uid {}", uid); | ||
768 | - }); | ||
769 | - } catch (Exception e) { | ||
770 | - log.warn("noticeBuyerDetectNotPass fail,uid {}", uid, e); | ||
771 | - } | ||
772 | - } | ||
773 | 713 | ||
774 | public void buyerCancelBeforeDepotReceive(@NonNull BuyerOrder buyerOrder, String compesant, SellerOrderGoods sog, boolean useDepositGoods) { | 714 | public void buyerCancelBeforeDepotReceive(@NonNull BuyerOrder buyerOrder, String compesant, SellerOrderGoods sog, boolean useDepositGoods) { |
775 | buyerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, compesant, sog); | 715 | buyerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, compesant, sog); |
-
Please register or login to post a comment