Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
d8142607
提交
d8142607
authored
6月 03, 2024
作者:
典文龙
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加成功次数和失败信息
上级
0d88aedd
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
80 行增加
和
25 行删除
+80
-25
AccountDistributeRecord.java
...com/yaoyaozw/customer/entity/AccountDistributeRecord.java
+46
-14
MyExecutorDistributeServiceImpl.java
...ustomer/service/impl/MyExecutorDistributeServiceImpl.java
+25
-6
AccountDistributeLogVO.java
...java/com/yaoyaozw/customer/vo/AccountDistributeLogVO.java
+2
-0
AccountDistributeLogMapper.xml
src/main/resources/mapper/AccountDistributeLogMapper.xml
+7
-5
没有找到文件。
src/main/java/com/yaoyaozw/customer/entity/AccountDistributeRecord.java
浏览文件 @
d8142607
...
...
@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.annotation.*;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.*
;
/**
* @Author: Dwl
...
...
@@ -46,42 +44,76 @@ public class AccountDistributeRecord implements Serializable {
*/
@TableField
(
value
=
"gmt_modified"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
gmtModified
;
/**
* 成功次数
*/
private
Integer
successCount
;
/**
* 失败的原因
*/
private
String
reason
;
private
static
final
long
serialVersionUID
=
1L
;
public
void
saveDistribute
(
Long
authId
,
Long
targetId
,
List
<
String
>
functionName
,
Long
createUser
)
{
public
void
saveDistribute
(
Long
authId
,
Long
targetId
,
List
<
String
>
functionName
,
Long
createUser
,
Integer
count
,
Map
<
String
,
String
>
reasonMap
)
{
this
.
authId
=
authId
;
this
.
targetAuthId
=
targetId
;
this
.
functionName
=
groupName
(
functionName
);
this
.
createUser
=
createUser
;
this
.
successCount
=
count
;
this
.
reason
=
getReasonMapInfo
(
functionName
,
reasonMap
);
this
.
gmtCreate
=
new
Date
();
this
.
gmtModified
=
new
Date
();
}
public
String
typeNameMap
(
String
type
)
{
Map
<
String
,
String
>
nameMap
=
new
HashMap
<>();
nameMap
.
put
(
"1"
,
"关回"
);
nameMap
.
put
(
"2"
,
"关键词"
);
nameMap
.
put
(
"3"
,
"延时客服"
);
nameMap
.
put
(
"4"
,
"菜单管理"
);
return
nameMap
.
get
(
type
);
}
private
String
getReasonMapInfo
(
List
<
String
>
functionName
,
Map
<
String
,
String
>
reasonMap
)
{
String
name
;
List
<
String
>
nameList
=
new
ArrayList
<>(
reasonMap
.
size
());
for
(
String
type
:
functionName
)
{
name
=
typeNameMap
(
type
)
+
reasonMap
.
get
(
type
);
nameList
.
add
(
name
);
}
if
(
nameList
.
isEmpty
())
{
return
""
;
}
return
nameList
.
toString
();
}
private
String
groupName
(
List
<
String
>
functionName
)
{
String
name
=
""
;
for
(
String
s
:
functionName
)
{
switch
(
s
)
{
String
Builder
name
=
new
StringBuilder
()
;
for
(
String
type
:
functionName
)
{
switch
(
type
)
{
case
"1"
:
name
+=
"关回, "
;
name
.
append
(
"关回, "
)
;
break
;
case
"2"
:
name
+=
"关键词, "
;
name
.
append
(
"关键词, "
)
;
break
;
case
"3"
:
name
+=
"延时客服, "
;
name
.
append
(
"延时客服, "
)
;
break
;
case
"4"
:
name
+=
"菜单管理, "
;
name
.
append
(
"菜单管理, "
)
;
break
;
default
:
break
;
}
}
if
(
!
name
.
isEmpty
()
)
{
name
=
n
ame
.
substring
(
0
,
name
.
length
()
-
2
);
if
(
name
.
length
()
>
0
)
{
name
=
n
ew
StringBuilder
(
name
.
substring
(
0
,
name
.
length
()
-
2
)
);
}
return
name
;
return
name
.
toString
()
;
}
}
src/main/java/com/yaoyaozw/customer/service/impl/MyExecutorDistributeServiceImpl.java
浏览文件 @
d8142607
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yaoyaozw.customer.common.BaseResult
;
import
com.yaoyaozw.customer.dto.DistributeDTO
;
import
com.yaoyaozw.customer.dto.MenuMainCopyDTO
;
import
com.yaoyaozw.customer.dto.follow.FollowReplyCopyDTO
;
...
...
@@ -15,7 +16,9 @@ import org.springframework.context.annotation.Lazy;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -53,7 +56,8 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
List
<
String
>
targetApp
=
targetAuthList
.
stream
().
map
(
AuthInfoVO:
:
getAppId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
idList
=
targetAuthList
.
stream
().
map
(
AuthInfoVO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
typeList
=
distributeDTO
.
getTypeList
();
Map
<
String
,
String
>
reasonMap
=
new
HashMap
<>();
Integer
count
=
0
;
try
{
for
(
String
type
:
typeList
)
{
switch
(
type
)
{
...
...
@@ -62,7 +66,8 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
try
{
log
.
info
(
"开始关回复用"
);
FollowReplyCopyDTO
followReplyCopyDTO
=
new
FollowReplyCopyDTO
(
sourceAuth
,
targetAuthList
);
followReplyService
.
copy
(
followReplyCopyDTO
);
BaseResult
result
=
followReplyService
.
copy
(
followReplyCopyDTO
);
count
=
statusLog
(
result
,
count
,
type
,
reasonMap
);
log
.
info
(
"关回复用结束"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"Off reply failed: {}"
,
e
.
getMessage
(),
e
);
...
...
@@ -75,7 +80,8 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
log
.
info
(
"开始关键词复用"
);
CustomerKeywordCopyDTO
customerKeywordCopyDTO
=
new
CustomerKeywordCopyDTO
();
customerKeywordCopyDTO
.
replace
(
sourceAuth
,
targetAuthList
,
targetAppList
);
keywordService
.
copy
(
customerKeywordCopyDTO
);
BaseResult
result
=
keywordService
.
copy
(
customerKeywordCopyDTO
);
count
=
statusLog
(
result
,
count
,
type
,
reasonMap
);
log
.
info
(
"关键词复用结束"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"Keyword reuse failure: {}"
,
e
.
getMessage
(),
e
);
...
...
@@ -86,7 +92,8 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
try
{
log
.
info
(
"开始延时客服复用"
);
removeBatch
(
distributeDTO
.
appIds
(),
type
,
new
ArrayList
<>());
customerGraphicsDelayService
.
copy
(
sourceAuth
.
getAppId
(),
""
,
""
,
null
,
targetApp
);
BaseResult
result
=
customerGraphicsDelayService
.
copy
(
sourceAuth
.
getAppId
(),
""
,
""
,
null
,
targetApp
);
count
=
statusLog
(
result
,
count
,
type
,
reasonMap
);
log
.
info
(
"延时客服复用结束"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"Delayed customer service reuse failure: {}"
,
e
.
getMessage
(),
e
);
...
...
@@ -99,7 +106,8 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
removeBatch
(
distributeDTO
.
appIds
(),
type
,
distributeDTO
.
getAuthIds
());
MenuMainCopyDTO
menuMainCopyDTO
=
new
MenuMainCopyDTO
();
menuMainCopyDTO
.
addList
(
sourceAuth
.
getId
(),
idList
);
menuFeignClient
.
copy
(
menuMainCopyDTO
);
BaseResult
result
=
menuFeignClient
.
copy
(
menuMainCopyDTO
);
count
=
statusLog
(
result
,
count
,
type
,
reasonMap
);
log
.
info
(
"菜单管理复用结束"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"Menu management reuse failure: {}"
,
e
.
getMessage
(),
e
);
...
...
@@ -113,15 +121,26 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
log
.
error
(
"Distribution reuse exception:{}"
,
e
.
getMessage
(),
e
);
}
Integer
finalCount
=
count
;
idList
.
forEach
(
c
->
{
AccountDistributeRecord
distributeLog
=
new
AccountDistributeRecord
();
distributeLog
.
saveDistribute
(
sourceAuth
.
getId
(),
c
,
typeList
,
userId
);
distributeLog
.
saveDistribute
(
sourceAuth
.
getId
(),
c
,
typeList
,
userId
,
finalCount
,
reasonMap
);
distributeLogList
.
add
(
distributeLog
);
});
distributeService
.
saveBatch
(
distributeLogList
);
}
private
Integer
statusLog
(
BaseResult
result
,
Integer
count
,
String
type
,
Map
<
String
,
String
>
reasonMap
)
{
Boolean
success
=
result
.
getSuccess
();
if
(
success
)
{
count
++;
}
else
{
reasonMap
.
put
(
type
,
"失败的信息_"
+
result
.
getMessage
());
}
return
count
;
}
private
void
removeBatch
(
List
<
String
>
appIds
,
String
type
,
List
<
Long
>
authIds
)
{
if
(
"3"
.
equals
(
type
))
{
try
{
...
...
src/main/java/com/yaoyaozw/customer/vo/AccountDistributeLogVO.java
浏览文件 @
d8142607
...
...
@@ -19,4 +19,6 @@ public class AccountDistributeLogVO {
private
Date
gmtCreate
;
private
Date
gmtModified
;
private
String
userName
;
private
Integer
successCount
;
private
String
reason
;
}
src/main/resources/mapper/AccountDistributeLogMapper.xml
浏览文件 @
d8142607
...
...
@@ -3,12 +3,14 @@
<mapper
namespace=
"com.yaoyaozw.customer.mapper.AccountDistributeLogMapper"
>
<select
id=
"selectLogList"
resultType=
"com.yaoyaozw.customer.vo.AccountDistributeLogVO"
>
SELECT a.nick_name AS nickName,
ai.nick_name AS targetName,
SELECT a.nick_name
AS nickName,
ai.nick_name
AS targetName,
adr.function_name AS functionName,
adr.gmt_create AS gmtCreate,
adr.gmt_modified AS gmtModified,
au.nick_name AS userName
adr.gmt_create AS gmtCreate,
adr.gmt_modified AS gmtModified,
au.nick_name AS userName,
adr.success_count AS successCount,
adr.reason AS reason
FROM account_distribute_record adr
LEFT JOIN authorizer_info ai ON ai.id = adr.target_auth_id
LEFT JOIN authorizer_info a ON a.id = adr.auth_id
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论