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
db42952e
Commit
db42952e
authored
Dec 26, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人号特殊出版社获取小号逻辑修改
parent
41342533
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
16 deletions
+32
-16
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+3
-2
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+29
-14
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
db42952e
...
...
@@ -22,6 +22,7 @@ import com.pcloud.wechatgroup.message.service.MessageService;
import
com.pcloud.wechatgroup.monitor.service.MonitorService
;
import
com.pcloud.wechatgroup.selfrobot.dto.AltAndUserDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.AltAndUserResultDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.AvailableRobotParamDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.RobotBaseInfoDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.SelfRobotDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.UserRobotDTO
;
...
...
@@ -361,10 +362,10 @@ public class WechatGroupConsr {
}
@ParamLog
(
value
=
"获取可用机器人"
)
public
SelfRobotDTO
getAvailableRobotByBookGroup
(
Long
wechatUserId
,
Integer
largeTemplet
,
Long
bookGroupId
)
{
public
SelfRobotDTO
getAvailableRobotByBookGroup
(
AvailableRobotParamDTO
availableRobotParamDTO
)
{
SelfRobotDTO
selfRobotDTO
=
null
;
try
{
selfRobotDTO
=
ResponseHandleUtil
.
parseResponse
(
selfRobotService
.
getAvailableRobotByBookGroup
(
wechatUserId
,
largeTemplet
,
bookGroupId
),
SelfRobotDTO
.
class
);
selfRobotDTO
=
ResponseHandleUtil
.
parseResponse
(
selfRobotService
.
getAvailableRobotByBookGroup
(
availableRobotParamDTO
),
SelfRobotDTO
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取可用机器人.[getAvailableRobotByBookGroup]:"
+
e
.
getMessage
(),
e
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
db42952e
...
...
@@ -174,6 +174,7 @@ import com.pcloud.wechatgroup.message.dto.SendTextDTO;
import
com.pcloud.wechatgroup.message.dto.UserChatCountDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.AltAndUserDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.AltAndUserResultDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.AvailableRobotParamDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.RobotBaseInfoDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.SelfRobotDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.UserRobotDTO
;
...
...
@@ -1427,26 +1428,40 @@ public class BookGroupBizImpl implements BookGroupBiz {
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"adviserId"
,
bookGroupDTO
.
getCreateUser
());
paramMap
.
put
(
"channelId"
,
bookGroupDTO
.
getChannelId
());
Integer
largeTemplet
;
//判断是否为定制出版社
Boolean
specail
=
false
;
Long
agentId
=
bookGroupDTO
.
getAgentId
();
List
<
String
>
specialAgentIds
=
wechatGroupConsr
.
getRobotListByLargeTemplet
(
LargeTempletEnum
.
SPECIAL_AGENT
.
code
);
if
(
specialAgentIds
.
contains
(
agentId
))
{
specail
=
true
;
}
if
(
specail
)
{
largeTemplet
=
LargeTempletEnum
.
SPECIAL_AGENT
.
code
;
}
else
{
BookDto
bookDto
=
bookDao
.
getById
(
paramMap
);
Long
templetId
=
bookDto
.
getTempletId
();
//根据分类id获取大类
TempletRelevance
templetRelevance
=
templetRelevanceDao
.
getByTempletId
(
templetId
);
LOGGER
.
info
(
"根据分类id获取大类templetRelevance"
+
templetRelevance
.
toString
());
largeTemplet
=
templetRelevance
.
getLargeTemplet
();
Integer
largeTemplet
=
templetRelevance
.
getLargeTemplet
();
List
<
Long
>
labelIds
=
new
ArrayList
<>();
if
(
null
!=
bookGroupDTO
.
getProLabelId
())
{
labelIds
.
add
(
bookGroupDTO
.
getProLabelId
());
}
if
(
null
!=
bookGroupDTO
.
getDepLabelId
())
{
labelIds
.
add
(
bookGroupDTO
.
getDepLabelId
());
}
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
Map
<
Long
,
String
>
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
if
(!
MapUtils
.
isEmpty
(
labelMap
))
{
if
(
null
!=
bookGroupDTO
.
getProLabelId
()
&&
labelMap
.
containsKey
(
bookGroupDTO
.
getProLabelId
()))
{
bookGroupDTO
.
setProLabelName
(
labelMap
.
get
(
bookGroupDTO
.
getProLabelId
()));
}
if
(
null
!=
bookGroupDTO
.
getDepLabelId
()
&&
labelMap
.
containsKey
(
bookGroupDTO
.
getDepLabelId
()))
{
bookGroupDTO
.
setDepLabelName
(
labelMap
.
get
(
bookGroupDTO
.
getDepLabelId
()));
}
}
}
Long
agentId
=
bookGroupDTO
.
getAgentId
();
//根据bookGroupId获取机器人
SelfRobotDTO
selfRobotDTO
=
wechatGroupConsr
.
getAvailableRobotByBookGroup
(
wechatUserId
,
largeTemplet
,
bookGroupId
);
AvailableRobotParamDTO
availableRobotParamDTO
=
new
AvailableRobotParamDTO
();
availableRobotParamDTO
.
setAgentId
(
agentId
);
availableRobotParamDTO
.
setBookGroupId
(
bookGroupId
);
availableRobotParamDTO
.
setWechatUserId
(
wechatUserId
);
availableRobotParamDTO
.
setLargeTemplet
(
largeTemplet
);
availableRobotParamDTO
.
setGrade
(
bookGroupDTO
.
getDepLabelName
());
availableRobotParamDTO
.
setSubject
(
bookGroupDTO
.
getProLabelName
());
SelfRobotDTO
selfRobotDTO
=
wechatGroupConsr
.
getAvailableRobotByBookGroup
(
availableRobotParamDTO
);
if
(
selfRobotDTO
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"未找到机器人!"
);
}
...
...
@@ -1455,7 +1470,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
ownAltQrcodeInfoDTO
.
setAltNickName
(
selfRobotDTO
.
getNickName
());
ownAltQrcodeInfoDTO
.
setAltQrcodeUrl
(
selfRobotDTO
.
getQrcodeUrl
());
ownAltQrcodeInfoDTO
.
setAltHeadUrl
(
selfRobotDTO
.
getHeadPic
());
if
(
s
pecail
)
{
if
(
s
elfRobotDTO
.
getAgentRobot
()!=
null
&&
selfRobotDTO
.
getAgentRobot
()
)
{
//先查询有没有重复的
String
altId
=
""
;
BookGroupAgentRecord
old
=
bookGroupAgentRecordDao
.
getByAltIdAndBookGroupId
(
altId
,
bookGroupId
);
...
...
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