Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e79ffe85
authored
Nov 13, 2021
by
linkwechat8856@163.com
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' into back_end_dev
2 parents
71c66859
51c68851
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
476 additions
and
235 deletions
README.md
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeEmpleCodeController.java
linkwe-ui/src/components/ChatContent.vue
linkwe-ui/src/views/application/taskDetail/addTask.vue
linkwe-ui/src/views/customerManage/customer.vue
linkwe-ui/src/views/customerManage/dimission/allocatedStaffDetailList.vue
linkwe-ui/src/views/customerManage/lossRemind.vue
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeUserClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerList.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeScanEmpleCodeCount.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/customer/ExternalUserDetail.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeAllocateCustomersVo.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackAddExternalContactImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackAddHalfExternalContactImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackDelExternalContactImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackDelFollowUserImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeFlowerCustomerRelMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeScanEmpleCodeCountMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeFlowerCustomerRelService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeScanEmpleCodeCountService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessageServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessgaeResultServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeEmpleCodeServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeFlowerCustomerRelServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeScanEmpleCodeCountServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMessgaeResultMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeFlowerCustomerRelMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeFlowerCustomerTagRelMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeScanEmpleCodeCountMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeUserMapper.xml
sql/link_wechat_prod.sql
README.md
View file @
e79ffe8
This diff is collapsed.
Click to expand it.
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
View file @
e79ffe8
...
...
@@ -150,6 +150,13 @@ public class WeCustomerController extends BaseController
}
@GetMapping
(
"/getCustomersInfoAndSynch"
)
public
AjaxResult
getCustomersInfoAndSynchWeCustomer
(
String
externalUserid
,
String
userId
){
weCustomerService
.
getCustomersInfoAndSynchWeCustomer
(
externalUserid
,
userId
);
return
AjaxResult
.
success
();
}
/**
* 客户打标签
* @param weMakeCustomerTag
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeEmpleCodeController.java
View file @
e79ffe8
...
...
@@ -190,7 +190,7 @@ public class WeEmpleCodeController extends BaseController {
// @PreAuthorize("@ss.hasPermi('wecom:code:getUserAddCustomerStat')")
@Log
(
title
=
"成员添加客户统计"
,
businessType
=
BusinessType
.
OTHER
)
@GetMapping
(
"/getUserAddCustomerStat"
)
public
AjaxResult
getUserAddCustomerStat
(
WeFlowerCustomerRel
weFlowerCustomerRel
){
return
AjaxResult
.
success
(
weFlowerCustomerRelService
.
getUserAddCustomerStat
(
weFlowerCustomerRel
));
public
AjaxResult
getUserAddCustomerStat
(
String
codeId
,
String
beginTime
,
String
endTime
){
return
AjaxResult
.
success
(
weFlowerCustomerRelService
.
getUserAddCustomerStat
(
codeId
,
beginTime
,
endTime
));
}
}
linkwe-ui/src/components/ChatContent.vue
View file @
e79ffe8
...
...
@@ -27,10 +27,15 @@ export default {
video
:
'attachment'
,
voice
:
'attachment'
,
location
:
'address'
,
weapp
:
'title'
,
card
:
'corpname'
weapp
:
'title'
// card: 'corpname'
}
let
attr
=
typeDict
[
this
.
message
.
msgType
]
if
(
attr
)
{
return
JSON
.
parse
(
this
.
message
.
contact
)[
typeDict
[
this
.
message
.
msgType
]]
}
else
{
return
JSON
.
parse
(
this
.
message
.
contact
)
}
return
JSON
.
parse
(
this
.
message
.
contact
)[
typeDict
[
this
.
message
.
msgType
]]
}
},
watch
:
{},
...
...
@@ -65,13 +70,7 @@ export default {
{{
content
}}
</
template
>
<
template
v-else-if=
"'image,emotion'.includes(message.msgType)"
>
<el-image
style=
"width: 100px; height: 100px"
:src=
"content"
fit=
"fit"
:preview-src-list=
"[content]"
>
</el-image>
<el-image
style=
"width: 100px; height: 100px"
:src=
"content"
fit=
"fit"
:preview-src-list=
"[content]"
>
</el-image>
</
template
>
<a
v-else-if=
"'file'.includes(message.msgType)"
...
...
@@ -90,11 +89,7 @@ export default {
{{ content }}
</a>
<div
v-else-if=
"message.msgType === 'voice'"
>
<i
class=
"el-icon-microphone"
style=
" font-size: 40px; color: #199ed8;"
@
click=
"playAudio('attachment')"
></i>
<i
class=
"el-icon-microphone"
style=
" font-size: 40px; color: #199ed8;"
@
click=
"playAudio('attachment')"
></i>
</div>
<
template
v-else-if=
"message.msgType === 'video'"
>
<video
...
...
@@ -137,44 +132,50 @@ export default {
>
</video-player>
-->
</
template
>
<div
v-else-if=
"message.msgType === 'location'"
class=
"msgtypecard"
>
<div
class=
"card
_name
"
>
<div
class=
"card
-content
"
>
<el-amap
ref=
"map"
vid=
"amapDemo"
:center=
"[
JSON.parse(message.contact).longitude,
JSON.parse(message.contact).latitude
]"
:center=
"[JSON.parse(message.contact).longitude, JSON.parse(message.contact).latitude]"
:zoom=
"15"
class=
"amap-demo"
style=
"pointer-events: none;"
>
<el-amap-marker
:position=
"[
JSON.parse(message.contact).longitude,
JSON.parse(message.contact).latitude
]"
:position=
"[JSON.parse(message.contact).longitude, JSON.parse(message.contact).latitude]"
></el-amap-marker>
</el-amap>
</div>
<div
class=
"card
_
foot"
>
{{ content }}
</div>
<div
class=
"card
-
foot"
>
{{ content }}
</div>
</div>
<div
v-else-if=
"message.msgType === 'weapp'"
class=
"msgtypecard"
>
<div
class=
"card
_name
"
>
{{ content }}
</div>
<div
class=
"card
_
foot"
>
小程序
</div>
<div
class=
"card
-content
"
>
{{ content }}
</div>
<div
class=
"card
-
foot"
>
小程序
</div>
</div>
<div
v-else-if=
"message.msgType === 'card'"
class=
"msgtypecard "
>
<div
class=
"card_name"
>
{{ content }}
</div>
<div
class=
"card_foot"
>
个人名片
</div>
<div
class=
"card-content"
>
<span
style=
"flex: none;"
>
{{ content.corpname }}:
</span>
<span>
{{ content.userid }}
</span>
</div>
<div
class=
"card-foot"
>
个人名片
</div>
</div>
<!-- 图文链接 -->
<div
v-else-if=
"message.msgType === 'link'"
class=
"msgtypecard "
>
<a
:href=
"content.link_url"
>
<div
class=
"card-content fxbw"
>
<div>
<div
class=
"card--link-title"
>
{{ content.title }}
</div>
<div
class=
"card--link-desc"
>
{{ content.description }}
</div>
</div>
<el-image
style=
"width: 50px; height: 50px"
:src=
"content.image_url"
fit=
"fit"
></el-image>
</div>
</a>
</div>
<div
v-else
>
不支持的消息类型:{{ message.msgType }}
</div>
<el-dialog
v-if=
"audioSrc[0]"
:visible
.
sync=
"dialogVisible"
width=
"30%"
@
close=
"close"
>
<el-dialog
v-if=
"audioSrc[0]"
:visible
.
sync=
"dialogVisible"
width=
"30%"
@
close=
"close"
>
<div
class=
"shabowboxvidoe shabowboxaudio"
>
<!-- <AudioPlayer
:audio-list="audioSrc"
...
...
@@ -223,23 +224,45 @@ export default {
.msgtypecard
{
width
:
320px
;
height
:
140px
;
//
height
:
140px
;
margin
:
10px
5px
;
border-radius
:
8px
;
-webkit-box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
6px
8px
0
rgba
(
0
,
0
,
0
,
0.19
);
-webkit-box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
6px
8px
0
rgba
(
0
,
0
,
0
,
0.19
);
box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
6px
8px
0
rgba
(
0
,
0
,
0
,
0.19
);
position
:
relative
;
background
:
#f8f8f8
;
overflow
:
hidden
;
.card
_name
{
.card
-content
{
width
:
320px
;
height
:
105px
;
line-height
:
80px
;
text-indent
:
10px
;
min-height
:
105px
;
height
:
100%
;
display
:
flex
;
align-items
:
center
;
padding
:
10px
;
line-height
:
1.5
;
//
text-indent
:
10px
;
color
:
#333
;
.card--link-title
{
font-size
:
16px
;
font-weight
:
500
;
margin-bottom
:
5px
;
text-overflow
:
-o-ellipsis-lastline
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
word-break
:
break-all
;
display
:
-webkit-box
;
white-space
:
pre-wrap
;
-webkit-line-clamp
:
2
;
line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
}
.card--link-desc
{
font-size
:
14px
;
color
:
#aaa
;
}
}
.card
_
foot
{
.card
-
foot
{
position
:
absolute
;
height
:
20px
;
border-top
:
1px
solid
#efefef
;
...
...
linkwe-ui/src/views/application/taskDetail/addTask.vue
View file @
e79ffe8
...
...
@@ -35,7 +35,6 @@ export default {
rewardImageUrl
:
''
,
rewardRule
:
''
},
rewardImageUrlTemp
:
''
,
action
:
process
.
env
.
VUE_APP_BASE_API
+
window
.
CONFIG
.
services
.
wecom
+
'/fission/upload'
,
headers
:
window
.
CONFIG
.
headers
,
ruleForm
:
{
...
...
@@ -223,7 +222,7 @@ export default {
},
handleAvatarSuccess
(
res
,
file
)
{
// this.rewardImageUrlTemp = URL.createObjectURL(file.raw) //预览
this
.
rewardImageUrlTemp
=
this
.
groupForm
.
rewardImageUrl
=
res
.
data
.
rewardImageUrl
this
.
groupForm
.
rewardImageUrl
=
res
.
data
.
rewardImageUrl
},
beforeAvatarUpload
(
file
)
{
const
isJPG
=
file
.
type
===
'image/jpeg'
...
...
@@ -388,7 +387,7 @@ export default {
:on-success=
"handleAvatarSuccess"
:before-upload=
"beforeAvatarUpload"
>
<img
v-if=
"
rewardImageUrlTemp"
:src=
"rewardImageUrlTemp
"
class=
"avatar"
/>
<img
v-if=
"
groupForm.rewardImageUrl"
:src=
"groupForm.rewardImageUrl
"
class=
"avatar"
/>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
...
...
linkwe-ui/src/views/customerManage/customer.vue
View file @
e79ffe8
...
...
@@ -167,8 +167,17 @@ export default {
})
})
if
(
hasErrorTag
.
length
>
0
)
{
this
.
msgError
(
'已有标签['
+
hasErrorTag
+
']不在标签库中,或存在异常'
)
return
this
.
$notify
({
// title: '标题名称',
message
:
this
.
$createElement
(
'i'
,
{
style
:
'color: red'
},
'已有标签['
+
hasErrorTag
+
']不在标签库中,已被删除或存在异常'
),
type
:
'warning'
,
customClass
:
'mzindex'
})
// this.msgError('已有标签[' + hasErrorTag + ']不在标签库中,已被删除或存在异常')
}
if
(
type
===
'remove'
&&
this
.
selectedTag
.
length
===
0
)
{
this
.
msgError
(
'该客户没有标签,不可进行移除'
)
...
...
@@ -443,3 +452,8 @@ export default {
margin
-
left
:
10
px
;
}
<
/style
>
<
style
>
.
mzindex
{
z
-
index
:
5000
!
important
;
}
<
/style
>
linkwe-ui/src/views/customerManage/dimission/allocatedStaffDetailList.vue
View file @
e79ffe8
<
script
>
import
{
getAllocateCustomers
,
getAllocateGroups
}
from
'@/api/customer/dimission'
import
{
getAllocateCustomers
,
getAllocateGroups
}
from
'@/api/customer/dimission'
export
default
{
name
:
'AllocatedStaffDetailList'
,
...
...
@@ -50,9 +47,7 @@ export default {
}
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
;(
this
.
type
===
'customer'
?
getAllocateCustomers
:
getAllocateGroups
)(
this
.
query
)
;(
this
.
type
===
'customer'
?
getAllocateCustomers
:
getAllocateGroups
)(
this
.
query
)
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
this
.
total
=
+
total
...
...
@@ -68,40 +63,20 @@ export default {
<
template
>
<div
class=
"page"
>
<el-table
ref=
"multipleTable"
:data=
"list"
tooltip-effect=
"dark"
style=
"width: 100%"
>
<el-table-column
v-if=
"type === 'customer'"
prop=
"customerName"
label=
"客户名称"
></el-table-column>
<el-table
ref=
"multipleTable"
:data=
"list"
tooltip-effect=
"dark"
style=
"width: 100%"
>
<el-table-column
v-if=
"type === 'customer'"
prop=
"customerName"
label=
"客户名称"
></el-table-column>
<el-table-column
v-else
prop=
"groupName"
label=
"群名称"
></el-table-column>
<el-table-column
:prop=
"type === 'customer' ? 'takeUserName' : 'newOwnerName'"
label=
"接替员工"
></el-table-column>
<el-table-column
prop=
"department"
label=
"接替员工所属部门"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"allocateTime"
label=
"分配时间"
show-overflow-tooltip
></el-table-column>
<el-table-column
:prop=
"type === 'customer' ? 'takeUserName' : 'newOwnerName'"
label=
"接替员工"
></el-table-column>
<el-table-column
prop=
"department"
label=
"接替员工所属部门"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"allocateTime"
label=
"分配时间"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"操作"
width=
"100"
>
<template
slot-scope=
"
scope
"
>
<template
slot-scope=
"
{ row }
">
<el-button
v-hasPermi=
"['customerManage:dimission:edit']"
@
click=
"
$router.push(
{
path: 'customerDetail',
query: {
id: scope.row.id
}
query: {
data: JSON.stringify(row)
}
})
"
type="text"
...
...
linkwe-ui/src/views/customerManage/lossRemind.vue
View file @
e79ffe8
...
...
@@ -258,13 +258,13 @@ export default {
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"操作"
width
=
"100"
>
<
template
slot
-
scope
=
"
scope
"
>
<
template
slot
-
scope
=
"
{
row
}
">
<el-button
v-hasPermi="
[
'customerManage:customer:view'
]
"
@click="
$router
.
push
({
path
:
'customerDetail'
,
query
:
{
id
:
scope
.
row
.
externalUserid
}
query
:
{
data
:
JSON
.
stringify
(
row
)
}
}
)
"
type="
text
"
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeUserClient.java
View file @
e79ffe8
...
...
@@ -12,7 +12,7 @@ import com.linkwechat.wecom.retry.WeCommonRetryWhen;
* @author: HaoN
* @create: 2020-08-27 16:42
**/
@BaseRequest
(
baseURL
=
"${weComServerUrl}${weComePrefix}"
,
interceptor
=
WeAccessTokenInterceptor
.
class
)
@BaseRequest
(
baseURL
=
"${weComServerUrl}${weComePrefix}"
,
interceptor
=
We
Common
AccessTokenInterceptor
.
class
)
@Retry
(
maxRetryCount
=
"3"
,
maxRetryInterval
=
"1000"
,
condition
=
WeCommonRetryWhen
.
class
)
public
interface
WeUserClient
{
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
View file @
e79ffe8
...
...
@@ -171,6 +171,11 @@ public class WeCustomer extends BaseEntity {
private
String
updateBy
;
/** 企业自定义的state参数,用于区分客户具体是通过哪个「联系我」添加,由企业通过创建「联系我」方式指定 */
private
String
state
;
/**
...
...
@@ -195,9 +200,10 @@ public class WeCustomer extends BaseEntity {
/**
* 0:正常;1:删除
*/
@TableLogic
//
@TableLogic
private
Integer
delFlag
;
//添加方式
private
Integer
addMethod
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerList.java
View file @
e79ffe8
...
...
@@ -68,6 +68,8 @@ public class WeCustomerList {
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
birthday
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeScanEmpleCodeCount.java
0 → 100644
View file @
e79ffe8
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
@Data
@TableName
(
"we_scan_emple_code_count"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeScanEmpleCodeCount
{
@TableId
private
Long
id
;
private
String
externalUserid
;
private
String
userId
;
private
Date
createTime
;
private
Long
empleCodeId
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/customer/ExternalUserDetail.java
View file @
e79ffe8
...
...
@@ -93,6 +93,9 @@ public class ExternalUserDetail extends WeResultDto {
private
String
oper_userid
;
/**标签**/
private
String
[]
tag_id
;
/** 企业自定义的state参数,用于区分客户具体是通过哪个「联系我」添加,由企业通过创建「联系我」方式指定 */
private
String
state
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeAllocateCustomersVo.java
View file @
e79ffe8
...
...
@@ -28,4 +28,35 @@ public class WeAllocateCustomersVo extends BaseEntity {
/**原拥有着*/
private
String
handoverUserId
;
private
String
avatar
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
birthday
;
//0-未知 1-男性 2-女性
private
Integer
gender
;
//查询标签id
private
String
tagIds
;
//标签名称,使用逗号隔开
private
String
tagNames
;
//跟进人名称
private
String
userName
;
//添加时间
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
firstAddTime
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackAddExternalContactImpl.java
View file @
e79ffe8
package
com
.
linkwechat
.
wecom
.
factory
.
impl
.
customer
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.io.FileUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -61,6 +62,10 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
private
WeCustomerClient
weCustomerClient
;
@Autowired
private
IWeScanEmpleCodeCountService
iWeScanEmpleCodeCountService
;
@Override
public
void
eventHandle
(
WxCpXmlMessageVO
message
)
{
if
(
message
.
getExternalUserId
()
!=
null
)
{
...
...
@@ -122,7 +127,7 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
}
/**
* 活码欢迎语发送
* 活码欢迎语发送
(扫码回掉)
*
* @param state 渠道
* @param wecomCode 欢迎语code
...
...
@@ -137,6 +142,15 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
WeWelcomeMsg
.
WeWelcomeMsgBuilder
weWelcomeMsgBuilder
=
WeWelcomeMsg
.
builder
().
welcome_code
(
wecomCode
);
WeEmpleCodeDto
messageMap
=
weEmpleCodeService
.
selectWelcomeMsgByState
(
state
);
if
(
StringUtils
.
isNotNull
(
messageMap
))
{
//扫码统计记录入库
iWeScanEmpleCodeCountService
.
save
(
WeScanEmpleCodeCount
.
builder
()
.
empleCodeId
(
Long
.
valueOf
(
state
))
.
createTime
(
new
Date
())
.
userId
(
userId
)
.
externalUserid
(
externalUserId
)
.
build
());
//查询活码对应标签
List
<
WeEmpleCodeTag
>
tagList
=
weEmpleCodeTagService
.
list
(
new
LambdaQueryWrapper
<
WeEmpleCodeTag
>()
.
eq
(
WeEmpleCodeTag:
:
getEmpleCodeId
,
messageMap
.
getEmpleCodeId
()));
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackAddHalfExternalContactImpl.java
View file @
e79ffe8
package
com
.
linkwechat
.
wecom
.
factory
.
impl
.
customer
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.linkwechat.common.enums.MediaType
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.wecom.domain.WeEmpleCodeTag
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerRel
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerTagRel
;
import
com.linkwechat.wecom.domain.*
;
import
com.linkwechat.wecom.domain.dto.WeEmpleCodeDto
;
import
com.linkwechat.wecom.domain.dto.WeMediaDto
;
import
com.linkwechat.wecom.domain.dto.WeWelcomeMsg
;
...
...
@@ -45,6 +44,9 @@ public class WeCallBackAddHalfExternalContactImpl extends WeEventStrategy {
@Autowired
private
IWeMaterialService
weMaterialService
;
@Autowired
private
IWeScanEmpleCodeCountService
iWeScanEmpleCodeCountService
;
@Override
public
void
eventHandle
(
WxCpXmlMessageVO
message
)
{
try
{
...
...
@@ -53,6 +55,15 @@ public class WeCallBackAddHalfExternalContactImpl extends WeEventStrategy {
}
//向扫码客户发送欢迎语
if
(
message
.
getState
()
!=
null
&&
message
.
getWelcomeCode
()
!=
null
)
{
//扫码统计记录入库
iWeScanEmpleCodeCountService
.
save
(
WeScanEmpleCodeCount
.
builder
()
.
empleCodeId
(
Long
.
valueOf
(
message
.
getState
()))
.
createTime
(
new
Date
())
.
userId
(
message
.
getUserId
())
.
externalUserid
(
message
.
getExternalUserId
())
.
build
());
log
.
info
(
"执行发送欢迎语>>>>>>>>>>>>>>>"
);
WeWelcomeMsg
.
WeWelcomeMsgBuilder
weWelcomeMsgBuilder
=
WeWelcomeMsg
.
builder
().
welcome_code
(
message
.
getWelcomeCode
());
WeEmpleCodeDto
messageMap
=
weEmpleCodeService
.
selectWelcomeMsgByScenario
(
message
.
getState
(),
message
.
getUserId
());
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackDelExternalContactImpl.java
View file @
e79ffe8
package
com
.
linkwechat
.
wecom
.
factory
.
impl
.
customer
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeSensitiveAct
;
import
com.linkwechat.wecom.domain.WeSensitiveActHit
;
import
com.linkwechat.wecom.domain.WeUser
;
import
com.linkwechat.wecom.domain.*
;
import
com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO
;
import
com.linkwechat.wecom.factory.WeEventStrategy
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
...
...
@@ -15,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author danmo
...
...
@@ -52,13 +51,26 @@ public class WeCallBackDelExternalContactImpl extends WeEventStrategy {
WeUser
user
=
weUserService
.
getById
(
message
.
getUserId
());
weSensitiveActHit
.
setOperator
(
user
.
getName
());
WeCustomer
weCustomer
=
weCustomerService
.
getOne
(
new
LambdaQueryWrapper
<
WeCustomer
>()
.
eq
(
WeCustomer:
:
getExternalUserid
,
message
.
getExternalUserId
())
.
eq
(
WeCustomer:
:
getFirstUserId
,
message
.
getUserId
()));
weSensitiveActHit
.
setOperateTargetId
(
weCustomer
.
getUserId
());
weSensitiveActHit
.
setOperateTarget
(
weCustomer
.
getName
());
weSensitiveActHitService
.
insertWeSensitiveActHit
(
weSensitiveActHit
);
List
<
WeCustomerList
>
weCustomerList
=
weCustomerService
.
findWeCustomerList
(
WeCustomerList
.
builder
()
.
externalUserid
(
message
.
getExternalUserId
())
.
firstUserId
(
message
.
getUserId
())
.
delFlag
(
new
Integer
(
1
))
.
build
());
if
(
CollectionUtil
.
isNotEmpty
(
weCustomerList
))
{
WeCustomerList
weCustomer
=
weCustomerList
.
stream
().
findFirst
().
get
();
weSensitiveActHit
.
setOperateTargetId
(
weCustomer
.
getFirstUserId
());
weSensitiveActHit
.
setOperateTarget
(
weCustomer
.
getCustomerName
());
weSensitiveActHitService
.
insertWeSensitiveActHit
(
weSensitiveActHit
);
}
}
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackDelFollowUserImpl.java
View file @
e79ffe8
package
com
.
linkwechat
.
wecom
.
factory
.
impl
.
customer
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.linkwechat.common.constant.WeConstans
;
...
...
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -51,38 +53,55 @@ public class WeCallBackDelFollowUserImpl extends WeEventStrategy {
Optional
.
ofNullable
(
validWeCorpAccount
).
ifPresent
(
weCorpAccount
->
{
String
customerChurnNoticeSwitch
=
weCorpAccount
.
getCustomerChurnNoticeSwitch
();
if
(
WeConstans
.
DEL_FOLLOW_USER_SWITCH_OPEN
.
equals
(
customerChurnNoticeSwitch
))
{
WeCustomer
weCustomer
=
weCustomerService
.
getOne
(
new
LambdaQueryWrapper
<
WeCustomer
>().
eq
(
WeCustomer:
:
getFirstUserId
,
message
.
getUserId
())
.
eq
(
WeCustomer:
:
getExternalUserid
,
message
.
getExternalUserId
()));
String
content
=
"您已经被客户@"
+
weCustomer
.
getName
()
+
"删除!"
;
TextMessageDto
textMessageDto
=
new
TextMessageDto
();
textMessageDto
.
setContent
(
content
);
WeMessagePushDto
weMessagePushDto
=
new
WeMessagePushDto
();
weMessagePushDto
.
setMsgtype
(
MessageType
.
TEXT
.
getMessageType
());
weMessagePushDto
.
setTouser
(
message
.
getUserId
());
weMessagePushDto
.
setText
(
textMessageDto
);
Optional
.
ofNullable
(
validWeCorpAccount
).
map
(
WeCorpAccount:
:
getAgentId
).
ifPresent
(
agentId
->
{
weMessagePushDto
.
setAgentid
(
Integer
.
valueOf
(
agentId
));
});
weMessagePushClient
.
sendMessageToUser
(
weMessagePushDto
,
weMessagePushDto
.
getAgentid
().
toString
());
//增加敏感行为记录,客户删除员工
WeSensitiveAct
weSensitiveAct
=
weSensitiveActHitService
.
getSensitiveActType
(
"拉黑/删除好友"
);
if
(
weSensitiveAct
!=
null
&&
weSensitiveAct
.
getEnableFlag
()
==
1
)
{
WeSensitiveActHit
weSensitiveActHit
=
new
WeSensitiveActHit
();
weSensitiveActHit
.
setSensitiveActId
(
weSensitiveAct
.
getId
());
weSensitiveActHit
.
setSensitiveAct
(
weSensitiveAct
.
getActName
());
weSensitiveActHit
.
setCreateTime
(
new
Date
(
message
.
getCreateTime
()));
weSensitiveActHit
.
setCreateBy
(
"admin"
);
WeUser
user
=
weUserService
.
getById
(
message
.
getUserId
());
weSensitiveActHit
.
setOperatorId
(
weCustomer
.
getUserId
());
weSensitiveActHit
.
setOperator
(
weCustomer
.
getName
());
weSensitiveActHit
.
setOperateTargetId
(
user
.
getUserId
());
weSensitiveActHit
.
setOperateTarget
(
user
.
getName
());
weSensitiveActHitService
.
insertWeSensitiveActHit
(
weSensitiveActHit
);
List
<
WeCustomerList
>
weCustomerList
=
weCustomerService
.
findWeCustomerList
(
WeCustomerList
.
builder
()
.
externalUserid
(
message
.
getExternalUserId
())
.
firstUserId
(
message
.
getUserId
())
.
delFlag
(
new
Integer
(
1
))
.
build
());
if
(
CollectionUtil
.
isNotEmpty
(
weCustomerList
)){
WeCustomerList
weCustomer
=
weCustomerList
.
stream
().
findFirst
().
get
();
String
content
=
"您已经被客户@"
+
weCustomer
.
getCustomerName
()
+
"删除!"
;
TextMessageDto
textMessageDto
=
new
TextMessageDto
();
textMessageDto
.
setContent
(
content
);
WeMessagePushDto
weMessagePushDto
=
new
WeMessagePushDto
();
weMessagePushDto
.
setMsgtype
(
MessageType
.
TEXT
.
getMessageType
());
weMessagePushDto
.
setTouser
(
message
.
getUserId
());
weMessagePushDto
.
setText
(
textMessageDto
);
Optional
.
ofNullable
(
validWeCorpAccount
).
map
(
WeCorpAccount:
:
getAgentId
).
ifPresent
(
agentId
->
{
weMessagePushDto
.
setAgentid
(
Integer
.
valueOf
(
agentId
));
});
weMessagePushClient
.
sendMessageToUser
(
weMessagePushDto
,
weMessagePushDto
.
getAgentid
().
toString
());
//增加敏感行为记录,客户删除员工
WeSensitiveAct
weSensitiveAct
=
weSensitiveActHitService
.
getSensitiveActType
(
"拉黑/删除好友"
);
if
(
weSensitiveAct
!=
null
&&
weSensitiveAct
.
getEnableFlag
()
==
1
)
{
WeSensitiveActHit
weSensitiveActHit
=
new
WeSensitiveActHit
();
weSensitiveActHit
.
setSensitiveActId
(
weSensitiveAct
.
getId
());
weSensitiveActHit
.
setSensitiveAct
(
weSensitiveAct
.
getActName
());
weSensitiveActHit
.
setCreateTime
(
new
Date
(
message
.
getCreateTime
()));
weSensitiveActHit
.
setCreateBy
(
"admin"
);
WeUser
user
=
weUserService
.
getById
(
message
.
getUserId
());
weSensitiveActHit
.
setOperatorId
(
weCustomer
.
getFirstUserId
());
weSensitiveActHit
.
setOperator
(
weCustomer
.
getCustomerName
());
weSensitiveActHit
.
setOperateTargetId
(
user
.
getUserId
());
weSensitiveActHit
.
setOperateTarget
(
user
.
getName
());
weSensitiveActHitService
.
insertWeSensitiveActHit
(
weSensitiveActHit
);
}
}
}
});
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeFlowerCustomerRelMapper.java
View file @
e79ffe8
...
...
@@ -82,8 +82,8 @@ public interface WeFlowerCustomerRelMapper extends BaseMapper<WeFlowerCustomerRe
/**
* 成员添加客户统计
* @param
weFlowerCustomerRel
* @param
* @return
*/
public
List
<
Map
<
String
,
Object
>>
getUserAddCustomerStat
(
WeFlowerCustomerRel
weFlowerCustomerRel
);
public
List
<
Map
<
String
,
Object
>>
getUserAddCustomerStat
(
@Param
(
"codeId"
)
String
codeId
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeScanEmpleCodeCountMapper.java
0 → 100644
View file @
e79ffe8
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeScanEmpleCodeCount
;
public
interface
WeScanEmpleCodeCountMapper
extends
BaseMapper
<
WeScanEmpleCodeCount
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
View file @
e79ffe8
...
...
@@ -10,6 +10,7 @@ import com.linkwechat.wecom.domain.dto.WeWelcomeMsg;
import
com.linkwechat.wecom.domain.vo.WeCustomerDetailVo
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -155,4 +156,7 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param params
*/
void
getCustomerByCondition
(
JSONObject
params
);
void
batchAddOrUpdate
(
List
<
WeCustomer
>
weCustomer
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeFlowerCustomerRelService.java
View file @
e79ffe8
...
...
@@ -23,9 +23,9 @@ public interface IWeFlowerCustomerRelService extends IService<WeFlowerCustomerRe
/**
* 成员添加客户统计
* @param
weFlowerCustomerRel
* @param
* @return Map
*/
public
Map
<
String
,
Object
>
getUserAddCustomerStat
(
WeFlowerCustomerRel
weFlowerCustomerRel
);
public
Map
<
String
,
Object
>
getUserAddCustomerStat
(
String
codeId
,
String
beginTime
,
String
endTime
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeScanEmpleCodeCountService.java
0 → 100644
View file @
e79ffe8
package
com
.
linkwechat
.
wecom
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeScanEmpleCodeCount
;
public
interface
IWeScanEmpleCodeCountService
extends
IService
<
WeScanEmpleCodeCount
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
View file @
e79ffe8
...
...
@@ -203,23 +203,7 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
*/
public
List
<
WeCustomerList
>
externalUserIds
(
String
pushRange
,
String
staffId
,
String
department
,
String
tag
)
{
if
(
pushRange
.
equals
(
WeConstans
.
SEND_MESSAGE_CUSTOMER_ALL
))
{
//从redis中读取数据
// List<WeCustomer> customers = redisCache.getCacheList(WeConstans.WECUSTOMERS_KEY);
// if (CollectionUtils.isEmpty(customers)) {
// WeCustomer weCustomer = new WeCustomer();
// weCustomer.setUserIds(staffId);
// weCustomer.setDepartmentIds(department);
// customers = weCustomerService.selectWeCustomerAllList(weCustomer);
// redisCache.setCacheList(WeConstans.WECUSTOMERS_KEY, customers);
// redisCache.expire(WeConstans.WECUSTOMERS_KEY,2 * 60L);
// }else{
// return customers;
// }
//
// WeCustomer weCustomer = new WeCustomer();
// weCustomer.setUserIds(staffId);
// weCustomer.setDepartmentIds(department);
// return weCustomerService.selectWeCustomerListNoRel(weCustomer);
return
weCustomerService
.
findWeCustomerList
(
WeCustomerList
.
builder
()
...
...
@@ -227,7 +211,6 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
.
departmentIds
(
department
)
.
build
());
}
else
{
//按条件查询客户
...
...
@@ -240,14 +223,6 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
.
departmentIds
(
department
)
.
build
());
// WeCustomer weCustomer = new WeCustomer();
// weCustomer.setUserIds(staffId);
// weCustomer.setTagIds(tag);
// weCustomer.setDepartmentIds(department);
//
//
//
// return weCustomerService.selectWeCustomerListNoRel(weCustomer);
}
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessageServiceImpl.java
View file @
e79ffe8
...
...
@@ -96,6 +96,7 @@ public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageM
@Override
public
void
sendMessgae
(
CustomerMessagePushDto
customerMessagePushDto
,
long
messageId
,
List
<
WeCustomerList
>
customers
,
List
<
WeGroup
>
groups
)
throws
JsonProcessingException
{
List
<
String
>
msgid
=
new
ArrayList
<>();
//发给客户
...
...
@@ -118,10 +119,17 @@ public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageM
messagePushDto
.
setSender
(
customerMessagePushDto
.
getStaffId
());
childMessage
(
messagePushDto
,
customerMessagePushDto
);
SendMessageResultDto
sendMessageResultDto
=
weCustomerMessagePushClient
.
sendCustomerMessageToUser
(
messagePushDto
);
if
(
WeConstans
.
WE_SUCCESS_CODE
.
equals
(
sendMessageResultDto
.
getErrcode
()))
{
msgid
.
add
(
sendMessageResultDto
.
getMsgid
());
try
{
SendMessageResultDto
sendMessageResultDto
=
weCustomerMessagePushClient
.
sendCustomerMessageToUser
(
messagePushDto
);
if
(
WeConstans
.
WE_SUCCESS_CODE
.
equals
(
sendMessageResultDto
.
getErrcode
()))
{
msgid
.
add
(
sendMessageResultDto
.
getMsgid
());
}
}
catch
(
Exception
e
){
log
.
error
(
"消息发送失败:"
+
e
.
getMessage
());
}
}
});
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessgaeResultServiceImpl.java
View file @
e79ffe8
...
...
@@ -57,7 +57,7 @@ public class WeCustomerMessgaeResultServiceImpl extends ServiceImpl<WeCustomerMe
customerMessgaeResult
.
setSendTime
(
null
);
customerMessgaeResult
.
setSendType
(
customerMessgaeResult
.
getSettingTime
()
==
null
?
customerMessagePushDto
.
getPushType
()
:
"2"
);
customerMessgaeResult
.
setExternalUserid
(
customer
.
getExternalUserid
());
customerMessgaeResult
.
setExternalName
(
customer
.
getName
());
customerMessgaeResult
.
setExternalName
(
customer
.
get
Customer
Name
());
customerMessgaeResult
.
setUserid
(
customer
.
getFirstUserId
());
customerMessgaeResult
.
setUserName
(
customer
.
getUserName
());
customerMessgaeResult
.
setStatus
(
"0"
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
e79ffe8
...
...
@@ -170,6 +170,8 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
weCustomer
.
setFirstUserId
(
followInfo
.
getUserid
());
weCustomer
.
setFirstAddTime
(
new
Date
(
followInfo
.
getCreatetime
()
*
1000L
));
weCustomer
.
setAddMethod
(
followInfo
.
getAdd_way
());
weCustomer
.
setState
(
followInfo
.
getState
());
weCustomer
.
setDelFlag
(
new
Integer
(
0
));
weCustomerList
.
add
(
weCustomer
);
List
<
String
>
tags
=
Stream
.
of
(
followInfo
.
getTag_id
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
tags
))
{
...
...
@@ -303,10 +305,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
);
if
(
CollectionUtil
.
isNotEmpty
(
weTagList
)){
if
(
addTag
.
size
()!=
weTagList
.
size
()){
new
WeComException
(
"部门标签不存在"
);
throw
new
WeComException
(
"部门标签不存在"
);
}
}
else
{
new
WeComException
(
"部门标签不存在"
);
throw
new
WeComException
(
"部门标签不存在"
);
}
...
...
@@ -374,6 +376,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
}
}
}
}
...
...
@@ -417,7 +423,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
if
(
null
!=
followUser
){
weCustomer
.
setFirstAddTime
(
new
Date
(
followUser
.
getCreatetime
()
*
1000L
));
weCustomer
.
setState
(
followUser
.
getState
());
weCustomer
.
setAddMethod
(
followUser
.
getAddWay
());
weCustomer
.
setDelFlag
(
new
Integer
(
0
));
this
.
baseMapper
.
batchAddOrUpdate
(
ListUtil
.
toList
(
weCustomer
)
);
...
...
@@ -704,5 +712,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
}
@Override
public
void
batchAddOrUpdate
(
List
<
WeCustomer
>
weCustomer
)
{
this
.
baseMapper
.
batchAddOrUpdate
(
weCustomer
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeEmpleCodeServiceImpl.java
View file @
e79ffe8
...
...
@@ -422,7 +422,7 @@ public class WeEmpleCodeServiceImpl extends ServiceImpl<WeEmpleCodeMapper, WeEmp
weContactWay
.
setType
(
weEmpleCode
.
getCodeType
());
weContactWay
.
setScene
(
WeConstans
.
QR_CODE_EMPLE_CODE_SCENE
);
weContactWay
.
setSkip_verify
(
weEmpleCode
.
getIsJoinConfirmFriends
().
equals
(
new
Integer
(
0
))?
false
:
true
);
weContactWay
.
setState
(
String
.
valueOf
(
weEmpleCode
.
get
Id
()));
weContactWay
.
setState
(
String
.
valueOf
(
weEmpleCode
.
get
State
()));
if
(
CollectionUtil
.
isNotEmpty
(
weEmpleCodeUseScops
))
{
//员工列表
String
[]
userIdArr
=
weEmpleCodeUseScops
.
stream
().
filter
(
itme
->
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeFlowerCustomerRelServiceImpl.java
View file @
e79ffe8
...
...
@@ -69,14 +69,14 @@ public class WeFlowerCustomerRelServiceImpl extends ServiceImpl<WeFlowerCustomer
}
@Override
public
Map
<
String
,
Object
>
getUserAddCustomerStat
(
WeFlowerCustomerRel
weFlowerCustomerRel
)
{
public
Map
<
String
,
Object
>
getUserAddCustomerStat
(
String
codeId
,
String
beginTime
,
String
endTime
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>(
16
);
List
<
String
>
dateList
=
new
ArrayList
<>();
List
<
Long
>
statList
=
new
ArrayList
<>();
Long
resultTotal
=
0L
;
List
<
Map
<
String
,
Object
>>
userAddCustomerStatList
=
this
.
baseMapper
.
getUserAddCustomerStat
(
weFlowerCustomerRel
);
String
beginTime
=
weFlowerCustomerRel
.
getBeginTime
();
String
endTime
=
weFlowerCustomerRel
.
getEndTime
();
List
<
Map
<
String
,
Object
>>
userAddCustomerStatList
=
this
.
baseMapper
.
getUserAddCustomerStat
(
codeId
,
beginTime
,
endTime
);
//
String beginTime = weFlowerCustomerRel.getBeginTime();
//
String endTime = weFlowerCustomerRel.getEndTime();
if
(
beginTime
!=
null
&&
endTime
!=
null
)
{
Date
beginDate
=
DateUtils
.
dateTime
(
DateUtils
.
YYYY_MM_DD
,
beginTime
);
Date
endDate
=
DateUtils
.
dateTime
(
DateUtils
.
YYYY_MM_DD
,
endTime
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeScanEmpleCodeCountServiceImpl.java
0 → 100644
View file @
e79ffe8
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.wecom.domain.WeScanEmpleCodeCount
;
import
com.linkwechat.wecom.mapper.WeScanEmpleCodeCountMapper
;
import
com.linkwechat.wecom.service.IWeScanEmpleCodeCountService
;
import
org.springframework.stereotype.Service
;
@Service
public
class
WeScanEmpleCodeCountServiceImpl
extends
ServiceImpl
<
WeScanEmpleCodeCountMapper
,
WeScanEmpleCodeCount
>
implements
IWeScanEmpleCodeCountService
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionServiceImpl.java
View file @
e79ffe8
...
...
@@ -315,16 +315,21 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W
});
}
}
else
{
// WeTaskFissionRecord weTaskFissionRecord = weTaskFissionRecordService
// .selectWeTaskFissionRecordByIdAndCustomerId(Long.valueOf(fissionId), unionId);
// Optional.ofNullable(weTaskFissionRecord).orElseThrow(() -> new WeComException("任务记录信息不存在"));
// List<WeFlowerCustomerRel> list = weFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>()
// .eq(WeFlowerCustomerRel::getState, WeConstans.FISSION_PREFIX + weTaskFissionRecord.getId()));
// List<String> eidList = Optional.ofNullable(list).orElseGet(ArrayList::new).stream()
// .map(WeFlowerCustomerRel::getExternalUserid).collect(Collectors.toList());
// if (CollectionUtil.isNotEmpty(eidList)) {
// customerList.addAll(weCustomerService.listByIds(eidList));
// }
WeTaskFissionRecord
weTaskFissionRecord
=
weTaskFissionRecordService
.
selectWeTaskFissionRecordByIdAndCustomerId
(
Long
.
valueOf
(
fissionId
),
unionId
);
Optional
.
ofNullable
(
weTaskFissionRecord
).
orElseThrow
(()
->
new
WeComException
(
"任务记录信息不存在"
));
List
<
WeCustomer
>
weCustomers
=
weCustomerService
.
list
(
new
LambdaQueryWrapper
<
WeCustomer
>()
.
eq
(
WeCustomer:
:
getState
,
WeConstans
.
FISSION_PREFIX
+
weTaskFissionRecord
.
getId
()));
List
<
String
>
eidList
=
Optional
.
ofNullable
(
weCustomers
).
orElseGet
(
ArrayList:
:
new
).
stream
()
.
map
(
WeCustomer:
:
getExternalUserid
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
eidList
))
{
customerList
.
addAll
(
weCustomerService
.
listByIds
(
eidList
));
}
}
return
customerList
;
}
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
e79ffe8
...
...
@@ -592,7 +592,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert
id=
"batchAddOrUpdate"
>
INSERT INTO we_customer(
external_userid,
NAME
,
`name`
,
avatar,
type,
gender,
...
...
@@ -610,32 +610,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
email,
address,
phone,
add_method
add_method,
del_flag,
state
) values
<foreach
collection=
"weCustomers"
item=
"item"
index=
"index"
separator=
","
>
(#{item.externalUserid},#{item.name},#{item.avatar},#{item.type},#{item.gender}, #{item.unionid},#{item.birthday},
#{item.corpName},#{item.corpFullName},#{item.position},#{item.isOpenChat}, #{item.createTime},
#{item.createBy},#{item.firstUserId},#{item.firstAddTime},#{item.qq},#{item.email},#{item.address},#{item.phone},#{item.addMethod}
#{item.createBy},#{item.firstUserId},#{item.firstAddTime},#{item.qq},#{item.email},#{item.address},#{item.phone},#{item.addMethod},
#{item.delFlag},#{item.state}
)
</foreach>
ON DUPLICATE KEY UPDATE
NAME=IF(we_customer.NAME != null, VALUES(NAME), we_customer.NAME),
avatar=IF(we_customer.avatar != null, VALUES(avatar), we_customer.avatar),
type=IF(we_customer.type != null, VALUES(type), we_customer.type),
gender=IF(we_customer.gender != null, VALUES(gender), we_customer.gender),
unionid=IF(we_customer.unionid != null, VALUES(unionid), we_customer.unionid),
birthday=IF(we_customer.birthday != null,VALUES(birthday), we_customer.birthday),
corp_name=IF(we_customer.corp_name != null, VALUES(corp_name), we_customer.corp_name),
corp_full_name=IF(we_customer.corp_full_name != null, VALUES(corp_full_name), we_customer.corp_full_name),
position=IF(we_customer.position != null, VALUES(position), we_customer.position),
is_open_chat=IF(we_customer.is_open_chat != null, VALUES(is_open_chat), we_customer.is_open_chat),
first_user_id=IF(we_customer.first_user_id != null, VALUES(first_user_id), we_customer.first_user_id),
first_add_time=IF(we_customer.first_add_time != null, VALUES(first_add_time), we_customer.first_add_time),
qq=IF(we_customer.qq != null, VALUES(qq), we_customer.qq),
email=IF(we_customer.email != null, VALUES(email), we_customer.email),
address=IF(we_customer.address != null, VALUES(address), we_customer.address),
phone=IF(we_customer.phone != null, VALUES(phone), we_customer.phone),
add_method=IF(we_customer.add_method != null, VALUES(add_method), we_customer.add_method);
NAME=IF(VALUES(NAME)=null and VALUES(NAME)='',we_customer.NAME,VALUES(NAME)),
avatar=IF( VALUES(avatar)=null and VALUES(avatar)='', we_customer.avatar,VALUES(avatar)),
type=IF(VALUES(type),we_customer.type,VALUES(type)),
gender=IF(VALUES(gender) , we_customer.gender,VALUES(gender)),
unionid=IF(VALUES(unionid)=null and VALUES(unionid)='',we_customer.unionid,VALUES(unionid)),
birthday=IF(VALUES(birthday), we_customer.birthday,VALUES(birthday)),
corp_name=IF(VALUES(corp_name)=null and VALUES(corp_name)='',we_customer.corp_name,VALUES(corp_name)),
corp_full_name=IF(VALUES(corp_full_name)=null and VALUES(corp_full_name)='', we_customer.corp_full_name,VALUES(corp_full_name)),
position=IF(VALUES(position)=null and VALUES(position)='',we_customer.position,VALUES(position)),
is_open_chat=IF(VALUES(is_open_chat),we_customer.is_open_chat,VALUES(is_open_chat)),
first_user_id=IF(VALUES(first_user_id)=null and VALUES(first_user_id)='', we_customer.first_user_id,VALUES(first_user_id)),
first_add_time=IF(VALUES(first_add_time)=null ,we_customer.first_add_time,VALUES(first_add_time)),
qq=IF(VALUES(qq)=null and VALUES(qq)='', we_customer.qq,VALUES(qq)),
email=IF(VALUES(email)=null and VALUES(email)='',we_customer.email,VALUES(email)),
address=IF(VALUES(address)=null and VALUES(address)='',we_customer.address,VALUES(address)),
phone=IF( VALUES(phone)=null and VALUES(phone)='', we_customer.phone, VALUES(phone)),
add_method=IF(VALUES(add_method),we_customer.add_method,VALUES(add_method)),
del_flag=IF(VALUES(del_flag), we_customer.del_flag, VALUES(del_flag)),
state=IF( VALUES(state)=null and VALUES(state)='', we_customer.state, VALUES(state));
</insert>
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMessgaeResultMapper.xml
View file @
e79ffe8
...
...
@@ -72,11 +72,14 @@
<select
id=
"customerMessagePushs"
resultType=
"com.linkwechat.wecom.domain.vo.WeCustomerMessageResultVo"
>
SELECT
user_name,
GROUP_CONCAT(IFNULL(external_name,chat_name)
SEPARATOR '、'
) customers
GROUP_CONCAT(IFNULL(external_name,chat_name)) customers
FROM
we_customer_messgaeResult
<where>
message_id=#{messageId}
<if
test=
"messageId !=null"
>
AND message_id=#{messageId}
</if>
<if
test=
"status!=null"
>
AND `status`=#{status}
</if>
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeFlowerCustomerRelMapper.xml
View file @
e79ffe8
...
...
@@ -118,22 +118,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</update>
<select
id=
"getUserAddCustomerStat"
parameterType=
"WeFlowerCustomerRel"
resultType=
"java.util.HashMap"
>
<select
id=
"getUserAddCustomerStat"
resultType=
"java.util.HashMap"
>
select
left(wfcr.first_add
_time,10) as createTime , count(1) as total
left(wfcr.create
_time,10) as createTime , count(1) as total
from
we_
customer
wfcr
we_
scan_emple_code_count
wfcr
<where>
<if
test=
"userId != null and userId != ''"
>
and wfcr.first_user_id = #{userId}
</if>
<if
test=
"addWay != null and addWay != ''"
>
and wfcr.add_method = #{addWay}
</if>
<if
test=
"codeId != null and codeId != ''"
>
and wfcr.emple_code_id = #{codeId}
</if>
<if
test=
"beginTime != null and beginTime != ''"
>
<!-- 开始时间检索 -->
AND date_format(wfcr.
first_add
_time,'%y%m%d')
>
= date_format(#{beginTime},'%y%m%d')
AND date_format(wfcr.
create
_time,'%y%m%d')
>
= date_format(#{beginTime},'%y%m%d')
</if>
<if
test=
"endTime != null and endTime != ''"
>
<!-- 结束时间检索 -->
AND date_format(wfcr.
first_add
_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
AND date_format(wfcr.
create
_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
</if>
</where>
group by
left(wfcr.first_add_time,10)
left(wfcr.create_time,10)
<!-- select-->
<!-- left(wfcr.first_add_time,10) as createTime , count(1) as total-->
<!-- from-->
<!-- we_customer wfcr-->
<!-- <where>-->
<!-- <if test="userId != null and userId != ''">and wfcr.first_user_id = #{userId}</if>-->
<!-- <if test="addWay != null and addWay != ''">and wfcr.add_method = #{addWay}</if>-->
<!-- <if test="beginTime != null and beginTime != ''"><!– 开始时间检索 –>-->
<!-- AND date_format(wfcr.first_add_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')-->
<!-- </if>-->
<!-- <if test="endTime != null and endTime != ''"><!– 结束时间检索 –>-->
<!-- AND date_format(wfcr.first_add_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')-->
<!-- </if>-->
<!-- </where>-->
<!-- group by-->
<!-- left(wfcr.first_add_time,10)-->
</select>
</mapper>
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeFlowerCustomerTagRelMapper.xml
View file @
e79ffe8
...
...
@@ -85,7 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ON DUPLICATE KEY UPDATE
user_id=IF(we_flower_customer_tag_rel.user_id != null, VALUES(user_id), we_flower_customer_tag_rel.user_id),
external_userid=IF(we_flower_customer_tag_rel.external_userid != null, VALUES(external_userid), we_flower_customer_tag_rel.external_userid),
tag_id=IF(we_flower_customer_tag_rel.tag_id != null, VALUES(tag_id), we_flower_customer_tag_rel.tag_id);
tag_id=IF(we_flower_customer_tag_rel.tag_id != null, VALUES(tag_id), we_flower_customer_tag_rel.tag_id),
create_time=IF(we_flower_customer_tag_rel.create_time != null, VALUES(create_time), we_flower_customer_tag_rel.create_time);
</insert>
</mapper>
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeScanEmpleCodeCountMapper.xml
0 → 100644
View file @
e79ffe8
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.linkwechat.wecom.mapper.WeScanEmpleCodeCountMapper"
>
</mapper>
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeUserMapper.xml
View file @
e79ffe8
...
...
@@ -156,11 +156,20 @@
wc.`name` as customerName,
wu.user_name as takeUserName,
wac.allocate_time,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id in (wu.department)) as department,
wc.avatar,
wc.birthday,
wc.gender,
GROUP_CONCAT(wt.`tag_id`) as tagIds,
GROUP_CONCAT(wt.`name`) as tagNames,
wu.user_name,
wc.first_add_time
FROM
we_allocate_customer wac
LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid
LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid
and wac.takeover_userid=wc.first_user_id
LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid
LEFT JOIN we_flower_customer_tag_rel wfctr ON wfctr.del_flag=0 AND wfctr.external_userid=wc.external_userid AND wfctr.user_id=wc.first_user_id
LEFT JOIN we_tag wt ON wt.tag_id=wfctr.tag_id
<where>
<if
test=
"handoverUserId != null and handoverUserId !=''"
>
and wac.handover_userid=#{handoverUserId}
</if>
<if
test=
"beginTime != null and beginTime !='' and endTime != null and endTime !=''"
>
...
...
sql/link_wechat_prod.sql
View file @
e79ffe8
...
...
@@ -11,7 +11,7 @@
Target Server Version : 50718
File Encoding : 65001
Date:
04/11/2021 18:03:23
Date:
12/11/2021 11:27:17
*/
SET
NAMES
utf8mb4
;
...
...
@@ -557,7 +557,7 @@ CREATE TABLE `sys_job_log` (
`exception_info`
varchar
(
2000
)
DEFAULT
''
COMMENT
'异常信息'
,
`create_time`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
PRIMARY
KEY
(
`job_log_id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
291556
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'定时任务调度日志表'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
300608
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'定时任务调度日志表'
;
-- ----------------------------
-- Records of sys_job_log
...
...
@@ -580,7 +580,7 @@ CREATE TABLE `sys_logininfor` (
`msg`
varchar
(
255
)
DEFAULT
''
COMMENT
'提示消息'
,
`login_time`
datetime
DEFAULT
NULL
COMMENT
'访问时间'
,
PRIMARY
KEY
(
`info_id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
8272
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'系统访问记录'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
9419
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'系统访问记录'
;
-- ----------------------------
-- Records of sys_logininfor
...
...
@@ -611,7 +611,7 @@ CREATE TABLE `sys_menu` (
`update_time`
datetime
DEFAULT
NULL
COMMENT
'更新时间'
,
`remark`
varchar
(
500
)
DEFAULT
''
COMMENT
'备注'
,
PRIMARY
KEY
(
`menu_id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
21
89
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'菜单权限表'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
21
93
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'菜单权限表'
;
-- ----------------------------
-- Records of sys_menu
...
...
@@ -919,7 +919,7 @@ CREATE TABLE `sys_oper_log` (
`error_msg`
varchar
(
2000
)
DEFAULT
''
COMMENT
'错误消息'
,
`oper_time`
datetime
DEFAULT
NULL
COMMENT
'操作时间'
,
PRIMARY
KEY
(
`oper_id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
78978
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'操作日志记录'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
90915
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'操作日志记录'
;
-- ----------------------------
-- Records of sys_oper_log
...
...
@@ -1827,7 +1827,7 @@ CREATE TABLE `we_chat_contact_msg` (
`update_time`
datetime
DEFAULT
NULL
COMMENT
'修改时间'
,
`del_flg`
tinyint
(
4
)
NOT
NULL
DEFAULT
'0'
COMMENT
'删除标识 0正常 1 删除'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
531
DEFAULT
CHARSET
=
utf8
COMMENT
=
'会话消息'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
604
DEFAULT
CHARSET
=
utf8
COMMENT
=
'会话消息'
;
-- ----------------------------
-- Records of we_chat_contact_msg
...
...
@@ -1853,7 +1853,7 @@ CREATE TABLE `we_chat_contact_sensitive_msg` (
`from_id`
varchar
(
32
)
NOT
NULL
COMMENT
'发送人id'
,
`msg_time`
datetime
NOT
NULL
COMMENT
'发送时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
3
DEFAULT
CHARSET
=
utf8mb4
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
6
DEFAULT
CHARSET
=
utf8mb4
;
-- ----------------------------
-- Records of we_chat_contact_sensitive_msg
...
...
@@ -2047,7 +2047,7 @@ CREATE TABLE `we_customer` (
`update_time`
datetime
DEFAULT
NULL
,
`create_by`
varchar
(
20
)
DEFAULT
NULL
,
`update_by`
varchar
(
20
)
DEFAULT
NULL
,
`del_flag`
tinyint
(
4
)
DEFAULT
'0'
COMMENT
'删除标识 0 有效 1 删除'
,
`del_flag`
tinyint
(
1
)
unsigned
zerofill
DEFAULT
'0'
COMMENT
'删除标识 0 有效 1 删除'
,
`first_user_id`
varchar
(
32
)
NOT
NULL
COMMENT
'添加人id'
,
`first_add_time`
datetime
DEFAULT
NULL
COMMENT
'添加时间'
,
`track_state`
tinyint
(
1
)
DEFAULT
NULL
COMMENT
'1:待跟进;2:跟进中;3:已成交;4:无意向;5:已流失'
,
...
...
@@ -2058,8 +2058,9 @@ CREATE TABLE `we_customer` (
`qq`
varchar
(
50
)
DEFAULT
NULL
COMMENT
'QQ号'
,
`other_descr`
varchar
(
1000
)
DEFAULT
NULL
COMMENT
'其他描述'
,
`address`
varchar
(
300
)
DEFAULT
NULL
COMMENT
'地址'
,
`add_method`
tiny
int
(
1
)
DEFAULT
NULL
,
`add_method`
int
(
1
)
DEFAULT
NULL
,
`customer_type`
tinyint
(
1
)
DEFAULT
NULL
,
`state`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'企业自定义的state参数,用于区分客户具体是通过哪个「联系我」添加,由企业通过创建「联系我」方式指定'
,
PRIMARY
KEY
(
`external_userid`
,
`first_user_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'企业微信客户表'
;
...
...
@@ -2092,7 +2093,7 @@ CREATE TABLE `we_customer_message` (
`actual_send`
int
(
11
)
DEFAULT
'0'
COMMENT
'实际发送消息数(客户对应多少人 客户群对应多个群)'
,
`timed_task`
int
(
1
)
DEFAULT
'0'
COMMENT
'是否定时任务 0 常规 1 定时发送'
,
PRIMARY
KEY
(
`message_id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
145
618654461126656
1
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'群发消息 微信消息表'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
145
870084837173248
1
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'群发消息 微信消息表'
;
-- ----------------------------
-- Records of we_customer_message
...
...
@@ -2146,7 +2147,7 @@ CREATE TABLE `we_customer_messageTimeTask` (
`exce_msg`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'群发异常消息'
,
`del_flag`
int
(
2
)
DEFAULT
'0'
COMMENT
'0:正常;1:删除;'
,
PRIMARY
KEY
(
`task_id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
31
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
49
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Records of we_customer_messageTimeTask
...
...
@@ -2502,7 +2503,7 @@ CREATE TABLE `we_group_member` (
`del_flag`
tinyint
(
4
)
NOT
NULL
DEFAULT
'0'
COMMENT
'删除标识 0 正常 1 删除'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`uindex_chatid_userid`
(
`chat_id`
,
`user_id`
,
`del_flag`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
14300036997492
29163
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'企业微信群成员'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
14300036997492
35048
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'企业微信群成员'
;
-- ----------------------------
-- Records of we_group_member
...
...
@@ -2639,6 +2640,7 @@ CREATE TABLE `we_group_message_template` (
`filter_condition`
varchar
(
2000
)
DEFAULT
NULL
COMMENT
'条件筛选'
,
`is_task`
tinyint
(
4
)
DEFAULT
'0'
COMMENT
'是否定时任务 0 立即发送 1 定时发送'
,
`status`
tinyint
(
4
)
DEFAULT
'0'
COMMENT
'是否执行 -1:失败 0:未执行 1:完成 2:取消'
,
`refresh_time`
datetime
DEFAULT
NULL
COMMENT
'同步时间'
,
`create_by`
varchar
(
64
)
NOT
NULL
DEFAULT
'0'
COMMENT
'创建人'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`update_by`
varchar
(
64
)
DEFAULT
'0'
COMMENT
'修改人'
,
...
...
@@ -3108,6 +3110,25 @@ BEGIN;
COMMIT
;
-- ----------------------------
-- Table structure for we_scan_emple_code_count
-- ----------------------------
DROP
TABLE
IF
EXISTS
`we_scan_emple_code_count`
;
CREATE
TABLE
`we_scan_emple_code_count`
(
`id`
bigint
(
20
)
NOT
NULL
COMMENT
'主键'
,
`external_userid`
varchar
(
32
)
DEFAULT
NULL
,
`user_id`
varchar
(
32
)
DEFAULT
NULL
,
`create_time`
datetime
DEFAULT
NULL
,
`emple_code_id`
bigint
(
20
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'扫描员工码,统计'
;
-- ----------------------------
-- Records of we_scan_emple_code_count
-- ----------------------------
BEGIN
;
COMMIT
;
-- ----------------------------
-- Table structure for we_sensitive
-- ----------------------------
DROP
TABLE
IF
EXISTS
`we_sensitive`
;
...
...
@@ -3124,7 +3145,7 @@ CREATE TABLE `we_sensitive` (
`update_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'更新人'
,
`update_time`
datetime
DEFAULT
NULL
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
5
4
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'敏感词设置表'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
5
7
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'敏感词设置表'
;
-- ----------------------------
-- Records of we_sensitive
...
...
@@ -3192,7 +3213,7 @@ CREATE TABLE `we_sensitive_audit_scope` (
`audit_scope_id`
varchar
(
64
)
NOT
NULL
COMMENT
'审计对象id'
,
`audit_scope_name`
varchar
(
64
)
NOT
NULL
COMMENT
'审计对象名称'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
7
1
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'敏感词审计范围'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
7
4
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'敏感词审计范围'
;
-- ----------------------------
-- Records of we_sensitive_audit_scope
...
...
@@ -3275,7 +3296,7 @@ CREATE TABLE `we_task_fission` (
`update_by`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'更新人'
,
`update_time`
datetime
DEFAULT
NULL
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
75
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'任务宝表'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
86
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'任务宝表'
;
-- ----------------------------
-- Records of we_task_fission
...
...
@@ -3320,7 +3341,7 @@ CREATE TABLE `we_task_fission_record` (
`complete_time`
datetime
DEFAULT
NULL
COMMENT
'完成时间'
,
`poster`
varchar
(
500
)
DEFAULT
NULL
COMMENT
'海报链接'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
76
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'裂变任务记录'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
82
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'裂变任务记录'
;
-- ----------------------------
-- Records of we_task_fission_record
...
...
@@ -3363,7 +3384,7 @@ CREATE TABLE `we_task_fission_staff` (
`staff_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'员工或组织机构id,为全部时为空'
,
`staff_name`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'员工或组织机构姓名,类型为全部时,为空'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
12
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'裂变任务员工列表'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
30
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'裂变任务员工列表'
;
-- ----------------------------
-- Records of we_task_fission_staff
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment