...
|
...
|
@@ -28,6 +28,7 @@ import java.math.BigDecimal; |
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Optional;
|
|
|
import java.util.concurrent.ArrayBlockingQueue;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
...
|
...
|
@@ -569,66 +570,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
/*********************************************************************
|
|
|
* 其他---短信
|
|
|
********************************************************************/
|
|
|
|
|
|
public void sendMsg4EntySeller(Integer uid){
|
|
|
log.info("InBoxFacade sendMsg4EntySeller inbox msg, uid {}",uid);
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
// 发送消息
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SYSTEM_ENTER_SETTLED;
|
|
|
String params = buildParams(null);
|
|
|
InboxReqVO inBoxReq = buildInboxReqVO(uid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(inBoxReq);
|
|
|
log.info("InBoxFacade sendMsg4enty inbox msg, uid {}, resp {}",
|
|
|
uid, resp);
|
|
|
});
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade sendMsg4EntySeller error inbox msg, sellerUid {}, prdName {} ",
|
|
|
uid, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void sendMsg4QuitEntrySeller(Integer uid){
|
|
|
log.info("InBoxFacade sendMsg4QuitEntrySeller inbox msg, uid {}",uid);
|
|
|
try {
|
|
|
executorService.execute(() -> {
|
|
|
// 发送消息
|
|
|
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.SYSTEM_EXIT_SETTLED;
|
|
|
String params = buildParams(null);
|
|
|
InboxReqVO inBoxReq = buildInboxReqVO(uid, params, ibt);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(inBoxReq);
|
|
|
log.info("InBoxFacade sendMsg4quit inbox msg, uid {}, resp {}",
|
|
|
uid, resp);
|
|
|
|
|
|
// 发送短信
|
|
|
String content=InboxBusinessTypeEnum.SMS_EXIT_SETTLED.getContent();
|
|
|
String phone=userProxyService.getMobile(uid);
|
|
|
log.info("sendMsg4quit inbox sms, uid {}, phone {}",
|
|
|
uid, phone);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("endMsg4quit inbox sms fail cause of phone is empty, uid {} ", uid);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
log.info("sendMsg4quit inbox sms send end, uid {}, phone {}",
|
|
|
uid, phone);
|
|
|
});
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade sendMsg4QuitEntrySeller error inbox msg, sellerUid {}, prdName {} ",
|
|
|
uid, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 鉴定中心把 买家取消(卖家已发货给中心)的物品,顺丰到付寄给卖家
|
|
|
*/
|
...
|
...
|
@@ -844,101 +785,6 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
public void sellerDeliverNotice(SellerOrderGoods sog, long orderCode, int times, int leftTime, String timeUnit) {
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
|
|
|
InboxBusinessTypeEnum ibt;
|
|
|
InboxBusinessTypeEnum smsInboxBusinessTypeEnum;
|
|
|
String params ;
|
|
|
String content;
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
try {
|
|
|
if (times == 2) {
|
|
|
params = buildParams(goodsTypeTag,prdName, sizeName,productCode, leftTime, timeUnit);
|
|
|
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_DELIVER_GOODS;
|
|
|
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_NOTIFIED_SEND_SECOND;
|
|
|
content = getReplacedContent(smsInboxBusinessTypeEnum.getContent(),goodsTypeTag,prdName,sizeName,productCode,leftTime,timeUnit,orderCode);
|
|
|
} else if (times == 3) {
|
|
|
params = buildParams(goodsTypeTag,prdName, sizeName,productCode);
|
|
|
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_DELIVER_GOODS_FAIL;
|
|
|
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_NOTIFIED_SEND_FAILED;
|
|
|
content = getReplacedContent(smsInboxBusinessTypeEnum.getContent(),goodsTypeTag,prdName,sizeName,productCode,orderCode);
|
|
|
} else {
|
|
|
return;
|
|
|
}
|
|
|
executorService.execute(() -> {
|
|
|
log.info("record sellerDeliverNotice inbox sms msg,sellerUid {},orderCode {}, prdName {}, times {}",
|
|
|
sellerUid,orderCode, prdName, times);
|
|
|
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record sellerDeliverNotice inbox msg,sellerUid {}, orderCode {} ,prdName {},sizeName {} times {},resp {}",
|
|
|
sellerUid,orderCode, prdName, sizeName, times, resp);
|
|
|
|
|
|
String phone = userProxyService.getMobile(sellerUid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("times {},sellerDeliverNotice sms send fail,sellerUid {}, orderCode {} ,prdName {}",
|
|
|
times, sellerUid, orderCode,prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
|
|
|
sendSmsService.smsSendByMobile(content, mobileList);
|
|
|
log.info("record sellerDeliverNotice inbox sms msg,sellerUid {},orderCode, prdName {}, times {},resp {}",
|
|
|
sellerUid, orderCode,prdName, times);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade sellerDeliverNotice error inbox msg, sellerUid {}, orderCode,prdName {} ",
|
|
|
sellerUid,orderCode, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void noticeSellerAppraiseUnsure(SellerOrderGoods sog, long orderCode) {
|
|
|
Integer sellerUid = sog.getUid();
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
String goodsTypeTag = buildGoodsTypeTagForSeller(sog);
|
|
|
|
|
|
InboxBusinessTypeEnum ibt;
|
|
|
InboxBusinessTypeEnum smsInboxBusinessTypeEnum;
|
|
|
String params;
|
|
|
String content;
|
|
|
try {
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
params = buildParams(goodsTypeTag,prdName, sizeName,productCode);
|
|
|
ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_UNSURE;
|
|
|
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_UNSURE;
|
|
|
content = getReplacedContent(smsInboxBusinessTypeEnum.getContent(),goodsTypeTag, prdName, sizeName,productCode,orderCode);
|
|
|
executorService.execute(() -> {
|
|
|
|
|
|
|
|
|
|
|
|
log.info("noticeSellerAppraiseUnsure inbox sms msg,sellerUid {}, prdName {}", sellerUid, prdName);
|
|
|
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("noticeSellerAppraiseUnsure inbox msg,sellerUid {}, prdName {},sizeName {},resp {}",
|
|
|
sellerUid, prdName, sizeName, resp);
|
|
|
|
|
|
String phone = userProxyService.getMobile(sellerUid);
|
|
|
if (StringUtils.isBlank(phone)) {
|
|
|
log.warn("noticeSellerAppraiseUnsure sms send fail,sellerUid {}, prdName {}", sellerUid, prdName);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
|
|
|
sendSmsService.smsSendByMobile(content, mobileList);
|
|
|
log.info("noticeSellerAppraiseUnsure inbox sms msg,sellerUid {}, prdName {},resp {}",
|
|
|
sellerUid, prdName, resp);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
log.warn("noticeSellerAppraiseUnsure error inbox msg, sellerUid {}, prdName {} ",
|
|
|
sellerUid, prdName, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void buyerCancelBeforeDepotReceive(@NonNull BuyerOrder buyerOrder, String compesant, SellerOrderGoods sog) {
|
|
|
buyerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, compesant, sog);
|
|
|
sellerNoticeFacade.buyerCancelBeforeDepotReceive(buyerOrder, sog);
|
...
|
...
|
@@ -1004,12 +850,12 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
public void noticeSuperSellerDegrade(Integer uid, SuperEnterStageLevel sesl, BigDecimal leftInWallet){
|
|
|
public void noticeSuperSellerDegrade(Integer uid, SuperEnterStageLevel sesl, BigDecimal leftInWallet) {
|
|
|
String logPrefix = "notice super seller degrade";
|
|
|
try {
|
|
|
executorService.execute(()->{
|
|
|
InboxBusinessTypeEnum smsIBT = null;
|
|
|
InboxBusinessTypeEnum inboxIBT = null;
|
|
|
switch (sesl){
|
|
|
InboxBusinessTypeEnum smsIBT;
|
|
|
InboxBusinessTypeEnum inboxIBT;
|
|
|
switch (sesl) {
|
|
|
case PARTITION:
|
|
|
inboxIBT = InboxBusinessTypeEnum.SUPER_SELLER_DEGRADE_PART_FUNC;
|
|
|
smsIBT = InboxBusinessTypeEnum.SMS_SUPER_SELLER_DEGRADE_PART_FUNC;
|
...
|
...
|
@@ -1018,73 +864,46 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
inboxIBT = InboxBusinessTypeEnum.SUPER_SELLER_DEGRADE_ALL_FUNC;
|
|
|
smsIBT = InboxBusinessTypeEnum.SMS_SUPER_SELLER_DEGRADE_ALL_FUNC;
|
|
|
break;
|
|
|
}
|
|
|
if (smsIBT == null || inboxIBT == null ){
|
|
|
log.warn("in noticeSuperSellerDegrade not match send condition, uid {}, SuperEnterStageLevel {},leftInWallet {}",
|
|
|
uid, sesl, leftInWallet);
|
|
|
default:
|
|
|
log.warn("{} fail, uid {}, SuperEnterStageLevel {},leftInWallet {}", logPrefix, uid, sesl, leftInWallet);
|
|
|
return;
|
|
|
}
|
|
|
String params = buildParams(leftInWallet);
|
|
|
InboxReqVO req = buildInboxReqVO(uid, params, inboxIBT);
|
|
|
newNotice(uid)
|
|
|
.withLogPrefix(logPrefix)
|
|
|
.withInBox(inboxIBT, leftInWallet)
|
|
|
.withSms(smsIBT, leftInWallet)
|
|
|
.send();
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
log.info("record noticeSuperSellerDegrade to super seller inbox msg, uid {}, SuperEnterStageLevel {},leftInWallet {} resp {}",
|
|
|
uid, sesl, leftInWallet, resp);
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(uid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("in noticeSuperSellerDegrade sms fail, uid {}, SuperEnterStageLevel {},leftInWallet {}",
|
|
|
uid, sesl, leftInWallet);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content = getReplacedContent(smsIBT.getContent(), leftInWallet);
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
log.info("record noticeSuperSellerDegrade inbox sms msg, uid {}, SuperEnterStageLevel {},leftInWallet {}",
|
|
|
uid, sesl, leftInWallet);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade noticeSuperSellerDegrade error inbox msg, uid {}, SuperEnterStageLevel {},leftInWallet {}",
|
|
|
uid, sesl, leftInWallet, e);
|
|
|
log.warn("{} fail, uid {}, SuperEnterStageLevel {},leftInWallet {}",
|
|
|
logPrefix, uid, sesl, leftInWallet, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void noticeLargeSettlementSuperDegrade(Integer uid, SuperEnterStageLevel sesl,String threshold, BigDecimal leftInWallet){
|
|
|
public void noticeLargeSettlementSuperDegrade(Integer uid, SuperEnterStageLevel sesl, String threshold, BigDecimal leftInWallet) {
|
|
|
String logPrefix = "notice large settlement super degrade";
|
|
|
try {
|
|
|
executorService.execute(()->{
|
|
|
InboxBusinessTypeEnum smsIBT = null;
|
|
|
switch (sesl){
|
|
|
InboxBusinessTypeEnum smsInboxBusinessTypeEnum;
|
|
|
switch (sesl) {
|
|
|
case FULL:
|
|
|
smsIBT = InboxBusinessTypeEnum.SMS_LARGE_SETTLEMENT_SUPER_WALLET_NOT_ENOUGH;
|
|
|
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_LARGE_SETTLEMENT_SUPER_WALLET_NOT_ENOUGH;
|
|
|
break;
|
|
|
case PARTITION:
|
|
|
smsIBT = InboxBusinessTypeEnum.SMS_LARGE_SETTLEMENT_SUPER_DEGRADE_PART_FUNC;
|
|
|
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_LARGE_SETTLEMENT_SUPER_DEGRADE_PART_FUNC;
|
|
|
break;
|
|
|
case DISABLE:
|
|
|
smsIBT = InboxBusinessTypeEnum.SMS_LARGE_SETTLEMENT_SUPER_DEGRADE_ALL_FUNC;
|
|
|
smsInboxBusinessTypeEnum = InboxBusinessTypeEnum.SMS_LARGE_SETTLEMENT_SUPER_DEGRADE_ALL_FUNC;
|
|
|
break;
|
|
|
}
|
|
|
if (smsIBT == null){
|
|
|
log.warn("in noticeLargeSettlementSuperDegrade not match send condition, uid {}, SuperEnterStageLevel {},leftInWallet {} threshold {}",
|
|
|
uid, sesl, leftInWallet, threshold);
|
|
|
return;
|
|
|
}
|
|
|
//短信
|
|
|
String phone = userProxyService.getMobile(uid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("in noticeLargeSettlementSuperDegrade sms fail, uid {}, SuperEnterStageLevel {},leftInWallet {} threshold{}",
|
|
|
uid, sesl, leftInWallet, threshold);
|
|
|
default:
|
|
|
log.warn("{} fail, uid {}, SuperEnterStageLevel {},leftInWallet {} threshold {}", logPrefix, uid, sesl, leftInWallet, threshold);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content = getReplacedContent(smsIBT.getContent(), threshold);
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
log.info("record noticeLargeSettlementSuperDegrade inbox sms msg, uid {}, SuperEnterStageLevel {},leftInWallet {} threshold {}",
|
|
|
uid, sesl, leftInWallet, threshold);
|
|
|
});
|
|
|
newNotice(uid)
|
|
|
.withLogPrefix(logPrefix)
|
|
|
.withSms(smsInboxBusinessTypeEnum, threshold)
|
|
|
.send();
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade noticeLargeSettlementSuperDegrade error inbox msg, uid {}, SuperEnterStageLevel {},leftInWallet {} threshold {}",
|
|
|
uid, sesl, leftInWallet,threshold, e);
|
|
|
log.warn("{} fail, uid {}, SuperEnterStageLevel {},leftInWallet {} threshold {}", logPrefix, uid, sesl, leftInWallet, threshold, e);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1098,38 +917,32 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
|
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog);
|
|
|
}
|
|
|
|
|
|
// 召回的
|
|
|
public void recallDepositnotify(int uid, SellerOrderGoods sog) {
|
|
|
/**
|
|
|
* 召回寄存商品
|
|
|
*/
|
|
|
public void recallDepositNotify(int uid, SellerOrderGoods sog) {
|
|
|
if (null == sog) {
|
|
|
log.warn("InBoxFacade recallDepositnotify error SellerOrderGoods is null, uid {}", uid);
|
|
|
log.warn("notice user recall deposit goods fail, uid {}, sog is null", uid);
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
String prdName = sog.getProductName();
|
|
|
String sizeName = sog.getSizeName();
|
|
|
try {
|
|
|
executorService.execute(()->{
|
|
|
newNotice(uid)
|
|
|
.withLogPrefix("notice user recall deposit goods")
|
|
|
.withInBox(() -> {
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
|
|
|
InboxBusinessTypeEnum ibtOfSeller = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_RECALL;
|
|
|
String paramsOfSeller = buildParams(prdName, sizeName,productCode);
|
|
|
InboxReqVO reqOfSeller = buildInboxReqVO(uid, paramsOfSeller, ibtOfSeller);
|
|
|
InBoxResponse respOfSeller = inBoxSDK.addInbox(reqOfSeller);
|
|
|
log.info("record recallDepositnotify to seller inbox msg, uid {}, sog {} resp {}",
|
|
|
uid, sog, respOfSeller);
|
|
|
|
|
|
String phone = userProxyService.getMobile(uid);
|
|
|
if (StringUtils.isBlank(phone)){
|
|
|
log.warn("in recallDepositnotify sms fail, uid {} sog {}", uid, sog);
|
|
|
return;
|
|
|
}
|
|
|
List<String> mobileList = Arrays.asList(phone);
|
|
|
String content= getReplacedContent(InboxBusinessTypeEnum.SMS_NOTIFY_SELLER_DEPOSIT_RECALL.getContent(),prdName, sizeName, productCode);
|
|
|
sendSmsService.smsSendByMobile(content,mobileList);
|
|
|
log.info("record recallDepositnotify inbox sms msg, uid {}, sog {}", uid, sog);
|
|
|
});
|
|
|
return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_RECALL, prdName, sizeName, productCode);
|
|
|
})
|
|
|
.withSms(() -> {
|
|
|
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
|
|
|
String productCode = product.getProductCode();
|
|
|
return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTIFY_SELLER_DEPOSIT_RECALL, prdName, sizeName, productCode);
|
|
|
})
|
|
|
.send();
|
|
|
} catch (Exception e) {
|
|
|
log.warn("InBoxFacade recallDepositnotify error inbox msg, uid {}, sog {}", uid, sog, e);
|
|
|
log.warn("notice user recall deposit goods fail, uid {}, sog {}", uid, sog, e);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|