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
6bfa1cdc
Commit
6bfa1cdc
authored
Sep 19, 2019
by
裴大威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat Text 1001742 300 to 1000
parent
f4bb1317
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
16 deletions
+41
-16
AdNewsBizImpl.java
...n/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
+1
-1
AdvertisingSpaceBizImpl.java
...ud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
+1
-1
SendWeixinRequestTools.java
...a/com/pcloud/book/group/tools/SendWeixinRequestTools.java
+6
-6
PushBizImpl.java
.../main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
+32
-7
BookKeyword.Mapper.xml
...src/main/resources/mapper/keywords/BookKeyword.Mapper.xml
+1
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
View file @
6bfa1cdc
...
...
@@ -442,7 +442,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
int
i
=
1
;
for
(
AdNews
adNews
:
adNewsList
)
{
String
temp
=
content
+
i
+
"."
+
adNews
.
getTitle
()
+
adNews
.
getShortUrl
()
+
"\n"
;
if
(
temp
.
length
()
>=
3
00
)
{
if
(
temp
.
length
()
>=
10
00
)
{
// 如果本次拼接后的长度大于 300,那么将之前拼接的内容存入数组
contents
.
add
(
content
);
// 重置 content 的内容
...
...
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
View file @
6bfa1cdc
...
...
@@ -383,7 +383,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
}
}
int
length
=
linkLength
+
adTitle
.
length
();
if
(
length
>
3
00
)
{
if
(
length
>
10
00
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"文本长度超过300!"
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendWeixinRequestTools.java
View file @
6bfa1cdc
...
...
@@ -155,7 +155,7 @@ public class SendWeixinRequestTools {
sb
.
append
(
"\n\n在群内回复以下关键词,领取任务或资源:\n"
);
for
(
KeywordDTO
keyword
:
keywords
)
{
// 关键词长度和欢迎语长度之和超过300会拆分成两条,若拆分之后关键词长度还是大于300则只发300以内的部分
if
((
s
.
length
()
+
sb
.
length
())
>=
300
&&
(
sb
.
length
()
+
(
keyword
.
getKeywords
()
+
"\n"
).
length
())
>=
2
77
)
{
if
((
s
.
length
()
+
sb
.
length
())
>=
1000
&&
(
sb
.
length
()
+
(
keyword
.
getKeywords
()
+
"\n"
).
length
())
>=
9
77
)
{
break
;
}
sb
.
append
(
"【"
).
append
(
keyword
.
getKeywords
()).
append
(
"】"
);
...
...
@@ -163,7 +163,7 @@ public class SendWeixinRequestTools {
}
StringBuilder
groupKeyword
=
getGroupKeyword
(
dto
,
sb
);
// 1001692 自定义欢迎语+关键词文案,如果超过300字,关键词拆分出来发
if
(
s
.
length
()
+
groupKeyword
.
length
()
>=
3
00
)
{
if
(
s
.
length
()
+
groupKeyword
.
length
()
>=
10
00
)
{
sendMessageDTO
.
setContent
(
s
);
sendMessage
(
sendMessageDTO
,
robotId
,
weixinGroupId
,
ip
,
code
);
sendMessageDTO
.
setContent
(
groupKeyword
.
toString
().
replaceFirst
(
"\n\n"
,
""
));
...
...
@@ -330,7 +330,7 @@ public class SendWeixinRequestTools {
for
(
int
i
=
0
;
i
<
keywords
.
size
();
i
++)
{
KeywordDTO
keywordDTO
=
keywords
.
get
(
i
);
String
keyword
=
"关键词【"
+
keywordDTO
.
getKeywords
()
+
"】\n"
+
" "
+
keywordDTO
.
getGuide
();
if
(
content
.
length
()
+
keyword
.
length
()
>
3
00
)
{
if
(
content
.
length
()
+
keyword
.
length
()
>
10
00
)
{
sendTextMessageToSelf
(
content
.
toString
(),
robotId
,
toWxId
,
ip
);
content
=
new
StringBuilder
(
keyword
);
}
else
{
...
...
@@ -385,7 +385,7 @@ public class SendWeixinRequestTools {
if
(!
CollectionUtils
.
isEmpty
(
keywords
)
&&
isGroupRobot
)
{
sb
.
append
(
"\n\n在群内回复以下关键词,领取任务或资源:\n"
);
for
(
KeywordDTO
keyword
:
keywords
)
{
if
((
content
.
length
()
+
sb
.
length
())
>=
300
&&
(
sb
.
length
()
+
(
keyword
.
getKeywords
()
+
"\n"
).
length
())
>=
2
77
)
{
if
((
content
.
length
()
+
sb
.
length
())
>=
1000
&&
(
sb
.
length
()
+
(
keyword
.
getKeywords
()
+
"\n"
).
length
())
>=
9
77
)
{
break
;
}
sb
.
append
(
"【"
).
append
(
keyword
.
getKeywords
()).
append
(
"】"
);
...
...
@@ -393,7 +393,7 @@ public class SendWeixinRequestTools {
}
StringBuilder
groupKeyword
=
getGroupKeyword
(
dto
,
sb
);
// 1001692 自定义欢迎语+关键词文案,如果超过300字,关键词拆分出来发
if
((
content
.
length
()
+
sb
.
length
())
>=
3
00
)
{
if
((
content
.
length
()
+
sb
.
length
())
>=
10
00
)
{
sendTextMessage
(
content
.
toString
(),
robotId
,
weixinGroupId
,
ip
);
sendTextMessage
(
groupKeyword
.
toString
().
replaceFirst
(
"\n\n"
,
""
),
robotId
,
weixinGroupId
,
ip
);
}
else
{
...
...
@@ -455,7 +455,7 @@ public class SendWeixinRequestTools {
for
(
int
i
=
0
;
i
<
keywords
.
size
();
i
++)
{
BookClockKeywordDTO
bookClockKeywordDTO
=
keywords
.
get
(
i
);
String
keyword
=
"关键词【"
+
bookClockKeywordDTO
.
getKeyword
()
+
"】\n"
+
" "
+
bookClockKeywordDTO
.
getGuide
();
if
(
content
.
length
()
+
keyword
.
length
()
>
3
00
)
{
if
(
content
.
length
()
+
keyword
.
length
()
>
10
00
)
{
sendTextMessageVO
.
setContent
(
content
);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
content
=
keyword
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
View file @
6bfa1cdc
package
com
.
pcloud
.
book
.
push
.
biz
.
impl
;
import
com.google.common.util.concurrent.ThreadFactoryBuilder
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.app.AppConsr
;
...
...
@@ -25,9 +24,28 @@ import com.pcloud.book.group.enums.TouchTypeEnum;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.push.biz.PushBiz
;
import
com.pcloud.book.push.check.PushCheck
;
import
com.pcloud.book.push.dao.*
;
import
com.pcloud.book.push.dto.*
;
import
com.pcloud.book.push.entity.*
;
import
com.pcloud.book.push.dao.MorningEveningNewsDao
;
import
com.pcloud.book.push.dao.PushDao
;
import
com.pcloud.book.push.dao.PushGroupDao
;
import
com.pcloud.book.push.dao.PushGroupRecordDao
;
import
com.pcloud.book.push.dao.PushItemDao
;
import
com.pcloud.book.push.dao.PushNewsRecordDao
;
import
com.pcloud.book.push.dao.PushPlanDao
;
import
com.pcloud.book.push.dao.PushRecordDao
;
import
com.pcloud.book.push.dto.PlanClassifyDTO
;
import
com.pcloud.book.push.dto.PushDTO
;
import
com.pcloud.book.push.dto.PushGroupDTO
;
import
com.pcloud.book.push.dto.PushPlanDTO
;
import
com.pcloud.book.push.dto.PushPlanItemDTO
;
import
com.pcloud.book.push.dto.PushRecordDTO
;
import
com.pcloud.book.push.entity.MorningEveningNews
;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushGroupRecord
;
import
com.pcloud.book.push.entity.PushItem
;
import
com.pcloud.book.push.entity.PushNewsRecord
;
import
com.pcloud.book.push.entity.PushPlan
;
import
com.pcloud.book.push.entity.PushRecord
;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.push.enums.PushStatusEnum
;
import
com.pcloud.book.push.enums.PushTypeEnum
;
...
...
@@ -48,14 +66,21 @@ import com.sdk.wxgroup.SendArticleMessageVO;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
java.util.concurrent.*
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -969,7 +994,7 @@ public class PushBizImpl implements PushBiz {
int
i
=
1
;
for
(
ESNews
esNews
:
esNewsList
)
{
String
contentL
=
content
+
i
+
"."
+
esNews
.
getTitle
()
+
esNews
.
getShortUrl
()
+
"\n"
;
if
(
contentL
.
length
()
>=
3
00
)
{
if
(
contentL
.
length
()
>=
10
00
)
{
contents
.
add
(
content
);
content
=
i
+
"."
+
esNews
.
getTitle
()
+
esNews
.
getShortUrl
()
+
"\n"
;
}
else
{
...
...
pcloud-service-book/src/main/resources/mapper/keywords/BookKeyword.Mapper.xml
View file @
6bfa1cdc
...
...
@@ -149,7 +149,7 @@
AND
k.is_delete = 0
AND classify_id = #{classifyId}
AND book_group_id = #{bookGroupId} order by bk.rank, bk.id desc
limit 40
AND book_group_id = #{bookGroupId} order by bk.rank, bk.id desc
</select>
<select
id=
"getKeywordId"
resultType=
"ReplyKeywordDTO"
parameterType=
"map"
>
...
...
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