Authored by Lixiaodi

支持再次入驻

... ... @@ -131,6 +131,11 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
if (orderInfo.getType() == TYPE_FIRST_RECHARGE) {
if (sw != null) {
logger.info("重新入驻首次充值保证金={},已入驻次数为,uid={}", amount, uid, sw.getJoinTimes());
if (sw.getStatus() == null || sw.getStatus() != 0) {
CommonAlarmEventPublisher.publish("重新入驻首次充值保证金失败", "ufo.order.recharge", "入驻状态异常:uid=" + uid + ",充值订单号为:" + orderCode + ", 充值金额为:" + amount);
logger.error("重新入驻首次充值保证金={},发现入驻状态异常,uid={},times={}", amount, uid, sw.getJoinTimes());
return;
}
if (sw.getJoinTimes() != null && sw.getJoinTimes() >= RE_JOIN_MAX_TIMES) {
CommonAlarmEventPublisher.publish("重新入驻首次充值保证金失败", "ufo.order.recharge", "超过入最大驻次数:uid=" + uid + ",充值订单号为:" + orderCode+", 充值金额为:"+amount);
logger.error("重新入驻首次充值保证金={},发现已超过最大入驻次数,uid={},times={}", amount, uid, sw.getJoinTimes());
... ... @@ -248,13 +253,19 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
sellerDealAfterPay(uid, orderCode, allMoney);
}
public boolean canRejoin(Integer uid) {
SellerWallet sw = sellerWalletMapper.selectByUidAndType(uid, 1);
if (sw == null || sw.getJoinTimes() == null || sw.getJoinTimes() < RE_JOIN_MAX_TIMES) {
return true;
}
public boolean canRejoin(Integer uid) {
SellerWallet sw = sellerWalletMapper.selectByUidAndType(uid, 1);
if (sw == null) {
return true;
}
if (sw.getStatus() == null || sw.getStatus() != 0) {
return false;
}
if (sw.getJoinTimes() == null || sw.getJoinTimes() < RE_JOIN_MAX_TIMES) {
return true;
}
return false;
}
}
private void sellerDealAfterPay(Integer uid, long orderCode, BigDecimal allMoney) {
sellerService.processApply(uid, orderCode, allMoney);
... ...
... ... @@ -15,6 +15,7 @@ import com.yohoufo.dal.order.model.SuperEntrySeller;
import com.yohoufo.dal.user.model.ZhiMaCert;
import com.yohoufo.order.common.SurperEntrySellerStatus;
import com.yohoufo.order.service.IStoredSellerService;
import com.yohoufo.order.service.MerchantOrderPaymentService;
import com.yohoufo.order.service.cache.StoredSellerCacheService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import org.slf4j.Logger;
... ... @@ -52,6 +53,9 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
@Autowired
private SuperEntrySellerMapper superEntrySellerMapper;
@Autowired
private MerchantOrderPaymentService merchantOrderPaymentService;
/**
* 是否入驻商户
... ... @@ -96,11 +100,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
if(isStoredSeller){
storedBefore = true;
}else{
//查已退驻记录
StoredSeller quitStoredSeller =storedSellerMapper.selectQuitByUid(uid);
if(quitStoredSeller!=null){
storedBefore=true;
}
storedBefore = !merchantOrderPaymentService.canRejoin(uid);
}
EntrySellerType entrySellerType = sellerService.getEntrySellerType(uid);
... ...