Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
ecc78325
Commit
ecc78325
authored
May 21, 2019
by
田超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
欢迎语的问题
parent
f9e0f08a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
21 deletions
+39
-21
GroupQrcodeBizImpl.java
...va/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
+13
-10
SendWeixinRequestTools.java
...a/com/pcloud/book/group/tools/SendWeixinRequestTools.java
+26
-11
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
View file @
ecc78325
...
@@ -40,10 +40,7 @@ import org.springframework.stereotype.Component;
...
@@ -40,10 +40,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author lily
* @author lily
...
@@ -187,13 +184,19 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
...
@@ -187,13 +184,19 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
//将二维码修改为已满群状态
//将二维码修改为已满群状态
changeToOverNumber
(
groupQrcodeDTO
.
getWeixinQrcodeId
(),
groupQrcodeDTO
.
getId
());
changeToOverNumber
(
groupQrcodeDTO
.
getWeixinQrcodeId
(),
groupQrcodeDTO
.
getId
());
}
}
// List<String> nickNames = JedisClusterUtils.getJsonList("BOOK:WEIXINGROUP:GUIDEUSER" + weixinGroupId, String.class);
// if(ListUtils.isEmpty(nickNames) && !StringUtil.isEmpty(nickName)){
Map
<
String
,
Integer
>
nickNames
=
JedisClusterUtils
.
getJson
(
"BOOK:WEIXINGROUP:GUIDEUSER"
+
weixinGroupId
,
Map
.
class
);
// nickNames = new ArrayList<>();
if
(
nickNames
==
null
){
// nickNames.add(nickName);
nickNames
=
new
HashMap
<>();
// JedisClusterUtils.setJsonList("BOOK:WEIXINGROUP:GUIDEUSER" + weixinGroupId, nickNames, 600);
nickNames
.
put
(
nickName
,
0
);
// }
JedisClusterUtils
.
setJson
(
"BOOK:WEIXINGROUP:GUIDEUSER"
+
weixinGroupId
,
nickNames
,
600
);
}
else
{
nickNames
.
put
(
nickName
,
0
);
}
String
value
=
JedisClusterUtils
.
getJson
(
"BOOK:WEIXINGROUP:GUIDE"
+
weixinGroupId
,
String
.
class
);
String
value
=
JedisClusterUtils
.
getJson
(
"BOOK:WEIXINGROUP:GUIDE"
+
weixinGroupId
,
String
.
class
);
if
(
StringUtil
.
isEmpty
(
value
))
{
if
(
StringUtil
.
isEmpty
(
value
))
{
JedisClusterUtils
.
setJson
(
"BOOK:WEIXINGROUP:GUIDE"
+
weixinGroupId
,
weixinGroupId
,
5
);
JedisClusterUtils
.
setJson
(
"BOOK:WEIXINGROUP:GUIDE"
+
weixinGroupId
,
weixinGroupId
,
5
);
}
else
{
}
else
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendWeixinRequestTools.java
View file @
ecc78325
...
@@ -25,8 +25,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -25,8 +25,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
/**
/**
* @author lily
* @author lily
...
@@ -284,17 +283,33 @@ public class SendWeixinRequestTools {
...
@@ -284,17 +283,33 @@ public class SendWeixinRequestTools {
public
static
void
sendDefaultMessage
(
String
groupName
,
String
robotId
,
String
weixinGroupId
)
{
public
static
void
sendDefaultMessage
(
String
groupName
,
String
robotId
,
String
weixinGroupId
)
{
String
content
=
""
;
String
content
=
""
;
// List<String> nickNames = JedisClusterUtils.getJsonList("BOOK:WEIXINGROUP:GUIDEUSER" + weixinGroupId, String.class);
Map
<
String
,
Integer
>
nickNames
=
JedisClusterUtils
.
getJson
(
"BOOK:WEIXINGROUP:GUIDEUSER"
+
weixinGroupId
,
Map
.
class
);
// if(!ListUtils.isEmpty(nickNames)){
int
i
=
0
;
// JedisClusterUtils.del("BOOK:WEIXINGROUP:GUIDEUSER" + weixinGroupId);
List
<
String
>
names
=
new
ArrayList
<>();
// }
Set
<
Map
.
Entry
<
String
,
Integer
>>
entries
=
nickNames
.
entrySet
();
// for (String nickName : nickNames) {
for
(
Iterator
<
Map
.
Entry
<
String
,
Integer
>>
iterator
=
entries
.
iterator
();
iterator
.
hasNext
();){
// content = content + "@" + nickName + " ";
if
(
i
==
5
){
// }
break
;
}
Map
.
Entry
<
String
,
Integer
>
entry
=
iterator
.
next
();
String
key
=
entry
.
getKey
();
Integer
value
=
entry
.
getValue
();
if
(
value
==
1
){
continue
;
}
names
.
add
(
key
);
i
++;
}
for
(
String
nickName
:
names
)
{
nickNames
.
remove
(
nickName
);
content
=
content
+
"@"
+
nickName
+
" "
;
}
JedisClusterUtils
.
setJson
(
"BOOK:WEIXINGROUP:GUIDEUSER"
+
weixinGroupId
,
nickNames
);
if
(
StringUtil
.
isEmpty
(
groupName
))
{
if
(
StringUtil
.
isEmpty
(
groupName
))
{
content
=
"
欢迎加入本群,凭以下关键词领取任务或资源:"
;
content
+=
",
欢迎加入本群,凭以下关键词领取任务或资源:"
;
}
else
{
}
else
{
content
=
"
欢迎加入"
+
groupName
+
"!凭以下关键词领取任务或资源:"
;
content
+=
",
欢迎加入"
+
groupName
+
"!凭以下关键词领取任务或资源:"
;
}
}
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
sendTextMessageVO
.
setContent
(
content
);
sendTextMessageVO
.
setContent
(
content
);
...
...
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