...
|
...
|
@@ -20,7 +20,6 @@ import lombok.NonNull; |
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
...
|
...
|
@@ -61,6 +60,12 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
@Autowired
|
|
|
private IUFOSendService ufoSendService;
|
|
|
|
|
|
@Autowired
|
|
|
private SellerNoticeFacade sellerNoticeFacade;
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerNoticeFacade buyerNoticeFacade;
|
|
|
|
|
|
@Override
|
|
|
public Logger getLogger() {
|
|
|
return log;
|
...
|
...
|
@@ -71,180 +76,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
********************************************************************/
|
|
|
|
|
|
/**
|
|
|
* 买家订单未付款
|
|
|
*
|
|
|
* @param buyerUid
|
|
|
*/
|
|
|
public void buyerOrderNotPayed(int buyerUid, long orderCode) {
|
|
|
log.info("notice buyer not paid, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
|
|
newNotice(buyerUid)
|
|
|
.withLogPrefix("notice buyer not paid")
|
|
|
.withInBox(InboxBusinessTypeEnum.PURCHASE_UNPAID, orderCode)
|
|
|
.withPush(() -> ufoSendService.buyerNotPay(String.valueOf(buyerUid), String.valueOf(orderCode)))
|
|
|
.send();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 通知买家,已经支付成功已通知卖家发货
|
|
|
*
|
|
|
* @param buyerUid
|
|
|
* @param orderCode
|
|
|
*/
|
|
|
public void buyerFinishPaid(int buyerUid, long orderCode, int deliveryHours, String unit) {
|
|
|
log.info("notice buyer finish paid, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
|
|
String timelimitDesc = new StringBuilder().append(deliveryHours).append(unit).toString();
|
|
|
newNotice(buyerUid)
|
|
|
.withLogPrefix("notice buyer finish paid")
|
|
|
.withInBox(InboxBusinessTypeEnum.PURCHASE_NOTIFIED_SELLER, orderCode, timelimitDesc)
|
|
|
.send();
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 卖家发货后
|
|
|
*
|
|
|
* @param buyerUid
|
|
|
* @param orderCode
|
|
|
*/
|
|
|
public void sellerDeliver2Depot(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
|
|
try {
|
|
|
log.info("notice buyer seller deliver 2 depot, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
|
|
newNotice(buyerUid)
|
|
|
.withLogPrefix("notice buyer seller deliver 2 depot")
|
|
|
.withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_SELLER_DELIVER, orderCode)
|
|
|
.withPush(() -> ufoSendService.sellerDeliverNotice(String.valueOf(buyerUid), String.valueOf(orderCode)))
|
|
|
.withSms(() -> {
|
|
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
|
|
String prdName = psog.getProductName();
|
|
|
String sizeName = psog.getSizeName();
|
|
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER, skupTypeText, prdName, sizeName, productCode, orderCode);
|
|
|
})
|
|
|
.send();
|
|
|
} catch (Exception ex) {
|
|
|
log.warn("notice buyer seller deliver 2 depot fail, buyerUid {}, orderCode {}", buyerUid, orderCode, ex);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 平台已发货给买家
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public void appraisePassAndDeliveryGoodsToBuyerNoticeBuyer(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
|
|
try {
|
|
|
log.info("notice buyer appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
|
|
newNotice(buyerUid)
|
|
|
.withLogPrefix("notice buyer appraise pass")
|
|
|
.withInBox(InboxBusinessTypeEnum.PURCHASE_SENDED, orderCode)
|
|
|
.withSms(() -> {
|
|
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
|
|
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
|
|
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
|
|
String prdName = psog.getProductName();
|
|
|
String sizeName = psog.getSizeName();
|
|
|
return buildSmsContent(InboxBusinessTypeEnum.SMS_SEND, skupTypeText, prdName, sizeName, productCode, orderCode);
|
|
|
})
|
|
|
.send();
|
|
|
} catch (Exception e) {
|
|
|
log.warn("notice buyer appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void appraisePassNoticeSeller(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
|
|
try {
|
|
|
log.info("notice seller appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
|
|
newNotice(psog.getUid())
|
|
|
.withLogPrefix("notice seller appraise pass")
|
|
|
.withInBox(() -> {
|
|
|
String prdName = psog.getProductName();
|
|
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
|
|
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
|
|
|
String sizeName = psog.getSizeName();
|
|
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
|
|
return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS,skupTypeText, prdName, sizeName, productCode);
|
|
|
})
|
|
|
.withSms(() -> {
|
|
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
|
|
return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_PASS, skupTypeText, orderCode);
|
|
|
})
|
|
|
.send();
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.warn("notice seller appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 订单生成,卖家取消售卖
|
|
|
*
|
|
|
* @param orderCode
|
|
|
*/
|
|
|
public void noticeBuyerWhenSellerCancelAfterPaid(int buyerUid, long orderCode,SellerOrderGoods psog ) {
|
|
|
try {
|
|
|
executorService.execute(()->{
|
|
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
|
|
String prdName = psog.getProductName();
|
|
|
String sizeName =psog.getSizeName();
|
|
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_CLOSED_SELLER;
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record noticeBuyerWhenSellerCancelAfterPaid inbox msg, buyerUid {}, orderCode {},prdName {} resp {}",
|
|
|
buyerUid, orderCode, prdName,resp);
|
|
|
|
|
|
//发push
|
|
|
SendMessageRspBo bo = ufoSendService.sellerCancelTrade(String.valueOf(buyerUid),String.valueOf(orderCode));
|
|
|
log.info("record noticeBuyerWhenSellerCancelAfterPaid push buyer uid is {}, orderCode is {}, result is {}", buyerUid, orderCode, JSON.toJSONString(bo));
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(buyerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("in noticeBuyerWhenSellerCancelAfterPaid sms fail, buyerUid {} orderCode {} prdName {}", buyerUid, orderCode,prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
|
|
|
String content=getReplacedContent(InboxBusinessTypeEnum.SMS_CLOSED_SELLER.getContent(),skupTypeText,prdName,productCode,sizeName,orderCode);
|
|
|
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
log.info("record noticeBuyerWhenSellerCancelAfterPaid inbox sms msg, buyerUid {}, orderCode {},prdName {}",
|
|
|
buyerUid, orderCode,prdName);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade noticeBuyerWhenSellerCancelAfterPaid error inbox msg, buyerUid {}, orderCode {} prdName {}",
|
|
|
buyerUid, orderCode,psog, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单生成,买家取消订单
|
|
|
*/
|
|
|
public void buyerCancelOrder(int buyerUid, long orderCode) {
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_CLOSED_BUYER;
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record buyerCancelOrder inbox msg, buyerUid {}, orderCode {}, resp {}",
|
|
|
buyerUid, orderCode, resp);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade buyerCancelOrder error inbox msg, buyerUid {}, orderCode {} ",
|
|
|
buyerUid, orderCode, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 平台鉴定不通过
|
|
|
*
|
|
|
* @param buyerUid
|
...
|
...
|
@@ -288,26 +119,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
|
|
|
|
|
|
/**
|
|
|
* 平台收货
|
|
|
*/
|
|
|
public void noticeBuyerWhenPlatformReceiveGoods(int buyerUid, long orderCode) {
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_PLATFORM_RECEIVE;
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record noticeBuyerWhenPlatformReceiveGoods inbox msg, buyerUid {}, orderCode {}, resp {}",
|
|
|
buyerUid, orderCode, resp);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade buyerCancelOrder error inbox msg, buyerUid {}, orderCode {} ",
|
|
|
buyerUid, orderCode, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 质检未通过,买家
|
|
|
*/
|
|
|
public void noticeBuyerWhenQualityCheckNotPass(int buyerUid, long orderCode,SellerOrderGoods sellerOrderGoods) {
|
...
|
...
|
@@ -1673,74 +1484,14 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
execute(task, logModule, logparams);
|
|
|
}
|
|
|
|
|
|
public void noticeWhenQuickDeliverOrderPaid(int buyerUid, long orderCode, SellerOrderGoods sog){
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
|
|
|
Runnable task = ()->{
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_QUICK_DELIVER_ORDER_PAID;
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record noticeWhenQuickDeliverOrderPaid to buyer inbox msg, buyerUid {}, orderCode {},prdName {} resp {}",
|
|
|
buyerUid, orderCode,prdName, resp);
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(buyerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("in noticeWhenQuickDeliverOrderPaid sms fail, buyerUid {} orderCode {} prdName {}", buyerUid, orderCode,prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
|
|
|
InboxBusinessTypeEnum sms=InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_QUICK_DELIVER_ORDER_PAID;
|
|
|
|
|
|
String content= getReplacedContent(sms.getContent(),prdName,sizeName,orderCode);
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
log.info("record noticeWhenQuickDeliverOrderPaid inbox sms msg, buyer Uid {}, orderCode {},prdName {} ,sizeName {} ",
|
|
|
buyerUid, orderCode, prdName,sizeName);
|
|
|
};
|
|
|
String logModule = "InBoxFacade noticeWhenQuickDeliverOrderPaid error inbox msg, buyerUid {}, orderCode {} ,prdName {}";
|
|
|
Object[] logparams = new Object[]{buyerUid, orderCode, prdName};
|
|
|
|
|
|
execute(task, logModule, logparams);
|
|
|
appraisePassNoticeSeller(buyerUid,orderCode, sog);
|
|
|
public void noticeWhenQuickDeliverOrderPaid(int buyerUid, long orderCode, SellerOrderGoods sog) {
|
|
|
buyerNoticeFacade.quickDeliverOrderPaid(buyerUid, orderCode, sog);
|
|
|
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog);
|
|
|
}
|
|
|
|
|
|
public void noticeWhenDepositOrderOfQuickDeliverGoodsPaid(int buyerUid, long orderCode, SellerOrderGoods sog){
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
|
|
|
Runnable task = ()->{
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_DEPOSIT_ORDER_OF_QUICK_DELIVER_PAID;
|
|
|
String params = buildParams(orderCode);
|
|
|
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record noticeWhenDepositOrderOfPaid to buyer inbox msg, buyerUid {}, orderCode {},prdName {} resp {}",
|
|
|
buyerUid, orderCode,prdName, resp);
|
|
|
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(buyerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("in noticeWhenDepositOrderOfPaid sms fail, buyerUid {} orderCode {} prdName {}", buyerUid, orderCode,prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
|
|
|
InboxBusinessTypeEnum sms=InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_DEPOSIT_ORDER_OF_QUICK_DELIVER_PAID;
|
|
|
|
|
|
String content= getReplacedContent(sms.getContent(),prdName,sizeName,orderCode);
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
log.info("record noticeWhenDepositOrderOfPaid inbox sms msg, buyer Uid {}, orderCode {},prdName {} ,sizeName {} ",
|
|
|
buyerUid, orderCode, prdName,sizeName);
|
|
|
};
|
|
|
String logModule = "InBoxFacade noticeWhenDepositOrderOfPaid error inbox msg, buyerUid {}, orderCode {} ,prdName {}";
|
|
|
Object[] logparams = new Object[]{buyerUid, orderCode, prdName};
|
|
|
execute(task, logModule, logparams);
|
|
|
//
|
|
|
appraisePassNoticeSeller(buyerUid,orderCode, sog);
|
|
|
public void noticeWhenDepositOrderOfQuickDeliverGoodsPaid(int buyerUid, long orderCode, SellerOrderGoods sog) {
|
|
|
buyerNoticeFacade.quickDeliverDepositGoodsPaid(buyerUid, orderCode, sog);
|
|
|
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog);
|
|
|
}
|
|
|
|
|
|
// 召回的
|
...
|
...
|
|