Authored by mingdan.ge

身份证上传新建

... ... @@ -26,6 +26,7 @@
from union_share_user_identity_card
where uid = #{uid,jdbcType=INTEGER}
and status=1
order by id desc
limit 1
</select>
... ...
... ... @@ -3807,14 +3807,13 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
identityCard.setStatus((byte)1);
identityCard.setCreateTime(DateUtil.getCurrentTimeSecond());
identityCard.setUpdateTime(identityCard.getCreateTime());
// 查询是否存在
UnionShareUserIdentityCard identityCardDb = unionShareUserIdentityCardMapper.selectByUid(bo.getUid());
// 查询是否有正常状态的身份证照片
UnionShareUserIdentityCard identityCardDb = unionShareUserIdentityCardMapper.selectActiveByUid(bo.getUid());
int result = 0;
if(identityCardDb==null){
result = unionShareUserIdentityCardMapper.insert(identityCard);
}else{
identityCard.setId(identityCardDb.getId());
result = unionShareUserIdentityCardMapper.updateByPrimaryKey(identityCard);
throw new ServiceException(ServiceError.UNION_IDENTITYCARD_EXIST_ERROR);
}
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(), bo.getUid());
return result;
... ...