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
aa3646c9
Commit
aa3646c9
authored
Feb 27, 2020
by
zhangdongwei-intern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
衔接语链接替换
parent
7ad99d18
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
6 deletions
+53
-6
PersonalStageBizImpl.java
...oud/book/personalstage/biz/impl/PersonalStageBizImpl.java
+12
-6
PersonalStageJumpBizImpl.java
...book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
+41
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageBizImpl.java
View file @
aa3646c9
...
@@ -105,8 +105,10 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -105,8 +105,10 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
private
String
wechatLinkPrefix
;
private
String
wechatLinkPrefix
;
private
final
static
String
PERSONAL_STAGE_PROJECT_PROGRESS_TEMPLATE
=
"${PROGRESS_URL}"
;
private
final
static
String
PERSONAL_STAGE_PROJECT_PROGRESS_TEMPLATE
=
"${PROGRESS_URL}"
;
//需求单链接替换符
private
final
static
String
PERSONAL_STAGE_PAPER_TEMPLATE
=
"${PROGRESS_URL&ProgressId}"
;
private
final
static
String
PERSONAL_STAGE_PAPER_TEMPLATE
=
"${PROGRESS_URL&ProgressId}"
;
//需求单链接替换符
private
final
static
String
PERSONAL_STAGE_PAPER_TEMPLATE1
=
"${PROGRESS_URL&ProgressId}"
;
// 项目进度路由
// 项目进度路由
private
final
static
String
PERSONAL_STAGE_PROJECT_PROGRESS
=
"/personalCenter/projectProgress"
;
private
final
static
String
PERSONAL_STAGE_PROJECT_PROGRESS
=
"/personalCenter/projectProgress"
;
...
@@ -531,9 +533,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -531,9 +533,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
return
;
return
;
}
}
//替换需求定制单链接
//替换需求定制单链接
if
(
null
!=
personalStageReply
.
getPaperId
())
{
this
.
replacePaperUrl
(
items
,
robotId
,
userWxId
,
personalStageReply
.
getPaperId
());
this
.
replacePaperUrl
(
items
,
robotId
,
userWxId
,
personalStageReply
.
getPaperId
());
}
sendReplyItems
(
items
,
robotId
,
userWxId
,
ip
,
personalStageUserId
);
sendReplyItems
(
items
,
robotId
,
userWxId
,
ip
,
personalStageUserId
);
}
}
...
@@ -556,13 +556,19 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -556,13 +556,19 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
@ParamLog
(
"替换需求定制单链接"
)
@ParamLog
(
"替换需求定制单链接"
)
private
void
replacePaperUrl
(
List
<
PersonalStageReplyItem
>
items
,
String
robotId
,
String
userWxId
,
Long
paperId
){
private
void
replacePaperUrl
(
List
<
PersonalStageReplyItem
>
items
,
String
robotId
,
String
userWxId
,
Long
paperId
){
for
(
PersonalStageReplyItem
item
:
items
){
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
item
.
getReplyType
())){
if
(
null
==
paperId
){
if
(
null
==
paperId
){
item
.
setContent
(
item
.
getContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE
,
""
));
item
.
setContent
(
item
.
getContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE1
,
""
));
return
;
return
;
}
}
for
(
PersonalStageReplyItem
item
:
items
){
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
item
.
getReplyType
())){
String
longUrl
=
wechatLinkPrefix
.
concat
(
PERSONAL_STAGE_PAPER
).
concat
(
paperId
.
toString
()).
concat
(
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotId
);
String
longUrl
=
wechatLinkPrefix
.
concat
(
PERSONAL_STAGE_PAPER
).
concat
(
paperId
.
toString
()).
concat
(
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotId
);
item
.
setContent
(
item
.
getContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE
,
UrlUtils
.
getShortUrl4Own
(
longUrl
)));
//由于前端给的替换符中的“&”可能会是“&”,所以两种替换符都要换掉
String
shortLink
=
UrlUtils
.
getShortUrl4Own
(
longUrl
);
item
.
setContent
(
item
.
getContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE
,
shortLink
));
item
.
setContent
(
item
.
getContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE1
,
shortLink
));
}
}
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
View file @
aa3646c9
...
@@ -42,6 +42,7 @@ import com.pcloud.common.page.PageParam;
...
@@ -42,6 +42,7 @@ import com.pcloud.common.page.PageParam;
import
com.pcloud.common.utils.DateNewUtils
;
import
com.pcloud.common.utils.DateNewUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
...
@@ -98,6 +99,15 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -98,6 +99,15 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
@Value
(
"${system.env}"
)
@Value
(
"${system.env}"
)
private
String
envStr
;
private
String
envStr
;
@Value
(
"${wechat.group.link.prefix}"
)
private
String
wechatLinkPrefix
;
//需求单链接替换符
private
final
static
String
PERSONAL_STAGE_PAPER_TEMPLATE
=
"${PROGRESS_URL&ProgressId}"
;
//需求单链接替换符
private
final
static
String
PERSONAL_STAGE_PAPER_TEMPLATE1
=
"${PROGRESS_URL&ProgressId}"
;
//需求定制单路由 https://wechat666.raysgo.com/personalCenter/questionNaire?paperId=679
private
final
static
String
PERSONAL_STAGE_PAPER
=
"/personalCenter/questionNaire?paperId="
;
@Override
@Override
@ParamLog
(
"新增阶段跳转"
)
@ParamLog
(
"新增阶段跳转"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -375,6 +385,10 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -375,6 +385,10 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
LOGGER
.
info
(
"没有该跳转衔接语!"
);
LOGGER
.
info
(
"没有该跳转衔接语!"
);
return
;
return
;
}
}
List
<
PersonalStageJumpLinkup
>
list
=
new
ArrayList
<>();
list
.
add
(
jumpLinkup
);
this
.
replacePaperUrl
(
list
,
linkupDelayDTO
.
getRobotId
(),
linkupDelayDTO
.
getWxId
(),
jumpLinkup
.
getPersonalStageJumpId
());
jumpLinkup
=
list
.
get
(
0
);
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
jumpLinkup
.
getReplyType
())){
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
jumpLinkup
.
getReplyType
())){
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
sendTextMessageVO
.
setContent
(
personalStageBiz
.
replaceProjectProgressUrl
(
jumpLinkup
.
getLinkupContent
(),
linkupDelayDTO
.
getRobotId
(),
linkupDelayDTO
.
getWxId
(),
linkupDelayDTO
.
getPersonalStageUserId
()));
sendTextMessageVO
.
setContent
(
personalStageBiz
.
replaceProjectProgressUrl
(
jumpLinkup
.
getLinkupContent
(),
linkupDelayDTO
.
getRobotId
(),
linkupDelayDTO
.
getWxId
(),
linkupDelayDTO
.
getPersonalStageUserId
()));
...
@@ -547,6 +561,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -547,6 +561,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
if
(
ListUtils
.
isEmpty
(
linkups
)){
if
(
ListUtils
.
isEmpty
(
linkups
)){
return
;
return
;
}
}
this
.
replacePaperUrl
(
linkups
,
robotWxId
,
userWxId
,
jumpId
);
for
(
PersonalStageJumpLinkup
jumpLinkup
:
linkups
){
for
(
PersonalStageJumpLinkup
jumpLinkup
:
linkups
){
if
(
jumpLinkup
.
getToStageStartTime
()!=
null
&&
jumpLinkup
.
getToStageStartTime
()>
0
){
if
(
jumpLinkup
.
getToStageStartTime
()!=
null
&&
jumpLinkup
.
getToStageStartTime
()>
0
){
LinkupDelayDTO
linkupDelayDTO
=
new
LinkupDelayDTO
();
LinkupDelayDTO
linkupDelayDTO
=
new
LinkupDelayDTO
();
...
@@ -588,4 +603,30 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -588,4 +603,30 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
updateStageUser
.
setUpdateTime
(
new
Date
());
updateStageUser
.
setUpdateTime
(
new
Date
());
personalStageUserDao
.
update
(
updateStageUser
);
personalStageUserDao
.
update
(
updateStageUser
);
}
}
@ParamLog
(
"替换需求定制单链接"
)
private
void
replacePaperUrl
(
List
<
PersonalStageJumpLinkup
>
linkups
,
String
robotId
,
String
userWxId
,
Long
jumpId
){
PersonalStageJumpDto
stageJump
=
personalStageJumpDao
.
getDtoById
(
jumpId
);
if
(
null
==
stageJump
){
return
;
}
PersonalStage
personalStage
=
personalStageDao
.
getById
(
stageJump
.
getPersonalStageId
());
if
(
null
==
personalStage
){
return
;
}
for
(
PersonalStageJumpLinkup
linkup
:
linkups
){
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
linkup
.
getReplyType
())){
if
(
null
==
personalStage
.
getPaperId
()){
linkup
.
setLinkupContent
(
linkup
.
getLinkupContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE
,
""
));
linkup
.
setLinkupContent
(
linkup
.
getLinkupContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE1
,
""
));
continue
;
}
String
longUrl
=
wechatLinkPrefix
.
concat
(
PERSONAL_STAGE_PAPER
).
concat
(
personalStage
.
getPaperId
().
toString
()).
concat
(
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotId
);
//由于前端给的替换符中的“&”可能会是“&”,所以两种替换符都要换掉
String
shortLink
=
UrlUtils
.
getShortUrl4Own
(
longUrl
);
linkup
.
setLinkupContent
(
linkup
.
getLinkupContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE
,
shortLink
));
linkup
.
setLinkupContent
(
linkup
.
getLinkupContent
().
replace
(
PERSONAL_STAGE_PAPER_TEMPLATE1
,
shortLink
));
}
}
}
}
}
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