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
8d26d422
Commit
8d26d422
authored
Jul 08, 2019
by
裴大威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat 1001092
parent
ed4929c3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
7 deletions
+61
-7
BookKeywordBiz.java
...ain/java/com/pcloud/book/keywords/biz/BookKeywordBiz.java
+2
-0
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+56
-3
BookKeywordFacade.java
...va/com/pcloud/book/keywords/facade/BookKeywordFacade.java
+1
-1
BookKeywordFacadeImpl.java
...loud/book/keywords/facade/impl/BookKeywordFacadeImpl.java
+2
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/BookKeywordBiz.java
View file @
8d26d422
...
@@ -26,6 +26,8 @@ public interface BookKeywordBiz {
...
@@ -26,6 +26,8 @@ public interface BookKeywordBiz {
*/
*/
void
insertKeyword
(
SetKeywordVO
setKeywordVO
);
void
insertKeyword
(
SetKeywordVO
setKeywordVO
);
void
insertKeywords
(
List
<
SetKeywordVO
>
setKeywordVOs
,
Long
partyId
);
/**
/**
* @Author:lili
* @Author:lili
* @Desr:更新关键词
* @Desr:更新关键词
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
8d26d422
...
@@ -55,6 +55,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -55,6 +55,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -159,6 +160,20 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -159,6 +160,20 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
bookKeywordDao
.
insert
(
bookKeyword
);
bookKeywordDao
.
insert
(
bookKeyword
);
}
}
@Override
@ParamLog
(
"批量新增关键词"
)
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
void
insertKeywords
(
List
<
SetKeywordVO
>
setKeywordVOs
,
Long
partyId
)
{
if
(
CollectionUtils
.
isEmpty
(
setKeywordVOs
)
||
null
==
partyId
)
{
log
.
info
(
"[insertKeywords] : setKeywordVOs:{}, partyId:{}"
,
setKeywordVOs
,
partyId
);
return
;
}
for
(
SetKeywordVO
vo
:
setKeywordVOs
)
{
vo
.
setUserId
(
partyId
);
this
.
insertKeyword
(
vo
);
}
}
@ParamLog
(
"校验关键词是否重复"
)
@ParamLog
(
"校验关键词是否重复"
)
private
void
checkKeyword
(
String
keywords
,
Long
classifyId
,
Long
bookGroupId
,
Long
keywordId
)
{
private
void
checkKeyword
(
String
keywords
,
Long
classifyId
,
Long
bookGroupId
,
Long
keywordId
)
{
Boolean
isHaveKeyword
=
bookKeywordDao
.
checkKeyword
(
keywords
,
classifyId
,
bookGroupId
,
keywordId
);
Boolean
isHaveKeyword
=
bookKeywordDao
.
checkKeyword
(
keywords
,
classifyId
,
bookGroupId
,
keywordId
);
...
@@ -242,6 +257,43 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -242,6 +257,43 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
if
(
keywords
==
null
)
{
if
(
keywords
==
null
)
{
return
new
PageBeanNew
<>(
listKeywordParam
.
getCurrentPage
(),
listKeywordParam
.
getNumPerPage
(),
new
ArrayList
<>());
return
new
PageBeanNew
<>(
listKeywordParam
.
getCurrentPage
(),
listKeywordParam
.
getNumPerPage
(),
new
ArrayList
<>());
}
}
final
List
<
Long
>
appIds
=
Lists
.
newArrayList
();
final
List
<
Long
>
productIds
=
Lists
.
newArrayList
();
for
(
ListKeywordVO
vo
:
keywords
.
getRecordList
())
{
if
(
"APP"
.
equalsIgnoreCase
(
vo
.
getServeType
()))
{
appIds
.
add
(
vo
.
getServeId
());
}
if
(
"PRODUCT"
.
equalsIgnoreCase
(
vo
.
getServeType
()))
{
productIds
.
add
(
vo
.
getServeId
());
}
}
Map
<
Long
,
AppDto
>
app
=
Maps
.
newHashMap
();
if
(!
CollectionUtils
.
isEmpty
(
appIds
))
{
app
=
appConsr
.
mapBaseByIds
(
appIds
);
}
Map
<
Long
,
ProductDto
>
proBasesByIds
=
Maps
.
newHashMap
();
if
(!
CollectionUtils
.
isEmpty
(
productIds
))
{
proBasesByIds
=
productConsr
.
getProBasesByIds
(
productIds
);
}
final
BookGroupDTO
dtoById
=
bookGroupDao
.
getDTOById
(
listKeywordParam
.
getBookGroupId
());
for
(
ListKeywordVO
vo
:
keywords
.
getRecordList
())
{
if
(
"APP"
.
equalsIgnoreCase
(
vo
.
getServeType
()))
{
final
AppDto
appDto
=
app
.
get
(
vo
.
getServeId
());
if
(
null
==
appDto
)
{
continue
;
}
vo
.
setChannelId
(
appDto
.
getChannelId
());
vo
.
setTypeCode
(
appDto
.
getTypeCode
());
}
if
(
"PRODUCT"
.
equalsIgnoreCase
(
vo
.
getServeType
()))
{
final
ProductDto
productDto
=
proBasesByIds
.
get
(
vo
.
getServeId
());
if
(
null
==
productDto
||
null
==
productDto
.
getProductTypeDto
())
{
continue
;
}
vo
.
setChannelId
(
dtoById
.
getChannelId
());
vo
.
setTypeCode
(
productDto
.
getProductTypeDto
().
getTypeCode
());
}
}
return
keywords
;
return
keywords
;
}
}
...
@@ -291,9 +343,10 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -291,9 +343,10 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
log
.
info
(
"[接收用户发送文本消息] keywordDao.getByKeyword耗时:{}ms "
,
System
.
currentTimeMillis
()
-
l1
);
log
.
info
(
"[接收用户发送文本消息] keywordDao.getByKeyword耗时:{}ms "
,
System
.
currentTimeMillis
()
-
l1
);
}
}
if
(
replyKeywordDTO
==
null
)
{
if
(
replyKeywordDTO
==
null
)
{
log
.
info
(
"[关键词消息回复]
classifyQrcodeInfo
is null"
);
log
.
info
(
"[关键词消息回复]
replyKeywordDTO
is null"
);
return
;
return
;
}
}
log
.
info
(
"[关键词回复原始数据] : sendKeywordMessage replyKeywordDTO :{}, robotId:{}, weixinGroupId:{}"
,
replyKeywordDTO
,
robotId
,
weixinGroupId
);
// 处理链接地址
// 处理链接地址
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
())
||
ReplyTypeEnum
.
LINK
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
()))
{
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
())
||
ReplyTypeEnum
.
LINK
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
()))
{
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
classifyQrcodeInfo
.
getChannelId
());
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
classifyQrcodeInfo
.
getChannelId
());
...
@@ -304,7 +357,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -304,7 +357,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
if
(
redisContent
!=
null
)
{
if
(
redisContent
!=
null
)
{
final
long
l1
=
System
.
currentTimeMillis
();
final
long
l1
=
System
.
currentTimeMillis
();
insertBookKeywordRecord
(
classifyQrcodeInfo
,
replyKeywordDTO
.
getKeywordId
(),
userWxId
,
weixinGroupId
,
false
);
insertBookKeywordRecord
(
classifyQrcodeInfo
,
replyKeywordDTO
.
getKeywordId
(),
userWxId
,
weixinGroupId
,
false
);
log
.
info
(
"[
接收用户发送文本消息] redisContent != null insertBookKeywordRecord耗时:{}ms "
,
System
.
currentTimeMillis
()
-
l1
);
log
.
info
(
"[
关键词消息回复] redisContent:{} insertBookKeywordRecord return"
,
redisContent
);
return
;
return
;
}
else
{
}
else
{
final
long
l1
=
System
.
currentTimeMillis
();
final
long
l1
=
System
.
currentTimeMillis
();
...
@@ -318,7 +371,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -318,7 +371,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
log
.
info
(
"[关键词消息回复] robotId is null content:{}, robotId:{},weixinGroupId:{}"
,
content
,
robotId
,
weixinGroupId
);
log
.
info
(
"[关键词消息回复] robotId is null content:{}, robotId:{},weixinGroupId:{}"
,
content
,
robotId
,
weixinGroupId
);
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
weixinGroupId
);
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
weixinGroupId
);
}
}
final
long
l2
=
System
.
currentTimeMillis
(
);
log
.
info
(
"[关键词回复发送数据] : sendKeywordMessage replyKeywordDTO :{}, robotId:{}, weixinGroupId:{}"
,
replyKeywordDTO
,
robotId
,
weixinGroupId
);
SendWeixinRequestTools
.
sendKeywordMessage
(
replyKeywordDTO
,
robotId
,
weixinGroupId
);
SendWeixinRequestTools
.
sendKeywordMessage
(
replyKeywordDTO
,
robotId
,
weixinGroupId
);
log
.
info
(
"[接收用户发送文本消息] SendWeixinRequestTools.sendKeywordMessage耗时:{}ms "
,
System
.
currentTimeMillis
()
-
l2
);
log
.
info
(
"[接收用户发送文本消息] SendWeixinRequestTools.sendKeywordMessage耗时:{}ms "
,
System
.
currentTimeMillis
()
-
l2
);
//新增关键词触发记录
//新增关键词触发记录
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/facade/BookKeywordFacade.java
View file @
8d26d422
...
@@ -41,7 +41,7 @@ public interface BookKeywordFacade {
...
@@ -41,7 +41,7 @@ public interface BookKeywordFacade {
@ApiImplicitParam
(
name
=
"setKeywordVO"
,
value
=
"设置关键词"
,
dataType
=
"SetKeywordVO"
,
paramType
=
"body"
)
@ApiImplicitParam
(
name
=
"setKeywordVO"
,
value
=
"设置关键词"
,
dataType
=
"SetKeywordVO"
,
paramType
=
"body"
)
})
})
@PostMapping
(
"insertKeyword"
)
@PostMapping
(
"insertKeyword"
)
ResponseDto
<?>
insertKeyword
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
SetKeywordVO
setKeywordVO
)
ResponseDto
<?>
insertKeyword
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
List
<
SetKeywordVO
>
setKeywordVOs
)
throws
BizException
,
PermissionException
;
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"更新关键词"
,
httpMethod
=
"POST"
)
@ApiOperation
(
value
=
"更新关键词"
,
httpMethod
=
"POST"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/facade/impl/BookKeywordFacadeImpl.java
View file @
8d26d422
...
@@ -43,10 +43,9 @@ public class BookKeywordFacadeImpl implements BookKeywordFacade {
...
@@ -43,10 +43,9 @@ public class BookKeywordFacadeImpl implements BookKeywordFacade {
@Override
@Override
@PostMapping
(
"insertKeyword"
)
@PostMapping
(
"insertKeyword"
)
public
ResponseDto
<?>
insertKeyword
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
SetKeywordVO
setKeywordVO
)
throws
BizException
,
PermissionException
{
public
ResponseDto
<?>
insertKeyword
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
List
<
SetKeywordVO
>
setKeywordVOs
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
setKeywordVO
.
setUserId
(
partyId
);
bookKeywordBiz
.
insertKeywords
(
setKeywordVOs
,
partyId
);
bookKeywordBiz
.
insertKeyword
(
setKeywordVO
);
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
...
...
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