Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intel_promotion_api
Project
Project
Details
Activity
Releases
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
liyilin
intel_promotion_api
Commits
8d10a035
Commit
8d10a035
authored
Aug 16, 2024
by
刘帅阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
0c18ec3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
CmsPriceClickServiceImpl.java
.../cmspriceclick/service/impl/CmsPriceClickServiceImpl.java
+11
-13
No files found.
src/main/java/org/rcisoft/business/cmspriceclick/service/impl/CmsPriceClickServiceImpl.java
View file @
8d10a035
...
...
@@ -245,8 +245,11 @@ public class CmsPriceClickServiceImpl extends ServiceImpl<CmsPriceClickRepositor
cmsPriceClicksDTOList
.
stream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
//
Pattern
pattern
=
Pattern
.
compile
(
"[0-9]*"
);
//行数
Integer
sum
=
0
;
//添加前先遍历一下那些数据有问题
for
(
CmsPriceClickDTO
cmsPriceClickDTO
:
cmsPriceClicksDTOList
)
{
sum
++;
//用户名去空格
cmsPriceClickDTO
.
setUserName
(
cmsPriceClickDTO
.
getUserName
().
replaceAll
(
"\\s+"
,
""
).
trim
());
cmsPriceClickDTO
.
setUserName
(
cmsPriceClickDTO
.
getUserName
().
replaceAll
(
"\\p{Zs}"
,
""
).
trim
());
...
...
@@ -262,40 +265,35 @@ public class CmsPriceClickServiceImpl extends ServiceImpl<CmsPriceClickRepositor
//1.用户身份证号不能为空 18位 且必须为数字类型
if
(
cmsPriceClickDTO
.
getIdCard
()
==
null
||
cmsPriceClickDTO
.
getIdCard
().
length
()
!=
18
)
{
// throw new CyServiceException(AdminUserInfoExceptionEnums.ID_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.ID_LENGTH_ERROR.getMessage() + ":" + cmsPriceClickDTO.getIdCard());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
ID_LENGTH_ERROR
.
getCode
(),
AdminUserInfoExceptionEnums
.
ID_LENGTH_ERROR
.
getMessage
());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
ID_LENGTH_ERROR
.
getCode
(),
sum
+
"行"
+
AdminUserInfoExceptionEnums
.
ID_LENGTH_ERROR
.
getMessage
());
}
//2.用户手机号 11位
if
(
cmsPriceClickDTO
.
getPhone
()
==
null
||
cmsPriceClickDTO
.
getPhone
().
length
()
!=
11
)
{
// System.out.println("+++" + cmsPriceClickDTO.getPhone() + "+++");
// throw new CyServiceException(AdminUserInfoExceptionEnums.ID_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.PHONE_LENGTH_ERROR.getMessage() + ":" + cmsPriceClickDTO.getPhone());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
ID_LENGTH_ERROR
.
getCode
(),
AdminUserInfoExceptionEnums
.
PHONE_LENGTH_ERROR
.
getMessage
());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
ID_LENGTH_ERROR
.
getCode
(),
sum
+
"行"
+
AdminUserInfoExceptionEnums
.
PHONE_LENGTH_ERROR
.
getMessage
());
}
//3.银行卡号不能为空 19位
if
(
cmsPriceClickDTO
.
getBankCard
()
==
null
||
cmsPriceClickDTO
.
getBankCard
().
length
()
>
30
)
{
// throw new CyServiceException(AdminUserInfoExceptionEnums.ID_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getMessage() + ":" + cmsPriceClickDTO.getBankCard());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
BANK_LENGTH_ERROR
.
getCode
(),
cmsPriceClickDTO
.
getIdCard
()
+
AdminUserInfoExceptionEnums
.
BANK_LENGTH_ERROR
.
getMessage
());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
BANK_LENGTH_ERROR
.
getCode
(),
sum
+
"行"
+
AdminUserInfoExceptionEnums
.
BANK_LENGTH_ERROR
.
getMessage
());
}
//4.推广次数不能为空
if
(
cmsPriceClickDTO
.
getClickThroughRate
()
==
null
)
{
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
CLICK_THROUGH_RATE_ERROR
.
getCode
(),
AdminUserInfoExceptionEnums
.
CLICK_THROUGH_RATE_ERROR
.
getMessage
());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
CLICK_THROUGH_RATE_ERROR
.
getCode
(),
sum
+
"行"
+
AdminUserInfoExceptionEnums
.
CLICK_THROUGH_RATE_ERROR
.
getMessage
());
}
//5.价格不能为空
if
(
cmsPriceClickDTO
.
getPrice
()
==
null
)
{
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
PRICE_ERROR
.
getCode
(),
AdminUserInfoExceptionEnums
.
PRICE_ERROR
.
getMessage
());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
PRICE_ERROR
.
getCode
(),
sum
+
"行"
+
AdminUserInfoExceptionEnums
.
PRICE_ERROR
.
getMessage
());
}
//手机号只能是数字
if
(!
pattern
.
matcher
(
cmsPriceClickDTO
.
getPhone
()).
matches
())
{
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
PHONE_LENGTH_ERROR
.
getCode
(),
AdminUserInfoExceptionEnums
.
PHONE_LENGTH_ERROR
.
getMessage
());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
PHONE_LENGTH_ERROR
.
getCode
(),
sum
+
"行"
+
AdminUserInfoExceptionEnums
.
PHONE_LENGTH_ERROR
.
getMessage
());
}
//银行卡号只能是数字
if
(!
pattern
.
matcher
(
cmsPriceClickDTO
.
getBankCard
()).
matches
())
{
// System.out.println("++" + cmsPriceClickDTO.getBankCard() + "+++");
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
BANK_LENGTH_ERROR
.
getCode
(),
AdminUserInfoExceptionEnums
.
BANK_LENGTH_ERROR
.
getMessage
());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
BANK_LENGTH_ERROR
.
getCode
(),
sum
+
"行"
+
AdminUserInfoExceptionEnums
.
BANK_LENGTH_ERROR
.
getMessage
());
}
//用户名称不能为空且 不能大于30
if
(
cmsPriceClickDTO
.
getUserName
()
==
null
||
cmsPriceClickDTO
.
getUserName
().
length
()
>
30
)
{
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
USER_NAME_LENGTH_ERROR
.
getCode
(),
AdminUserInfoExceptionEnums
.
USER_NAME_LENGTH_ERROR
.
getMessage
());
throw
new
CyServiceException
(
AdminUserInfoExceptionEnums
.
USER_NAME_LENGTH_ERROR
.
getCode
(),
sum
+
"行"
+
AdminUserInfoExceptionEnums
.
USER_NAME_LENGTH_ERROR
.
getMessage
());
}
}
...
...
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