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
9b49d486
Commit
9b49d486
authored
Mar 05, 2020
by
zhuyajie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
书名信息带入需求单
parent
9536bcc3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
0 deletions
+62
-0
PersonalStageJumpBiz.java
...m/pcloud/book/personalstage/biz/PersonalStageJumpBiz.java
+11
-0
PersonalStageBizImpl.java
...oud/book/personalstage/biz/impl/PersonalStageBizImpl.java
+18
-0
PersonalStageJumpBizImpl.java
...book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
+19
-0
PersonalStageFacade.java
...pcloud/book/personalstage/facade/PersonalStageFacade.java
+14
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/PersonalStageJumpBiz.java
View file @
9b49d486
...
...
@@ -7,6 +7,9 @@ import com.pcloud.book.personalstage.vo.request.UpdateStageJumpRequestVO;
import
com.pcloud.common.core.mq.DelayQueueDTO
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
import
java.util.Map
;
public
interface
PersonalStageJumpBiz
{
/**
* 新建阶段跳转
...
...
@@ -48,4 +51,12 @@ public interface PersonalStageJumpBiz {
boolean
handlePersonalStagePaperJump
(
String
userWxId
,
String
robotWxId
,
Long
paperId
);
void
sendPaperEmail
(
String
userWxId
,
String
robotWxId
);
/**
* 获取阶段设置期间用户输入的需求单信息
* @param robotWxId
* @param userWxId
* @return
*/
Map
<
String
,
Object
>
getUserInputPaperInfo
(
String
robotWxId
,
String
userWxId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageBizImpl.java
View file @
9b49d486
...
...
@@ -694,6 +694,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
content
=
content
.
replace
(
PersonalStageConstant
.
PERSONAL_STAGE_PROJECT_PROGRESS_TEMPLATE
,
UrlUtils
.
getShortUrl4Own
(
longUrl
));
}
content
=
replaceUserSendContent
(
content
,
robotId
,
userWxId
);
content
=
replaceReadingStyle
(
content
,
robotId
,
userWxId
);
return
content
;
}
...
...
@@ -715,6 +716,23 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
return
content
;
}
@ParamLog
(
"替换阅读偏好"
)
public
String
replaceReadingStyle
(
String
linkupContent
,
String
robotWxId
,
String
userWxId
){
if
(
linkupContent
.
indexOf
(
"${readingStyle="
)>-
1
){
Integer
serchch
=
linkupContent
.
indexOf
(
"${readingStyle="
);
String
readingStyle
=
linkupContent
.
substring
(
serchch
+
15
,
serchch
+
19
);
String
content
=
linkupContent
.
substring
(
serchch
,
serchch
+
20
);
if
(!
StringUtil
.
isEmpty
(
readingStyle
)
&&
!
StringUtil
.
isEmpty
(
content
)){
//保持用户输入的内容
String
key
=
"BOOK:READING_STYLE:"
+
userWxId
+
"-"
+
robotWxId
;
JedisClusterUtils
.
setJson
(
key
,
readingStyle
);
//去掉衔接语这种替换符 ${readingStyle=xxxx}
linkupContent
=
linkupContent
.
replace
(
content
,
readingStyle
);
}
}
return
linkupContent
;
}
@ParamLog
(
"替换需求定制单链接"
)
private
void
replacePaperUrl
(
List
<
PersonalStageReplyItem
>
items
,
String
robotId
,
String
userWxId
,
Long
paperId
){
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
View file @
9b49d486
...
...
@@ -42,6 +42,7 @@ import com.pcloud.common.page.PageParam;
import
com.pcloud.common.utils.DateNewUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
...
...
@@ -629,4 +630,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
}
}
}
@Override
public
Map
<
String
,
Object
>
getUserInputPaperInfo
(
String
robotWxId
,
String
userWxId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//书名
String
bookKey
=
"BOOK:USER_SEND_CONTENT:"
+
userWxId
+
"-"
+
robotWxId
;
String
userSendContent
=
JedisClusterUtils
.
getJson
(
bookKey
,
String
.
class
);
//阅读偏好
String
readingKey
=
"BOOK:READING_STYLE:"
+
userWxId
+
"-"
+
robotWxId
;
String
readingStyle
=
JedisClusterUtils
.
getJson
(
readingKey
,
String
.
class
);
if
(!
StringUtil
.
isEmpty
(
userSendContent
)){
map
.
put
(
"书名"
,
userSendContent
);
}
if
(!
StringUtil
.
isEmpty
(
readingStyle
)){
map
.
put
(
"阅读偏好"
,
readingStyle
);
}
return
map
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/facade/PersonalStageFacade.java
View file @
9b49d486
...
...
@@ -16,6 +16,7 @@ import com.pcloud.common.utils.SessionUtil;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.book.personalstage.biz.PersonalStageJumpBiz
;
import
com.pcloud.common.utils.string.StringUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Api
(
"定制化阶段"
)
...
...
@@ -239,4 +241,16 @@ public class PersonalStageFacade {
return
new
ResponseDto
<>(
personalStageBiz
.
getCurrentPersonalStage
(
wxId
,
robotId
));
}
@ApiOperation
(
"获取阶段设置期间用户输入的需求单信息"
)
@GetMapping
(
"getUserInputPaperInfo"
)
public
ResponseDto
<?>
getUserInputPaperInfo
(
@RequestParam
(
"robotWxId"
)
@ApiParam
(
"小号id"
)
String
robotWxId
,
@RequestParam
(
"userWxId"
)
@ApiParam
(
"用户id"
)
String
userWxId
){
if
(
StringUtil
.
isEmpty
(
robotWxId
)
||
StringUtil
.
isEmpty
(
userWxId
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少用户或小号id"
);
}
Map
<
String
,
Object
>
map
=
personalStageJumpBiz
.
getUserInputPaperInfo
(
robotWxId
,
userWxId
);
return
new
ResponseDto
<>(
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