...
|
...
|
@@ -55,7 +55,7 @@ public class SellerEnterApplyService { |
|
|
logger.info("in applySuperEntry uid {} orderCode {} targetEST {}", uid, orderCode, targetEST);
|
|
|
if (Objects.isNull(orderCode)){
|
|
|
logger.warn("in applySuperEntry uid {} orderCode is null targetEST {}", uid, targetEST);
|
|
|
throw new UfoServiceException(400, "orderCode is null");
|
|
|
//throw new UfoServiceException(400, "orderCode is null");
|
|
|
}
|
|
|
if (Objects.isNull(targetEST)){
|
|
|
logger.warn("in applySuperEntry uid {} orderCode {} targetEST is null", uid, orderCode);
|
...
|
...
|
@@ -160,16 +160,27 @@ public class SellerEnterApplyService { |
|
|
seac.setUid(uid);
|
|
|
seac.setOrderCode(orderCode);
|
|
|
List<SellerEnterApply> seaList = sellerEnterApplyMapper.selectByUOCET(seac);
|
|
|
upgradeLevel(uid, orderCode, left, seaList);
|
|
|
}
|
|
|
|
|
|
|
|
|
public void upgradeLevel(int uid, Long orderCode, BigDecimal left, List<SellerEnterApply> seaList){
|
|
|
if (CollectionUtils.isEmpty(seaList)){
|
|
|
logger.warn("in audit SellerEnterApply no record so that it's only charge order, uid {} orderCode {}",
|
|
|
logger.warn("in upgradeLevel no record so that it's only charge order, uid {} orderCode {}",
|
|
|
uid, orderCode);
|
|
|
return;
|
|
|
}
|
|
|
if (seaList.size()>1){
|
|
|
logger.warn("in audit SellerEnterApply one orderCode mapped multiple apply,uid {} orderCode {}", uid, orderCode);
|
|
|
logger.warn("in upgradeLevel one orderCode mapped multiple apply,uid {} orderCode {}", uid, orderCode);
|
|
|
}
|
|
|
//卖家包装类
|
|
|
SellerService.SellerWrapper sellerWrapper = new SellerService().new SellerWrapper(uid).buildBase();
|
|
|
upgradeLevel(sellerWrapper, orderCode, left, seaList);
|
|
|
}
|
|
|
|
|
|
public void upgradeLevel(SellerService.SellerWrapper sellerWrapper,
|
|
|
Long orderCode, BigDecimal left, List<SellerEnterApply> seaList){
|
|
|
int uid = sellerWrapper.getUid();
|
|
|
//持久化的入驻信息
|
|
|
StoredSeller pss = sellerWrapper.getStoredSeller();
|
|
|
SellerBo sellerBo = sellerWrapper.build();
|
...
|
...
|
@@ -191,7 +202,7 @@ public class SellerEnterApplyService { |
|
|
boolean isMatchedET = Objects.equals(preEnterType=msea.getPreEnterType(), currentEnterType);
|
|
|
boolean noStoredSeller = Objects.isNull(pss);
|
|
|
|
|
|
logger.info("in audit SellerEnterApply ready pass apply and add StoredSeller, uid {} orderCode {} currentEnterType {} PreEnterType {} noStoredSeller {} target Level {} isMatchedET {}",
|
|
|
logger.info("in upgradeLevel ready pass apply and add StoredSeller, uid {} orderCode {} currentEnterType {} PreEnterType {} noStoredSeller {} target Level {} isMatchedET {}",
|
|
|
uid, orderCode, currentEnterType,preEnterType, noStoredSeller, level, isMatchedET);
|
|
|
if(Objects.equals(currentEnterType, EntrySellerType.NOT_ENTRY.getCode())){
|
|
|
//普通卖家 -> 普通入驻 ,1. apply 状态 ,2. enter_seller 从无到有
|
...
|
...
|
@@ -204,7 +215,7 @@ public class SellerEnterApplyService { |
|
|
SellerLevelFuncBo slfb = sellerFuncService.getSellerLevelFunc(targetEst.getCode(), level);
|
|
|
storedSellerService.addUserAsStoredSeller(uid, targetEst, slfb);
|
|
|
}else{
|
|
|
logger.warn("in audit SellerEnterApply add StoredSeller fail, uid {} orderCode {}",
|
|
|
logger.warn("in upgradeLevel add StoredSeller fail, uid {} orderCode {}",
|
|
|
uid, orderCode);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -216,13 +227,13 @@ public class SellerEnterApplyService { |
|
|
SellerLevelFuncBo slfb = sellerFuncService.getSellerLevelFunc(targetEst.getCode(), level);
|
|
|
storedSellerService.addUserAsStoredSeller(uid, targetEst, slfb);
|
|
|
}else{
|
|
|
logger.warn("in audit SellerEnterApply add StoredSeller fail, uid {} orderCode {}",
|
|
|
logger.warn("in upgradeLevel add StoredSeller fail, uid {} orderCode {}",
|
|
|
uid, orderCode);
|
|
|
}
|
|
|
|
|
|
}else if (Objects.equals(currentEnterType, EntrySellerType.SPECIAL_SUPER.getCode())){
|
|
|
//白名单超级卖家
|
|
|
logger.warn("in audit SellerEnterApply SPECIAL_SUPER no need any action, uid {} orderCode {}",
|
|
|
logger.warn("in upgradeLevel SPECIAL_SUPER no need any action, uid {} orderCode {}",
|
|
|
uid, orderCode);
|
|
|
}else if (Objects.equals(currentEnterType, EntrySellerType.SUPER_ENTRY.getCode())){
|
|
|
//超级卖家
|
...
|
...
|
@@ -232,15 +243,13 @@ public class SellerEnterApplyService { |
|
|
boolean levelNeedUpgrade = Objects.nonNull(sesl)
|
|
|
&& Objects.nonNull(currentLevel = sesl.getCode())
|
|
|
&& !currentLevel.equals(level);
|
|
|
logger.warn("in audit SellerEnterApply update StoredSeller, uid {} orderCode {} currentLevel {} target level {}",
|
|
|
logger.warn("in upgradeLevel update StoredSeller, uid {} orderCode {} currentLevel {} target level {}",
|
|
|
uid, orderCode, currentLevel, level);
|
|
|
if (!noStoredSeller && isMatchedET && levelNeedUpgrade) {
|
|
|
SellerLevelFuncBo slfb = sellerFuncService.getSellerLevelFunc(targetEst.getCode(), level);
|
|
|
storedSellerService.updateEnterSeller(uid, targetEst, slfb);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|