Showing
5 changed files
with
32 additions
and
29 deletions
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | select | 23 | select |
24 | <include refid="Base_Column_List" /> | 24 | <include refid="Base_Column_List" /> |
25 | from stored_seller | 25 | from stored_seller |
26 | - where uid = #{uid} and (valid_status = 1 or valid_status = 2) | 26 | + where uid = #{uid} and valid_status = 1 |
27 | order by id desc limit 1 | 27 | order by id desc limit 1 |
28 | </select> | 28 | </select> |
29 | 29 |
@@ -6,9 +6,7 @@ import com.yoho.tools.common.beans.ApiResponse; | @@ -6,9 +6,7 @@ import com.yoho.tools.common.beans.ApiResponse; | ||
6 | import com.yohobuy.ufo.model.user.req.AuthorizeInfoReq; | 6 | import com.yohobuy.ufo.model.user.req.AuthorizeInfoReq; |
7 | import com.yohoufo.common.annotation.IgnoreSession; | 7 | import com.yohoufo.common.annotation.IgnoreSession; |
8 | import com.yohoufo.common.annotation.IgnoreSignature; | 8 | import com.yohoufo.common.annotation.IgnoreSignature; |
9 | -import com.yohoufo.common.exception.GatewayException; | ||
10 | import com.yohoufo.dal.user.model.UserAuthorizeInfo; | 9 | import com.yohoufo.dal.user.model.UserAuthorizeInfo; |
11 | -import com.yohoufo.user.requestVO.RealNameAuthorizeReqVO; | ||
12 | import com.yohoufo.user.service.IRealNameAuthorizeService; | 10 | import com.yohoufo.user.service.IRealNameAuthorizeService; |
13 | import com.yohoufo.user.service.IStoredSellerService; | 11 | import com.yohoufo.user.service.IStoredSellerService; |
14 | import com.yohoufo.user.service.risk.GraphVerifyService; | 12 | import com.yohoufo.user.service.risk.GraphVerifyService; |
@@ -56,22 +54,4 @@ public class RealNameAuthorize4PlatformController { | @@ -56,22 +54,4 @@ public class RealNameAuthorize4PlatformController { | ||
56 | return new ApiResponse.ApiResponseBuilder().code(200) | 54 | return new ApiResponse.ApiResponseBuilder().code(200) |
57 | .data(info).message("").build(); | 55 | .data(info).message("").build(); |
58 | } | 56 | } |
59 | - | ||
60 | - | ||
61 | - /** | ||
62 | - * 商户退驻 | ||
63 | - */ | ||
64 | - @RequestMapping(value="/quitStoredSeller") | ||
65 | - @IgnoreSession | ||
66 | - @IgnoreSignature | ||
67 | - public ApiResponse quitStoredSeller(@RequestBody RealNameAuthorizeReqVO reqVO) throws GatewayException { | ||
68 | - logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO); | ||
69 | - //(1) 优先校验请求的参数 | ||
70 | - if (reqVO == null || reqVO.getUid() <=0 ){ | ||
71 | - throw new GatewayException(400, "参数错误,uid不存在!"); | ||
72 | - } | ||
73 | - | ||
74 | - storedSellerService.quitStoredSeller(reqVO); | ||
75 | - return new ApiResponse(); | ||
76 | - } | ||
77 | } | 57 | } |
@@ -57,7 +57,7 @@ public class StoredSellerController { | @@ -57,7 +57,7 @@ public class StoredSellerController { | ||
57 | /** | 57 | /** |
58 | * 申请退驻 | 58 | * 申请退驻 |
59 | */ | 59 | */ |
60 | - @RequestMapping(params = "method=ufo.user.applyQuitStoredSeller") | 60 | + /*@RequestMapping(params = "method=ufo.user.applyQuitStoredSeller") |
61 | public ApiResponse applyQuitStoredSeller(RealNameAuthorizeReqVO reqVO) throws GatewayException { | 61 | public ApiResponse applyQuitStoredSeller(RealNameAuthorizeReqVO reqVO) throws GatewayException { |
62 | logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO); | 62 | logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO); |
63 | //(1) 优先校验请求的参数 | 63 | //(1) 优先校验请求的参数 |
@@ -67,6 +67,22 @@ public class StoredSellerController { | @@ -67,6 +67,22 @@ public class StoredSellerController { | ||
67 | 67 | ||
68 | storedSellerService.applyQuitStoredSeller(reqVO.getUid()); | 68 | storedSellerService.applyQuitStoredSeller(reqVO.getUid()); |
69 | return new ApiResponse(); | 69 | return new ApiResponse(); |
70 | + }*/ | ||
71 | + | ||
72 | + | ||
73 | + /** | ||
74 | + * 商户退驻 | ||
75 | + */ | ||
76 | + @RequestMapping(params = "method=ufo.user.quitStoredSeller") | ||
77 | + public ApiResponse quitStoredSeller(RealNameAuthorizeReqVO reqVO) throws GatewayException { | ||
78 | + logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO); | ||
79 | + //(1) 优先校验请求的参数 | ||
80 | + if (reqVO == null || reqVO.getUid() <=0 ){ | ||
81 | + throw new GatewayException(400, "参数错误,uid不存在!"); | ||
82 | + } | ||
83 | + | ||
84 | + storedSellerService.quitStoredSeller(reqVO); | ||
85 | + return new ApiResponse(); | ||
70 | } | 86 | } |
71 | 87 | ||
72 | } | 88 | } |
@@ -8,7 +8,7 @@ public interface IStoredSellerService { | @@ -8,7 +8,7 @@ public interface IStoredSellerService { | ||
8 | 8 | ||
9 | void addUserAsStoredSeller(Integer uid); | 9 | void addUserAsStoredSeller(Integer uid); |
10 | 10 | ||
11 | - void applyQuitStoredSeller(Integer uid); | 11 | + //void applyQuitStoredSeller(Integer uid); |
12 | 12 | ||
13 | 13 | ||
14 | void quitStoredSeller(RealNameAuthorizeReqVO reqVO); | 14 | void quitStoredSeller(RealNameAuthorizeReqVO reqVO); |
@@ -2,6 +2,7 @@ package com.yohoufo.user.service.impl; | @@ -2,6 +2,7 @@ package com.yohoufo.user.service.impl; | ||
2 | 2 | ||
3 | import com.yoho.error.exception.ServiceException; | 3 | import com.yoho.error.exception.ServiceException; |
4 | import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum; | 4 | import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum; |
5 | +import com.yohoufo.common.caller.UfoServiceCaller; | ||
5 | import com.yohoufo.dal.user.IStoredSellerDao; | 6 | import com.yohoufo.dal.user.IStoredSellerDao; |
6 | import com.yohoufo.dal.user.model.StoredSeller; | 7 | import com.yohoufo.dal.user.model.StoredSeller; |
7 | import com.yohoufo.dal.user.model.ZhiMaCert; | 8 | import com.yohoufo.dal.user.model.ZhiMaCert; |
@@ -31,6 +32,9 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | @@ -31,6 +32,9 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | ||
31 | @Autowired | 32 | @Autowired |
32 | private IStoredSellerDao storedSellerDao; | 33 | private IStoredSellerDao storedSellerDao; |
33 | 34 | ||
35 | + @Autowired | ||
36 | + private UfoServiceCaller ufoServiceCaller; | ||
37 | + | ||
34 | 38 | ||
35 | /** | 39 | /** |
36 | * 退出入驻 | 40 | * 退出入驻 |
@@ -46,16 +50,19 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | @@ -46,16 +50,19 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | ||
46 | throw new ServiceException(400,"未找到入驻信息"); | 50 | throw new ServiceException(400,"未找到入驻信息"); |
47 | } | 51 | } |
48 | 52 | ||
49 | - Integer expectStatus=StoredSellerStatusEnum.apply_quit.getId(); | 53 | + Integer expectStatus=StoredSellerStatusEnum.entered.getId(); |
50 | if(!expectStatus.equals(storedSeller.getValidStatus())){ | 54 | if(!expectStatus.equals(storedSeller.getValidStatus())){ |
51 | - throw new ServiceException(400,"商户入驻状态变化,不允许申请退出!"); | 55 | + throw new ServiceException(400,"商户入驻状态变化,不允许退驻!"); |
52 | } | 56 | } |
53 | 57 | ||
58 | + //TODO 检查商户是否有出售中的商品,或者有订单未完成的 ,都不可以提交 | ||
59 | + | ||
60 | + | ||
54 | LocalDateTime now=LocalDateTime.now(); | 61 | LocalDateTime now=LocalDateTime.now(); |
55 | long ts=now.toEpochSecond(ZoneOffset.of("+8")); | 62 | long ts=now.toEpochSecond(ZoneOffset.of("+8")); |
56 | 63 | ||
57 | //更新为退驻 | 64 | //更新为退驻 |
58 | - int num = storedSellerDao.updateToQuitByPrimaryKey(storedSeller.getId(),StoredSellerStatusEnum.quit.getId(),StoredSellerStatusEnum.apply_quit.getId(), | 65 | + int num = storedSellerDao.updateToQuitByPrimaryKey(storedSeller.getId(),StoredSellerStatusEnum.quit.getId(),expectStatus, |
59 | reqVO.getOperatorUid(),reqVO.getOperatorName(), | 66 | reqVO.getOperatorUid(),reqVO.getOperatorName(), |
60 | ts,ts); | 67 | ts,ts); |
61 | //清掉缓存 | 68 | //清掉缓存 |
@@ -64,7 +71,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | @@ -64,7 +71,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | ||
64 | logger.info("StoredSellerServiceImpl quitStoredSeller end ,uid is {} ,update num ",uid,num); | 71 | logger.info("StoredSellerServiceImpl quitStoredSeller end ,uid is {} ,update num ",uid,num); |
65 | 72 | ||
66 | if(num > 0){ | 73 | if(num > 0){ |
67 | - //@TODO 执行退保证金的操作 | 74 | + //TODO 执行退保证金的操作 |
68 | 75 | ||
69 | }else{ | 76 | }else{ |
70 | logger.error("StoredSellerServiceImpl quitStoredSeller update row is 0,reqVo {}",reqVO); | 77 | logger.error("StoredSellerServiceImpl quitStoredSeller update row is 0,reqVo {}",reqVO); |
@@ -72,7 +79,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | @@ -72,7 +79,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | ||
72 | 79 | ||
73 | } | 80 | } |
74 | 81 | ||
75 | - @Override | 82 | + /*@Override |
76 | public void applyQuitStoredSeller(Integer uid){ | 83 | public void applyQuitStoredSeller(Integer uid){ |
77 | logger.info("StoredSellerServiceImpl applyQuitStoredSeller uid is {} ",uid); | 84 | logger.info("StoredSellerServiceImpl applyQuitStoredSeller uid is {} ",uid); |
78 | StoredSeller storedSeller = getValidStoredSeller(uid); | 85 | StoredSeller storedSeller = getValidStoredSeller(uid); |
@@ -96,7 +103,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | @@ -96,7 +103,7 @@ public class StoredSellerServiceImpl implements IStoredSellerService { | ||
96 | cacheService.removeStoredSeller(uid); | 103 | cacheService.removeStoredSeller(uid); |
97 | 104 | ||
98 | logger.info("StoredSellerServiceImpl applyQuitStoredSeller end ,uid is {} ,update num ",uid,num); | 105 | logger.info("StoredSellerServiceImpl applyQuitStoredSeller end ,uid is {} ,update num ",uid,num); |
99 | - } | 106 | + }*/ |
100 | 107 | ||
101 | @Override | 108 | @Override |
102 | public boolean isStoredSeller(Integer uid){ | 109 | public boolean isStoredSeller(Integer uid){ |
-
Please register or login to post a comment