Authored by chenjian

fix:对于valid_status=1,photo_status=0的用户的认证

... ... @@ -23,6 +23,8 @@ public interface IZhiMaCertDao {
int updatePhotoResult(@Param("id")int id, @Param("imageUrl")String imageUrl, @Param("validPhoto")int validPhoto, @Param("updateTime")long updateTime);
int updateStatusPassFully(int id);
//获取生效的认证信息
ZhiMaCert selectByPrimaryKey(int id);
... ...
... ... @@ -118,6 +118,15 @@
where id = #{id}
</update>
<update id="updateStatusPassFully" parameterType="java.lang.Integer">
update zhima_cert
set valid_status = 1,
valid_photo = 1,
image_url = 'null,null',
update_time = unix_timestamp()
where id = #{id,jdbcType=INTEGER}
</update>
<!--
<delete id="deleteByUid" parameterType="java.lang.Integer">
update zhima_cert
... ...
... ... @@ -197,7 +197,7 @@ public class CertificationServiceImpl implements ICertificationService {
}
JSONObject result = JSONObject.parseObject(response.getBody()).getJSONObject("alipay_user_certify_open_query_response");
if("Success".equals(result.get("msg")) && "T".equals(result.get("passed"))){
int updateCount = zhiMaCertDao.updateValidStatusByPrimaryKey(zhiMaCert.getId());
int updateCount = zhiMaCertDao.updateStatusPassFully(zhiMaCert.getId());
if(updateCount < 1){
logger.warn("queryUserCertify: update certResult fail. reqVO is {}", reqVO);
throw new UfoServiceException(400, "更新身份认证结果失败!");
... ... @@ -273,14 +273,17 @@ public class CertificationServiceImpl implements ICertificationService {
zhiMaCert.setCreateTime(System.currentTimeMillis()/1000);
zhiMaCert.setUpdateTime(System.currentTimeMillis()/1000);
zhiMaCertDao.insertAndGetID(zhiMaCert);
}else if(null != zhiMaCert && !CertPhotoEnum.isValidStatus(zhiMaCert.getValidPhoto())){
}
/*
else if(null != zhiMaCert && !CertPhotoEnum.isValidStatus(zhiMaCert.getValidPhoto())){
zhiMaCertDao.updatePhotoResult(zhiMaCert.getId(), reqVO.getFrontImageUrl()+","+reqVO.getBackImageUrl(),
reqVO.getPhotoValidStatus(), System.currentTimeMillis()/1000);
}
*/
logger.info("beginCertificateEx: save db success. reqVO is {}, zhiMaCert is {}", reqVO, zhiMaCert);
//(8)支付宝实名认证(如果已经认证过了,将不会继续认证)
if(null == zhiMaCert || 1 != zhiMaCert.getValidStatus()) {
if(null == zhiMaCert || 1 != zhiMaCert.getValidStatus() || !CertPhotoEnum.isValidStatus(zhiMaCert.getValidPhoto())) {
alipayService.beginAlipayCertEx(reqVO, zhiMaCert, respBO); //开始支付宝刷脸认证
logger.info("beginCertificateEx: call alipay certify end. reqVO is {}, zhiMaCert is {}, respBO is {}", reqVO, zhiMaCert, respBO);
}
... ...