Authored by chenchao

add notice when buyer order cancel because of pull wool

... ... @@ -397,6 +397,9 @@ public class BuyerOrderCancelService {
asyncProcessPenalty(preparedData, targetStatus);
//clean cache
cacheCleaner.cleanSellerAndBuyerOrderDetailAndList(pbo.getSellerUid(), pbo.getUid(), orderCode);
//notice
sellerNoticeFacade.buyerOrderCancelByBuyerPullWool(preparedData.getSellerOrderGoods());
buyerNoticeFacade.cancelByBuyerPullWool(pbo);
}
}
... ...
... ... @@ -606,5 +606,20 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
}
}
public void cancelByBuyerPullWool(BuyerOrder buyerOrder){
Integer uid = buyerOrder.getUid();
Long orderCode = buyerOrder.getOrderCode();
try {
newBuyerNotice(buyerOrder)
.withLogPrefix("notice buyer cancelByBuyerPullWool")
.withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_BUYER_PULL_WOOL, orderCode)
.withPush(() -> ufoSendService.sellerDeliverHours(String.valueOf(uid), String.valueOf(orderCode)))
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_BUYER_PULL_WOOL, orderCode)
.send();
} catch (Exception e) {
log.warn("notice buyer cancelByBuyerPullWool fail,uid {} orderCode {}", uid,orderCode, e);
}
}
}
... ...
... ... @@ -906,4 +906,26 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
}
}
public void buyerOrderCancelByBuyerPullWool(SellerOrderGoods sog){
InboxBusinessTypeEnum ibtOfsms = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_BUYER_PULL_WOOL;
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_BUYER_PULL_WOOL;
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
try {
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
Object[] inboxParams = new Object[]{prdName, sizeName, productCode};
Object[] smsParams = inboxParams;
newSellerNotice(sog)
.withLogPrefix("notice seller OrderCancelByBuyerPullWool")
.withInBox(ibt, inboxParams)
.withSms(ibtOfsms, smsParams)
.send();
}catch (Exception ex){
log.warn("notice seller buyerOrderCancelByBuyerPullWool fail, sellerUid {}, skup {} ", sellerUid, sog.getId(), ex);
}
}
}
... ...