...
|
...
|
@@ -90,66 +90,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
return log;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 卖家发货提醒,买家支付购买后
|
|
|
*
|
|
|
* @param sog
|
|
|
*/
|
|
|
public void sellerSkupPaidByBuyer(SellerOrderGoods sog, long orderCode, int deliveryTimeLimit, String unit) {
|
|
|
String logPrefix = "seller skup paid by buyer";
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
try {
|
|
|
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
String timelimitDesc = new StringBuilder().append(deliveryTimeLimit).append(unit).toString();
|
|
|
newSellerNotice(sog)
|
|
|
.withLogPrefix(logPrefix)
|
|
|
.withInBox(InboxBusinessTypeEnum.SALE_SEND, goodsTypeTag,prdName, sizeName,productCode, timelimitDesc)
|
|
|
.withPush(()->ufoSendService.sellerGoodsSend(String.valueOf(sellerUid),String.valueOf(orderCode),prdName,sizeName,productCode,timelimitDesc))
|
|
|
.withSms(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND,goodsTypeTag,prdName,sizeName,productCode,orderCode,timelimitDesc)
|
|
|
.send();
|
|
|
} catch (Exception e) {
|
|
|
log.warn("{} fail, sellerUid {}, prdName {} ", logPrefix,sellerUid, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
public void sellerOverSeasSkupPaidByBuyer(SellerOrderGoods sog, long orderCode, int deliveryTimeLimit, String unit) {
|
|
|
String logPrefix = "seller overseas skup paid by buyer";
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
try {
|
|
|
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
String timelimitDesc = new StringBuilder().append(deliveryTimeLimit).append(unit).toString();
|
|
|
newSellerNotice(sog)
|
|
|
.withLogPrefix(logPrefix)
|
|
|
.withInBox(InboxBusinessTypeEnum.SALE_SEND, goodsTypeTag,prdName, sizeName,productCode, timelimitDesc)
|
|
|
.withPush(()->ufoSendService.sellerGoodsSend(String.valueOf(sellerUid),String.valueOf(orderCode),prdName,sizeName,productCode,timelimitDesc))
|
|
|
.withSms(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND,goodsTypeTag,prdName,sizeName,productCode,orderCode,timelimitDesc)
|
|
|
.send();
|
|
|
} catch (Exception e) {
|
|
|
log.warn("{} fail, sellerUid {}, prdName {} ", logPrefix,sellerUid, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 鉴定结束发货,发送站内信和短信
|
|
|
* @param uid
|
...
|
...
|
@@ -159,7 +99,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
*/
|
|
|
public void sendInboxSmsWhenAppraiseFinished(InboxBusinessTypeEnum inbox, InboxBusinessTypeEnum sms,
|
|
|
int uid, String prdName, String productCode,String wayBillCode){
|
|
|
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
String params = buildParams(prdName, productCode);
|
...
|
...
|
@@ -217,51 +156,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 交易关闭:订单生成,平台鉴定不通过
|
|
|
*
|
|
|
* @param sog
|
|
|
*/
|
|
|
public void noticeSellerWhenAppraiseFail(SellerOrderGoods sog,long orderCode ,String wayBillCode) {
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SALE_CLOSED_PLATFORM;
|
|
|
String params = buildParams(goodsTypeTag,prdName, sizeName,productCode);
|
|
|
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record noticeSellerWhenAppraiseFail inbox msg, SellerOrderGoods {} sellerUid {}, prdName {} orderCode {},wayBillCode {} resp {}",
|
|
|
JSON.toJSONString(sog), sellerUid, prdName,orderCode ,wayBillCode, resp);
|
|
|
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(sellerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("record noticeSellerWhenAppraiseFail sms send fail cause of empty phone number,sellerUid {}, prdName {} ,wayBillCode {}", sellerUid, prdName,wayBillCode);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_CLOSED_PLATFORM.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode,wayBillCode);
|
|
|
sendSmsService.smsSendByMobile(content, mobileList);
|
|
|
log.info("record noticeSellerWhenAppraiseFail sms send,sellerUid {}, prdName {},orderCode {},wayBillCode {} ",
|
|
|
sellerUid, prdName,orderCode,wayBillCode);
|
|
|
});
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade noticeSellerWhenAppraiseFail error inbox msg, sellerUid {}, prdName {} ",
|
|
|
sellerUid, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 更低的出价提醒
|
|
|
* @param sog
|
|
|
*/
|
...
|
...
|
@@ -307,101 +201,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 鉴定中心把 买家取消(卖家已发货给中心)的物品,顺丰到付寄给卖家
|
|
|
*/
|
|
|
public void sendCancelledProductToSellerByCenter(int sellerUid,Long orderCode,SellerOrderGoods sog,String wayBillCode){
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
log.info("record sendCancelledProductToSeller inbox sms msg,sellerUid {},orderCode {},sellerOrderGoods {}, wayBillCode {}",
|
|
|
sellerUid, orderCode,sog,wayBillCode);
|
|
|
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
//消息
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_EXPRESS_CANCELLED_BY_BUYER_AFTER_DELIVERY;
|
|
|
String params = buildParams(goodsTypeTag,prdName,sizeName,productCode,wayBillCode);
|
|
|
InboxReqVO inBoxReq = buildInboxReqVO(sellerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(inBoxReq);
|
|
|
log.info("InBoxFacade sendCancelledProductToSeller inbox msg, sellerUid {},orderCode {},sellerOrderGoods {}, wayBillCode {},resp {}",
|
|
|
sellerUid, orderCode,sog,wayBillCode,resp);
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(sellerUid);
|
|
|
log.info("sendCancelledProductToSeller wayBillCode sms send get phone {},sellerUid {}, wayBillCode {}",
|
|
|
phone,sellerUid,wayBillCode);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("sendCancelledProductToSeller wayBillCode sms send fail cause of phone blank,sellerUid {}, wayBillCode {}",
|
|
|
sellerUid,wayBillCode);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_CANCELED_BY_BUYER_AFTER_RECEIVED.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode,wayBillCode);
|
|
|
|
|
|
sendSmsService.smsSendByMobile(content, mobileList);
|
|
|
log.info("record sendCancelledProductToSeller inbox sms msg end,sellerUid {}, wayBillCode {}, phone {},",
|
|
|
sellerUid, wayBillCode, phone);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade sendCancelledProductToSeller error inbox msg, sellerUid {}, wayBillCode {} ",
|
|
|
sellerUid, wayBillCode, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 无法鉴定寄回,给卖家消息
|
|
|
*/
|
|
|
public void sellerAppraiseUnsure_send_back(SellerOrderGoods sog,long orderCode,String wayBillCode) {
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_UNSURE_SEND_BACK;
|
|
|
String params = buildParams(goodsTypeTag,prdName, sizeName,productCode);
|
|
|
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record sellerAppraiseUnsure_send_back inbox msg, SellerOrderGoods {} ,sellerUid {}, prdName {}, sizeName {}, resp {}",
|
|
|
JSON.toJSONString(sog),sellerUid, prdName, sizeName , resp);
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(sellerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("sellerAppraiseUnsure_send_back sms send fail,sellerUid {}, prdName {}", sellerUid, prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
InboxBusinessTypeEnum sms = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_UNSURE_SEND_BACK;
|
|
|
|
|
|
String content = getReplacedContent(sms.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode,wayBillCode);
|
|
|
sendSmsService.smsSendByMobile(content, mobileList);
|
|
|
log.info("record sellerAppraiseUnsure_send_back inbox sms msg,sellerUid {}, prdName {},orderCode {}",
|
|
|
sellerUid, prdName,orderCode);
|
|
|
});
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade sellerAppraiseUnsure_send_back error inbox msg, sellerUid {}, prdName {} ",
|
|
|
sellerUid, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void buyerCancelBeforeDepotReceive(@NonNull BuyerOrder buyerOrder, String compesant, SellerOrderGoods sog, boolean useDepositGoods) {
|
|
|
buyerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, compesant, sog);
|
|
|
sellerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, sog, useDepositGoods);
|
...
|
...
|
@@ -686,7 +485,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
public void sendMessageWhenChangeOwner(Integer ownerUid,Long orderCode,
|
|
|
SellerOrderGoods sellerOrderGoods){
|
|
|
InboxBusinessTypeEnum inboxType = InboxBusinessTypeEnum.NOTICE_BUYER_DEPOSIT_IN_STORAGE;
|
...
|
...
|
@@ -709,9 +507,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void paidAppraiseOrderDeliverBackNotice(int uid,long orderCode, String expressNumber, AppraiseOrderStatus targetStatus){
|
|
|
log.info("enter paidAppraiseOrderDeliverBackNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus);
|
|
|
try {
|
...
|
...
|
|