Authored by qinchao

商户退驻

... ... @@ -23,7 +23,7 @@
select
<include refid="Base_Column_List" />
from stored_seller
where uid = #{uid} and (valid_status = 1 or valid_status = 2)
where uid = #{uid} and valid_status = 1
order by id desc limit 1
</select>
... ...
... ... @@ -6,9 +6,7 @@ import com.yoho.tools.common.beans.ApiResponse;
import com.yohobuy.ufo.model.user.req.AuthorizeInfoReq;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.common.exception.GatewayException;
import com.yohoufo.dal.user.model.UserAuthorizeInfo;
import com.yohoufo.user.requestVO.RealNameAuthorizeReqVO;
import com.yohoufo.user.service.IRealNameAuthorizeService;
import com.yohoufo.user.service.IStoredSellerService;
import com.yohoufo.user.service.risk.GraphVerifyService;
... ... @@ -56,22 +54,4 @@ public class RealNameAuthorize4PlatformController {
return new ApiResponse.ApiResponseBuilder().code(200)
.data(info).message("").build();
}
/**
* 商户退驻
*/
@RequestMapping(value="/quitStoredSeller")
@IgnoreSession
@IgnoreSignature
public ApiResponse quitStoredSeller(@RequestBody RealNameAuthorizeReqVO reqVO) throws GatewayException {
logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO);
//(1) 优先校验请求的参数
if (reqVO == null || reqVO.getUid() <=0 ){
throw new GatewayException(400, "参数错误,uid不存在!");
}
storedSellerService.quitStoredSeller(reqVO);
return new ApiResponse();
}
}
... ...
... ... @@ -57,7 +57,7 @@ public class StoredSellerController {
/**
* 申请退驻
*/
@RequestMapping(params = "method=ufo.user.applyQuitStoredSeller")
/*@RequestMapping(params = "method=ufo.user.applyQuitStoredSeller")
public ApiResponse applyQuitStoredSeller(RealNameAuthorizeReqVO reqVO) throws GatewayException {
logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO);
//(1) 优先校验请求的参数
... ... @@ -67,6 +67,22 @@ public class StoredSellerController {
storedSellerService.applyQuitStoredSeller(reqVO.getUid());
return new ApiResponse();
}*/
/**
* 商户退驻
*/
@RequestMapping(params = "method=ufo.user.quitStoredSeller")
public ApiResponse quitStoredSeller(RealNameAuthorizeReqVO reqVO) throws GatewayException {
logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO);
//(1) 优先校验请求的参数
if (reqVO == null || reqVO.getUid() <=0 ){
throw new GatewayException(400, "参数错误,uid不存在!");
}
storedSellerService.quitStoredSeller(reqVO);
return new ApiResponse();
}
}
... ...
... ... @@ -8,7 +8,7 @@ public interface IStoredSellerService {
void addUserAsStoredSeller(Integer uid);
void applyQuitStoredSeller(Integer uid);
//void applyQuitStoredSeller(Integer uid);
void quitStoredSeller(RealNameAuthorizeReqVO reqVO);
... ...
... ... @@ -2,6 +2,7 @@ package com.yohoufo.user.service.impl;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.dal.user.IStoredSellerDao;
import com.yohoufo.dal.user.model.StoredSeller;
import com.yohoufo.dal.user.model.ZhiMaCert;
... ... @@ -31,6 +32,9 @@ public class StoredSellerServiceImpl implements IStoredSellerService {
@Autowired
private IStoredSellerDao storedSellerDao;
@Autowired
private UfoServiceCaller ufoServiceCaller;
/**
* 退出入驻
... ... @@ -46,16 +50,19 @@ public class StoredSellerServiceImpl implements IStoredSellerService {
throw new ServiceException(400,"未找到入驻信息");
}
Integer expectStatus=StoredSellerStatusEnum.apply_quit.getId();
Integer expectStatus=StoredSellerStatusEnum.entered.getId();
if(!expectStatus.equals(storedSeller.getValidStatus())){
throw new ServiceException(400,"商户入驻状态变化,不允许申请退出!");
throw new ServiceException(400,"商户入驻状态变化,不允许退驻!");
}
//TODO 检查商户是否有出售中的商品,或者有订单未完成的 ,都不可以提交
LocalDateTime now=LocalDateTime.now();
long ts=now.toEpochSecond(ZoneOffset.of("+8"));
//更新为退驻
int num = storedSellerDao.updateToQuitByPrimaryKey(storedSeller.getId(),StoredSellerStatusEnum.quit.getId(),StoredSellerStatusEnum.apply_quit.getId(),
int num = storedSellerDao.updateToQuitByPrimaryKey(storedSeller.getId(),StoredSellerStatusEnum.quit.getId(),expectStatus,
reqVO.getOperatorUid(),reqVO.getOperatorName(),
ts,ts);
//清掉缓存
... ... @@ -64,7 +71,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService {
logger.info("StoredSellerServiceImpl quitStoredSeller end ,uid is {} ,update num ",uid,num);
if(num > 0){
//@TODO 执行退保证金的操作
//TODO 执行退保证金的操作
}else{
logger.error("StoredSellerServiceImpl quitStoredSeller update row is 0,reqVo {}",reqVO);
... ... @@ -72,7 +79,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService {
}
@Override
/*@Override
public void applyQuitStoredSeller(Integer uid){
logger.info("StoredSellerServiceImpl applyQuitStoredSeller uid is {} ",uid);
StoredSeller storedSeller = getValidStoredSeller(uid);
... ... @@ -96,7 +103,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService {
cacheService.removeStoredSeller(uid);
logger.info("StoredSellerServiceImpl applyQuitStoredSeller end ,uid is {} ,update num ",uid,num);
}
}*/
@Override
public boolean isStoredSeller(Integer uid){
... ...