Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
service-campaign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Ha
service-campaign
Commits
3e9013f4
Commit
3e9013f4
authored
Sep 13, 2019
by
=
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.myitsol.com/hanv/service-campaign
parents
267b9d95
934f252c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
...om/viettel/campaign/service/impl/CustomerServiceImpl.java
+7
-7
No files found.
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
View file @
3e9013f4
...
@@ -1262,7 +1262,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1262,7 +1262,7 @@ public class CustomerServiceImpl implements CustomerService {
Customer
saved
=
customerRepository
.
save
(
c
);
Customer
saved
=
customerRepository
.
save
(
c
);
if
(
rawDataList
.
get
(
i
).
length
>
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])
if
(
rawDataList
.
get
(
i
).
length
>
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])
&&
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])]
!=
null
)
{
&&
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])]
!=
null
)
{
String
[]
mainPhone
=
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
().
split
(
"
;
"
);
String
[]
mainPhone
=
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
().
split
(
"
[,;]
"
);
for
(
int
j
=
0
;
j
<
mainPhone
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
mainPhone
.
length
;
j
++)
{
CustomerContact
cc
=
new
CustomerContact
();
CustomerContact
cc
=
new
CustomerContact
();
cc
.
setCustomerId
(
saved
.
getCustomerId
());
cc
.
setCustomerId
(
saved
.
getCustomerId
());
...
@@ -1280,7 +1280,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1280,7 +1280,7 @@ public class CustomerServiceImpl implements CustomerService {
}
}
if
(
rawDataList
.
get
(
i
).
length
>
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])
if
(
rawDataList
.
get
(
i
).
length
>
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])
&&
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])]
!=
null
)
{
&&
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])]
!=
null
)
{
String
[]
subPhone
=
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
().
split
(
"
;
"
);
String
[]
subPhone
=
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
().
split
(
"
[,;]
"
);
for
(
int
j
=
0
;
j
<
subPhone
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
subPhone
.
length
;
j
++)
{
CustomerContact
cc
=
new
CustomerContact
();
CustomerContact
cc
=
new
CustomerContact
();
cc
.
setCustomerId
(
saved
.
getCustomerId
());
cc
.
setCustomerId
(
saved
.
getCustomerId
());
...
@@ -1298,7 +1298,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1298,7 +1298,7 @@ public class CustomerServiceImpl implements CustomerService {
}
}
if
(
rawDataList
.
get
(
i
).
length
>
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.email"
,
locale
).
split
(
"#"
)[
0
])
if
(
rawDataList
.
get
(
i
).
length
>
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.email"
,
locale
).
split
(
"#"
)[
0
])
&&
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.email"
,
locale
).
split
(
"#"
)[
0
])]
!=
null
)
{
&&
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.email"
,
locale
).
split
(
"#"
)[
0
])]
!=
null
)
{
String
[]
email
=
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.email"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
split
(
"
;
"
);
String
[]
email
=
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.email"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
split
(
"
[,;]
"
);
for
(
int
j
=
0
;
j
<
email
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
email
.
length
;
j
++)
{
CustomerContact
cc
=
new
CustomerContact
();
CustomerContact
cc
=
new
CustomerContact
();
cc
.
setCustomerId
(
saved
.
getCustomerId
());
cc
.
setCustomerId
(
saved
.
getCustomerId
());
...
@@ -1382,7 +1382,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1382,7 +1382,7 @@ public class CustomerServiceImpl implements CustomerService {
//<editor-fold desc="Validate Methods" defaultstate="collapsed">
//<editor-fold desc="Validate Methods" defaultstate="collapsed">
private
String
validateExistPhone
(
String
str
,
Locale
locale
,
boolean
isCheckDuplicate
)
{
private
String
validateExistPhone
(
String
str
,
Locale
locale
,
boolean
isCheckDuplicate
)
{
String
result
=
""
;
String
result
=
""
;
String
[]
arr
=
str
.
split
(
"
;
"
);
String
[]
arr
=
str
.
split
(
"
[;,]
"
);
List
<
CustomerContact
>
contactList
;
List
<
CustomerContact
>
contactList
;
if
(
str
.
length
()
>
50
)
{
if
(
str
.
length
()
>
50
)
{
result
+=
BundleUtils
.
getLangString
(
"customer.phoneMax50"
,
locale
);
result
+=
BundleUtils
.
getLangString
(
"customer.phoneMax50"
,
locale
);
...
@@ -1411,7 +1411,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1411,7 +1411,7 @@ public class CustomerServiceImpl implements CustomerService {
private
boolean
validateNumberOnly
(
String
str
)
{
private
boolean
validateNumberOnly
(
String
str
)
{
String
regexp
=
"\\b\\d+\\b"
;
String
regexp
=
"\\b\\d+\\b"
;
String
[]
arr
=
str
.
split
(
"
;
"
);
String
[]
arr
=
str
.
split
(
"
[,;]
"
);
int
count
=
0
;
int
count
=
0
;
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
if
(!
arr
[
i
].
matches
(
regexp
))
{
if
(!
arr
[
i
].
matches
(
regexp
))
{
...
@@ -1423,7 +1423,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1423,7 +1423,7 @@ public class CustomerServiceImpl implements CustomerService {
private
String
validateDuplicateEmail
(
String
str
,
Locale
locale
)
{
private
String
validateDuplicateEmail
(
String
str
,
Locale
locale
)
{
String
result
=
""
;
String
result
=
""
;
String
[]
arr
=
str
.
split
(
"
,
"
);
String
[]
arr
=
str
.
split
(
"
[;,]
"
);
List
<
CustomerContact
>
contactList
;
List
<
CustomerContact
>
contactList
;
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
contactList
=
customerContactRepository
.
findCustomerContactsByContactEquals
(
arr
[
i
]);
contactList
=
customerContactRepository
.
findCustomerContactsByContactEquals
(
arr
[
i
]);
...
@@ -1455,7 +1455,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1455,7 +1455,7 @@ public class CustomerServiceImpl implements CustomerService {
}
}
private
boolean
validateEmail
(
String
str
)
{
private
boolean
validateEmail
(
String
str
)
{
String
[]
arr
=
str
.
split
(
"
,
"
);
String
[]
arr
=
str
.
split
(
"
[;,]
"
);
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
Matcher
matcher
=
EMAIL_REGEXP
.
matcher
(
arr
[
i
]);
Matcher
matcher
=
EMAIL_REGEXP
.
matcher
(
arr
[
i
]);
if
(!
matcher
.
matches
())
{
if
(!
matcher
.
matches
())
{
...
...
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