Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
4b6640df
Commit
4b6640df
authored
May 24, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新增场站导入时手机号、邮箱格式校验。
parent
a2235aa8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
ExcelServiceImpl.java
.../boot/module/jxiop/biz/service/impl/ExcelServiceImpl.java
+13
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/ExcelServiceImpl.java
View file @
4b6640df
...
@@ -58,8 +58,12 @@ public class ExcelServiceImpl {
...
@@ -58,8 +58,12 @@ public class ExcelServiceImpl {
PersonSkillEducationServiceImpl
personSkillEducationService
;
PersonSkillEducationServiceImpl
personSkillEducationService
;
@Autowired
@Autowired
PersonAccountServiceImpl
personAccountServiceImpl
;
PersonAccountServiceImpl
personAccountServiceImpl
;
// 邮箱校验正则
static
final
String
EMAIL
=
"^([a-zA-Z\\d][\\w-]{2,})@(\\w{2,})\\.([a-z]{2,})(\\.[a-z]{2,})?$"
;
/**
* 电话校验正则
*/
static
final
String
PHONE
=
"^1((3|4|5|6|7|8|9){1}\\d{1}|70)\\d{8}$"
;
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
,
Map
par
)
throws
ClassNotFoundException
{
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
,
Map
par
)
throws
ClassNotFoundException
{
String
url
=
excelDto
.
getClassUrl
();
String
url
=
excelDto
.
getClassUrl
();
...
@@ -149,6 +153,7 @@ public class ExcelServiceImpl {
...
@@ -149,6 +153,7 @@ public class ExcelServiceImpl {
this
.
yanzheng
(
exStationBasicDto
.
getStationType
(),
"场站类型"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getStationType
(),
"场站类型"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getStationMasterName
(),
"站长"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getStationMasterName
(),
"站长"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getMobilePhone
(),
"手机号码"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getMobilePhone
(),
"手机号码"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getEmail
(),
"邮箱"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getDevopsTime
(),
"运维时间"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getDevopsTime
(),
"运维时间"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getOwnerUnit
(),
"运维单位"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getOwnerUnit
(),
"运维单位"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getAddress
(),
"场站地址"
,
i
);
this
.
yanzheng
(
exStationBasicDto
.
getAddress
(),
"场站地址"
,
i
);
...
@@ -207,7 +212,12 @@ public class ExcelServiceImpl {
...
@@ -207,7 +212,12 @@ public class ExcelServiceImpl {
if
(
obj
==
null
){
if
(
obj
==
null
){
throw
new
InnerInvokException
(
"第"
+
(
i
+
2
)
+
"行,"
+
name
+
"数据不能空"
,
"403"
,
"第"
+
(
i
+
2
)
+
"行,"
+
name
+
"数据不能空"
,
403
);
throw
new
InnerInvokException
(
"第"
+
(
i
+
2
)
+
"行,"
+
name
+
"数据不能空"
,
"403"
,
"第"
+
(
i
+
2
)
+
"行,"
+
name
+
"数据不能空"
,
403
);
}
}
if
(
obj
!=
null
&&
name
.
equals
(
"手机号码"
)&&
String
.
valueOf
(
obj
).
matches
(
PHONE
))
{
throw
new
InnerInvokException
(
"第"
+
(
i
+
2
)
+
"行,"
+
name
+
"手机号码填写错误"
,
"403"
,
"第"
+
(
i
+
2
)
+
"行,"
+
name
+
"手机号码填写错误"
,
403
);
}
if
(
obj
!=
null
&&
name
.
equals
(
"邮箱"
)&&
String
.
valueOf
(
obj
).
matches
(
EMAIL
))
{
throw
new
InnerInvokException
(
"第"
+
(
i
+
2
)
+
"行,"
+
name
+
"邮箱填写错误"
,
"403"
,
"第"
+
(
i
+
2
)
+
"行,"
+
name
+
"邮箱填写错误"
,
403
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment