From cc9384035ae8b71b33e866e0690b0bc65fa02135 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 03 Jan 2024 09:30:39 +0800
Subject: [PATCH] 根据身份证、保安证编号获取用户;微信注册修改为限定身份证号不能重复

---
 src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java b/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
index 7cc27b4..6a2857d 100644
--- a/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
+++ b/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -1900,11 +1900,11 @@
 	@Override
 	public Boolean wxRegister(User user) {
 		User params = new User();
-		params.setPhone(user.getPhone());
-		//查看数据库是否有相同手机号
+		params.setCardid(user.getCardid());
+		//查看数据库是否有相同身份证号
 		List<User> list = list(Condition.getQueryWrapper(params));
 		if (list.size()>0){
-			throw new ServiceException("该用户已注册");
+			throw new ServiceException("该身份证号已注册");
 		}
 
 		//注册新用户
@@ -1966,13 +1966,12 @@
 				}
 			}
 
-			//根据身份证获取用户
-			User userInfoByIdCardNo = baseMapper.getUserInfoByIdCardNo(userExcel.getCardid());
+			//根据身份证、保安证编号获取用户
+			User userInfoByIdCardNo = baseMapper.getUserInfoByIdCardNoAndSecurityNumber(userExcel.getCardid(),userExcel.getSecuritynumber());
 
-			if (!userInfoByIdCardNo.getSecuritynumber().equals( userExcel.getSecuritynumber())){
-				throw new ServiceException("导入失败!保安证编号与系统不匹配!");
+			if (userInfoByIdCardNo == null){
+				throw new ServiceException("导入失败!身份证号和保安证编号与系统不匹配!");
 			}
-
 
 			User user = new User();
 			user.setId(userInfoByIdCardNo.getId());

--
Gitblit v1.9.3