Authored by qinchao

入驻商户接口

... ... @@ -119,7 +119,7 @@ public class RealNameAuthorizeController {
throw new GatewayException(400, "参数错误,uid不存在!");
}
ZhiMaCert zhiMaCertInfo =realNameAuthorizeService.getZhiMaCert(reqVO.getUid());
ZhiMaCert zhiMaCertInfo =realNameAuthorizeService.getValidZhiMaCert(reqVO.getUid());
boolean isZhiMaCert=false;
if(zhiMaCertInfo!=null){
isZhiMaCert=true;
... ...
... ... @@ -48,6 +48,7 @@ public class StoredSellerController {
throw new GatewayException(400, "参数错误,uid不存在!");
}
return new ApiResponse(true);
storedSellerService.addUserAsStoredSeller(reqVO.getUid());
return new ApiResponse();
}
}
... ...
... ... @@ -16,7 +16,7 @@ public interface IRealNameAuthorizeService {
void saveAuthorizeInfo(RealNameAuthorizeReqVO reqVO);
ZhiMaCert getZhiMaCert(int uid);
ZhiMaCert getValidZhiMaCert(int uid);
AuthorizeResultRespVO zhiMaCertInit(RealNameAuthorizeReqVO reqVO);
... ...
... ... @@ -101,7 +101,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
@Override
public ZhiMaCert getZhiMaCert(int uid) {
public ZhiMaCert getValidZhiMaCert(int uid) {
logger.info("RealNameAuthorizeServiceImpl getZhiMaCert uid is {} ", uid);
// 从redis缓存中获取
ZhiMaCert zhiMaCert = cacheService.getZhiMaCert(uid);
... ... @@ -124,7 +124,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
public AuthorizeResultRespVO zhiMaCertInit(RealNameAuthorizeReqVO reqVO) {
logger.info("real name zhiMaCertInit reqVO {}", reqVO);
//检查是否已经认证,如果已经认证,报错
if (null != this.getZhiMaCert(reqVO.getUid())) {
if (null != this.getValidZhiMaCert(reqVO.getUid())) {
throw new ServiceException(400, "已实名认证!");
}
//检查身份证号认证信息是否已经存在,存在则不允许再次使用
... ...
... ... @@ -4,6 +4,7 @@ import com.yoho.error.exception.ServiceException;
import com.yohoufo.dal.user.IStoredSellerDao;
import com.yohoufo.dal.user.model.StoredSeller;
import com.yohoufo.user.cache.CacheService;
import com.yohoufo.user.service.IRealNameAuthorizeService;
import com.yohoufo.user.service.IStoredSellerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -20,6 +21,10 @@ public class StoredSellerServiceImpl implements IStoredSellerService {
@Autowired
private CacheService cacheService;
@Autowired
IRealNameAuthorizeService realNameAuthorizeService;
@Autowired
private IStoredSellerDao storedSellerDao;
... ... @@ -54,6 +59,16 @@ public class StoredSellerServiceImpl implements IStoredSellerService {
@Override
public void addUserAsStoredSeller(Integer uid){
logger.info("StoredSellerServiceImpl addUserAsStoredSeller enter uid is {} ",uid);
//检查是否已经实名认证
if(null==realNameAuthorizeService.getValidZhiMaCert(uid)){
logger.error("StoredSellerServiceImpl get zhi ma cert info is null , uid is {} ",uid);
throw new ServiceException(400,"商户没有实名认证,不允许更新为入驻商户");
}
//@TODO 检查是否已经缴纳保证金
LocalDateTime now=LocalDateTime.now();
long ts=now.toEpochSecond(ZoneOffset.of("+8"));
StoredSeller storedSeller=new StoredSeller();
... ...