...
|
...
|
@@ -48,6 +48,7 @@ import java.text.SimpleDateFormat; |
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneOffset;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.concurrent.TimeUnit;
|
...
|
...
|
@@ -299,7 +300,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
/**
|
|
|
* 清芝麻认证的缓存信息
|
|
|
*/
|
|
|
@Override
|
|
|
/*@Override
|
|
|
public int clearZhiMaCertInfo(Integer uid){
|
|
|
logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo uid is {} ", uid);
|
|
|
int result = 0;
|
...
|
...
|
@@ -310,7 +311,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
cacheService.delZhiMaCert(uid);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
@Override
|
|
|
public ZhiMaCert getValidZhiMaCert(int uid) {
|
...
|
...
|
@@ -328,6 +329,42 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
if (zhiMaCert != null) {
|
|
|
//保存到redis
|
|
|
cacheService.setZhiMaCert(zhiMaCert);
|
|
|
}else{
|
|
|
//根据uid查询最近一条芝麻认证没通过的数据数据:
|
|
|
// 如果没有主动请求过&&ocr通过了 ,再根据biz_no获取支付宝结果 ,
|
|
|
// 最后打个标记,代表已经请求过一次,后续不再请求
|
|
|
// 暂时不打标志了 ,请求一次时间也不长 ,后续再观察下,看看时间情况
|
|
|
ZhiMaCert zhiMaCert_check_again = zhiMaCertDao.selectLatestUnAuthorizeByUid(uid);
|
|
|
Calendar c = Calendar.getInstance();
|
|
|
c.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
c.set(Calendar.MINUTE, 0);
|
|
|
c.set(Calendar.SECOND, 0);
|
|
|
c.set(Calendar.MILLISECOND, 0);
|
|
|
Long today_zero=c.getTimeInMillis()/1000;
|
|
|
|
|
|
//当天至少请求过一次实名认证,并且是当天的数据
|
|
|
//String dayStr = getStringDate("yyyyMMdd");
|
|
|
//Long count = cacheService.getPhotoCheckCount(dayStr,uid);
|
|
|
logger.info("getValidZhiMaCert recall zhiMaCertResultQuery enter uid is {} zhiMaCert_check_again {}",uid,zhiMaCert_check_again);
|
|
|
if(zhiMaCert_check_again!=null&&StringUtils.isNotBlank(zhiMaCert_check_again.getBizNo())
|
|
|
&&CertPhotoEnum.isValidStatus(zhiMaCert_check_again.getValidPhoto())
|
|
|
&&zhiMaCert_check_again.getCreateTime()>=today_zero
|
|
|
){
|
|
|
ZhimaCustomerCertificationQueryResponse zhiMaResp=ZhiMaCallUtil.zhiMaResult(zhiMaCert_check_again.getBizNo());
|
|
|
logger.info("getValidZhiMaCert recall zhiMaCertResultQuery enter result is {},zhiMaCert_check_again {}",JSON.toJSONString(zhiMaResp),zhiMaCert_check_again);
|
|
|
if(zhiMaResp!=null&&zhiMaResp.isSuccess()&&"true".equals(zhiMaResp.getPassed())){
|
|
|
//芝麻认证通过
|
|
|
int updateCount = zhiMaCertDao.updateValidStatusByPrimaryKey(zhiMaCert_check_again.getId());
|
|
|
logger.info("getValidZhiMaCert recall zhiMaCertResultQuery updateCount {} ,result is {},zhiMaCert_check_again {}",updateCount ,JSON.toJSONString(zhiMaResp),zhiMaCert_check_again);
|
|
|
if(updateCount>=1){
|
|
|
zhiMaCert = zhiMaCertDao.selectValidByUid(uid);
|
|
|
if (zhiMaCert != null) {
|
|
|
//保存到redis
|
|
|
cacheService.setZhiMaCert(zhiMaCert);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return zhiMaCert;
|
|
|
}
|
...
|
...
|
@@ -545,7 +582,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
//存储认证信息
|
|
|
ZhiMaCert zhiMaCert = new ZhiMaCert();
|
|
|
zhiMaCert.setUid(reqVO.getUid());
|
|
|
zhiMaCert.setValidStatus(0);//用户还未授权,暂时未生效
|
|
|
zhiMaCert.setValidStatus(9);//用户还未授权,暂时未生效 ,初始值为9
|
|
|
zhiMaCert.setCertName(reqVO.getCertName());
|
|
|
zhiMaCert.setCertNo(reqVO.getCertNo());
|
|
|
zhiMaCert.setCreateTime(nowSecond);
|
...
|
...
|
|