Authored by chenchao

add notice control flag

... ... @@ -117,17 +117,17 @@ public class ErpSellerGoodsController {
* 后台下架
* 在遥远的未来或者根本就没有未来
* 那就用"也许"来表达下,未来也许需要MQ方式
* @param sellerOrder
* @param req
* @return
*/
@RequestMapping(value="/offShelveByErp")
@ResponseBody
@IgnoreSession
@IgnoreSignature
public ApiResponse offShelveByErp(@RequestBody SellerOrder sellerOrder) {
public ApiResponse offShelveByErp(@RequestBody SellerOrderCancelReq req) {
logger.info("in ufo.sellerOrder.cancel, sellerOrder {}", sellerOrder);
boolean result = sellerOrderService.offShelveByErp(sellerOrder.getSkup()) ;
logger.info("in ufo.sellerOrder.cancel, req {}", req);
boolean result = sellerOrderService.offShelveByErp(req) ;
String msg = "后台下架成功";
if(!result){
msg = "后台下架失败";
... ...
... ... @@ -17,4 +17,10 @@ public class ErpCancelSellerOrderEvent extends Event {
private int skup;
/**
* 默认false 需要通知
* 不需要通知 设置为true
*/
private boolean noNeedNotice;
}
... ...
... ... @@ -370,12 +370,16 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
}
public boolean offShelveByErp(int skup){
public boolean offShelveByErp(SellerOrderCancelReq req){
int skup = req.getSkup();
if (skup <= 0 ){
log.warn("in offShelveByErp, skup illegal, skup {}", skup);
return false;
}
ErpCancelSellerOrderEvent event = ErpCancelSellerOrderEvent.builder().skup(skup).build();
ErpCancelSellerOrderEvent event = ErpCancelSellerOrderEvent.builder()
.skup(skup)
.noNeedNotice(req.isNoNeedNotice())
.build();
OffShelveCancelCase offShelveCancelCase = new OffShelveCancelCase(event);
offShelveCancelCase.accept(sellerOrderCancelService);
return true;
... ...
... ... @@ -815,15 +815,19 @@ public class SellerOrderCancelService {
if (cpn == null){
return;
}
boolean noNeedNotice = event.isNoNeedNotice();
//false 需要通知
if (!noNeedNotice) {
SellerOrderGoods psog = cpn.psog;
Integer sellerUid = psog.getUid();
if (cpn.isQuickDeliver){
if (cpn.isQuickDeliver) {
// notice seller
sellerNoticeFacade.noticeSellerWhenPlatformOffShelve(psog);
}else {
} else {
sellerNoticeFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog);
}
}
}
private static class CancelStatusNode{
int skup;
SkupStatus expectSkupStatus;
... ...