add notice control flag
Showing
4 changed files
with
27 additions
and
13 deletions
@@ -117,17 +117,17 @@ public class ErpSellerGoodsController { | @@ -117,17 +117,17 @@ public class ErpSellerGoodsController { | ||
117 | * 后台下架 | 117 | * 后台下架 |
118 | * 在遥远的未来或者根本就没有未来 | 118 | * 在遥远的未来或者根本就没有未来 |
119 | * 那就用"也许"来表达下,未来也许需要MQ方式 | 119 | * 那就用"也许"来表达下,未来也许需要MQ方式 |
120 | - * @param sellerOrder | 120 | + * @param req |
121 | * @return | 121 | * @return |
122 | */ | 122 | */ |
123 | @RequestMapping(value="/offShelveByErp") | 123 | @RequestMapping(value="/offShelveByErp") |
124 | @ResponseBody | 124 | @ResponseBody |
125 | @IgnoreSession | 125 | @IgnoreSession |
126 | @IgnoreSignature | 126 | @IgnoreSignature |
127 | - public ApiResponse offShelveByErp(@RequestBody SellerOrder sellerOrder) { | 127 | + public ApiResponse offShelveByErp(@RequestBody SellerOrderCancelReq req) { |
128 | 128 | ||
129 | - logger.info("in ufo.sellerOrder.cancel, sellerOrder {}", sellerOrder); | ||
130 | - boolean result = sellerOrderService.offShelveByErp(sellerOrder.getSkup()) ; | 129 | + logger.info("in ufo.sellerOrder.cancel, req {}", req); |
130 | + boolean result = sellerOrderService.offShelveByErp(req) ; | ||
131 | String msg = "后台下架成功"; | 131 | String msg = "后台下架成功"; |
132 | if(!result){ | 132 | if(!result){ |
133 | msg = "后台下架失败"; | 133 | msg = "后台下架失败"; |
@@ -17,4 +17,10 @@ public class ErpCancelSellerOrderEvent extends Event { | @@ -17,4 +17,10 @@ public class ErpCancelSellerOrderEvent extends Event { | ||
17 | 17 | ||
18 | 18 | ||
19 | private int skup; | 19 | private int skup; |
20 | + | ||
21 | + /** | ||
22 | + * 默认false 需要通知 | ||
23 | + * 不需要通知 设置为true | ||
24 | + */ | ||
25 | + private boolean noNeedNotice; | ||
20 | } | 26 | } |
@@ -370,12 +370,16 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | @@ -370,12 +370,16 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic | ||
370 | } | 370 | } |
371 | 371 | ||
372 | 372 | ||
373 | - public boolean offShelveByErp(int skup){ | 373 | + public boolean offShelveByErp(SellerOrderCancelReq req){ |
374 | + int skup = req.getSkup(); | ||
374 | if (skup <= 0 ){ | 375 | if (skup <= 0 ){ |
375 | log.warn("in offShelveByErp, skup illegal, skup {}", skup); | 376 | log.warn("in offShelveByErp, skup illegal, skup {}", skup); |
376 | return false; | 377 | return false; |
377 | } | 378 | } |
378 | - ErpCancelSellerOrderEvent event = ErpCancelSellerOrderEvent.builder().skup(skup).build(); | 379 | + ErpCancelSellerOrderEvent event = ErpCancelSellerOrderEvent.builder() |
380 | + .skup(skup) | ||
381 | + .noNeedNotice(req.isNoNeedNotice()) | ||
382 | + .build(); | ||
379 | OffShelveCancelCase offShelveCancelCase = new OffShelveCancelCase(event); | 383 | OffShelveCancelCase offShelveCancelCase = new OffShelveCancelCase(event); |
380 | offShelveCancelCase.accept(sellerOrderCancelService); | 384 | offShelveCancelCase.accept(sellerOrderCancelService); |
381 | return true; | 385 | return true; |
@@ -815,13 +815,17 @@ public class SellerOrderCancelService { | @@ -815,13 +815,17 @@ public class SellerOrderCancelService { | ||
815 | if (cpn == null){ | 815 | if (cpn == null){ |
816 | return; | 816 | return; |
817 | } | 817 | } |
818 | - SellerOrderGoods psog = cpn.psog; | ||
819 | - Integer sellerUid = psog.getUid(); | ||
820 | - if (cpn.isQuickDeliver){ | ||
821 | - // notice seller | ||
822 | - sellerNoticeFacade.noticeSellerWhenPlatformOffShelve(psog); | ||
823 | - }else { | ||
824 | - sellerNoticeFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog); | 818 | + boolean noNeedNotice = event.isNoNeedNotice(); |
819 | + //false 需要通知 | ||
820 | + if (!noNeedNotice) { | ||
821 | + SellerOrderGoods psog = cpn.psog; | ||
822 | + Integer sellerUid = psog.getUid(); | ||
823 | + if (cpn.isQuickDeliver) { | ||
824 | + // notice seller | ||
825 | + sellerNoticeFacade.noticeSellerWhenPlatformOffShelve(psog); | ||
826 | + } else { | ||
827 | + sellerNoticeFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog); | ||
828 | + } | ||
825 | } | 829 | } |
826 | } | 830 | } |
827 | private static class CancelStatusNode{ | 831 | private static class CancelStatusNode{ |
-
Please register or login to post a comment