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
c8993d72
Commit
c8993d72
authored
Apr 03, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加导入校验
parent
c7523883
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
HouseholdPvServiceImpl.java
...module/jxiop/biz/service/impl/HouseholdPvServiceImpl.java
+36
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HouseholdPvServiceImpl.java
View file @
c8993d72
...
...
@@ -36,6 +36,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -68,6 +69,14 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
RedisUtils
redisUtils
;
/**
* 身份证校验
*/
final
String
ID_CARD
=
"^[1-9]\\d{5}[1-9]\\d{3}((0[1-9])|(1[0-2]))(0[1-9]|([1|2][0-9])|3[0-1])((\\d{4})|\\d{3}X)$"
;
/**
* 电话校验
*/
final
String
PHONE
=
"^1((3|4|5|6|7|8|9){1}\\d{1}|70)\\d{8}$"
;
/**
* 分页查询
*/
public
IPage
<
HouseholdPvDto
>
queryForHouseholdPvPage
(
Page
<
HouseholdPvDto
>
page
,
HouseholdPvDto
dto
)
{
...
...
@@ -188,6 +197,33 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
if
(!
map
.
containsKey
(
dto
.
getDistrictId
()))
{
return
"第"
+
line
+
" 行乡镇不存在!"
;
}
if
(
dto
.
getNumber
().
length
()
>
50
)
{
return
"第"
+
line
+
" 行户号最多输入50个字符!"
;
}
if
(
dto
.
getName
().
length
()
>
50
)
{
return
"第"
+
line
+
" 行户主姓名最多输入50个字符!"
;
}
boolean
idCard
=
dto
.
getIdNumber
().
matches
(
ID_CARD
);
if
(!
idCard
)
{
return
"第"
+
line
+
" 行身份证号格式有误!"
;
}
if
(
dto
.
getIssuingAuthority
().
length
()
>
200
)
{
return
"第"
+
line
+
" 行签发机关最多输入200个字符!"
;
}
boolean
phone
=
dto
.
getPhone
().
matches
(
PHONE
);
if
(!
phone
)
{
return
"第"
+
line
+
" 行手机号码格式有误!"
;
}
if
(
dto
.
getAddress
().
length
()
>
200
)
{
return
"第"
+
line
+
" 行居住地最多输入200个字符!"
;
}
if
(
dto
.
getPostcode
().
length
()
>
10
)
{
return
"第"
+
line
+
" 行居住地邮编最多输入10个字符!"
;
}
if
(
dto
.
getServiceAddress
().
length
()
>
200
)
{
return
"第"
+
line
+
" 行送达地址最多输入200个字符!"
;
}
LambdaQueryWrapper
<
HouseholdPvDistrict
>
orgLambda
=
new
QueryWrapper
<
HouseholdPvDistrict
>().
lambda
();
orgLambda
.
likeRight
(
HouseholdPvDistrict:
:
getBizOrgCode
,
orgCodeMap
.
get
(
dto
.
getPlatformCompanyId
()));
List
<
HouseholdPvDistrict
>
householdPvDistricts
=
householdPvDistrictMapper
.
selectList
(
orgLambda
);
...
...
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