...
|
...
|
@@ -6,6 +6,7 @@ import com.yohoufo.dal.user.IStoredSellerDao; |
|
|
import com.yohoufo.dal.user.model.StoredSeller;
|
|
|
import com.yohoufo.dal.user.model.ZhiMaCert;
|
|
|
import com.yohoufo.user.cache.CacheService;
|
|
|
import com.yohoufo.user.requestVO.RealNameAuthorizeReqVO;
|
|
|
import com.yohoufo.user.service.IRealNameAuthorizeService;
|
|
|
import com.yohoufo.user.service.IStoredSellerService;
|
|
|
import org.slf4j.Logger;
|
...
|
...
|
@@ -30,6 +31,47 @@ public class StoredSellerServiceImpl implements IStoredSellerService { |
|
|
@Autowired
|
|
|
private IStoredSellerDao storedSellerDao;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 退出入驻
|
|
|
* @param reqVO
|
|
|
*/
|
|
|
@Override
|
|
|
public void quitStoredSeller(RealNameAuthorizeReqVO reqVO){
|
|
|
logger.info("StoredSellerServiceImpl quitStoredSeller enter reqVO is {} ",reqVO);
|
|
|
Integer uid=reqVO.getUid();
|
|
|
StoredSeller storedSeller = getValidStoredSeller(uid);
|
|
|
if(null==storedSeller){
|
|
|
logger.error("StoredSellerServiceImpl quitStoredSeller store seller is null,uid is {} ",uid);
|
|
|
throw new ServiceException(400,"未找到入驻信息");
|
|
|
}
|
|
|
|
|
|
Integer expectStatus=StoredSellerStatusEnum.apply_quit.getId();
|
|
|
if(!expectStatus.equals(storedSeller.getValidStatus())){
|
|
|
throw new ServiceException(400,"商户入驻状态变化,不允许申请退出!");
|
|
|
}
|
|
|
|
|
|
LocalDateTime now=LocalDateTime.now();
|
|
|
long ts=now.toEpochSecond(ZoneOffset.of("+8"));
|
|
|
|
|
|
//更新为退驻
|
|
|
int num = storedSellerDao.updateToQuitByPrimaryKey(storedSeller.getId(),StoredSellerStatusEnum.quit.getId(),StoredSellerStatusEnum.apply_quit.getId(),
|
|
|
reqVO.getOperatorUid(),reqVO.getOperatorName(),
|
|
|
ts,ts);
|
|
|
//清掉缓存
|
|
|
cacheService.removeStoredSeller(uid);
|
|
|
|
|
|
logger.info("StoredSellerServiceImpl quitStoredSeller end ,uid is {} ,update num ",uid,num);
|
|
|
|
|
|
if(num > 0){
|
|
|
//@TODO 执行退保证金的操作
|
|
|
|
|
|
}else{
|
|
|
logger.error("StoredSellerServiceImpl quitStoredSeller update row is 0,reqVo {}",reqVO);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void applyQuitStoredSeller(Integer uid){
|
|
|
logger.info("StoredSellerServiceImpl applyQuitStoredSeller uid is {} ",uid);
|
...
|
...
|
@@ -39,7 +81,8 @@ public class StoredSellerServiceImpl implements IStoredSellerService { |
|
|
throw new ServiceException(400,"未找到入驻信息");
|
|
|
}
|
|
|
|
|
|
if(!StoredSellerStatusEnum.entered.getId().equals(storedSeller.getValidStatus())){
|
|
|
Integer expectStatus =StoredSellerStatusEnum.entered.getId();
|
|
|
if(!expectStatus.equals(storedSeller.getValidStatus())){
|
|
|
throw new ServiceException(400,"商户入驻状态变化,不允许申请退出!");
|
|
|
}
|
|
|
|
...
|
...
|
@@ -48,7 +91,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService { |
|
|
throw new ServiceException(400,"商户入驻操作错误,不允许申请退出!");
|
|
|
}
|
|
|
|
|
|
int num = storedSellerDao.updateStatusByPrimaryKey(storedSeller.getId(),StoredSellerStatusEnum.apply_quit.getId());
|
|
|
int num = storedSellerDao.updateStatusByPrimaryKey(storedSeller.getId(),StoredSellerStatusEnum.apply_quit.getId(),expectStatus);
|
|
|
//清掉缓存
|
|
|
cacheService.removeStoredSeller(uid);
|
|
|
|
...
|
...
|
|