Authored by Lixiaodi

支持再次入驻

@@ -131,6 +131,11 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { @@ -131,6 +131,11 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
131 if (orderInfo.getType() == TYPE_FIRST_RECHARGE) { 131 if (orderInfo.getType() == TYPE_FIRST_RECHARGE) {
132 if (sw != null) { 132 if (sw != null) {
133 logger.info("重新入驻首次充值保证金={},已入驻次数为,uid={}", amount, uid, sw.getJoinTimes()); 133 logger.info("重新入驻首次充值保证金={},已入驻次数为,uid={}", amount, uid, sw.getJoinTimes());
  134 + if (sw.getStatus() == null || sw.getStatus() != 0) {
  135 + CommonAlarmEventPublisher.publish("重新入驻首次充值保证金失败", "ufo.order.recharge", "入驻状态异常:uid=" + uid + ",充值订单号为:" + orderCode + ", 充值金额为:" + amount);
  136 + logger.error("重新入驻首次充值保证金={},发现入驻状态异常,uid={},times={}", amount, uid, sw.getJoinTimes());
  137 + return;
  138 + }
134 if (sw.getJoinTimes() != null && sw.getJoinTimes() >= RE_JOIN_MAX_TIMES) { 139 if (sw.getJoinTimes() != null && sw.getJoinTimes() >= RE_JOIN_MAX_TIMES) {
135 CommonAlarmEventPublisher.publish("重新入驻首次充值保证金失败", "ufo.order.recharge", "超过入最大驻次数:uid=" + uid + ",充值订单号为:" + orderCode+", 充值金额为:"+amount); 140 CommonAlarmEventPublisher.publish("重新入驻首次充值保证金失败", "ufo.order.recharge", "超过入最大驻次数:uid=" + uid + ",充值订单号为:" + orderCode+", 充值金额为:"+amount);
136 logger.error("重新入驻首次充值保证金={},发现已超过最大入驻次数,uid={},times={}", amount, uid, sw.getJoinTimes()); 141 logger.error("重新入驻首次充值保证金={},发现已超过最大入驻次数,uid={},times={}", amount, uid, sw.getJoinTimes());
@@ -248,13 +253,19 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { @@ -248,13 +253,19 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
248 sellerDealAfterPay(uid, orderCode, allMoney); 253 sellerDealAfterPay(uid, orderCode, allMoney);
249 } 254 }
250 255
251 - public boolean canRejoin(Integer uid) {  
252 - SellerWallet sw = sellerWalletMapper.selectByUidAndType(uid, 1);  
253 - if (sw == null || sw.getJoinTimes() == null || sw.getJoinTimes() < RE_JOIN_MAX_TIMES) {  
254 - return true;  
255 - } 256 + public boolean canRejoin(Integer uid) {
  257 + SellerWallet sw = sellerWalletMapper.selectByUidAndType(uid, 1);
  258 + if (sw == null) {
  259 + return true;
  260 + }
  261 + if (sw.getStatus() == null || sw.getStatus() != 0) {
  262 + return false;
  263 + }
  264 + if (sw.getJoinTimes() == null || sw.getJoinTimes() < RE_JOIN_MAX_TIMES) {
  265 + return true;
  266 + }
256 return false; 267 return false;
257 - } 268 + }
258 269
259 private void sellerDealAfterPay(Integer uid, long orderCode, BigDecimal allMoney) { 270 private void sellerDealAfterPay(Integer uid, long orderCode, BigDecimal allMoney) {
260 sellerService.processApply(uid, orderCode, allMoney); 271 sellerService.processApply(uid, orderCode, allMoney);
@@ -15,6 +15,7 @@ import com.yohoufo.dal.order.model.SuperEntrySeller; @@ -15,6 +15,7 @@ import com.yohoufo.dal.order.model.SuperEntrySeller;
15 import com.yohoufo.dal.user.model.ZhiMaCert; 15 import com.yohoufo.dal.user.model.ZhiMaCert;
16 import com.yohoufo.order.common.SurperEntrySellerStatus; 16 import com.yohoufo.order.common.SurperEntrySellerStatus;
17 import com.yohoufo.order.service.IStoredSellerService; 17 import com.yohoufo.order.service.IStoredSellerService;
  18 +import com.yohoufo.order.service.MerchantOrderPaymentService;
18 import com.yohoufo.order.service.cache.StoredSellerCacheService; 19 import com.yohoufo.order.service.cache.StoredSellerCacheService;
19 import com.yohoufo.order.service.proxy.InBoxFacade; 20 import com.yohoufo.order.service.proxy.InBoxFacade;
20 import org.slf4j.Logger; 21 import org.slf4j.Logger;
@@ -52,6 +53,9 @@ public class StoreSellerServiceImpl implements IStoredSellerService { @@ -52,6 +53,9 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
52 53
53 @Autowired 54 @Autowired
54 private SuperEntrySellerMapper superEntrySellerMapper; 55 private SuperEntrySellerMapper superEntrySellerMapper;
  56 +
  57 + @Autowired
  58 + private MerchantOrderPaymentService merchantOrderPaymentService;
55 59
56 /** 60 /**
57 * 是否入驻商户 61 * 是否入驻商户
@@ -96,11 +100,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService { @@ -96,11 +100,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
96 if(isStoredSeller){ 100 if(isStoredSeller){
97 storedBefore = true; 101 storedBefore = true;
98 }else{ 102 }else{
99 - //查已退驻记录  
100 - StoredSeller quitStoredSeller =storedSellerMapper.selectQuitByUid(uid);  
101 - if(quitStoredSeller!=null){  
102 - storedBefore=true;  
103 - } 103 + storedBefore = !merchantOrderPaymentService.canRejoin(uid);
104 } 104 }
105 105
106 EntrySellerType entrySellerType = sellerService.getEntrySellerType(uid); 106 EntrySellerType entrySellerType = sellerService.getEntrySellerType(uid);