...
|
...
|
@@ -2,6 +2,7 @@ package com.yohoufo.order.service.proxy; |
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
|
|
|
import com.yohobuy.ufo.model.order.common.SuperEnterStageLevel;
|
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.inboxclient.model.InBoxResponse;
|
|
|
import com.yohoufo.inboxclient.model.InboxReqVO;
|
...
|
...
|
@@ -14,6 +15,7 @@ import org.slf4j.helpers.MessageFormatter; |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.concurrent.ArrayBlockingQueue;
|
...
|
...
|
@@ -1108,6 +1110,51 @@ public class InBoxFacade { |
|
|
}
|
|
|
}
|
|
|
|
|
|
public void noticeSuperSellerDegrade(Integer uid, SuperEnterStageLevel sesl, BigDecimal leftInWallet){
|
|
|
try {
|
|
|
executorService.execute(()->{
|
|
|
InboxBusinessTypeEnum smsIBT = null;
|
|
|
InboxBusinessTypeEnum inboxIBT = null;
|
|
|
switch (sesl){
|
|
|
case PARTITION:
|
|
|
inboxIBT = InboxBusinessTypeEnum.SUPER_SELLER_DEGRADE_PART_FUNC;
|
|
|
smsIBT = InboxBusinessTypeEnum.SMS_SUPER_SELLER_DEGRADE_PART_FUNC;
|
|
|
break;
|
|
|
case DISABLE:
|
|
|
inboxIBT = InboxBusinessTypeEnum.SUPER_SELLER_DEGRADE_ALL_FUNC;
|
|
|
smsIBT = InboxBusinessTypeEnum.SMS_SUPER_SELLER_DEGRADE_ALL_FUNC;
|
|
|
break;
|
|
|
}
|
|
|
if (smsIBT == null || inboxIBT == null ){
|
|
|
logger.warn("in noticeSuperSellerDegrade not match send condition, uid {}, SuperEnterStageLevel {},leftInWallet {}",
|
|
|
uid, sesl, leftInWallet);
|
|
|
return;
|
|
|
}
|
|
|
String params = buildParams(leftInWallet);
|
|
|
InboxReqVO req = buildInboxReqVO(uid, params, inboxIBT);
|
|
|
|
|
|
InBoxResponse resp = inBoxSDK.addInbox(req);
|
|
|
logger.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)){
|
|
|
logger.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);
|
|
|
logger.info("record noticeSuperSellerDegrade inbox sms msg, uid {}, SuperEnterStageLevel {},leftInWallet {}",
|
|
|
uid, sesl, leftInWallet);
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("InBoxFacade noticeSuperSellerDegrade error inbox msg, uid {}, SuperEnterStageLevel {},leftInWallet {}",
|
|
|
uid, sesl, leftInWallet, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public InboxReqVO buildInboxReqVO(int uid, String params, InboxBusinessTypeEnum ibt) {
|
|
|
InboxReqVO req = new InboxReqVO();
|
|
|
req.setType(ibt.getType());
|
...
|
...
|
|