Showing
9 changed files
with
278 additions
and
280 deletions
@@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.order.common.OrderStatus; | @@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.order.common.OrderStatus; | ||
8 | import com.yohobuy.ufo.model.order.common.TabType; | 8 | import com.yohobuy.ufo.model.order.common.TabType; |
9 | import com.yohoufo.order.event.NotPaidNoticeEvent; | 9 | import com.yohoufo.order.event.NotPaidNoticeEvent; |
10 | import com.yohoufo.order.mq.TopicConstants; | 10 | import com.yohoufo.order.mq.TopicConstants; |
11 | +import com.yohoufo.order.service.proxy.BuyerNoticeFacade; | ||
11 | import com.yohoufo.order.service.proxy.InBoxFacade; | 12 | import com.yohoufo.order.service.proxy.InBoxFacade; |
12 | import com.yohoufo.order.utils.LoggerUtils; | 13 | import com.yohoufo.order.utils.LoggerUtils; |
13 | import org.slf4j.Logger; | 14 | import org.slf4j.Logger; |
@@ -28,6 +29,9 @@ public class NotPaidNoticeDelayMsgConsumer implements YhConsumer { | @@ -28,6 +29,9 @@ public class NotPaidNoticeDelayMsgConsumer implements YhConsumer { | ||
28 | private InBoxFacade inBoxFacade; | 29 | private InBoxFacade inBoxFacade; |
29 | 30 | ||
30 | @Autowired | 31 | @Autowired |
32 | + private BuyerNoticeFacade buyerNoticeFacade; | ||
33 | + | ||
34 | + @Autowired | ||
31 | private BuyerOrderMapper buyerOrderMapper; | 35 | private BuyerOrderMapper buyerOrderMapper; |
32 | 36 | ||
33 | 37 | ||
@@ -56,7 +60,7 @@ public class NotPaidNoticeDelayMsgConsumer implements YhConsumer { | @@ -56,7 +60,7 @@ public class NotPaidNoticeDelayMsgConsumer implements YhConsumer { | ||
56 | } | 60 | } |
57 | if(OrderStatus.WAITING_PAY.getCode() == buyerOrder.getStatus()){ | 61 | if(OrderStatus.WAITING_PAY.getCode() == buyerOrder.getStatus()){ |
58 | logger.info("in {}, msg {}, status {}", topic, event, buyerOrder.getStatus()); | 62 | logger.info("in {}, msg {}, status {}", topic, event, buyerOrder.getStatus()); |
59 | - inBoxFacade.buyerOrderNotPayed(event.getUid(), event.getOrderCode()); | 63 | + buyerNoticeFacade.buyerOrderNotPayed(event.getUid(), event.getOrderCode()); |
60 | } | 64 | } |
61 | break; | 65 | break; |
62 | } | 66 | } |
@@ -34,6 +34,7 @@ import com.yohoufo.order.service.impl.OrderOverTimeService; | @@ -34,6 +34,7 @@ import com.yohoufo.order.service.impl.OrderOverTimeService; | ||
34 | import com.yohoufo.order.service.impl.TradeBillsService; | 34 | import com.yohoufo.order.service.impl.TradeBillsService; |
35 | import com.yohoufo.order.service.listener.BuyerOrderChangeEvent; | 35 | import com.yohoufo.order.service.listener.BuyerOrderChangeEvent; |
36 | import com.yohoufo.order.service.listener.OrderChangeListenerContainer; | 36 | import com.yohoufo.order.service.listener.OrderChangeListenerContainer; |
37 | +import com.yohoufo.order.service.proxy.BuyerNoticeFacade; | ||
37 | import com.yohoufo.order.service.proxy.DeliveryMinutesService; | 38 | import com.yohoufo.order.service.proxy.DeliveryMinutesService; |
38 | import com.yohoufo.order.service.proxy.InBoxFacade; | 39 | import com.yohoufo.order.service.proxy.InBoxFacade; |
39 | import com.yohoufo.order.service.proxy.OrderStatusFlowService; | 40 | import com.yohoufo.order.service.proxy.OrderStatusFlowService; |
@@ -70,6 +71,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | @@ -70,6 +71,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | ||
70 | InBoxFacade inBoxFacade; | 71 | InBoxFacade inBoxFacade; |
71 | 72 | ||
72 | @Autowired | 73 | @Autowired |
74 | + BuyerNoticeFacade buyerNoticeFacade; | ||
75 | + | ||
76 | + @Autowired | ||
73 | private BuyerOrderGoodsMapper buyerOrderGoodsMapper; | 77 | private BuyerOrderGoodsMapper buyerOrderGoodsMapper; |
74 | 78 | ||
75 | @Autowired | 79 | @Autowired |
@@ -227,7 +231,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | @@ -227,7 +231,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | ||
227 | .uid(uid).sellerUid(sellerUid).skup(sellerOrderGoods.getId()) | 231 | .uid(uid).sellerUid(sellerUid).skup(sellerOrderGoods.getId()) |
228 | .orderCode(orderCode).build(); | 232 | .orderCode(orderCode).build(); |
229 | EventBusPublisher.publishEvent(event); | 233 | EventBusPublisher.publishEvent(event); |
230 | - inBoxFacade.buyerFinishPaid(uid, orderCode, deliveryHours, unit); | 234 | + buyerNoticeFacade.buyerFinishPaid(uid, orderCode, deliveryHours, unit); |
231 | } | 235 | } |
232 | 236 | ||
233 | /** | 237 | /** |
@@ -244,7 +248,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | @@ -244,7 +248,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | ||
244 | int dtl = acr.getMin(); | 248 | int dtl = acr.getMin(); |
245 | String unit = TimeUnit.HOURS.equals(tu) ? DateUtil.UNIT_HOURS : DateUtil.UNIT_DAYS; | 249 | String unit = TimeUnit.HOURS.equals(tu) ? DateUtil.UNIT_HOURS : DateUtil.UNIT_DAYS; |
246 | inBoxFacade.sellerSkupPaidByBuyer(sellerOrderGoods, orderCode, dtl, unit); | 250 | inBoxFacade.sellerSkupPaidByBuyer(sellerOrderGoods, orderCode, dtl, unit); |
247 | - inBoxFacade.buyerFinishPaid(uid, orderCode, dtl, unit); | 251 | + buyerNoticeFacade.buyerFinishPaid(uid, orderCode, dtl, unit); |
248 | 252 | ||
249 | // 记录此订单的发货超时时间期限点 | 253 | // 记录此订单的发货超时时间期限点 |
250 | int ts = DateUtil.getCurrentTimeSecond(); | 254 | int ts = DateUtil.getCurrentTimeSecond(); |
@@ -142,6 +142,9 @@ public class AppraiseService { | @@ -142,6 +142,9 @@ public class AppraiseService { | ||
142 | @Autowired | 142 | @Autowired |
143 | private BuyerNoticeFacade buyerNoticeFacade; | 143 | private BuyerNoticeFacade buyerNoticeFacade; |
144 | 144 | ||
145 | + @Autowired | ||
146 | + private SellerNoticeFacade sellerNoticeFacade; | ||
147 | + | ||
145 | 148 | ||
146 | @Autowired | 149 | @Autowired |
147 | TransferService transferService; | 150 | TransferService transferService; |
@@ -1275,7 +1278,7 @@ public class AppraiseService { | @@ -1275,7 +1278,7 @@ public class AppraiseService { | ||
1275 | orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode()); | 1278 | orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode()); |
1276 | //TODO 鉴定通过, | 1279 | //TODO 鉴定通过, |
1277 | Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null); | 1280 | Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null); |
1278 | - inBoxFacade.appraisePassNoticeSeller(buyerUid, orderCode, sellerOrderGoods); | 1281 | + sellerNoticeFacade.appraisePass(buyerUid, orderCode, sellerOrderGoods); |
1279 | } catch (Exception ex) { | 1282 | } catch (Exception ex) { |
1280 | LOGGER.warn("in judgeCenterPass,refund fail, refundReqOfSeller {}", refundReqOfSeller, ex); | 1283 | LOGGER.warn("in judgeCenterPass,refund fail, refundReqOfSeller {}", refundReqOfSeller, ex); |
1281 | String content = "后台鉴定通过商品,订单" + orderCode + "退还保证金失败"; | 1284 | String content = "后台鉴定通过商品,订单" + orderCode + "退还保证金失败"; |
@@ -1419,8 +1422,8 @@ public class AppraiseService { | @@ -1419,8 +1422,8 @@ public class AppraiseService { | ||
1419 | orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode()); | 1422 | orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode()); |
1420 | 1423 | ||
1421 | //平台已发货给买家 | 1424 | //平台已发货给买家 |
1422 | - inBoxFacade.appraisePassAndDeliveryGoodsToBuyerNoticeBuyer(buyerUid, orderCode, sellerOrderGoods); | ||
1423 | - inBoxFacade.appraisePassNoticeSeller(buyerUid, orderCode, sellerOrderGoods); | 1425 | + buyerNoticeFacade.appraisePassAndDeliveryGoodsToBuyer(buyerUid, orderCode, sellerOrderGoods); |
1426 | + sellerNoticeFacade.appraisePass(buyerUid, orderCode, sellerOrderGoods); | ||
1424 | } catch (Exception ex) { | 1427 | } catch (Exception ex) { |
1425 | LOGGER.warn("in appraiseSuccess,refund fail, refundReqOfSeller {}", refundReqOfSeller, ex); | 1428 | LOGGER.warn("in appraiseSuccess,refund fail, refundReqOfSeller {}", refundReqOfSeller, ex); |
1426 | String content = "鉴定通过时,订单" + orderCode + "退还保证金失败"; | 1429 | String content = "鉴定通过时,订单" + orderCode + "退还保证金失败"; |
@@ -38,10 +38,7 @@ import com.yohoufo.order.service.cache.OrderCacheService; | @@ -38,10 +38,7 @@ import com.yohoufo.order.service.cache.OrderCacheService; | ||
38 | import com.yohoufo.order.service.listener.BuyerOrderChangeEvent; | 38 | import com.yohoufo.order.service.listener.BuyerOrderChangeEvent; |
39 | import com.yohoufo.order.service.listener.OrderChangeListenerContainer; | 39 | import com.yohoufo.order.service.listener.OrderChangeListenerContainer; |
40 | import com.yohoufo.order.service.pay.AbstractPayService; | 40 | import com.yohoufo.order.service.pay.AbstractPayService; |
41 | -import com.yohoufo.order.service.proxy.InBoxFacade; | ||
42 | -import com.yohoufo.order.service.proxy.OrderStatusFlowService; | ||
43 | -import com.yohoufo.order.service.proxy.ProductProxyService; | ||
44 | -import com.yohoufo.order.service.proxy.UserProxyService; | 41 | +import com.yohoufo.order.service.proxy.*; |
45 | import com.yohoufo.order.utils.BuyerOrderUtils; | 42 | import com.yohoufo.order.utils.BuyerOrderUtils; |
46 | import com.yohoufo.order.utils.LoggerUtils; | 43 | import com.yohoufo.order.utils.LoggerUtils; |
47 | import com.yohoufo.order.utils.SellerGoodsHelper; | 44 | import com.yohoufo.order.utils.SellerGoodsHelper; |
@@ -75,6 +72,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { | @@ -75,6 +72,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { | ||
75 | private InBoxFacade inBoxFacade; | 72 | private InBoxFacade inBoxFacade; |
76 | 73 | ||
77 | @Autowired | 74 | @Autowired |
75 | + private BuyerNoticeFacade buyerNoticeFacade; | ||
76 | + | ||
77 | + @Autowired | ||
78 | private OrderCacheService orderCacheService; | 78 | private OrderCacheService orderCacheService; |
79 | 79 | ||
80 | @Autowired | 80 | @Autowired |
@@ -491,7 +491,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { | @@ -491,7 +491,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { | ||
491 | // | 491 | // |
492 | int sellerUid = dataNode.buyerOrderInDB.getSellerUid(); | 492 | int sellerUid = dataNode.buyerOrderInDB.getSellerUid(); |
493 | inBoxFacade.noticSellerWhenBuyerCancel(sellerUid, psog); | 493 | inBoxFacade.noticSellerWhenBuyerCancel(sellerUid, psog); |
494 | - inBoxFacade.buyerCancelOrder(orderRequest.getUid(), orderCode); | 494 | + buyerNoticeFacade.buyerCancelOrder(orderRequest.getUid(), orderCode); |
495 | 495 | ||
496 | // | 496 | // |
497 | cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()), | 497 | cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()), |
@@ -694,7 +694,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { | @@ -694,7 +694,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { | ||
694 | //记录订单的状态变更信息 | 694 | //记录订单的状态变更信息 |
695 | if(num>=1){ | 695 | if(num>=1){ |
696 | logger.info("in confirmReceive record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid); | 696 | logger.info("in confirmReceive record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid); |
697 | - inBoxFacade.noticeBuyerWhenPlatformReceiveGoods(uid,orderCode); | 697 | + buyerNoticeFacade.platformReceiveGoods(uid,orderCode); |
698 | orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode()); | 698 | orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetStatus.getCode()); |
699 | }else{ | 699 | }else{ |
700 | logger.warn("in confirmReceive not record status change cause of update empty num , orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid); | 700 | logger.warn("in confirmReceive not record status change cause of update empty num , orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid); |
@@ -36,10 +36,7 @@ import com.yohoufo.order.service.IExpressCompanyService; | @@ -36,10 +36,7 @@ import com.yohoufo.order.service.IExpressCompanyService; | ||
36 | import com.yohoufo.order.service.IExpressInfoService; | 36 | import com.yohoufo.order.service.IExpressInfoService; |
37 | import com.yohoufo.order.service.cache.CacheCleaner; | 37 | import com.yohoufo.order.service.cache.CacheCleaner; |
38 | import com.yohoufo.order.service.cache.CacheKeyBuilder; | 38 | import com.yohoufo.order.service.cache.CacheKeyBuilder; |
39 | -import com.yohoufo.order.service.proxy.InBoxFacade; | ||
40 | -import com.yohoufo.order.service.proxy.OrderStatusFlowService; | ||
41 | -import com.yohoufo.order.service.proxy.ProductProxyService; | ||
42 | -import com.yohoufo.order.service.proxy.UserProxyService; | 39 | +import com.yohoufo.order.service.proxy.*; |
43 | import com.yohoufo.order.service.seller.SkupService; | 40 | import com.yohoufo.order.service.seller.SkupService; |
44 | import com.yohoufo.order.service.seller.setting.SellerService; | 41 | import com.yohoufo.order.service.seller.setting.SellerService; |
45 | import com.yohoufo.order.service.seller.setting.SellerWrapper; | 42 | import com.yohoufo.order.service.seller.setting.SellerWrapper; |
@@ -99,6 +96,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -99,6 +96,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
99 | InBoxFacade inBoxFacade; | 96 | InBoxFacade inBoxFacade; |
100 | 97 | ||
101 | @Autowired | 98 | @Autowired |
99 | + BuyerNoticeFacade buyerNoticeFacade; | ||
100 | + | ||
101 | + @Autowired | ||
102 | private CacheCleaner cacheCleaner; | 102 | private CacheCleaner cacheCleaner; |
103 | 103 | ||
104 | @Autowired | 104 | @Autowired |
@@ -209,7 +209,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -209,7 +209,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
209 | LOGGER.info("in deliverToDepot record status change, orderCode {},uid {} ,sellerUid {}", orderCode,buyerUid,sellerUid); | 209 | LOGGER.info("in deliverToDepot record status change, orderCode {},uid {} ,sellerUid {}", orderCode,buyerUid,sellerUid); |
210 | orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetOrderStatus.getCode()); | 210 | orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetOrderStatus.getCode()); |
211 | 211 | ||
212 | - inBoxFacade.sellerDeliver2Depot(buyerUid, orderCode, psog); | 212 | + buyerNoticeFacade.sellerDeliver2Depot(buyerUid, orderCode, psog); |
213 | 213 | ||
214 | //卖家物流检查 | 214 | //卖家物流检查 |
215 | BuyerOrderSellerDeliveryCheckEvent sellerDeliveryCheckEvent = BuyerOrderSellerDeliveryCheckEvent.builder().uid(buyerUid).sellerUid(sellerUid).orderCode(orderCode).build(); | 215 | BuyerOrderSellerDeliveryCheckEvent sellerDeliveryCheckEvent = BuyerOrderSellerDeliveryCheckEvent.builder().uid(buyerUid).sellerUid(sellerUid).orderCode(orderCode).build(); |
@@ -4,12 +4,18 @@ import com.yoho.message.sdk.service.ufo.IUFOSendService; | @@ -4,12 +4,18 @@ import com.yoho.message.sdk.service.ufo.IUFOSendService; | ||
4 | import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum; | 4 | import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum; |
5 | import com.yohobuy.ufo.model.order.constants.SkupType; | 5 | import com.yohobuy.ufo.model.order.constants.SkupType; |
6 | import com.yohoufo.dal.order.model.SellerOrderGoods; | 6 | import com.yohoufo.dal.order.model.SellerOrderGoods; |
7 | +import com.yohoufo.dal.product.ProductMapper; | ||
7 | import com.yohoufo.dal.product.model.Product; | 8 | import com.yohoufo.dal.product.model.Product; |
9 | +import com.yohoufo.inboxclient.model.InBoxResponse; | ||
10 | +import com.yohoufo.inboxclient.model.InboxReqVO; | ||
8 | import lombok.extern.slf4j.Slf4j; | 11 | import lombok.extern.slf4j.Slf4j; |
12 | +import org.apache.commons.lang3.StringUtils; | ||
9 | import org.slf4j.Logger; | 13 | import org.slf4j.Logger; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.stereotype.Service; | 15 | import org.springframework.stereotype.Service; |
12 | 16 | ||
17 | +import java.util.Arrays; | ||
18 | +import java.util.List; | ||
13 | import java.util.Optional; | 19 | import java.util.Optional; |
14 | import java.util.function.Function; | 20 | import java.util.function.Function; |
15 | import java.util.function.Supplier; | 21 | import java.util.function.Supplier; |
@@ -21,14 +27,178 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | @@ -21,14 +27,178 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { | ||
21 | @Autowired | 27 | @Autowired |
22 | private IUFOSendService ufoSendService; | 28 | private IUFOSendService ufoSendService; |
23 | 29 | ||
30 | + @Autowired | ||
31 | + private ProductMapper productMapper; | ||
32 | + | ||
24 | @Override | 33 | @Override |
25 | public Logger getLogger() { | 34 | public Logger getLogger() { |
26 | return log; | 35 | return log; |
27 | } | 36 | } |
28 | 37 | ||
38 | + /** | ||
39 | + * 买家订单未付款 | ||
40 | + * | ||
41 | + * @param buyerUid | ||
42 | + */ | ||
43 | + public void buyerOrderNotPayed(int buyerUid, long orderCode) { | ||
44 | + log.info("notice buyer not paid, buyerUid {}, orderCode {}", buyerUid, orderCode); | ||
45 | + newNotice(buyerUid) | ||
46 | + .withLogPrefix("notice buyer not paid") | ||
47 | + .withInBox(InboxBusinessTypeEnum.PURCHASE_UNPAID, orderCode) | ||
48 | + .withPush(() -> ufoSendService.buyerNotPay(String.valueOf(buyerUid), String.valueOf(orderCode))) | ||
49 | + .send(); | ||
50 | + } | ||
29 | 51 | ||
30 | /** | 52 | /** |
31 | - * 平台发货给买家 | 53 | + * 买家订单支付成功 |
54 | + * | ||
55 | + * @param buyerUid | ||
56 | + * @param orderCode | ||
57 | + */ | ||
58 | + public void buyerFinishPaid(int buyerUid, long orderCode, int deliveryHours, String unit) { | ||
59 | + log.info("notice buyer finish paid, buyerUid {}, orderCode {}", buyerUid, orderCode); | ||
60 | + String timelimitDesc = new StringBuilder().append(deliveryHours).append(unit).toString(); | ||
61 | + newNotice(buyerUid) | ||
62 | + .withLogPrefix("notice buyer finish paid") | ||
63 | + .withInBox(InboxBusinessTypeEnum.PURCHASE_NOTIFIED_SELLER, orderCode, timelimitDesc) | ||
64 | + .send(); | ||
65 | + } | ||
66 | + | ||
67 | + | ||
68 | + /** | ||
69 | + * 买家取消订单 | ||
70 | + */ | ||
71 | + public void buyerCancelOrder(int buyerUid, long orderCode) { | ||
72 | + try { | ||
73 | + newNotice(buyerUid) | ||
74 | + .withLogPrefix("notice buyer buyer cancel order") | ||
75 | + .withInBox(InboxBusinessTypeEnum.PURCHASE_CLOSED_BUYER, orderCode) | ||
76 | + .send(); | ||
77 | + } catch (Exception e) { | ||
78 | + log.warn("notice buyer buyer cancel order fail, buyerUid {}, orderCode {} ", buyerUid, orderCode, e); | ||
79 | + } | ||
80 | + } | ||
81 | + | ||
82 | + /** | ||
83 | + * 买家支付后卖家取消售卖 | ||
84 | + * | ||
85 | + * @param orderCode | ||
86 | + */ | ||
87 | + public void sellerCancelBuyerOrderAfterPaid(int buyerUid, long orderCode, SellerOrderGoods psog) { | ||
88 | + try { | ||
89 | + newNotice(buyerUid) | ||
90 | + .withLogPrefix("notice buyer seller cancel buyer order after paid") | ||
91 | + .withInBox(InboxBusinessTypeEnum.PURCHASE_CLOSED_SELLER, orderCode) | ||
92 | + .withPush(() -> ufoSendService.sellerCancelTrade(String.valueOf(buyerUid), String.valueOf(orderCode))) | ||
93 | + .withSms(() -> { | ||
94 | + String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
95 | + String prdName = psog.getProductName(); | ||
96 | + String sizeName = psog.getSizeName(); | ||
97 | + Product product = productMapper.selectByPrimaryKey(psog.getProductId()); | ||
98 | + String productCode = product.getProductCode(); | ||
99 | + return buildSmsContent(InboxBusinessTypeEnum.SMS_CLOSED_SELLER, skupTypeText, prdName, productCode, sizeName, orderCode); | ||
100 | + }) | ||
101 | + .send(); | ||
102 | + } catch (Exception e) { | ||
103 | + log.warn("notice buyer seller cancel buyer order after paid fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e); | ||
104 | + } | ||
105 | + } | ||
106 | + | ||
107 | + /** | ||
108 | + * 卖家发货后 | ||
109 | + * | ||
110 | + * @param buyerUid | ||
111 | + * @param orderCode | ||
112 | + */ | ||
113 | + public void sellerDeliver2Depot(int buyerUid, long orderCode, SellerOrderGoods psog) { | ||
114 | + try { | ||
115 | + newNotice(buyerUid) | ||
116 | + .withLogPrefix("notice buyer seller deliver 2 depot") | ||
117 | + .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_SELLER_DELIVER, orderCode) | ||
118 | + .withPush(() -> ufoSendService.sellerDeliverNotice(String.valueOf(buyerUid), String.valueOf(orderCode))) | ||
119 | + .withSms(() -> { | ||
120 | + String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
121 | + String prdName = psog.getProductName(); | ||
122 | + String sizeName = psog.getSizeName(); | ||
123 | + Product product = productMapper.selectByPrimaryKey(psog.getProductId()); | ||
124 | + String productCode = product.getProductCode(); | ||
125 | + return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER, skupTypeText, prdName, sizeName, productCode, orderCode); | ||
126 | + }) | ||
127 | + .send(); | ||
128 | + } catch (Exception ex) { | ||
129 | + log.warn("notice buyer seller deliver 2 depot fail, buyerUid {}, orderCode {}", buyerUid, orderCode, ex); | ||
130 | + } | ||
131 | + } | ||
132 | + | ||
133 | + /** | ||
134 | + * 平台收货 | ||
135 | + */ | ||
136 | + public void platformReceiveGoods(int buyerUid, long orderCode) { | ||
137 | + try { | ||
138 | + newNotice(buyerUid) | ||
139 | + .withLogPrefix("notice buyer platform receive goods") | ||
140 | + .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_PLATFORM_RECEIVE, orderCode) | ||
141 | + .send(); | ||
142 | + } catch (Exception e) { | ||
143 | + log.warn("notice buyer platform receive goods fail, buyerUid {}, orderCode {} ", buyerUid, orderCode, e); | ||
144 | + } | ||
145 | + } | ||
146 | + | ||
147 | + /** | ||
148 | + * 平台已鉴定通过并发货给买家 | ||
149 | + * | ||
150 | + * @return | ||
151 | + */ | ||
152 | + public void appraisePassAndDeliveryGoodsToBuyer(int buyerUid, long orderCode, SellerOrderGoods psog) { | ||
153 | + try { | ||
154 | + newNotice(buyerUid) | ||
155 | + .withLogPrefix("notice buyer appraise pass and delivery goods to buyer") | ||
156 | + .withInBox(InboxBusinessTypeEnum.PURCHASE_SENDED, orderCode) | ||
157 | + .withSms(() -> { | ||
158 | + Product product = productMapper.selectByPrimaryKey(psog.getProductId()); | ||
159 | + String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse(""); | ||
160 | + String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
161 | + String prdName = psog.getProductName(); | ||
162 | + String sizeName = psog.getSizeName(); | ||
163 | + return buildSmsContent(InboxBusinessTypeEnum.SMS_SEND, skupTypeText, prdName, sizeName, productCode, orderCode); | ||
164 | + }) | ||
165 | + .send(); | ||
166 | + } catch (Exception e) { | ||
167 | + log.warn("notice buyer appraise pass and delivery goods to buyer fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e); | ||
168 | + } | ||
169 | + } | ||
170 | + | ||
171 | + public void quickDeliverOrderPaid(int buyerUid, long orderCode, SellerOrderGoods sog) { | ||
172 | + try { | ||
173 | + String prdName = sog.getProductName(); | ||
174 | + String sizeName = sog.getSizeName(); | ||
175 | + newNotice(buyerUid) | ||
176 | + .withLogPrefix("notice buyer quick deliver order paid") | ||
177 | + .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_QUICK_DELIVER_ORDER_PAID, orderCode) | ||
178 | + .withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_QUICK_DELIVER_ORDER_PAID, prdName, sizeName, orderCode) | ||
179 | + .send(); | ||
180 | + } catch (Exception e) { | ||
181 | + log.warn("notice buyer quick deliver order paid fail, uid {}, orderCode {}", buyerUid, orderCode, e); | ||
182 | + } | ||
183 | + } | ||
184 | + | ||
185 | + public void quickDeliverDepositGoodsPaid(int buyerUid, long orderCode, SellerOrderGoods sog) { | ||
186 | + try { | ||
187 | + String prdName = sog.getProductName(); | ||
188 | + String sizeName = sog.getSizeName(); | ||
189 | + newNotice(buyerUid) | ||
190 | + .withLogPrefix("notice buyer quick deliver order paid") | ||
191 | + .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DEPOSIT_ORDER_OF_QUICK_DELIVER_PAID, orderCode) | ||
192 | + .withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DEPOSIT_ORDER_OF_QUICK_DELIVER_PAID, prdName, sizeName, orderCode) | ||
193 | + .send(); | ||
194 | + } catch (Exception e) { | ||
195 | + log.warn("notice buyer quick deliver order paid fail, uid {}, orderCode {}", buyerUid, orderCode, e); | ||
196 | + } | ||
197 | + } | ||
198 | + | ||
199 | + | ||
200 | + /** | ||
201 | + * 平台发货寄存商品给买家 | ||
32 | * | 202 | * |
33 | * @return | 203 | * @return |
34 | */ | 204 | */ |
@@ -20,7 +20,6 @@ import lombok.NonNull; | @@ -20,7 +20,6 @@ import lombok.NonNull; | ||
20 | import lombok.extern.slf4j.Slf4j; | 20 | import lombok.extern.slf4j.Slf4j; |
21 | import org.apache.commons.lang3.StringUtils; | 21 | import org.apache.commons.lang3.StringUtils; |
22 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
23 | -import org.slf4j.LoggerFactory; | ||
24 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
25 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
26 | 25 | ||
@@ -61,6 +60,12 @@ public class InBoxFacade extends BaseNoticeFacade{ | @@ -61,6 +60,12 @@ public class InBoxFacade extends BaseNoticeFacade{ | ||
61 | @Autowired | 60 | @Autowired |
62 | private IUFOSendService ufoSendService; | 61 | private IUFOSendService ufoSendService; |
63 | 62 | ||
63 | + @Autowired | ||
64 | + private SellerNoticeFacade sellerNoticeFacade; | ||
65 | + | ||
66 | + @Autowired | ||
67 | + private BuyerNoticeFacade buyerNoticeFacade; | ||
68 | + | ||
64 | @Override | 69 | @Override |
65 | public Logger getLogger() { | 70 | public Logger getLogger() { |
66 | return log; | 71 | return log; |
@@ -71,180 +76,6 @@ public class InBoxFacade extends BaseNoticeFacade{ | @@ -71,180 +76,6 @@ public class InBoxFacade extends BaseNoticeFacade{ | ||
71 | ********************************************************************/ | 76 | ********************************************************************/ |
72 | 77 | ||
73 | /** | 78 | /** |
74 | - * 买家订单未付款 | ||
75 | - * | ||
76 | - * @param buyerUid | ||
77 | - */ | ||
78 | - public void buyerOrderNotPayed(int buyerUid, long orderCode) { | ||
79 | - log.info("notice buyer not paid, buyerUid {}, orderCode {}", buyerUid, orderCode); | ||
80 | - newNotice(buyerUid) | ||
81 | - .withLogPrefix("notice buyer not paid") | ||
82 | - .withInBox(InboxBusinessTypeEnum.PURCHASE_UNPAID, orderCode) | ||
83 | - .withPush(() -> ufoSendService.buyerNotPay(String.valueOf(buyerUid), String.valueOf(orderCode))) | ||
84 | - .send(); | ||
85 | - } | ||
86 | - | ||
87 | - /** | ||
88 | - * 通知买家,已经支付成功已通知卖家发货 | ||
89 | - * | ||
90 | - * @param buyerUid | ||
91 | - * @param orderCode | ||
92 | - */ | ||
93 | - public void buyerFinishPaid(int buyerUid, long orderCode, int deliveryHours, String unit) { | ||
94 | - log.info("notice buyer finish paid, buyerUid {}, orderCode {}", buyerUid, orderCode); | ||
95 | - String timelimitDesc = new StringBuilder().append(deliveryHours).append(unit).toString(); | ||
96 | - newNotice(buyerUid) | ||
97 | - .withLogPrefix("notice buyer finish paid") | ||
98 | - .withInBox(InboxBusinessTypeEnum.PURCHASE_NOTIFIED_SELLER, orderCode, timelimitDesc) | ||
99 | - .send(); | ||
100 | - } | ||
101 | - | ||
102 | - | ||
103 | - /** | ||
104 | - * 卖家发货后 | ||
105 | - * | ||
106 | - * @param buyerUid | ||
107 | - * @param orderCode | ||
108 | - */ | ||
109 | - public void sellerDeliver2Depot(int buyerUid, long orderCode, SellerOrderGoods psog) { | ||
110 | - try { | ||
111 | - log.info("notice buyer seller deliver 2 depot, buyerUid {}, orderCode {}", buyerUid, orderCode); | ||
112 | - newNotice(buyerUid) | ||
113 | - .withLogPrefix("notice buyer seller deliver 2 depot") | ||
114 | - .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_SELLER_DELIVER, orderCode) | ||
115 | - .withPush(() -> ufoSendService.sellerDeliverNotice(String.valueOf(buyerUid), String.valueOf(orderCode))) | ||
116 | - .withSms(() -> { | ||
117 | - String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
118 | - String prdName = psog.getProductName(); | ||
119 | - String sizeName = psog.getSizeName(); | ||
120 | - Product product = productMapper.selectByPrimaryKey(psog.getProductId()); | ||
121 | - String productCode = product.getProductCode(); | ||
122 | - return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER, skupTypeText, prdName, sizeName, productCode, orderCode); | ||
123 | - }) | ||
124 | - .send(); | ||
125 | - } catch (Exception ex) { | ||
126 | - log.warn("notice buyer seller deliver 2 depot fail, buyerUid {}, orderCode {}", buyerUid, orderCode, ex); | ||
127 | - } | ||
128 | - } | ||
129 | - | ||
130 | - /** | ||
131 | - * 平台已发货给买家 | ||
132 | - * | ||
133 | - * @return | ||
134 | - */ | ||
135 | - public void appraisePassAndDeliveryGoodsToBuyerNoticeBuyer(int buyerUid, long orderCode, SellerOrderGoods psog) { | ||
136 | - try { | ||
137 | - log.info("notice buyer appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode); | ||
138 | - newNotice(buyerUid) | ||
139 | - .withLogPrefix("notice buyer appraise pass") | ||
140 | - .withInBox(InboxBusinessTypeEnum.PURCHASE_SENDED, orderCode) | ||
141 | - .withSms(() -> { | ||
142 | - Product product = productMapper.selectByPrimaryKey(psog.getProductId()); | ||
143 | - String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse(""); | ||
144 | - String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
145 | - String prdName = psog.getProductName(); | ||
146 | - String sizeName = psog.getSizeName(); | ||
147 | - return buildSmsContent(InboxBusinessTypeEnum.SMS_SEND, skupTypeText, prdName, sizeName, productCode, orderCode); | ||
148 | - }) | ||
149 | - .send(); | ||
150 | - } catch (Exception e) { | ||
151 | - log.warn("notice buyer appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e); | ||
152 | - } | ||
153 | - } | ||
154 | - | ||
155 | - public void appraisePassNoticeSeller(int buyerUid, long orderCode, SellerOrderGoods psog) { | ||
156 | - try { | ||
157 | - log.info("notice seller appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode); | ||
158 | - newNotice(psog.getUid()) | ||
159 | - .withLogPrefix("notice seller appraise pass") | ||
160 | - .withInBox(() -> { | ||
161 | - String prdName = psog.getProductName(); | ||
162 | - Product product = productMapper.selectByPrimaryKey(psog.getProductId()); | ||
163 | - String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse(""); | ||
164 | - String sizeName = psog.getSizeName(); | ||
165 | - String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
166 | - return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS,skupTypeText, prdName, sizeName, productCode); | ||
167 | - }) | ||
168 | - .withSms(() -> { | ||
169 | - String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
170 | - return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_PASS, skupTypeText, orderCode); | ||
171 | - }) | ||
172 | - .send(); | ||
173 | - | ||
174 | - } catch (Exception e) { | ||
175 | - log.warn("notice seller appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e); | ||
176 | - } | ||
177 | - | ||
178 | - } | ||
179 | - | ||
180 | - | ||
181 | - /** | ||
182 | - * 订单生成,卖家取消售卖 | ||
183 | - * | ||
184 | - * @param orderCode | ||
185 | - */ | ||
186 | - public void noticeBuyerWhenSellerCancelAfterPaid(int buyerUid, long orderCode,SellerOrderGoods psog ) { | ||
187 | - try { | ||
188 | - executorService.execute(()->{ | ||
189 | - String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
190 | - String prdName = psog.getProductName(); | ||
191 | - String sizeName =psog.getSizeName(); | ||
192 | - Product product = productMapper.selectByPrimaryKey(psog.getProductId()); | ||
193 | - String productCode = product.getProductCode(); | ||
194 | - | ||
195 | - InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_CLOSED_SELLER; | ||
196 | - String params = buildParams(orderCode); | ||
197 | - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt); | ||
198 | - | ||
199 | - InBoxResponse resp = inBoxSDK.addInbox(req); | ||
200 | - log.info("record noticeBuyerWhenSellerCancelAfterPaid inbox msg, buyerUid {}, orderCode {},prdName {} resp {}", | ||
201 | - buyerUid, orderCode, prdName,resp); | ||
202 | - | ||
203 | - //发push | ||
204 | - SendMessageRspBo bo = ufoSendService.sellerCancelTrade(String.valueOf(buyerUid),String.valueOf(orderCode)); | ||
205 | - log.info("record noticeBuyerWhenSellerCancelAfterPaid push buyer uid is {}, orderCode is {}, result is {}", buyerUid, orderCode, JSON.toJSONString(bo)); | ||
206 | - | ||
207 | - //短信 | ||
208 | - String phone = userProxyService.getMobile(buyerUid); | ||
209 | - if (StringUtils.isBlank(phone)){ | ||
210 | - log.warn("in noticeBuyerWhenSellerCancelAfterPaid sms fail, buyerUid {} orderCode {} prdName {}", buyerUid, orderCode,prdName); | ||
211 | - return; | ||
212 | - } | ||
213 | - List<String> mobileList = Arrays.asList(phone); | ||
214 | - | ||
215 | - String content=getReplacedContent(InboxBusinessTypeEnum.SMS_CLOSED_SELLER.getContent(),skupTypeText,prdName,productCode,sizeName,orderCode); | ||
216 | - | ||
217 | - sendSmsService.smsSendByMobile(content,mobileList); | ||
218 | - log.info("record noticeBuyerWhenSellerCancelAfterPaid inbox sms msg, buyerUid {}, orderCode {},prdName {}", | ||
219 | - buyerUid, orderCode,prdName); | ||
220 | - }); | ||
221 | - } catch (Exception e) { | ||
222 | - log.warn("InBoxFacade noticeBuyerWhenSellerCancelAfterPaid error inbox msg, buyerUid {}, orderCode {} prdName {}", | ||
223 | - buyerUid, orderCode,psog, e); | ||
224 | - } | ||
225 | - } | ||
226 | - | ||
227 | - /** | ||
228 | - * 订单生成,买家取消订单 | ||
229 | - */ | ||
230 | - public void buyerCancelOrder(int buyerUid, long orderCode) { | ||
231 | - try { | ||
232 | - executorService.execute(() -> { | ||
233 | - InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_CLOSED_BUYER; | ||
234 | - String params = buildParams(orderCode); | ||
235 | - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt); | ||
236 | - | ||
237 | - InBoxResponse resp = inBoxSDK.addInbox(req); | ||
238 | - log.info("record buyerCancelOrder inbox msg, buyerUid {}, orderCode {}, resp {}", | ||
239 | - buyerUid, orderCode, resp); | ||
240 | - }); | ||
241 | - } catch (Exception e) { | ||
242 | - log.warn("InBoxFacade buyerCancelOrder error inbox msg, buyerUid {}, orderCode {} ", | ||
243 | - buyerUid, orderCode, e); | ||
244 | - } | ||
245 | - } | ||
246 | - | ||
247 | - /** | ||
248 | * 平台鉴定不通过 | 79 | * 平台鉴定不通过 |
249 | * | 80 | * |
250 | * @param buyerUid | 81 | * @param buyerUid |
@@ -288,26 +119,6 @@ public class InBoxFacade extends BaseNoticeFacade{ | @@ -288,26 +119,6 @@ public class InBoxFacade extends BaseNoticeFacade{ | ||
288 | 119 | ||
289 | 120 | ||
290 | /** | 121 | /** |
291 | - * 平台收货 | ||
292 | - */ | ||
293 | - public void noticeBuyerWhenPlatformReceiveGoods(int buyerUid, long orderCode) { | ||
294 | - try { | ||
295 | - executorService.execute(() -> { | ||
296 | - InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_PLATFORM_RECEIVE; | ||
297 | - String params = buildParams(orderCode); | ||
298 | - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt); | ||
299 | - | ||
300 | - InBoxResponse resp = inBoxSDK.addInbox(req); | ||
301 | - log.info("record noticeBuyerWhenPlatformReceiveGoods inbox msg, buyerUid {}, orderCode {}, resp {}", | ||
302 | - buyerUid, orderCode, resp); | ||
303 | - }); | ||
304 | - } catch (Exception e) { | ||
305 | - log.warn("InBoxFacade buyerCancelOrder error inbox msg, buyerUid {}, orderCode {} ", | ||
306 | - buyerUid, orderCode, e); | ||
307 | - } | ||
308 | - } | ||
309 | - | ||
310 | - /** | ||
311 | * 质检未通过,买家 | 122 | * 质检未通过,买家 |
312 | */ | 123 | */ |
313 | public void noticeBuyerWhenQualityCheckNotPass(int buyerUid, long orderCode,SellerOrderGoods sellerOrderGoods) { | 124 | public void noticeBuyerWhenQualityCheckNotPass(int buyerUid, long orderCode,SellerOrderGoods sellerOrderGoods) { |
@@ -1673,74 +1484,14 @@ public class InBoxFacade extends BaseNoticeFacade{ | @@ -1673,74 +1484,14 @@ public class InBoxFacade extends BaseNoticeFacade{ | ||
1673 | execute(task, logModule, logparams); | 1484 | execute(task, logModule, logparams); |
1674 | } | 1485 | } |
1675 | 1486 | ||
1676 | - public void noticeWhenQuickDeliverOrderPaid(int buyerUid, long orderCode, SellerOrderGoods sog){ | ||
1677 | - String prdName = sog.getProductName(); | ||
1678 | - String sizeName = sog.getSizeName(); | ||
1679 | - | ||
1680 | - Runnable task = ()->{ | ||
1681 | - InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_QUICK_DELIVER_ORDER_PAID; | ||
1682 | - String params = buildParams(orderCode); | ||
1683 | - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt); | ||
1684 | - | ||
1685 | - InBoxResponse resp = inBoxSDK.addInbox(req); | ||
1686 | - log.info("record noticeWhenQuickDeliverOrderPaid to buyer inbox msg, buyerUid {}, orderCode {},prdName {} resp {}", | ||
1687 | - buyerUid, orderCode,prdName, resp); | ||
1688 | - | ||
1689 | - //短信 | ||
1690 | - String phone = userProxyService.getMobile(buyerUid); | ||
1691 | - if (StringUtils.isBlank(phone)){ | ||
1692 | - log.warn("in noticeWhenQuickDeliverOrderPaid sms fail, buyerUid {} orderCode {} prdName {}", buyerUid, orderCode,prdName); | ||
1693 | - return; | ||
1694 | - } | ||
1695 | - List<String> mobileList = Arrays.asList(phone); | ||
1696 | - | ||
1697 | - InboxBusinessTypeEnum sms=InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_QUICK_DELIVER_ORDER_PAID; | ||
1698 | - | ||
1699 | - String content= getReplacedContent(sms.getContent(),prdName,sizeName,orderCode); | ||
1700 | - sendSmsService.smsSendByMobile(content,mobileList); | ||
1701 | - log.info("record noticeWhenQuickDeliverOrderPaid inbox sms msg, buyer Uid {}, orderCode {},prdName {} ,sizeName {} ", | ||
1702 | - buyerUid, orderCode, prdName,sizeName); | ||
1703 | - }; | ||
1704 | - String logModule = "InBoxFacade noticeWhenQuickDeliverOrderPaid error inbox msg, buyerUid {}, orderCode {} ,prdName {}"; | ||
1705 | - Object[] logparams = new Object[]{buyerUid, orderCode, prdName}; | ||
1706 | - | ||
1707 | - execute(task, logModule, logparams); | ||
1708 | - appraisePassNoticeSeller(buyerUid,orderCode, sog); | ||
1709 | - } | ||
1710 | - | ||
1711 | - public void noticeWhenDepositOrderOfQuickDeliverGoodsPaid(int buyerUid, long orderCode, SellerOrderGoods sog){ | ||
1712 | - String prdName = sog.getProductName(); | ||
1713 | - String sizeName = sog.getSizeName(); | ||
1714 | - | ||
1715 | - Runnable task = ()->{ | ||
1716 | - InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DEPOSIT_ORDER_OF_QUICK_DELIVER_PAID; | ||
1717 | - String params = buildParams(orderCode); | ||
1718 | - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt); | ||
1719 | - | ||
1720 | - InBoxResponse resp = inBoxSDK.addInbox(req); | ||
1721 | - log.info("record noticeWhenDepositOrderOfPaid to buyer inbox msg, buyerUid {}, orderCode {},prdName {} resp {}", | ||
1722 | - buyerUid, orderCode,prdName, resp); | ||
1723 | - | ||
1724 | - //短信 | ||
1725 | - String phone = userProxyService.getMobile(buyerUid); | ||
1726 | - if (StringUtils.isBlank(phone)){ | ||
1727 | - log.warn("in noticeWhenDepositOrderOfPaid sms fail, buyerUid {} orderCode {} prdName {}", buyerUid, orderCode,prdName); | ||
1728 | - return; | 1487 | + public void noticeWhenQuickDeliverOrderPaid(int buyerUid, long orderCode, SellerOrderGoods sog) { |
1488 | + buyerNoticeFacade.quickDeliverOrderPaid(buyerUid, orderCode, sog); | ||
1489 | + sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog); | ||
1729 | } | 1490 | } |
1730 | - List<String> mobileList = Arrays.asList(phone); | ||
1731 | 1491 | ||
1732 | - InboxBusinessTypeEnum sms=InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DEPOSIT_ORDER_OF_QUICK_DELIVER_PAID; | ||
1733 | - | ||
1734 | - String content= getReplacedContent(sms.getContent(),prdName,sizeName,orderCode); | ||
1735 | - sendSmsService.smsSendByMobile(content,mobileList); | ||
1736 | - log.info("record noticeWhenDepositOrderOfPaid inbox sms msg, buyer Uid {}, orderCode {},prdName {} ,sizeName {} ", | ||
1737 | - buyerUid, orderCode, prdName,sizeName); | ||
1738 | - }; | ||
1739 | - String logModule = "InBoxFacade noticeWhenDepositOrderOfPaid error inbox msg, buyerUid {}, orderCode {} ,prdName {}"; | ||
1740 | - Object[] logparams = new Object[]{buyerUid, orderCode, prdName}; | ||
1741 | - execute(task, logModule, logparams); | ||
1742 | - // | ||
1743 | - appraisePassNoticeSeller(buyerUid,orderCode, sog); | 1492 | + public void noticeWhenDepositOrderOfQuickDeliverGoodsPaid(int buyerUid, long orderCode, SellerOrderGoods sog) { |
1493 | + buyerNoticeFacade.quickDeliverDepositGoodsPaid(buyerUid, orderCode, sog); | ||
1494 | + sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog); | ||
1744 | } | 1495 | } |
1745 | 1496 | ||
1746 | // 召回的 | 1497 | // 召回的 |
1 | +package com.yohoufo.order.service.proxy; | ||
2 | + | ||
3 | +import com.yoho.message.sdk.service.ufo.IUFOSendService; | ||
4 | +import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum; | ||
5 | +import com.yohobuy.ufo.model.order.constants.SkupType; | ||
6 | +import com.yohoufo.dal.order.model.SellerOrderGoods; | ||
7 | +import com.yohoufo.dal.product.ProductMapper; | ||
8 | +import com.yohoufo.dal.product.model.Product; | ||
9 | +import lombok.extern.slf4j.Slf4j; | ||
10 | +import org.slf4j.Logger; | ||
11 | +import org.springframework.beans.factory.annotation.Autowired; | ||
12 | +import org.springframework.stereotype.Service; | ||
13 | + | ||
14 | +import java.util.Optional; | ||
15 | +import java.util.function.Function; | ||
16 | +import java.util.function.Supplier; | ||
17 | + | ||
18 | +@Service | ||
19 | +@Slf4j(topic = "SellerNoticeFacade") | ||
20 | +public class SellerNoticeFacade extends BaseNoticeFacade { | ||
21 | + | ||
22 | + @Autowired | ||
23 | + private IUFOSendService ufoSendService; | ||
24 | + | ||
25 | + @Autowired | ||
26 | + private ProductMapper productMapper; | ||
27 | + | ||
28 | + @Override | ||
29 | + public Logger getLogger() { | ||
30 | + return log; | ||
31 | + } | ||
32 | + | ||
33 | + /** | ||
34 | + * 商品鉴定已通过 | ||
35 | + * | ||
36 | + * @param orderCode | ||
37 | + */ | ||
38 | + public void appraisePass(int buyerUid, long orderCode, SellerOrderGoods psog) { | ||
39 | + try { | ||
40 | + Integer sellerUid = psog.getUid(); | ||
41 | + newNotice(sellerUid) | ||
42 | + .withLogPrefix("notice seller appraise pass") | ||
43 | + .withInBox(() -> { | ||
44 | + String prdName = psog.getProductName(); | ||
45 | + Product product = productMapper.selectByPrimaryKey(psog.getProductId()); | ||
46 | + String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse(""); | ||
47 | + String sizeName = psog.getSizeName(); | ||
48 | + String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
49 | + return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS, skupTypeText, prdName, sizeName, productCode); | ||
50 | + }) | ||
51 | + .withSms(() -> { | ||
52 | + String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName(); | ||
53 | + return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_PASS, skupTypeText, orderCode); | ||
54 | + }) | ||
55 | + .send(); | ||
56 | + } catch (Exception e) { | ||
57 | + log.warn("notice seller appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e); | ||
58 | + } | ||
59 | + } | ||
60 | + | ||
61 | + | ||
62 | +} |
@@ -39,6 +39,7 @@ import com.yohoufo.order.service.handler.RefundGoodsMoneyHandler; | @@ -39,6 +39,7 @@ import com.yohoufo.order.service.handler.RefundGoodsMoneyHandler; | ||
39 | import com.yohoufo.order.service.handler.penalty.PenaltyResult; | 39 | import com.yohoufo.order.service.handler.penalty.PenaltyResult; |
40 | import com.yohoufo.order.service.handler.penalty.SellerEarnestMoney2BuyerPenaltyCalculator; | 40 | import com.yohoufo.order.service.handler.penalty.SellerEarnestMoney2BuyerPenaltyCalculator; |
41 | import com.yohoufo.order.service.impl.PayRefundService; | 41 | import com.yohoufo.order.service.impl.PayRefundService; |
42 | +import com.yohoufo.order.service.proxy.BuyerNoticeFacade; | ||
42 | import com.yohoufo.order.service.seller.setting.SellerService; | 43 | import com.yohoufo.order.service.seller.setting.SellerService; |
43 | import com.yohoufo.order.service.impl.TransferService; | 44 | import com.yohoufo.order.service.impl.TransferService; |
44 | import com.yohoufo.order.service.impl.visitor.*; | 45 | import com.yohoufo.order.service.impl.visitor.*; |
@@ -101,6 +102,9 @@ public class SellerOrderCancelService { | @@ -101,6 +102,9 @@ public class SellerOrderCancelService { | ||
101 | private InBoxFacade inBoxFacade; | 102 | private InBoxFacade inBoxFacade; |
102 | 103 | ||
103 | @Autowired | 104 | @Autowired |
105 | + private BuyerNoticeFacade buyerNoticeFacade; | ||
106 | + | ||
107 | + @Autowired | ||
104 | private TransferService transferService; | 108 | private TransferService transferService; |
105 | 109 | ||
106 | @Autowired | 110 | @Autowired |
@@ -653,7 +657,7 @@ public class SellerOrderCancelService { | @@ -653,7 +657,7 @@ public class SellerOrderCancelService { | ||
653 | .refund(); | 657 | .refund(); |
654 | //异步 | 658 | //异步 |
655 | //消息通知 | 659 | //消息通知 |
656 | - inBoxFacade.noticeBuyerWhenSellerCancelAfterPaid(buyerUid, buyerOrderCode, psog); | 660 | + buyerNoticeFacade.sellerCancelBuyerOrderAfterPaid(buyerUid, buyerOrderCode, psog); |
657 | inBoxFacade.sellerCancelAfterBuyerPaid( psog); | 661 | inBoxFacade.sellerCancelAfterBuyerPaid( psog); |
658 | 662 | ||
659 | //记录状态信息 | 663 | //记录状态信息 |
-
Please register or login to post a comment