From ffef20d703aaa9b60c9234dd0b42f3d006426dc7 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 31 十二月 2025 17:02:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLargeKeyGridUserController.java | 35 +++++++++++++++++++++++++++++++----
1 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLargeKeyGridUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLargeKeyGridUserController.java
index 2e92259..1867cd7 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLargeKeyGridUserController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLargeKeyGridUserController.java
@@ -202,50 +202,62 @@
for (LargeKeyGridUserImport largeKeyGridUserImport : largeKeyGridUserImports) {
if (!StringUtils.hasLength(largeKeyGridUserImport.getGridInfo())){
result.append("第"+i+"行:[", "网格"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getCommunityName())){
result.append("第"+i+"行:[", "小区名称"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getBuildingInfo())){
result.append("第"+i+"行:[", "楼栋信息"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getUnitNumber())){
result.append("第"+i+"行:[", "单元号"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getHouseNumber())){
result.append("第"+i+"行:[", "门牌号"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getUserName())){
result.append("第"+i+"行:[", "姓名"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getUserSexStr())){
result.append("第"+i+"行:[", "性别"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getIdCard())){
result.append("第"+i+"行:[", "身份证号"+"]不能为空");
+ i++;
continue;
}
- if (largeKeyGridUserImport.getIdCard().matches("^$|(^[1-9]\\\\d{7}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])\\\\d{3}$)|(^[1-9]\\\\d{5}[1-9]\\\\d{3}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])((\\\\d{4})|\\\\d{3}[Xx])$)")){
+ if (!largeKeyGridUserImport.getIdCard().matches("^$|(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)")){
result.append("第"+i+"行:[", "身份证号"+"]格式不正确");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getContactNumber())){
result.append("第"+i+"行:[", "联系电话"+"]不能为空");
+ i++;
continue;
}
- if (largeKeyGridUserImport.getContactNumber().matches("^1[3-9]\\\\d{9}$")){
+ if (!largeKeyGridUserImport.getContactNumber().matches("^$|^1[3-9]\\d{9}$")){
result.append("第"+i+"行:[", "联系电话"+"]格式不正确");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getTypeName())){
result.append("第"+i+"行:[", "类型名称"+"]不能为空");
+ i++;
continue;
}
TLargeKeyGridUser largeKeyGridUser = new TLargeKeyGridUser();
@@ -260,6 +272,7 @@
break;
default:
result.append("第"+i+"行:[", "性别"+"]格式错误");
+ i++;
continue;
}
@@ -268,6 +281,7 @@
.last("LIMIT 1"));
if(Objects.isNull(largeKeyPersonnelType)){
result.append("第"+i+"行:[", "类型名称"+"]不存在");
+ i++;
continue;
}
largeKeyGridUser.setTypeId(largeKeyPersonnelType.getId());
@@ -315,46 +329,57 @@
for (LargeKeyGridUserImport largeKeyGridUserImport : largeKeyGridUserImports) {
if (!StringUtils.hasLength(largeKeyGridUserImport.getGridInfo())){
result.append("第"+i+"行:[", "网格"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getCommunityName())){
result.append("第"+i+"行:[", "小区名称"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getBuildingInfo())){
result.append("第"+i+"行:[", "楼栋信息"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getUnitNumber())){
result.append("第"+i+"行:[", "单元号"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getHouseNumber())){
result.append("第"+i+"行:[", "门牌号"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getUserName())){
result.append("第"+i+"行:[", "姓名"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getUserSexStr())){
result.append("第"+i+"行:[", "性别"+"]不能为空");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getIdCard())){
result.append("第"+i+"行:[", "身份证号"+"]不能为空");
+ i++;
continue;
}
- if (largeKeyGridUserImport.getIdCard().matches("^$|(^[1-9]\\\\d{7}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])\\\\d{3}$)|(^[1-9]\\\\d{5}[1-9]\\\\d{3}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])((\\\\d{4})|\\\\d{3}[Xx])$)")){
+ if (!largeKeyGridUserImport.getIdCard().matches("^$|(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)")){
result.append("第"+i+"行:[", "身份证号"+"]格式不正确");
+ i++;
continue;
}
if (!StringUtils.hasLength(largeKeyGridUserImport.getContactNumber())){
result.append("第"+i+"行:[", "联系电话"+"]不能为空");
+ i++;
continue;
}
- if (largeKeyGridUserImport.getContactNumber().matches("^1[3-9]\\\\d{9}$")){
+ if (!largeKeyGridUserImport.getContactNumber().matches("^$|^1[3-9]\\d{9}$")){
result.append("第"+i+"行:[", "联系电话"+"]格式不正确");
+ i++;
continue;
}
TLargeKeyGridUser largeKeyGridUser = new TLargeKeyGridUser();
@@ -369,6 +394,7 @@
break;
default:
result.append("第"+i+"行:[", "性别"+"]格式错误");
+ i++;
continue;
}
@@ -378,6 +404,7 @@
.last("LIMIT 1"));
if(Objects.isNull(largeKeyPersonnelType)){
result.append("第"+i+"行:[", "类型名称"+"]不存在");
+ i++;
continue;
}
largeKeyGridUser.setTypeId(largeKeyPersonnelType.getId());
--
Gitblit v1.7.1