1
|
package com.yohoufo.user.controller.passport;
|
1
|
package com.yohoufo.user.controller.passport;
|
2
|
|
2
|
|
3
|
|
3
|
|
|
|
4
|
+import com.yoho.core.config.ConfigReader;
|
4
|
import com.yoho.tools.common.beans.ApiResponse;
|
5
|
import com.yoho.tools.common.beans.ApiResponse;
|
5
|
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
6
|
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
6
|
import com.yohoufo.common.exception.GatewayException;
|
7
|
import com.yohoufo.common.exception.GatewayException;
|
|
@@ -32,6 +33,9 @@ public class RealNameAuthorizeController { |
|
@@ -32,6 +33,9 @@ public class RealNameAuthorizeController { |
32
|
|
33
|
|
33
|
private final String yohoCardUrlPre= "http://yhgidcard.static.yhbimg.com/yohocard";
|
34
|
private final String yohoCardUrlPre= "http://yhgidcard.static.yhbimg.com/yohocard";
|
34
|
|
35
|
|
|
|
36
|
+ @Autowired
|
|
|
37
|
+ private ConfigReader configReader;
|
|
|
38
|
+
|
35
|
/*@Autowired
|
39
|
/*@Autowired
|
36
|
GraphVerifyService graphVerifyService;*/
|
40
|
GraphVerifyService graphVerifyService;*/
|
37
|
|
41
|
|
|
@@ -166,6 +170,12 @@ public class RealNameAuthorizeController { |
|
@@ -166,6 +170,12 @@ public class RealNameAuthorizeController { |
166
|
@RequestMapping(params = "method=ufo.user.zhiMaCertWithPhotoCheckInit")
|
170
|
@RequestMapping(params = "method=ufo.user.zhiMaCertWithPhotoCheckInit")
|
167
|
public ApiResponse zhiMaCertWithPhotoCheckInit(RealNameAuthorizeReqVO reqVO) throws GatewayException {
|
171
|
public ApiResponse zhiMaCertWithPhotoCheckInit(RealNameAuthorizeReqVO reqVO) throws GatewayException {
|
168
|
logger.info("enter realNameAuthorize.zhiMaCertWithPhotoCheckInit param reqVO is {}", reqVO);
|
172
|
logger.info("enter realNameAuthorize.zhiMaCertWithPhotoCheckInit param reqVO is {}", reqVO);
|
|
|
173
|
+ //若版本低于6.9.9提示升级版本
|
|
|
174
|
+ if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && compareVersion(reqVO.getApp_version(), "6.9.9") < 0 ){
|
|
|
175
|
+ logger.info("realNameAuthorize.zhiMaCertWithPhotoCheckInit: version need update, version is {}, uid is {}", reqVO.getApp_version(), reqVO.getUid());
|
|
|
176
|
+ throw new GatewayException(400, "支付宝实名认证服务已升级,请升级有货APP最新版本后重新申请");
|
|
|
177
|
+ }
|
|
|
178
|
+
|
169
|
//(1) 优先校验请求的参数
|
179
|
//(1) 优先校验请求的参数
|
170
|
if (reqVO == null || reqVO.getUid()<=0){
|
180
|
if (reqVO == null || reqVO.getUid()<=0){
|
171
|
throw new GatewayException(400, "uid不能为空!");
|
181
|
throw new GatewayException(400, "uid不能为空!");
|
|
@@ -251,6 +261,12 @@ public class RealNameAuthorizeController { |
|
@@ -251,6 +261,12 @@ public class RealNameAuthorizeController { |
251
|
public ApiResponse zhiMaCertResultQuery(RealNameAuthorizeReqVO reqVO) throws GatewayException {
|
261
|
public ApiResponse zhiMaCertResultQuery(RealNameAuthorizeReqVO reqVO) throws GatewayException {
|
252
|
logger.info("enter realNameAuthorize.zhiMaCertResultQuery param reqVO is {}", reqVO);
|
262
|
logger.info("enter realNameAuthorize.zhiMaCertResultQuery param reqVO is {}", reqVO);
|
253
|
|
263
|
|
|
|
264
|
+ //若版本低于6.9.9提示升级版本
|
|
|
265
|
+ if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && compareVersion(reqVO.getApp_version(), "6.9.9") < 0 ){
|
|
|
266
|
+ logger.info("realNameAuthorize.zhiMaCertResultQuery: version need update, version is {}, uid is {}", reqVO.getApp_version(), reqVO.getUid());
|
|
|
267
|
+ throw new GatewayException(400, "支付宝实名认证服务已升级,请升级有货APP最新版本后重新申请");
|
|
|
268
|
+ }
|
|
|
269
|
+
|
254
|
//(1) 优先校验请求的参数
|
270
|
//(1) 优先校验请求的参数
|
255
|
if (reqVO == null || reqVO.getUid()<=0){
|
271
|
if (reqVO == null || reqVO.getUid()<=0){
|
256
|
throw new GatewayException(400, "参数错误,uid不能为空!");
|
272
|
throw new GatewayException(400, "参数错误,uid不能为空!");
|
|
@@ -266,4 +282,28 @@ public class RealNameAuthorizeController { |
|
@@ -266,4 +282,28 @@ public class RealNameAuthorizeController { |
266
|
return result;
|
282
|
return result;
|
267
|
}
|
283
|
}
|
268
|
|
284
|
|
|
|
285
|
+ private int compareVersion(String curVersion,String sysVersion){
|
|
|
286
|
+ boolean isCurBlank = StringUtils.isBlank(curVersion);
|
|
|
287
|
+ boolean isSysBlank = StringUtils.isBlank(sysVersion);
|
|
|
288
|
+ if(isCurBlank && isSysBlank){
|
|
|
289
|
+ return 0;
|
|
|
290
|
+ }
|
|
|
291
|
+ if(isCurBlank){
|
|
|
292
|
+ return -1;
|
|
|
293
|
+ }
|
|
|
294
|
+ if(isSysBlank){
|
|
|
295
|
+ return 1;
|
|
|
296
|
+ }
|
|
|
297
|
+ String[] curArr = curVersion.split("\\.");
|
|
|
298
|
+ String[] sysArr = sysVersion.split("\\.");
|
|
|
299
|
+ for(int i=0;i<3;i++){
|
|
|
300
|
+ int cur = Integer.parseInt(curArr[i]);
|
|
|
301
|
+ int sys = Integer.parseInt(sysArr[i]);
|
|
|
302
|
+ if(cur != sys){
|
|
|
303
|
+ return cur-sys;
|
|
|
304
|
+ }
|
|
|
305
|
+ }
|
|
|
306
|
+ return 0;
|
|
|
307
|
+ }
|
|
|
308
|
+
|
269
|
} |
309
|
} |