Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
1d7c4cb4
Commit
1d7c4cb4
authored
Oct 30, 2019
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回滚联系人修改内容,单独提交
parent
bf527954
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
23 deletions
+10
-23
ContactServiceImpl.java
...quantgroup/xyqb/service/user/impl/ContactServiceImpl.java
+10
-23
No files found.
src/main/java/cn/quantgroup/xyqb/service/user/impl/ContactServiceImpl.java
View file @
1d7c4cb4
...
@@ -35,23 +35,6 @@ public class ContactServiceImpl implements IContactService {
...
@@ -35,23 +35,6 @@ public class ContactServiceImpl implements IContactService {
if
(
trim
)
{
if
(
trim
)
{
trim
(
contacts
);
trim
(
contacts
);
}
}
// 按修改时间倒序排列
if
(!
CollectionUtils
.
isEmpty
(
contacts
)){
Collections
.
sort
(
contacts
,
(
o1
,
o2
)
->
{
Date
paidAt1
=
o1
.
getUpdateAt
();
Date
paidAt2
=
o2
.
getUpdateAt
();
if
(
paidAt1
==
null
&&
paidAt2
==
null
)
{
return
0
;
}
if
(
paidAt1
==
null
)
{
return
-
1
;
}
if
(
paidAt2
==
null
)
{
return
-
1
;
}
return
paidAt1
.
compareTo
(
paidAt2
);
});
}
return
contacts
;
return
contacts
;
}
}
...
@@ -118,17 +101,21 @@ public class ContactServiceImpl implements IContactService {
...
@@ -118,17 +101,21 @@ public class ContactServiceImpl implements IContactService {
* @param contacts - 新联系人列表
* @param contacts - 新联系人列表
*/
*/
private
void
mergeContacts
(
Long
userId
,
List
<
Contact
>
contacts
)
{
private
void
mergeContacts
(
Long
userId
,
List
<
Contact
>
contacts
)
{
// 当前联系人列表
List
<
Contact
>
userContact
=
contactRepository
.
findByUserId
(
userId
);
int
userContactCount
=
(
userContact
==
null
)
?
0
:
userContact
.
size
();
Timestamp
now
=
new
Timestamp
(
System
.
currentTimeMillis
());
Timestamp
now
=
new
Timestamp
(
System
.
currentTimeMillis
());
for
(
int
i
=
0
;
i
<
contacts
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
contacts
.
size
();
i
++)
{
Contact
c
=
contacts
.
get
(
i
);
Contact
c
=
contacts
.
get
(
i
);
c
.
setId
(
null
);
c
.
setUserId
(
userId
);
c
.
setUserId
(
userId
);
if
(
Objects
.
isNull
(
c
.
getRelation
())){
c
.
setRelation
(
c
.
getRelation
()
==
null
?
Relation
.
OTHER
:
c
.
getRelation
());
c
.
setRelation
(
Relation
.
OTHER
);
}
if
(
Objects
.
isNull
(
c
.
getId
())){
c
.
setCreatedAt
(
now
);
c
.
setCreatedAt
(
now
);
}
c
.
setUpdateAt
(
now
);
c
.
setUpdateAt
(
now
);
if
(
userContactCount
>
i
)
{
c
.
setId
(
userContact
.
get
(
i
).
getId
());
c
.
setCreatedAt
(
userContact
.
get
(
i
).
getCreatedAt
()
==
null
?
now
:
userContact
.
get
(
i
).
getCreatedAt
());
}
}
}
}
}
}
}
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