|
|
package com.yohoufo.order.service.impl;
|
|
|
|
|
|
import com.yoho.core.config.ConfigReader;
|
|
|
import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
|
|
|
import com.yohobuy.ufo.model.order.bo.SellerBo;
|
|
|
import com.yohobuy.ufo.model.order.bo.SellerLevelFuncBo;
|
...
|
...
|
@@ -26,6 +27,7 @@ import com.yohoufo.order.service.MerchantOrderPaymentService; |
|
|
import com.yohoufo.order.service.proxy.InBoxFacade;
|
|
|
import com.yohoufo.order.service.proxy.ProductProxyService;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import com.yohoufo.order.utils.MailSender;
|
|
|
import com.yohoufo.order.utils.SellerHelper;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.slf4j.Logger;
|
...
|
...
|
@@ -75,6 +77,9 @@ public class SellerEnterApplyService { |
|
|
@Autowired
|
|
|
private MerchantOrderPaymentService merchantOrderPaymentService;
|
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
|
|
/**
|
|
|
* 申请成为超级卖家
|
|
|
* 对于未支付的某一种身份申请做订单号替换
|
...
|
...
|
@@ -449,12 +454,6 @@ public class SellerEnterApplyService { |
|
|
//当前身份
|
|
|
EntrySellerType currentEST = sellerBo.getEntrySellerType();
|
|
|
Integer currentEnterType = currentEST.getCode();
|
|
|
EntrySellerType targetEST = EntrySellerType.SUPER_ENTRY;
|
|
|
boolean isMactchedEST = Objects.equals(currentEnterType, targetEST.getCode());
|
|
|
if (!isMactchedEST){
|
|
|
logger.warn("changeLevel4Super is not super, uid {} left in wallet {}", uid, left);
|
|
|
return 0;
|
|
|
}
|
|
|
//身份等级配置
|
|
|
Map<EntrySellerType,EntryThreshold> estMap = metaConfigService.getEntryThreshold();
|
|
|
EntryThreshold set = estMap.get(currentEST);
|
...
|
...
|
@@ -476,9 +475,23 @@ public class SellerEnterApplyService { |
|
|
uid, currentLevel, level, levelNeedUpgrade, isValid);
|
|
|
int result = 0;
|
|
|
if (levelNeedUpgrade && isValid) {
|
|
|
doUpgradeSuper(targetEST, currentLevel, level, uid);
|
|
|
SuperEnterStageLevel targetSESL = SuperEnterStageLevel.getSuperEnterStageLevel(level);
|
|
|
inBoxFacade.noticeSuperSellerDegrade(uid, targetSESL, bslfb.getWalletThreshold());
|
|
|
doUpgradeSuper(currentEST, currentLevel, level, uid);
|
|
|
if (sellerBo.isNormalSuper()) {
|
|
|
SuperEnterStageLevel targetSESL = SuperEnterStageLevel.getSuperEnterStageLevel(level);
|
|
|
inBoxFacade.noticeSuperSellerDegrade(uid, targetSESL, bslfb.getWalletThreshold());
|
|
|
}
|
|
|
|
|
|
if (sellerBo.isLargeSettlementSuper()){
|
|
|
try {
|
|
|
MailSender.newMailSender()
|
|
|
.subject("UFO香港卖家结算")
|
|
|
.to(configReader.getString("ufo.order.seller.noticeHKSellerEmailTo", "chao.chen@yoho.cn,xiuchun.luo@yoho.cn"))
|
|
|
.body("您的钱包金额不足,请及时充值", "text/html;charset=utf-8")
|
|
|
.send();
|
|
|
}catch (Exception ex){
|
|
|
logger.info("changeLevel4Super send mail fail, uid {} left wallet {}", uid, left, ex);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
...
|
...
|
|