Authored by mingdan.ge

身份证上传新建

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