|
@@ -48,6 +48,7 @@ import java.text.SimpleDateFormat; |
|
@@ -48,6 +48,7 @@ import java.text.SimpleDateFormat; |
48
|
import java.time.LocalDateTime;
|
48
|
import java.time.LocalDateTime;
|
49
|
import java.time.ZoneOffset;
|
49
|
import java.time.ZoneOffset;
|
50
|
import java.util.ArrayList;
|
50
|
import java.util.ArrayList;
|
|
|
51
|
+import java.util.Calendar;
|
51
|
import java.util.Date;
|
52
|
import java.util.Date;
|
52
|
import java.util.List;
|
53
|
import java.util.List;
|
53
|
import java.util.concurrent.TimeUnit;
|
54
|
import java.util.concurrent.TimeUnit;
|
|
@@ -299,7 +300,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
@@ -299,7 +300,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
299
|
/**
|
300
|
/**
|
300
|
* 清芝麻认证的缓存信息
|
301
|
* 清芝麻认证的缓存信息
|
301
|
*/
|
302
|
*/
|
302
|
- @Override
|
303
|
+ /*@Override
|
303
|
public int clearZhiMaCertInfo(Integer uid){
|
304
|
public int clearZhiMaCertInfo(Integer uid){
|
304
|
logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo uid is {} ", uid);
|
305
|
logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo uid is {} ", uid);
|
305
|
int result = 0;
|
306
|
int result = 0;
|
|
@@ -310,7 +311,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
@@ -310,7 +311,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
310
|
cacheService.delZhiMaCert(uid);
|
311
|
cacheService.delZhiMaCert(uid);
|
311
|
}
|
312
|
}
|
312
|
return result;
|
313
|
return result;
|
313
|
- }
|
314
|
+ }*/
|
314
|
|
315
|
|
315
|
@Override
|
316
|
@Override
|
316
|
public ZhiMaCert getValidZhiMaCert(int uid) {
|
317
|
public ZhiMaCert getValidZhiMaCert(int uid) {
|
|
@@ -328,6 +329,42 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
@@ -328,6 +329,42 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
328
|
if (zhiMaCert != null) {
|
329
|
if (zhiMaCert != null) {
|
329
|
//保存到redis
|
330
|
//保存到redis
|
330
|
cacheService.setZhiMaCert(zhiMaCert);
|
331
|
cacheService.setZhiMaCert(zhiMaCert);
|
|
|
332
|
+ }else{
|
|
|
333
|
+ //根据uid查询最近一条芝麻认证没通过的数据数据:
|
|
|
334
|
+ // 如果没有主动请求过&&ocr通过了 ,再根据biz_no获取支付宝结果 ,
|
|
|
335
|
+ // 最后打个标记,代表已经请求过一次,后续不再请求
|
|
|
336
|
+ // 暂时不打标志了 ,请求一次时间也不长 ,后续再观察下,看看时间情况
|
|
|
337
|
+ ZhiMaCert zhiMaCert_check_again = zhiMaCertDao.selectLatestUnAuthorizeByUid(uid);
|
|
|
338
|
+ Calendar c = Calendar.getInstance();
|
|
|
339
|
+ c.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
340
|
+ c.set(Calendar.MINUTE, 0);
|
|
|
341
|
+ c.set(Calendar.SECOND, 0);
|
|
|
342
|
+ c.set(Calendar.MILLISECOND, 0);
|
|
|
343
|
+ Long today_zero=c.getTimeInMillis()/1000;
|
|
|
344
|
+
|
|
|
345
|
+ //当天至少请求过一次实名认证,并且是当天的数据
|
|
|
346
|
+ //String dayStr = getStringDate("yyyyMMdd");
|
|
|
347
|
+ //Long count = cacheService.getPhotoCheckCount(dayStr,uid);
|
|
|
348
|
+ logger.info("getValidZhiMaCert recall zhiMaCertResultQuery enter uid is {} zhiMaCert_check_again {}",uid,zhiMaCert_check_again);
|
|
|
349
|
+ if(zhiMaCert_check_again!=null&&StringUtils.isNotBlank(zhiMaCert_check_again.getBizNo())
|
|
|
350
|
+ &&CertPhotoEnum.isValidStatus(zhiMaCert_check_again.getValidPhoto())
|
|
|
351
|
+ &&zhiMaCert_check_again.getCreateTime()>=today_zero
|
|
|
352
|
+ ){
|
|
|
353
|
+ ZhimaCustomerCertificationQueryResponse zhiMaResp=ZhiMaCallUtil.zhiMaResult(zhiMaCert_check_again.getBizNo());
|
|
|
354
|
+ logger.info("getValidZhiMaCert recall zhiMaCertResultQuery enter result is {},zhiMaCert_check_again {}",JSON.toJSONString(zhiMaResp),zhiMaCert_check_again);
|
|
|
355
|
+ if(zhiMaResp!=null&&zhiMaResp.isSuccess()&&"true".equals(zhiMaResp.getPassed())){
|
|
|
356
|
+ //芝麻认证通过
|
|
|
357
|
+ int updateCount = zhiMaCertDao.updateValidStatusByPrimaryKey(zhiMaCert_check_again.getId());
|
|
|
358
|
+ logger.info("getValidZhiMaCert recall zhiMaCertResultQuery updateCount {} ,result is {},zhiMaCert_check_again {}",updateCount ,JSON.toJSONString(zhiMaResp),zhiMaCert_check_again);
|
|
|
359
|
+ if(updateCount>=1){
|
|
|
360
|
+ zhiMaCert = zhiMaCertDao.selectValidByUid(uid);
|
|
|
361
|
+ if (zhiMaCert != null) {
|
|
|
362
|
+ //保存到redis
|
|
|
363
|
+ cacheService.setZhiMaCert(zhiMaCert);
|
|
|
364
|
+ }
|
|
|
365
|
+ }
|
|
|
366
|
+ }
|
|
|
367
|
+ }
|
331
|
}
|
368
|
}
|
332
|
return zhiMaCert;
|
369
|
return zhiMaCert;
|
333
|
}
|
370
|
}
|
|
@@ -545,7 +582,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
@@ -545,7 +582,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
545
|
//存储认证信息
|
582
|
//存储认证信息
|
546
|
ZhiMaCert zhiMaCert = new ZhiMaCert();
|
583
|
ZhiMaCert zhiMaCert = new ZhiMaCert();
|
547
|
zhiMaCert.setUid(reqVO.getUid());
|
584
|
zhiMaCert.setUid(reqVO.getUid());
|
548
|
- zhiMaCert.setValidStatus(0);//用户还未授权,暂时未生效
|
585
|
+ zhiMaCert.setValidStatus(9);//用户还未授权,暂时未生效 ,初始值为9
|
549
|
zhiMaCert.setCertName(reqVO.getCertName());
|
586
|
zhiMaCert.setCertName(reqVO.getCertName());
|
550
|
zhiMaCert.setCertNo(reqVO.getCertNo());
|
587
|
zhiMaCert.setCertNo(reqVO.getCertNo());
|
551
|
zhiMaCert.setCreateTime(nowSecond);
|
588
|
zhiMaCert.setCreateTime(nowSecond);
|