Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
eec213b0
Commit
eec213b0
authored
Oct 30, 2024
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入群时间在访问分享页之前的才算无效入群
parent
07472368
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
10 deletions
+27
-10
GroupChatActivityBaseContext.java
...ge/service/pojo/bo/chat/GroupChatActivityBaseContext.java
+14
-2
GroupChatActivityInviteLogServiceImpl.java
...vice/chat/impl/GroupChatActivityInviteLogServiceImpl.java
+13
-8
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/chat/GroupChatActivityBaseContext.java
View file @
eec213b0
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
.
bo
.
chat
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatActivityDTO
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatUser
;
import
java.util.Date
;
/**
* Created by wangzubo on 2024/10/9.
...
...
@@ -33,6 +32,11 @@ public class GroupChatActivityBaseContext {
*/
private
String
uniqueId
;
/**
* 最后一次访问邀请页时间
*/
private
Date
lastShareTime
;
public
Long
getChatUserId
()
{
return
chatUserId
;
}
...
...
@@ -72,4 +76,12 @@ public class GroupChatActivityBaseContext {
public
void
setUniqueId
(
String
uniqueId
)
{
this
.
uniqueId
=
uniqueId
;
}
public
Date
getLastShareTime
()
{
return
lastShareTime
;
}
public
void
setLastShareTime
(
Date
lastShareTime
)
{
this
.
lastShareTime
=
lastShareTime
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/impl/GroupChatActivityInviteLogServiceImpl.java
View file @
eec213b0
...
...
@@ -110,7 +110,7 @@ public class GroupChatActivityInviteLogServiceImpl implements GroupChatActivityI
return
;
}
List
<
String
>
unionIdList
=
chatUserList
.
stream
().
map
(
TabGroupChatUser:
:
getUnionid
).
collect
(
Collectors
.
toList
());
List
<
List
<
String
>>
partition
=
Lists
.
partition
(
unionIdList
,
100
0
);
List
<
List
<
String
>>
partition
=
Lists
.
partition
(
unionIdList
,
100
);
for
(
List
<
String
>
unionIds
:
partition
)
{
List
<
TabGroupChatActivityShareBind
>
shareBindList
=
groupChatActivityShareBindService
.
query24Record
(
unionIds
);
if
(
CollectionUtils
.
isEmpty
(
shareBindList
))
{
...
...
@@ -120,6 +120,7 @@ public class GroupChatActivityInviteLogServiceImpl implements GroupChatActivityI
Map
<
String
,
List
<
TabGroupChatActivityShareBind
>>
map
=
shareBindList
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabGroupChatActivityShareBind:
:
getInviteeUnionId
));
for
(
TabGroupChatUser
groupChatUser
:
chatUserList
)
{
Long
chatUserId
=
groupChatUser
.
getChatUserId
();
Date
joinTime
=
groupChatUser
.
getJoinTime
();
String
unionid
=
groupChatUser
.
getUnionid
();
List
<
TabGroupChatActivityShareBind
>
list
=
map
.
get
(
unionid
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
...
...
@@ -128,6 +129,10 @@ public class GroupChatActivityInviteLogServiceImpl implements GroupChatActivityI
Set
<
Long
>
chatActivityIdSet
=
new
HashSet
<>();
//同个活动取最近一条绑定信息
for
(
TabGroupChatActivityShareBind
shareBind
:
list
)
{
if
(
DateUtil
.
compare
(
shareBind
.
getCreateTime
(),
joinTime
)
>=
0
)
{
logger
.
info
(
"分享绑定时间大于入群时间 过滤"
);
continue
;
}
Long
chatActivityId
=
shareBind
.
getChatActivityId
();
if
(
chatActivityIdSet
.
add
(
chatActivityId
))
{
GroupChatActivityBaseContext
chatActivityContext
=
new
GroupChatActivityBaseContext
();
...
...
@@ -136,7 +141,7 @@ public class GroupChatActivityInviteLogServiceImpl implements GroupChatActivityI
chatActivityContext
.
setInviterMemberId
(
shareBind
.
getInviterMemberId
());
chatActivityContext
.
setEnterpriseId
(
shareBind
.
getEnterpriseId
());
chatActivityContext
.
setUniqueId
(
shareBind
.
getInviteeUnionId
());
// todo 社群邀请-mq异步
chatActivityContext
.
setLastShareTime
(
shareBind
.
getCreateTime
());
// groupChatInvite(chatActivityContext);
try
{
GICMQClientUtil
.
getClientInstance
().
sendMessage
(
"shareGroupChatInviteMQ"
,
JSON
.
toJSONString
(
chatActivityContext
));
...
...
@@ -273,8 +278,8 @@ public class GroupChatActivityInviteLogServiceImpl implements GroupChatActivityI
String
enterpriseId
=
activity
.
getEnterpriseId
();
TabGroupChatUser
chatUser
=
context
.
getChatUser
();
String
userId
=
chatUser
.
getUserId
();
Long
chatUserId
=
chatUser
.
getChatUserId
();
Long
chatActivityId
=
context
.
getChatActivityId
();
Date
lastShareTime
=
context
.
getLastShareTime
();
Integer
inviteType
=
activity
.
getInviteType
();
TabGroupChatActivityInviteLog
inviteLog
=
new
TabGroupChatActivityInviteLog
();
inviteLog
.
setChatActivityId
(
chatActivityId
);
...
...
@@ -287,21 +292,21 @@ public class GroupChatActivityInviteLogServiceImpl implements GroupChatActivityI
if
(
Objects
.
equals
(
ChatActivityInviteTypeEnum
.
NONE_GROUP_CHAT
.
value
,
inviteType
))
{
List
<
TabGroupChatUser
>
chatUserList
=
groupChatUserMapper
.
listByUserId
(
enterpriseId
,
userId
,
1
);
if
(
CollectionUtils
.
isNotEmpty
(
chatUserList
))
{
TabGroupChatUser
groupChatUser
=
chatUserList
.
get
(
0
);
if
(!
Objects
.
equals
(
groupChatUser
.
getChatUserId
(),
chatUserId
))
{
// 入群时间在访问分享页之前的才算无效入群
chatUserList
=
chatUserList
.
stream
().
filter
(
u
->
DateUtil
.
compare
(
lastShareTime
,
u
.
getJoinTime
())
>=
0
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
chatUserList
))
{
return
ChatActivityInvalidInviteTypeEnum
.
TWO
.
value
;
}
}
}
if
(
Objects
.
equals
(
ChatActivityInviteTypeEnum
.
FIRST_GROUP_CHAT
.
value
,
inviteType
))
{
List
<
TabGroupChatUser
>
chatUserList2
=
groupChatUserMapper
.
listByUserId
(
enterpriseId
,
userId
,
null
);
// 入群时间在访问分享页之前的才算无效入群
chatUserList2
=
chatUserList2
.
stream
().
filter
(
u
->
DateUtil
.
compare
(
lastShareTime
,
u
.
getJoinTime
())
>=
0
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
chatUserList2
))
{
TabGroupChatUser
groupChatUser
=
chatUserList2
.
get
(
0
);
if
(!
Objects
.
equals
(
groupChatUser
.
getChatUserId
(),
chatUserId
))
{
return
ChatActivityInvalidInviteTypeEnum
.
THREE
.
value
;
}
}
}
return
null
;
}
...
...
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