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 2c6f74b2
authored
Jan 12, 2021
by
xinlaa
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into front_end_dev
2 parents
f3fecc86
731238f9
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
1380 additions
and
249 deletions
README.md
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatCollectionController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatItemController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatSideController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WePosterController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WePosterFontController.java
linkwe-admin/src/main/resources/application.yml
linkwe-common/src/main/java/com/linkwechat/common/core/elasticsearch/ElasticSearch.java
linkwe-common/src/main/java/com/linkwechat/common/utils/img/NetFileUtils.java
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/RyTask.java
linkwe-ui/package.json
linkwe-ui/src/api/content.js
linkwe-ui/src/utils/common.js
linkwe-ui/src/views/conversation/component/chat.vue
linkwe-ui/src/views/conversation/component/curList.vue
linkwe-ui/src/views/conversation/component/cusChat.vue
linkwe-ui/src/views/conversation/component/list.vue
linkwe-ui/src/views/conversation/content.vue
linkwe-ui/src/views/conversation/page/employeeTest.vue
linkwe-ui/src/views/conversation/page/roleTest.vue
linkwe-ui/src/views/conversation/page/userTest.vue
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeChatSide.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeChatSideVo.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatCollectionMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatItemMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatSideMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatCollectionService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatContactMappingService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatItemService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatSideService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatCollectionServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatContactMappingServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatItemServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatSideServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeConversationArchiveServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePosterServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeSensitiveServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeChatCollectionMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeChatItemMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeChatSideMapper.xml
README.md
View file @
2c6f74b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<p></p>
<p></p>
<p
align=
"center"
>
<p
align=
"center"
>
<img
alt=
"logo"
src=
"https://images.gitee.com/uploads/images/202
0/1203/143430_03205b51
_1480777.png"
width=
"120"
style=
"margin-bottom: 0px;"
>
<img
alt=
"logo"
src=
"https://images.gitee.com/uploads/images/202
1/0107/210318_e1f66c96
_1480777.png"
width=
"120"
style=
"margin-bottom: 0px;"
>
</p>
</p>
<h2
align=
"center"
>
LinkWeChat —— 让每个企业都是私域流量营销专家
</h2>
<h2
align=
"center"
>
LinkWeChat —— 让每个企业都是私域流量营销专家
</h2>
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatCollectionController.java
View file @
2c6f74b
...
@@ -3,12 +3,16 @@ package com.linkwechat.web.controller.wecom;
...
@@ -3,12 +3,16 @@ package com.linkwechat.web.controller.wecom;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
com.linkwechat.wecom.service.IWeChatCollectionService
;
import
com.linkwechat.wecom.service.IWeChatCollectionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
/**
* 聊天工具 侧边栏栏 素材收藏
* 聊天工具 侧边栏栏 素材收藏
*
*
...
@@ -28,8 +32,8 @@ public class WeChatCollectionController extends BaseController {
...
@@ -28,8 +32,8 @@ public class WeChatCollectionController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:collection:add')"
)
@PreAuthorize
(
"@ss.hasPermi('chat:collection:add')"
)
@Log
(
title
=
"添加收藏"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"添加收藏"
,
businessType
=
BusinessType
.
INSERT
)
@P
ostMapping
@P
utMapping
(
"addCollection"
)
public
AjaxResult
addCollection
(
@RequestParam
(
value
=
"materialId"
)
Long
materialId
,
@RequestParam
(
value
=
"userId"
)
Long
userId
)
{
public
AjaxResult
addCollection
(
@RequestParam
(
value
=
"materialId"
)
Long
materialId
,
@RequestParam
(
value
=
"userId"
)
Long
userId
)
{
return
toAjax
(
weChatCollectionService
.
addCollection
(
materialId
,
userId
));
return
toAjax
(
weChatCollectionService
.
addCollection
(
materialId
,
userId
));
}
}
...
@@ -39,9 +43,20 @@ public class WeChatCollectionController extends BaseController {
...
@@ -39,9 +43,20 @@ public class WeChatCollectionController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:collection:delete')"
)
@PreAuthorize
(
"@ss.hasPermi('chat:collection:delete')"
)
@Log
(
title
=
"取消收藏"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"取消收藏"
,
businessType
=
BusinessType
.
UPDATE
)
@P
utMapping
@P
ostMapping
(
value
=
"cancleCollection"
)
public
AjaxResult
cancleCollection
(
@RequestParam
(
value
=
"materialId"
)
Long
materialId
,
@RequestParam
(
value
=
"userId"
)
Long
userId
)
{
public
AjaxResult
cancleCollection
(
@RequestParam
(
value
=
"materialId"
)
Long
materialId
,
@RequestParam
(
value
=
"userId"
)
Long
userId
)
{
return
toAjax
(
weChatCollectionService
.
cancleCollection
(
materialId
,
userId
));
return
toAjax
(
weChatCollectionService
.
cancleCollection
(
materialId
,
userId
));
}
}
/**
* 收藏列表
*/
@PreAuthorize
(
"@ss.hasPermi('chat:collection:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
@RequestParam
(
value
=
"userId"
)
Long
userId
)
{
startPage
();
List
<
WeChatSideVo
>
collections
=
weChatCollectionService
.
collections
(
userId
);
return
getDataTable
(
collections
);
}
}
}
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatItemController.java
View file @
2c6f74b
...
@@ -3,15 +3,16 @@ package com.linkwechat.web.controller.wecom;
...
@@ -3,15 +3,16 @@ package com.linkwechat.web.controller.wecom;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.wecom.domain.dto.WeChatItemDto
;
import
com.linkwechat.wecom.domain.dto.WeChatItemDto
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
com.linkwechat.wecom.service.IWeChatItemService
;
import
com.linkwechat.wecom.service.IWeChatItemService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
java.util.List
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* 聊天工具侧边栏
* 聊天工具侧边栏
...
@@ -35,6 +36,15 @@ public class WeChatItemController extends BaseController {
...
@@ -35,6 +36,15 @@ public class WeChatItemController extends BaseController {
return
toAjax
(
weChatItemService
.
checkItems
(
chatItemDto
));
return
toAjax
(
weChatItemService
.
checkItems
(
chatItemDto
));
}
}
/**
* h5素材列表
*/
@PreAuthorize
(
"@ss.hasPermi('chat:item:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
@RequestParam
(
value
=
"sideId"
)
Long
sideId
)
{
startPage
();
List
<
WeChatSideVo
>
weChatSideVos
=
weChatItemService
.
chatItems
(
sideId
);
return
getDataTable
(
weChatSideVos
);
}
}
}
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatSideController.java
View file @
2c6f74b
...
@@ -30,9 +30,9 @@ public class WeChatSideController extends BaseController {
...
@@ -30,9 +30,9 @@ public class WeChatSideController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:side:list')"
)
@PreAuthorize
(
"@ss.hasPermi('chat:side:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
()
{
public
TableDataInfo
list
(
@RequestParam
(
value
=
"h5"
)
String
h5
)
{
startPage
();
startPage
();
List
<
WeChatSide
>
weChatSides
=
weChatSideService
.
chatSides
();
List
<
WeChatSide
>
weChatSides
=
weChatSideService
.
chatSides
(
h5
);
return
getDataTable
(
weChatSides
);
return
getDataTable
(
weChatSides
);
}
}
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WePosterController.java
View file @
2c6f74b
...
@@ -5,22 +5,19 @@ import com.linkwechat.common.core.domain.AjaxResult;
...
@@ -5,22 +5,19 @@ import com.linkwechat.common.core.domain.AjaxResult;
import
com.linkwechat.common.enums.MediaType
;
import
com.linkwechat.common.enums.MediaType
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.wecom.domain.WeMaterial
;
import
com.linkwechat.wecom.domain.WePoster
;
import
com.linkwechat.wecom.domain.WePoster
;
import
com.linkwechat.wecom.domain.WePosterFont
;
import
com.linkwechat.wecom.domain.WePosterSubassembly
;
import
com.linkwechat.wecom.domain.WePosterSubassembly
;
import
com.linkwechat.wecom.service.IWePosterFontService
;
import
com.linkwechat.wecom.service.IWePosterFontService
;
import
com.linkwechat.wecom.service.IWePosterService
;
import
com.linkwechat.wecom.service.IWePosterService
;
import
com.linkwechat.wecom.service.IWePosterSubassemblyService
;
import
com.linkwechat.wecom.service.IWePosterSubassemblyService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.awt.*
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -46,8 +43,9 @@ public class WePosterController extends BaseController {
...
@@ -46,8 +43,9 @@ public class WePosterController extends BaseController {
@PostMapping
(
value
=
"insert"
)
@PostMapping
(
value
=
"insert"
)
@ApiOperation
(
"创建海报"
)
@ApiOperation
(
"创建海报"
)
@PreAuthorize
(
"@ss.hasAnyPermi('wecom:poster:insert')"
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AjaxResult
insert
(
@RequestBody
WePoster
poster
){
public
AjaxResult
insert
(
@RequestBody
WePoster
poster
)
{
wePosterService
.
generateSimpleImg
(
poster
);
wePosterService
.
generateSimpleImg
(
poster
);
poster
.
setId
(
SnowFlakeUtil
.
nextId
());
poster
.
setId
(
SnowFlakeUtil
.
nextId
());
poster
.
setDelFlag
(
0
);
poster
.
setDelFlag
(
0
);
...
@@ -68,37 +66,38 @@ public class WePosterController extends BaseController {
...
@@ -68,37 +66,38 @@ public class WePosterController extends BaseController {
@PutMapping
(
value
=
"update"
)
@PutMapping
(
value
=
"update"
)
@ApiOperation
(
"修改海报"
)
@ApiOperation
(
"修改海报"
)
@PreAuthorize
(
"@ss.hasAnyPermi('wecom:poster:update')"
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AjaxResult
update
(
@RequestBody
WePoster
poster
){
public
AjaxResult
update
(
@RequestBody
WePoster
poster
)
{
if
(
poster
.
getId
()
==
null
)
{
if
(
poster
.
getId
()
==
null
)
{
return
AjaxResult
.
error
(
"id为空"
);
return
AjaxResult
.
error
(
"id为空"
);
}
}
poster
.
setMediaType
(
null
);
poster
.
setMediaType
(
null
);
wePosterService
.
generateSimpleImg
(
poster
);
wePosterService
.
generateSimpleImg
(
poster
);
wePosterService
.
saveOrUpdate
(
poster
);
wePosterService
.
saveOrUpdate
(
poster
);
List
<
WePosterSubassembly
>
posterSubassemblyList
=
wePosterSubassemblyService
.
lambdaQuery
().
eq
(
WePosterSubassembly:
:
getPosterId
,
poster
.
getId
()).
eq
(
WePosterSubassembly:
:
getDelFlag
,
1
).
list
();
List
<
WePosterSubassembly
>
posterSubassemblyList
=
wePosterSubassemblyService
.
lambdaQuery
().
eq
(
WePosterSubassembly:
:
getPosterId
,
poster
.
getId
()).
eq
(
WePosterSubassembly:
:
getDelFlag
,
1
).
list
();
Map
<
Long
,
WePosterSubassembly
>
posterSubassemblyMap
=
posterSubassemblyList
.
stream
().
collect
(
Collectors
.
toMap
(
WePosterSubassembly:
:
getId
,
p
->
p
));
Map
<
Long
,
WePosterSubassembly
>
posterSubassemblyMap
=
posterSubassemblyList
.
stream
().
collect
(
Collectors
.
toMap
(
WePosterSubassembly:
:
getId
,
p
->
p
));
List
<
WePosterSubassembly
>
insertList
=
new
ArrayList
<>();
List
<
WePosterSubassembly
>
insertList
=
new
ArrayList
<>();
List
<
WePosterSubassembly
>
updateList
=
new
ArrayList
<>();
List
<
WePosterSubassembly
>
updateList
=
new
ArrayList
<>();
poster
.
getPosterSubassemblyList
().
forEach
(
wePosterSubassembly
->
{
poster
.
getPosterSubassemblyList
().
forEach
(
wePosterSubassembly
->
{
if
(
wePosterSubassembly
.
getId
()
==
null
)
{
if
(
wePosterSubassembly
.
getId
()
==
null
)
{
wePosterSubassembly
.
setId
(
SnowFlakeUtil
.
nextId
());
wePosterSubassembly
.
setId
(
SnowFlakeUtil
.
nextId
());
wePosterSubassembly
.
setPosterId
(
poster
.
getId
());
wePosterSubassembly
.
setPosterId
(
poster
.
getId
());
wePosterSubassembly
.
setDelFlag
(
0
);
wePosterSubassembly
.
setDelFlag
(
0
);
insertList
.
add
(
wePosterSubassembly
);
insertList
.
add
(
wePosterSubassembly
);
}
else
{
}
else
{
posterSubassemblyMap
.
remove
(
wePosterSubassembly
.
getId
());
posterSubassemblyMap
.
remove
(
wePosterSubassembly
.
getId
());
updateList
.
add
(
wePosterSubassembly
);
updateList
.
add
(
wePosterSubassembly
);
}
}
});
});
if
(!
CollectionUtils
.
isEmpty
(
insertList
))
{
if
(!
CollectionUtils
.
isEmpty
(
insertList
))
{
wePosterSubassemblyService
.
saveBatch
(
insertList
);
wePosterSubassemblyService
.
saveBatch
(
insertList
);
}
}
if
(!
CollectionUtils
.
isEmpty
(
updateList
))
{
if
(!
CollectionUtils
.
isEmpty
(
updateList
))
{
wePosterSubassemblyService
.
updateBatchById
(
updateList
);
wePosterSubassemblyService
.
updateBatchById
(
updateList
);
}
}
List
<
WePosterSubassembly
>
deleteList
=
new
ArrayList
<>(
posterSubassemblyMap
.
values
());
List
<
WePosterSubassembly
>
deleteList
=
new
ArrayList
<>(
posterSubassemblyMap
.
values
());
if
(!
CollectionUtils
.
isEmpty
(
deleteList
))
{
if
(!
CollectionUtils
.
isEmpty
(
deleteList
))
{
deleteList
.
forEach
(
wePosterSubassembly
->
wePosterSubassembly
.
setDelFlag
(
1
));
deleteList
.
forEach
(
wePosterSubassembly
->
wePosterSubassembly
.
setDelFlag
(
1
));
wePosterSubassemblyService
.
updateBatchById
(
deleteList
);
wePosterSubassemblyService
.
updateBatchById
(
deleteList
);
}
}
...
@@ -118,19 +117,21 @@ public class WePosterController extends BaseController {
...
@@ -118,19 +117,21 @@ public class WePosterController extends BaseController {
}*/
}*/
@GetMapping
(
value
=
"entity/{id}"
)
@GetMapping
(
value
=
"entity/{id}"
)
@PreAuthorize
(
"@ss.hasAnyPermi('wecom:poster:entity')"
)
@ApiOperation
(
"查询海报详情"
)
@ApiOperation
(
"查询海报详情"
)
public
AjaxResult
entity
(
@PathVariable
Long
id
){
public
AjaxResult
entity
(
@PathVariable
Long
id
)
{
return
AjaxResult
.
success
(
wePosterService
.
selectOne
(
id
));
return
AjaxResult
.
success
(
wePosterService
.
selectOne
(
id
));
}
}
@GetMapping
(
value
=
"page"
)
@GetMapping
(
value
=
"page"
)
@ApiOperation
(
"分页查询海报"
)
@ApiOperation
(
"分页查询海报"
)
public
AjaxResult
page
(
Long
categoryId
,
String
name
){
@PreAuthorize
(
"@ss.hasAnyPermi('wecom:poster:page')"
)
public
AjaxResult
page
(
Long
categoryId
,
String
name
)
{
startPage
();
startPage
();
List
<
WePoster
>
fontList
=
wePosterService
.
lambdaQuery
()
List
<
WePoster
>
fontList
=
wePosterService
.
lambdaQuery
()
.
eq
(
WePoster:
:
getDelFlag
,
0
)
.
eq
(
WePoster:
:
getDelFlag
,
0
)
.
eq
(
categoryId
!=
null
,
WePoster:
:
getCategoryId
,
categoryId
)
.
eq
(
categoryId
!=
null
,
WePoster:
:
getCategoryId
,
categoryId
)
.
like
(
StringUtils
.
isNotBlank
(
name
),
WePoster:
:
getTitle
,
name
)
.
like
(
StringUtils
.
isNotBlank
(
name
),
WePoster:
:
getTitle
,
name
)
.
orderByDesc
(
WePoster:
:
getCreateTime
)
.
orderByDesc
(
WePoster:
:
getCreateTime
)
.
list
();
.
list
();
return
AjaxResult
.
success
(
getDataTable
(
fontList
));
return
AjaxResult
.
success
(
getDataTable
(
fontList
));
...
@@ -138,14 +139,15 @@ public class WePosterController extends BaseController {
...
@@ -138,14 +139,15 @@ public class WePosterController extends BaseController {
@DeleteMapping
(
value
=
"delete/{id}"
)
@DeleteMapping
(
value
=
"delete/{id}"
)
@ApiOperation
(
value
=
"删除海报"
)
@ApiOperation
(
value
=
"删除海报"
)
@PreAuthorize
(
"@ss.hasAnyPermi('wecom:poster:delete')"
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AjaxResult
deletePosterFont
(
@PathVariable
Long
id
){
public
AjaxResult
deletePosterFont
(
@PathVariable
Long
id
)
{
wePosterService
.
lambdaUpdate
().
set
(
WePoster:
:
getDelFlag
,
1
).
eq
(
WePoster:
:
getId
,
id
);
wePosterService
.
update
(
wePosterSubassemblyService
.
lambdaUpdate
().
set
(
WePosterSubassembly:
:
getDelFlag
,
1
).
eq
(
WePosterSubassembly:
:
getPosterId
,
id
);
wePosterService
.
lambdaUpdate
().
set
(
WePoster:
:
getDelFlag
,
1
).
eq
(
WePoster:
:
getId
,
id
));
wePosterSubassemblyService
.
update
(
wePosterSubassemblyService
.
lambdaUpdate
().
set
(
WePosterSubassembly:
:
getDelFlag
,
1
).
eq
(
WePosterSubassembly:
:
getPosterId
,
id
));
return
AjaxResult
.
success
(
"删除成功"
);
return
AjaxResult
.
success
(
"删除成功"
);
}
}
}
}
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WePosterFontController.java
View file @
2c6f74b
...
@@ -4,7 +4,6 @@ import com.linkwechat.common.core.controller.BaseController;
...
@@ -4,7 +4,6 @@ import com.linkwechat.common.core.controller.BaseController;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.enums.MediaType
;
import
com.linkwechat.common.enums.MediaType
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.web.controller.common.CommonController
;
import
com.linkwechat.wecom.domain.WePosterFont
;
import
com.linkwechat.wecom.domain.WePosterFont
;
import
com.linkwechat.wecom.service.IWePosterFontService
;
import
com.linkwechat.wecom.service.IWePosterFontService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -30,7 +29,7 @@ public class WePosterFontController extends BaseController {
...
@@ -30,7 +29,7 @@ public class WePosterFontController extends BaseController {
@PostMapping
(
value
=
"posterFont"
)
@PostMapping
(
value
=
"posterFont"
)
@ApiOperation
(
"创建海报字体"
)
@ApiOperation
(
"创建海报字体"
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AjaxResult
insertPosterFont
(
@RequestBody
WePosterFont
posterFont
){
public
AjaxResult
insertPosterFont
(
@RequestBody
WePosterFont
posterFont
)
{
posterFont
.
setId
(
SnowFlakeUtil
.
nextId
());
posterFont
.
setId
(
SnowFlakeUtil
.
nextId
());
posterFont
.
setDelFlag
(
0
);
posterFont
.
setDelFlag
(
0
);
posterFont
.
setMediaType
(
MediaType
.
POSTER_FONT
.
getType
());
posterFont
.
setMediaType
(
MediaType
.
POSTER_FONT
.
getType
());
...
@@ -42,8 +41,8 @@ public class WePosterFontController extends BaseController {
...
@@ -42,8 +41,8 @@ public class WePosterFontController extends BaseController {
@PutMapping
(
value
=
"posterFont"
)
@PutMapping
(
value
=
"posterFont"
)
@ApiOperation
(
"修改海报字体"
)
@ApiOperation
(
"修改海报字体"
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AjaxResult
updatePosterFont
(
@RequestBody
WePosterFont
posterFont
){
public
AjaxResult
updatePosterFont
(
@RequestBody
WePosterFont
posterFont
)
{
if
(
posterFont
.
getId
()
==
null
)
{
if
(
posterFont
.
getId
()
==
null
)
{
return
AjaxResult
.
error
(
"id为空"
);
return
AjaxResult
.
error
(
"id为空"
);
}
}
posterFont
.
setMediaType
(
null
);
posterFont
.
setMediaType
(
null
);
...
@@ -53,9 +52,9 @@ public class WePosterFontController extends BaseController {
...
@@ -53,9 +52,9 @@ public class WePosterFontController extends BaseController {
@GetMapping
(
value
=
"posterFontList"
)
@GetMapping
(
value
=
"posterFontList"
)
@ApiOperation
(
"列表查询海报字体"
)
@ApiOperation
(
"列表查询海报字体"
)
public
AjaxResult
selectPosterFontList
(){
public
AjaxResult
selectPosterFontList
()
{
List
<
WePosterFont
>
fontList
=
wePosterFontService
.
lambdaQuery
()
List
<
WePosterFont
>
fontList
=
wePosterFontService
.
lambdaQuery
()
.
eq
(
WePosterFont:
:
getDelFlag
,
0
)
.
eq
(
WePosterFont:
:
getDelFlag
,
0
)
.
orderByDesc
(
WePosterFont:
:
getOrder
)
.
orderByDesc
(
WePosterFont:
:
getOrder
)
.
orderByDesc
(
WePosterFont:
:
getCreateTime
)
.
orderByDesc
(
WePosterFont:
:
getCreateTime
)
.
list
();
.
list
();
...
@@ -64,10 +63,10 @@ public class WePosterFontController extends BaseController {
...
@@ -64,10 +63,10 @@ public class WePosterFontController extends BaseController {
@GetMapping
(
value
=
"posterFontPage"
)
@GetMapping
(
value
=
"posterFontPage"
)
@ApiOperation
(
"分页查询海报字体"
)
@ApiOperation
(
"分页查询海报字体"
)
public
AjaxResult
selectPosterFontPage
(){
public
AjaxResult
selectPosterFontPage
()
{
startPage
();
startPage
();
List
<
WePosterFont
>
fontList
=
wePosterFontService
.
lambdaQuery
()
List
<
WePosterFont
>
fontList
=
wePosterFontService
.
lambdaQuery
()
.
eq
(
WePosterFont:
:
getDelFlag
,
0
)
.
eq
(
WePosterFont:
:
getDelFlag
,
0
)
.
orderByDesc
(
WePosterFont:
:
getOrder
)
.
orderByDesc
(
WePosterFont:
:
getOrder
)
.
orderByDesc
(
WePosterFont:
:
getCreateTime
)
.
orderByDesc
(
WePosterFont:
:
getCreateTime
)
.
list
();
.
list
();
...
@@ -77,11 +76,11 @@ public class WePosterFontController extends BaseController {
...
@@ -77,11 +76,11 @@ public class WePosterFontController extends BaseController {
@DeleteMapping
(
value
=
"posterFont/{id}"
)
@DeleteMapping
(
value
=
"posterFont/{id}"
)
@ApiOperation
(
"删除海报字体"
)
@ApiOperation
(
"删除海报字体"
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AjaxResult
deletePosterFont
(
@PathVariable
Long
id
){
public
AjaxResult
deletePosterFont
(
@PathVariable
Long
id
)
{
wePosterFontService
.
lambdaUpdate
().
set
(
WePosterFont:
:
getDelFlag
,
1
).
eq
(
WePosterFont:
:
getId
,
id
);
wePosterFontService
.
update
(
wePosterFontService
.
lambdaUpdate
().
set
(
WePosterFont:
:
getDelFlag
,
1
).
eq
(
WePosterFont:
:
getId
,
id
));
return
AjaxResult
.
success
(
"删除成功"
);
return
AjaxResult
.
success
(
"删除成功"
);
}
}
}
}
linkwe-admin/src/main/resources/application.yml
View file @
2c6f74b
...
@@ -178,6 +178,8 @@ wecome:
...
@@ -178,6 +178,8 @@ wecome:
-
/externalcontact/get_unassigned_list
-
/externalcontact/get_unassigned_list
-
/externalcontact/send_welcome_msg
-
/externalcontact/send_welcome_msg
-
/externalcontact/unionid_to_external_userid
-
/externalcontact/unionid_to_external_userid
-
/externalcontact/add_msg_template
-
/externalcontact/get_group_msg_result
-
/get_jsapi_ticket
-
/get_jsapi_ticket
-
/ticket/get
-
/ticket/get
fileUplodUrl
:
/media/upload,/media/uploadimg
fileUplodUrl
:
/media/upload,/media/uploadimg
...
...
linkwe-common/src/main/java/com/linkwechat/common/core/elasticsearch/ElasticSearch.java
View file @
2c6f74b
...
@@ -216,7 +216,7 @@ public class ElasticSearch {
...
@@ -216,7 +216,7 @@ public class ElasticSearch {
*/
*/
public
void
insertBatchAsync
(
String
idxName
,
List
<
JSONObject
>
list
,
List
<
Consumer
<
List
<
JSONObject
>>>
consumers
)
{
public
void
insertBatchAsync
(
String
idxName
,
List
<
JSONObject
>
list
,
List
<
Consumer
<
List
<
JSONObject
>>>
consumers
)
{
BulkRequest
request
=
new
BulkRequest
();
BulkRequest
request
=
new
BulkRequest
();
list
.
forEach
(
item
->
request
.
add
(
new
IndexRequest
(
idxName
,
"_doc"
).
id
(
item
.
getString
(
"msgid"
))
list
.
parallelStream
().
forEach
(
item
->
request
.
add
(
new
IndexRequest
(
idxName
,
"_doc"
).
id
(
item
.
getString
(
"msgid"
))
.
source
(
item
,
XContentType
.
JSON
)));
.
source
(
item
,
XContentType
.
JSON
)));
try
{
try
{
restHighLevelClient
.
bulkAsync
(
request
,
RequestOptions
.
DEFAULT
,
getActionListener
(
list
,
consumers
));
restHighLevelClient
.
bulkAsync
(
request
,
RequestOptions
.
DEFAULT
,
getActionListener
(
list
,
consumers
));
...
...
linkwe-common/src/main/java/com/linkwechat/common/utils/img/NetFileUtils.java
View file @
2c6f74b
...
@@ -25,19 +25,6 @@ public class NetFileUtils {
...
@@ -25,19 +25,6 @@ public class NetFileUtils {
private
static
final
WebClient
webClient
=
WebClient
.
create
(
vertx
);
private
static
final
WebClient
webClient
=
WebClient
.
create
(
vertx
);
public
static
void
main
(
String
[]
args
)
{
FileCallable
fileCallable
=
getNetFile
(
"https://pc-index-skin.cdn.bcebos.com/hiphoto/51631423522.jpg?x-bce-process=image/crop,x_0,y_13,w_1999,h_1250"
);
ByteArrayOutputStream
byteArrayOutputStream
=
getByteArrayOutputStream
(
fileCallable
,
true
);
StreamMultipartFile
file
=
new
StreamMultipartFile
(
"你好啊.jpg"
,
byteArrayOutputStream
.
toByteArray
());
File
f
=
new
File
(
"D:/网页/2.jpg"
);
try
{
file
.
transferTo
(
f
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
public
static
FileCallable
getNetFile
(
String
urlPath
){
public
static
FileCallable
getNetFile
(
String
urlPath
){
FileCallable
fileCallable
=
new
FileCallable
();
FileCallable
fileCallable
=
new
FileCallable
();
...
...
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/RyTask.java
View file @
2c6f74b
...
@@ -76,10 +76,10 @@ public class RyTask {
...
@@ -76,10 +76,10 @@ public class RyTask {
""
,
redisCache
);
""
,
redisCache
);
if
(
CollectionUtil
.
isNotEmpty
(
chatDataList
)){
if
(
CollectionUtil
.
isNotEmpty
(
chatDataList
)){
try
{
try
{
List
<
JSONObject
>
elasticSearchEntities
=
weChatContactMappingService
.
saveWeChatContactMapping
(
chatDataList
);
List
<
Consumer
<
List
<
JSONObject
>>>
consumerList
=
Lists
.
newArrayList
();
List
<
Consumer
<
List
<
JSONObject
>>>
consumerList
=
Lists
.
newArrayList
();
consumerList
.
add
(
weChatContactMappingService:
:
saveWeChatContactMapping
);
consumerList
.
add
(
weSensitiveService:
:
hitSensitive
);
consumerList
.
add
(
weSensitiveService:
:
hitSensitive
);
elasticSearch
.
insertBatchAsync
(
WeConstans
.
WECOM_FINANCE_INDEX
,
chatDataList
,
consumerList
);
elasticSearch
.
insertBatchAsync
(
WeConstans
.
WECOM_FINANCE_INDEX
,
elasticSearchEntities
,
consumerList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"消息处理异常:ex:{}"
,
e
);
log
.
error
(
"消息处理异常:ex:{}"
,
e
);
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
linkwe-ui/package.json
View file @
2c6f74b
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
"js-beautify"
:
"1.10.2"
,
"js-beautify"
:
"1.10.2"
,
"js-cookie"
:
"2.2.0"
,
"js-cookie"
:
"2.2.0"
,
"jsencrypt"
:
"3.0.0-rc.1"
,
"jsencrypt"
:
"3.0.0-rc.1"
,
"moment"
:
"^2.29.1"
,
"normalize.css"
:
"7.0.0"
,
"normalize.css"
:
"7.0.0"
,
"nprogress"
:
"0.2.0"
,
"nprogress"
:
"0.2.0"
,
"path-to-regexp"
:
"2.4.0"
,
"path-to-regexp"
:
"2.4.0"
,
...
...
linkwe-ui/src/api/content.js
0 → 100644
View file @
2c6f74b
import
request
from
'@/utils/request'
const
getTree
=
(
params
)
=>
{
return
request
({
url
:
'/chat/mapping/list'
,
method
:
'get'
,
params
,
})
}
const
chatList
=
(
params
)
=>
{
return
request
({
url
:
'/wecom/finance/getChatContactList'
,
method
:
'get'
,
params
,
})
}
const
listByCustomer
=
(
params
)
=>
{
return
request
({
url
:
'/chat/mapping/listByCustomer'
,
method
:
'get'
,
params
,
})
}
const
getChatAllList
=
(
params
)
=>
{
return
request
({
url
:
'/wecom/finance/getChatAllList'
,
method
:
'get'
,
params
,
})
}
//
export
const
content
=
{
getTree
,
chatList
,
listByCustomer
,
getChatAllList
}
\ No newline at end of file
\ No newline at end of file
linkwe-ui/src/utils/common.js
View file @
2c6f74b
...
@@ -52,6 +52,19 @@ export function resetForm(refName) {
...
@@ -52,6 +52,19 @@ export function resetForm(refName) {
}
}
}
}
//年月日格式
export
function
yearMouthDay
(
data
)
{
var
time
=
new
Date
(
data
);
var
year
=
time
.
getFullYear
();
var
month
=
time
.
getMonth
()
+
1
;
var
date
=
time
.
getDate
();
console
.
log
(
year
+
'-'
+
add0
(
month
)
+
'-'
+
add0
(
date
))
return
year
+
'-'
+
add0
(
month
)
+
'-'
+
add0
(
date
)
}
function
add0
(
m
){
return
m
<
10
?
'0'
+
m
:
m
}
// 添加日期范围
// 添加日期范围
export
function
addDateRange
(
params
,
dateRange
)
{
export
function
addDateRange
(
params
,
dateRange
)
{
var
search
=
params
;
var
search
=
params
;
...
...
linkwe-ui/src/views/conversation/component/chat.vue
0 → 100644
View file @
2c6f74b
<
template
>
<div
class=
"takecontent"
>
<ul>
<li
v-for=
"(item,index) in allChat"
:key=
"index"
>
<div
:style=
"
{'color':item.action=='send'?'#199ed8':'#999'}">
{{
item
.
from
}}
<span
:style=
"
{'color':item.action=='send'?'#199ed8':'#999'}">
{{
parseTime
(
item
.
msgtime
)
}}
</span></div>
<div
v-if=
"item.msgtype=='text'"
class=
"msgtypetext"
>
{{
item
.
text
.
content
}}
</div>
<div
v-else-if=
"item.msgtype=='image'"
class=
"msgtypeimg"
>
<img
:src=
"item.image.attachment"
>
</div>
<div
v-else-if=
"item.msgtype=='file'"
class=
"msgtypefile"
@
click=
"down(item.file)"
>
{{
item
.
file
.
filename
}}
</div>
<!--
<div
v-else-if=
"item.msgtype=='link'&&item.text"
class=
"msgtypelink"
>
{{
item
.
text
.
content
}}
</div>
-->
<div
v-else-if=
"item.msgtype=='voice'"
class=
"msgtypevoice"
>
<i
class=
"el-icon-video-play"
@
click=
"play(item,'voice')"
></i>
</div>
<div
v-else-if=
"item.msgtype=='video'"
class=
"msgtypevideo"
>
<i
class=
"el-icon-video-play"
@
click=
"play(item,'video')"
></i>
</div>
<div
v-else-if=
"item.msgtype=='location'"
class=
"msgtypecard "
>
<div
class=
"card_name"
></div>
<div
class=
"card_foot"
>
{{
item
.
location
.
address
}}
</div>
</div>
<div
v-else-if=
"item.msgtype=='weapp'"
class=
"msgtypecard "
>
<div
class=
"card_name"
></div>
<div
class=
"card_foot"
>
小程序
</div>
</div>
<div
v-else-if=
"item.msgtype=='card'"
class=
"msgtypecard "
>
<div
class=
"card_name"
>
{{
item
.
card
.
corpname
}}
</div>
<div
class=
"card_foot"
>
个人名片
</div>
</div>
</li>
</ul>
<el-dialog
:visible
.
sync=
"dia"
:show-close=
'false'
>
<p>
播放
</p>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
parseTime
,
yearMouthDay
,
}
from
'@/utils/common.js'
export
default
{
props
:
{
allChat
:
{
type
:
Array
,
defluat
:
()
=>
[]
}
},
data
()
{
return
{
dia
:
false
}
},
methods
:
{
play
()
{
this
.
dia
=
true
},
down
(
e
){
//下载文件
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
*
{
padding
:
0
;
margin
:
0
;
}
.takecontent
{
text-align
:
left
;
width
:
100%
;
height
:
600px
;
overflow-y
:
scroll
;
::-webkit-scrollbar
{
display
:
none
;
}
ul
li
{
padding
:
8px
;
}
.msgtypetext
{
padding
:
10px
0
;
}
.msgtypevoice
{
margin
:
10px
;
}
.msgtypefile
{
margin
:
10px
;
width
:
200px
;
height
:
40px
;
line-height
:
40px
;
cursor
:
pointer
;
color
:
#199ed8
;
text-indent
:
10px
;
box-shadow
:
0
1px
4px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
1px
4px
0
rgba
(
0
,
0
,
0
,
0.19
);
}
.card_name
{
line-height
:
80px
;
text-indent
:
10px
;}
.msgtypevideo
{
margin
:
10px
;
font-size
:
40px
;
cursor
:
pointer
;
color
:
#199ed8
;
border-radius
:
8px
;
}
.msgtypeimg
{
width
:
100px
;
height
:
80px
;
margin
:
10px
;
}
.msgtypecard
{
width
:
300px
;
height
:
140px
;
margin
:
10px
;
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
);
box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
6px
8px
0
rgba
(
0
,
0
,
0
,
0.19
);
position
:
relative
;
.card_foot
{
position
:
absolute
;
height
:
20px
;
border-top
:
1px
solid
#efefef
;
text-align
:
left
;
bottom
:
15px
;
padding
:
10px
;
color
:
#333
;
font-weight
:
bold
;
width
:
100%
;
}
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
linkwe-ui/src/views/conversation/component/curList.vue
0 → 100644
View file @
2c6f74b
<
template
>
<div
class=
"list"
v-loading=
"loading"
>
<div
v-if=
"personList.length>=1"
>
<ul>
<li
v-for=
"(item,index) in personList"
:key=
"index"
@
click=
"liClick(item)"
>
<el-row
style=
"padding:10px"
>
<el-col
:span=
"4"
>
<img
:src=
"item.finalChatContext.fromInfo.avatar"
></el-col>
<el-col
:span=
"20"
>
<p>
{{
item
.
roomInfo
.
groupName
}}
<span
class=
"fr gray"
>
{{
parseTime
(
item
.
finalChatContext
.
msgtime
)
}}
</span></p>
<p
class=
"gray padt10"
v-if=
"item.finalChatContext.text"
>
{{
item
.
finalChatContext
.
text
.
content
}}
</p>
</el-col>
</el-row>
</li>
</ul>
</div>
<div
v-else
></div>
</div>
</
template
>
<
script
>
import
{
parseTime
}
from
'@/utils/common.js'
export
default
{
props
:
{
personList
:
{
type
:
Array
,
defluat
:
()
=>
[]
},
loading
:
{
type
:
Boolean
,
defluat
:
false
},
},
data
()
{
return
{
loadings
:
true
}
},
methods
:{
liClick
(
e
){
this
.
$emit
(
'chatFn'
,
e
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
*
{
padding
:
0
;
margin
:
0
;}
.list
{
overflow-y
:
scroll
;
height
:
652px
;
::-webkit-scrollbar
{
display
:
none
;
}
/
deep
/
.el-loading-spinner
{
margin-top
:
20px
;}
.fr
{
float
:
right
;}
.gray
{
color
:
#999
;}
.padt10
{
padding-top
:
10px
;}
ul
li
{
overflow
:
hidden
;
border-bottom
:
1px
solid
#efefef
;
cursor
:
pointer
;
p{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;}
:hover
{
background
:
#efefef
;}
img
{
width
:
40px
;
height
:
40px
;
float
:
left
}
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
linkwe-ui/src/views/conversation/component/cusChat.vue
0 → 100644
View file @
2c6f74b
<
template
>
<div
class=
"takecontent"
>
<ul>
<li
v-for=
"(item,index) in allChat"
:key=
"index"
>
<div
:style=
"
{'color':item.action=='send'?'#199ed8':'#999'}">
{{
item
.
from
}}
<span
:style=
"
{'color':item.action=='send'?'#199ed8':'#999'}">
{{
parseTime
(
item
.
msgtime
)
}}
</span></div>
<div
v-if=
"item.msgtype=='text'"
class=
"msgtypetext"
>
{{
item
.
text
.
content
}}
</div>
<div
v-else-if=
"item.msgtype=='image'"
class=
"msgtypeimg"
>
<img
:src=
"item.image.attachment"
>
</div>
<div
v-else-if=
"item.msgtype=='file'"
class=
"msgtypefile"
@
click=
"down(item.file)"
>
{{
item
.
file
.
filename
}}
</div>
<!--
<div
v-else-if=
"item.msgtype=='link'&&item.text"
class=
"msgtypelink"
>
{{
item
.
text
.
content
}}
</div>
-->
<div
v-else-if=
"item.msgtype=='voice'"
class=
"msgtypevoice"
>
<i
class=
"el-icon-video-play"
@
click=
"play(item,'voice')"
></i>
</div>
<div
v-else-if=
"item.msgtype=='video'"
class=
"msgtypevideo"
>
<i
class=
"el-icon-video-play"
@
click=
"play(item,'video')"
></i>
</div>
<div
v-else-if=
"item.msgtype=='location'"
class=
"msgtypecard "
>
<div
class=
"card_name"
></div>
<div
class=
"card_foot"
>
{{
item
.
location
.
address
}}
</div>
</div>
<div
v-else-if=
"item.msgtype=='weapp'"
class=
"msgtypecard "
>
<div
class=
"card_name"
></div>
<div
class=
"card_foot"
>
小程序
</div>
</div>
<div
v-else-if=
"item.msgtype=='card'"
class=
"msgtypecard "
>
<div
class=
"card_name"
>
{{
item
.
card
.
corpname
}}
</div>
<div
class=
"card_foot"
>
个人名片
</div>
</div>
</li>
</ul>
<el-dialog
:visible
.
sync=
"dia"
:show-close=
'false'
>
<p>
播放
</p>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
parseTime
,
yearMouthDay
,
}
from
'@/utils/common.js'
export
default
{
props
:
{
allChat
:
{
type
:
Array
,
defluat
:
()
=>
[]
}
},
data
()
{
return
{
dia
:
false
}
},
methods
:
{
play
()
{
this
.
dia
=
true
},
down
(
e
){
//下载文件
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
*
{
padding
:
0
;
margin
:
0
;
}
.takecontent
{
text-align
:
left
;
width
:
100%
;
height
:
600px
;
overflow-y
:
scroll
;
::-webkit-scrollbar
{
display
:
none
;
}
ul
li
{
padding
:
8px
;
}
.msgtypetext
{
padding
:
10px
0
;
}
.msgtypevoice
{
margin
:
10px
;
}
.msgtypefile
{
margin
:
10px
;
width
:
200px
;
height
:
40px
;
line-height
:
40px
;
cursor
:
pointer
;
color
:
#199ed8
;
text-indent
:
10px
;
box-shadow
:
0
1px
4px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
1px
4px
0
rgba
(
0
,
0
,
0
,
0.19
);
}
.card_name
{
line-height
:
80px
;
text-indent
:
10px
;}
.msgtypevideo
{
margin
:
10px
;
font-size
:
40px
;
cursor
:
pointer
;
color
:
#199ed8
;
border-radius
:
8px
;
}
.msgtypeimg
{
width
:
100px
;
height
:
80px
;
margin
:
10px
;
}
.msgtypecard
{
width
:
300px
;
height
:
140px
;
margin
:
10px
;
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
);
box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
6px
8px
0
rgba
(
0
,
0
,
0
,
0.19
);
position
:
relative
;
.card_foot
{
position
:
absolute
;
height
:
20px
;
border-top
:
1px
solid
#efefef
;
text-align
:
left
;
bottom
:
15px
;
padding
:
10px
;
color
:
#333
;
font-weight
:
bold
;
width
:
100%
;
}
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
linkwe-ui/src/views/conversation/component/list.vue
0 → 100644
View file @
2c6f74b
<
template
>
<div
class=
"list"
v-loading=
"loading"
>
<div
v-if=
"personList.length>=1"
>
<ul>
<li
v-for=
"(item,index) in personList"
:key=
"index"
@
click=
"liClick(item)"
>
<el-row
style=
"padding:10px"
>
<el-col
:span=
"4"
>
<img
:src=
"item.receiveWeCustomer.avatar"
></el-col>
<el-col
:span=
"20"
>
<p>
{{
item
.
receiveWeCustomer
.
name
}}
<span
class=
"fr gray"
>
{{
parseTime
(
item
.
finalChatContext
.
msgtime
)
}}
</span></p>
<p
class=
"gray padt10"
v-if=
"item.finalChatContext.text"
>
{{
item
.
finalChatContext
.
text
.
content
}}
</p>
</el-col>
</el-row>
</li>
</ul>
</div>
<div
v-else
></div>
</div>
</
template
>
<
script
>
import
{
parseTime
}
from
'@/utils/common.js'
export
default
{
props
:
{
personList
:
{
type
:
Array
,
defluat
:
()
=>
[]
},
loading
:
{
type
:
Boolean
,
defluat
:
false
},
},
data
()
{
return
{
loadings
:
true
}
},
methods
:{
liClick
(
e
){
this
.
$emit
(
'chatFn'
,
e
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
*
{
padding
:
0
;
margin
:
0
;}
.list
{
overflow-y
:
scroll
;
height
:
708px
;
::-webkit-scrollbar
{
display
:
none
;
}
/
deep
/
.el-loading-spinner
{
margin-top
:
20px
;}
.fr
{
float
:
right
;}
.gray
{
color
:
#999
;}
.padt10
{
padding-top
:
10px
;}
ul
li
{
padding
:
10px
;
overflow
:
hidden
;
border-bottom
:
1px
solid
#efefef
;
cursor
:
pointer
;
p{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;}
:hover
{
background
:
#efefef
;}
img
{
width
:
40px
;
height
:
40px
;
float
:
left
}
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
linkwe-ui/src/views/conversation/content.vue
View file @
2c6f74b
<
template
>
<
template
>
<div
class=
"content"
>
<div
class=
"content"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"
根据员工检测
"
name=
"1"
>
<el-tab-pane
label=
"
员工检索
"
name=
"1"
>
<employee></employee>
<employee></employee>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"
根据用户检测"
name=
"2"
>
<el-tab-pane
label=
"
客户检索"
name=
"2"
>
<user></user>
<user
v-if=
"activeName==2"
></user>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"全局检
测
"
name=
"3"
>
<el-tab-pane
label=
"全局检
索
"
name=
"3"
>
<role></role>
<role
v-if=
"activeName==3"
></role>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -33,3 +32,6 @@ import role from './page/roleTest.vue'
...
@@ -33,3 +32,6 @@ import role from './page/roleTest.vue'
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
*
{
margin
:
0
;
padding
:
0
;}
</
style
>
linkwe-ui/src/views/conversation/page/employeeTest.vue
View file @
2c6f74b
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
</div>
</div>
</div>
</div>
<div
class=
"ct_box ct_boxFirst"
>
<div
class=
"ct_box ct_boxFirst"
>
<el-tree
class=
"filter-tree"
:data=
"
data"
:filter-node-method=
"filterNode"
ref=
"tre
e"
<el-tree
class=
"filter-tree"
:data=
"
treeData"
:props=
"defaultProps"
:filter-node-method=
"filterNod
e"
@
node-click=
"handleNodeClick
"
>
ref=
"tree"
@
node-click=
"handleNodeClick"
:default-expand-all=
"true
"
>
</el-tree>
</el-tree>
</div>
</div>
</el-col>
</el-col>
...
@@ -20,85 +20,117 @@
...
@@ -20,85 +20,117 @@
<div
class=
"hd_name"
>
{{
talkName
}}
</div>
<div
class=
"hd_name"
>
{{
talkName
}}
</div>
</div>
</div>
<div
class=
"hd_tabs"
>
<div
class=
"hd_tabs"
>
<el-tabs
v-model=
"activeName"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"tabClick(true)"
>
<el-tab-pane
label=
"内部联系人"
name=
"0"
>
<el-tab-pane
label=
"内部联系人"
name=
"0"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<
!-- 应该是类似聊天记录的 后期弄成组件 看 --
>
<
list
v-if=
"activeName==0"
:personList=
"personList"
:loading=
"loading"
@
chatFn=
'chatFn'
>
暂无联系人
</list>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"外部联系人"
name=
"1"
>
<el-tab-pane
label=
"外部联系人"
name=
"1"
>
<div
class=
"ct_box"
>
<list
v-if=
"activeName==1"
:personList=
"personList"
:loading=
"loading"
@
chatFn=
'chatFn'
>
<!-- ! -->
</list>
暂无联系人
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"群聊"
name=
"2"
>
<el-tab-pane
label=
"群聊"
name=
"2"
>
<div
class=
"ct_box"
>
<!-- ! -->
暂无联系人
</div>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
</div>
</div>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<div
class=
"hd_box"
>
<div
class=
"hd_box"
>
<div
class=
"hd_name hd_nameRi"
>
下载会话
</div>
<div
class=
"hd_name"
><span
v-if=
"chat.receiveWeCustomer"
>
与
{{
chat
.
receiveWeCustomer
.
name
}}
的聊天
</span>
<span
class=
"fr hd_nameRi"
>
下载会话
</span></div>
</div>
</div>
<div
class=
" hd_tabthree"
>
<div
class=
" hd_tabthree"
>
<el-tabs
v-model=
"activeNameThree"
>
<el-tabs
v-model=
"activeNameThree"
@
tab-click=
"activeNameThreeClick()"
>
<el-tab-pane
label=
"全部"
name=
"0"
>
<el-tab-pane
label=
"全部"
name=
"0"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<chat
:allChat=
"allChat"
v-if=
"allChat.length>=1"
></chat>
<el-pagination
background
v-if=
"allChat.length>=1"
layout=
"prev, pager, next"
class=
"pagination"
:current-page=
"currentPage"
@
current-change=
"currentChange"
:total=
"total"
>
</el-pagination>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"图片及视频"
name=
"1"
>
<el-tab-pane
label=
"图片及视频"
name=
"1"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<chat
:allChat=
"allChatImg"
v-if=
"allChatImg.length>=1"
></chat>
<el-pagination
background
v-if=
"allChatImg.length>=1"
class=
"pagination"
layout=
"prev, pager, next"
:total=
"total"
@
current-change=
"currentChange"
:current-page=
"currentPage"
>
</el-pagination>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"文件"
name=
"
3
"
>
<el-tab-pane
label=
"文件"
name=
"
2
"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<el-table
:data=
"fileData"
stripe
style=
"width: 100%"
:header-cell-style=
"
{background:'#fff'}">
<el-table
:data=
"allFile"
stripe
style=
"width: 100%"
<el-table-column
prop=
"date"
label=
"类型"
>
:header-cell-style=
"
{background:'#fff'}">
<el-table-column
prop=
"msgtype"
label=
"类型"
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"name"
label=
"名称"
>
<el-table-column
label=
"名称"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
file
.
filename
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"address"
label=
"大小"
>
<el-table-column
label=
"大小"
>
<
template
slot-scope=
"scope"
>
{{
filterSize
(
scope
.
row
.
file
.
filesize
)
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"address"
label=
"来源"
>
<el-table-column
prop=
"action"
label=
"来源"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
tolist
[
0
]
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"address"
label=
"操作"
>
<el-table-column
prop=
"action"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
size=
"small"
>
下载
</el-button>
<el-button
type=
"text"
size=
"small"
>
查看
</el-button>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"链接"
name=
"
4
"
>
<el-tab-pane
label=
"链接"
name=
"
3
"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"语音通话"
name=
"
5
"
>
<el-tab-pane
label=
"语音通话"
name=
"
4
"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<el-table
:data=
"fileData"
stripe
style=
"width: 100%"
:header-cell-style=
"
{background:'#fff'}">
<el-table
:data=
"fileData"
stripe
style=
"width: 100%"
:header-cell-style=
"{background:'#fff'}"
>
<el-table-column
prop=
"date"
label=
"发起人"
>
<el-table-column
prop=
"date"
label=
"发起人"
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"name"
label=
"通话时间"
>
<el-table-column
prop=
"name"
label=
"通话时间"
>
...
@@ -114,45 +146,50 @@
...
@@ -114,45 +146,50 @@
</div>
</div>
</el-col>
</el-col>
</el-row>
</el-row>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
list
from
'../component/list.vue'
import
chat
from
'../component/chat.vue'
import
*
as
api
from
'@/api/organization'
import
{
content
}
from
'@/api/content.js'
import
{
yearMouthDay
}
from
'@/utils/common.js'
export
default
{
export
default
{
components
:
{
list
,
chat
},
data
()
{
data
()
{
return
{
return
{
employAmount
:
1
,
employAmount
:
1
,
employId
:
''
,
employName
:
''
,
employName
:
''
,
talkName
:
''
,
talkName
:
''
,
data
:
[{
treeData
:
[],
id
:
1
,
defaultProps
:
{
label
:
'一级 1'
,
label
:
'name'
,
children
:
[{
children
:
'children'
,
id
:
4
,
},
label
:
'二级 1-1'
,
children
:
[{
id
:
9
,
label
:
'三级 1-1-1'
},
{
id
:
10
,
label
:
'三级 1-1-2'
}]
}]
},
{
id
:
3
,
label
:
'一级 3'
,
children
:
[{
id
:
7
,
label
:
'二级 3-1'
},
{
id
:
8
,
label
:
'二级 3-2'
}]
}],
activeName
:
"1"
,
activeName
:
"1"
,
activeNameThree
:
'
1
'
,
activeNameThree
:
'
0
'
,
takeTime
:
''
,
takeTime
:
''
,
fileData
:
[]
fileData
:
[],
chat
:
{},
personList
:
[],
loading
:
false
,
allChat
:
[],
//全部聊天记录
allChatImg
:
[],
//图片,
allVoice
:
[],
allFile
:
[],
allLInk
:
[],
//分页
total
:
''
,
currentPage
:
''
};
};
},
},
watch
:
{
watch
:
{
...
@@ -160,15 +197,136 @@
...
@@ -160,15 +197,136 @@
this
.
$refs
.
tree
.
filter
(
val
);
this
.
$refs
.
tree
.
filter
(
val
);
}
}
},
},
mounted
()
{
this
.
getTree
()
},
methods
:
{
methods
:
{
filterSize
(
size
)
{
if
(
!
size
)
return
''
;
if
(
size
<
this
.
pow1024
(
1
))
return
size
+
' B'
;
if
(
size
<
this
.
pow1024
(
2
))
return
(
size
/
this
.
pow1024
(
1
)).
toFixed
(
2
)
+
' KB'
;
if
(
size
<
this
.
pow1024
(
3
))
return
(
size
/
this
.
pow1024
(
2
)).
toFixed
(
2
)
+
' MB'
;
if
(
size
<
this
.
pow1024
(
4
))
return
(
size
/
this
.
pow1024
(
3
)).
toFixed
(
2
)
+
' GB'
;
return
(
size
/
pow1024
(
4
)).
toFixed
(
2
)
+
' TB'
},
pow1024
(
num
)
{
return
Math
.
pow
(
1024
,
num
)
},
currentChange
(
e
)
{
this
.
currentPage
=
e
this
.
activeNameThreeClick
(
true
)
},
activeNameThreeClick
(
page
)
{
if
(
!!!
page
)
{
this
.
currentPage
=
1
}
if
(
this
.
chat
&&
this
.
chat
.
receiveWeCustomer
)
{
let
msgType
=
''
if
(
this
.
activeNameThree
==
0
)
{
msgType
=
''
}
else
if
(
this
.
activeNameThree
==
1
)
{
msgType
=
'image'
}
else
if
(
this
.
activeNameThree
==
2
)
{
msgType
=
'file'
}
else
if
(
this
.
activeNameThree
==
3
)
{
msgType
=
'link'
}
else
if
(
this
.
activeNameThree
==
4
)
{
msgType
=
'voice'
}
let
query
=
{
fromId
:
this
.
employId
,
receiveId
:
this
.
chat
.
receiveId
,
msgType
,
pageSize
:
'10'
,
pageNum
:
this
.
currentPage
,
beginTime
:
this
.
takeTime
?
yearMouthDay
(
this
.
takeTime
[
0
])
:
""
,
endTime
:
this
.
takeTime
?
yearMouthDay
(
this
.
takeTime
[
1
])
:
''
,
}
content
.
chatList
(
query
).
then
(
res
=>
{
this
.
total
=
Number
(
res
.
total
)
if
(
this
.
activeNameThree
==
0
)
{
return
this
.
allChat
=
res
.
rows
}
if
(
this
.
activeNameThree
==
1
)
{
return
this
.
allChatImg
=
res
.
rows
}
if
(
this
.
activeNameThree
==
2
)
{
return
this
.
allFile
=
res
.
rows
}
if
(
this
.
activeNameThree
==
3
)
{
return
this
.
allLInk
=
res
.
rows
}
if
(
this
.
activeNameThree
==
4
)
{
return
this
.
allVoice
=
res
.
rows
}
})
}
},
chatFn
(
data
)
{
this
.
chat
=
data
;
if
(
data
.
receiveWeCustomer
)
{
this
.
activeNameThreeClick
()
}
},
getTree
()
{
api
.
getTree
().
then
(({
data
})
=>
{
this
.
treeData
=
this
.
handleTree
(
data
)
this
.
handleNodeClick
(
this
.
treeData
[
0
],
true
)
})
},
tabClick
(
flag
)
{
this
.
personList
=
[]
if
(
!
this
.
employId
)
{
return
}
if
(
flag
)
{
this
.
loading
=
true
}
content
.
getTree
({
fromId
:
this
.
employId
,
searchType
:
this
.
activeName
}).
then
(({
rows
})
=>
{
this
.
loading
=
false
this
.
personList
=
rows
}).
catch
(
err
=>
{
this
.
loading
=
false
})
},
filterNode
(
value
,
data
)
{
filterNode
(
value
,
data
)
{
console
.
log
(
value
,
data
)
if
(
!
value
)
return
true
;
if
(
!
value
)
return
true
;
return
data
.
label
.
indexOf
(
value
)
!==
-
1
;
return
data
.
name
.
indexOf
(
value
)
!==
-
1
;
},
},
handleNodeClick
(
data
)
{
handleNodeClick
(
data
,
add
)
{
if
(
!
data
.
children
)
{
if
(
!
data
.
gender
)
{
console
.
log
(
data
.
label
)
let
querys
=
{
this
.
talkName
=
data
.
label
pageNum
:
'1'
,
pageSize
:
'999'
,
isActivate
:
'4'
,
department
:
data
.
id
}
api
.
getList
(
querys
).
then
(({
rows
})
=>
{
if
(
add
==
true
)
{
console
.
log
(
this
.
treeData
,
data
,
rows
)
this
.
treeData
[
0
].
children
=
data
.
children
.
concat
(
rows
)
return
}
else
{
const
newChild
=
rows
;
this
.
$set
(
data
,
'children'
,
[]);
data
.
children
=
rows
}
})
}
else
{
this
.
talkName
=
data
.
name
;
this
.
employId
=
data
.
userId
;
this
.
tabClick
()
}
}
}
}
}
}
...
@@ -176,8 +334,17 @@
...
@@ -176,8 +334,17 @@
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
/
deep
/
#tab-0
{
*
{
text-indent
:
15px
;
margin
:
0
;
padding
:
0
;
}
/
deep
/
.el-tabs__nav-scroll
{
padding-left
:
15px
;
}
.fr
{
float
:
right
;
}
}
.borderR
{
.borderR
{
...
@@ -194,6 +361,10 @@
...
@@ -194,6 +361,10 @@
.hd_tabs
{
.hd_tabs
{
background
:
#fff
;
background
:
#fff
;
/deep/
.el-tabs__header
{
margin
:
0
;
}
}
}
.hd_tabthree
{
.hd_tabthree
{
...
@@ -219,25 +390,33 @@
...
@@ -219,25 +390,33 @@
}
}
.ct_boxFirst
{
.ct_boxFirst
{
height
:
7
20px
;
height
:
7
07px
!important
;
}
}
.ct_box
{
.ct_box
{
background
:
white
;
background
:
white
;
min-
height
:
710px
;
height
:
710px
;
padding
:
10px
;
padding
:
10px
;
overflow-y
:
scroll
;
overflow-y
:
scroll
;
border-bottom
:
1px
solid
#efefef
;
color
:
#999
;
color
:
#999
;
text-align
:
center
;
text-align
:
center
;
::-webkit-scrollbar
{
::-webkit-scrollbar
{
display
:
none
;
display
:
none
;
}
}
.hds_time
{
.hds_time
{
float
:
left
;
text-align
:
left
;
width
:
100%
;
padding
:
10px
0
;
padding
:
10px
0
;
}
}
}
}
}
.pagination
{
padding
:
10px
0
;
height
:
30px
;
float
:
left
;
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
linkwe-ui/src/views/conversation/page/roleTest.vue
View file @
2c6f74b
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
<el-form
:inline=
"true"
:model=
"form"
class=
"demo-form-inline"
>
<el-form
:inline=
"true"
:model=
"form"
class=
"demo-form-inline"
>
<el-row>
<el-row>
<el-form-item
label=
"员工名称"
>
<el-form-item
label=
"员工名称"
>
<el-
select
v-model=
"form.Ename"
placeholder=
"员工名称"
style=
"width:300px"
>
<el-
input
v-model=
"form.Ename"
placeholder=
"客户名称"
style=
"width:300px"
></el-input
>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"客户名称"
>
<el-form-item
label=
"客户名称"
>
<el-input
v-model=
"form.Cname"
placeholder=
"客户名称"
style=
"width:300px"
></el-input>
<el-input
v-model=
"form.Cname"
placeholder=
"客户名称"
style=
"width:300px"
></el-input>
...
@@ -15,14 +15,16 @@
...
@@ -15,14 +15,16 @@
<el-input
v-model=
"form.Scontent"
placeholder=
"查找内容"
style=
"width:300px"
></el-input>
<el-input
v-model=
"form.Scontent"
placeholder=
"查找内容"
style=
"width:300px"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"时间范围"
>
<el-form-item
label=
"时间范围"
>
<el-time-picker
is-range
v-model=
"form.Stime"
range-separator=
"至"
start-placeholder=
"开始时间"
end-placeholder=
"结束时间"
placeholder=
"选择时间范围"
>
<el-date-picker
v-model=
"form.Stime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
</el-time-picker>
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
>
</el-date-picker>
</el-form-item>
</el-form-item>
</el-row>
</el-row>
<el-row>
<el-row>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"init"
>
查询
</el-button>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button>
导出列表
</el-button>
<el-button>
导出列表
</el-button>
...
@@ -31,13 +33,18 @@
...
@@ -31,13 +33,18 @@
</el-form>
</el-form>
<div
class=
"content"
>
<div
class=
"content"
>
<el-table
:data=
"fileData"
stripe
style=
"width: 100%"
:header-cell-style=
"
{background:'#fff'}">
<el-table
:data=
"fileData"
stripe
style=
"width: 100%"
:header-cell-style=
"
{background:'#fff'}">
<el-table-column
prop=
"date"
label=
"发送者"
width=
"200"
>
<el-table-column
prop=
"date"
label=
"发送者"
width=
"300"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
from
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"name"
label=
" 内容"
>
<el-table-column
prop=
"name"
label=
" 内容"
>
<
template
slot-scope=
"scope"
v-if=
"scope.row.text"
>
{{
scope
.
row
.
text
.
content
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"消息状态"
width=
"200"
>
<el-table-column
label=
"消息状态"
width=
"200"
>
<template
slot=
"header"
>
<
template
slot=
"header"
>
{{
floorRange
}}
{{
floorRange
}}
<el-select
size=
"mini"
v-model=
"floorRange"
class=
"noborder"
@
change=
"chechName(floorRange)"
>
<el-select
size=
"mini"
v-model=
"floorRange"
class=
"noborder"
@
change=
"chechName(floorRange)"
>
<el-option
v-for=
"item in displayOptions"
:key=
"item.value"
:label=
"item.label"
<el-option
v-for=
"item in displayOptions"
:key=
"item.value"
:label=
"item.label"
...
@@ -45,22 +52,45 @@
...
@@ -45,22 +52,45 @@
</el-option>
</el-option>
</el-select>
</el-select>
</
template
>
</
template
>
<
template
slot-scope=
"scope"
>
<div
class=
"pers"
>
<span
v-if=
"scope.row.action==''"
>
</span>
<span
v-else-if=
"scope.row.action=='send'"
>
<span
class=
"green"
></span>
已发送
</span>
<span
v-else-if=
"scope.row.action=='recall'"
>
<span
class=
"red"
></span>
已撤回
</span>
<span
v-else-if=
"scope.row.action=='switch'"
>
<span
class=
"gay"
></span>
企业日志
</span>
</div>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"address"
label=
"发送时间"
width=
"200"
>
<el-table-column
prop=
"address"
label=
"发送时间"
width=
"200"
>
<
template
slot-scope=
"scope"
v-if=
"scope.row.text"
>
{{
parseTime
(
scope
.
row
.
msgtime
)
}}
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<el-pagination
<el-pagination
background
class=
"pagination"
layout=
"prev, pager, next"
:total=
"total"
:page-size=
"20"
@
current-change=
"currentChange"
:current-page=
"currentPage"
>
style=
"padding:10px"
</el-pagination>
:pager-count=
"11"
layout=
"prev, pager, next"
:total=
"1000"
>
</el-pagination>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
content
}
from
'@/api/content.js'
import
{
yearMouthDay
,
parseTime
}
from
'@/utils/common.js'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -70,53 +100,125 @@
...
@@ -70,53 +100,125 @@
Scontent
:
''
,
Scontent
:
''
,
Stime
:
''
Stime
:
''
},
},
currentPage
:
1
,
total
:
0
,
ac
:
''
,
fileData
:
[],
fileData
:
[],
floorRange
:
'全部'
,
floorRange
:
'全部'
,
displayOptions
:
[{
displayOptions
:
[{
value
:
"
0
"
,
value
:
""
,
label
:
"全部"
label
:
"全部"
},
},
{
{
value
:
"
1
"
,
value
:
"
send
"
,
label
:
"已发送"
label
:
"已发送"
},
},
{
{
value
:
"
2
"
,
value
:
"
recall
"
,
label
:
"已撤回"
label
:
"已撤回"
},
},
{
{
value
:
"
3
"
,
value
:
"
switch
"
,
label
:
"切回企业日志"
label
:
"切回企业日志"
}
}
]
]
}
}
},
},
methods
:{
mounted
()
{
chechName
(
e
){
this
.
init
()
if
(
e
==
0
){
},
this
.
floorRange
=
'全部'
methods
:
{
currentChange
(
e
)
{
this
.
currentPage
=
e
this
.
init
(
true
)
},
init
(
flag
)
{
if
(
!!!
flag
)
{
this
.
currentPage
=
1
}
}
else
if
(
e
==
1
){
let
query
=
{
this
.
floorRange
=
'已发送'
userName
:
this
.
form
.
Ename
,
}
else
if
(
e
==
2
){
customerName
:
this
.
form
.
Cname
,
this
.
floorRange
=
'已撤回'
keyWord
:
this
.
form
.
Scontent
,
}
else
{
beginTime
:
this
.
form
.
Stime
?
yearMouthDay
(
this
.
form
.
Stime
[
0
])
:
""
,
this
.
floorRange
=
'切回企业日志'
endTime
:
this
.
form
.
Stime
?
yearMouthDay
(
this
.
form
.
Stime
[
1
])
:
""
,
pageNum
:
this
.
currentPage
,
action
:
this
.
ac
}
}
content
.
getChatAllList
(
query
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
fileData
=
res
.
rows
;
this
.
total
=
Number
(
res
.
total
)
})
},
chechName
(
e
)
{
if
(
e
==
0
)
{
this
.
floorRange
=
'全部'
this
.
ac
=
''
}
else
if
(
e
==
1
)
{
this
.
floorRange
=
'已发送'
this
.
ac
=
'send'
}
else
if
(
e
==
2
)
{
this
.
floorRange
=
'已撤回'
this
.
ac
=
'recall'
}
else
{
this
.
floorRange
=
'切回企业日志'
this
.
ac
=
'switch'
}
this
.
init
()
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.demo-form-inline
{
.demo-form-inline
{
background
:
#
efefef
;
background
:
#
f1f1f1
;
padding
:
18px
10px
0
10px
;
padding
:
18px
10px
0
10px
;
}
}
.content
{
.content
{
margin-top
:
15px
;
margin-top
:
15px
;
padding
:
10px
;
padding
:
10px
;
}
}
.pers
{
position
:
relative
;
.green
{
background
:
greenyellow
;
position
:
absolute
;
width
:
6px
;
height
:
6px
;
border-radius
:
50%
;
top
:
10px
;
left
:
-8px
;
}
.red
{
background
:
red
;
position
:
absolute
;
width
:
6px
;
height
:
6px
;
border-radius
:
50%
;
top
:
10px
;
left
:
-8px
;
}
.gay
{
background
:
gray
;
position
:
absolute
;
width
:
6px
;
height
:
6px
;
border-radius
:
50%
;
top
:
10px
;
left
:
-8px
;
}
}
.noborder
{
.noborder
{
/deep/
.el-input--mini
.el-input__inner{
width
:
2px
;
border
:
none
}
/deep/
.el-input--mini
.el-input__inner
{
width
:
2px
;
border
:
none
}
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
linkwe-ui/src/views/conversation/page/userTest.vue
View file @
2c6f74b
...
@@ -11,12 +11,16 @@
...
@@ -11,12 +11,16 @@
</div>
</div>
<div
class=
"ct_box ct_boxFirst"
>
<div
class=
"ct_box ct_boxFirst"
>
<ul>
<ul>
<li
v-for=
"(i,t) in 49"
:key=
"t"
@
click=
"personCheck(i,t)"
:class=
"
{'liActive':t==personIndex}">
<!-- -->
<el-row
:gutter=
"20"
>
<li
v-for=
"(i,t) in CList"
:key=
"t"
@
click=
"personCheck(i,t)"
:class=
"
{'liActive':t==personIndex}">
<el-col
:span=
"4"
>
<img
<el-row
:gutter=
"20"
style=
" padding: 10px 0;margin:0"
>
src=
"http://wx.qlogo.cn/mmhead/pburdzLK7PV4ZRaUcsb0X4ssicO9TqpQHZa26oHRvb1ONZT1r3dI0Aw/0"
<el-col
:span=
"4"
>
alt=
""
></el-col>
<img
<el-col
:span=
"16"
><span
style=
"line-height:40px"
>
{{
i
}}
</span></el-col>
v-if=
"i.avatar"
:src=
"i.avatar"
alt=
"头像"
>
</el-col>
<el-col
:span=
"16"
v-if=
"i"
><span
style=
"line-height:40px"
>
{{
i
.
name
}}
</span></el-col>
</el-row>
</el-row>
</li>
</li>
</ul>
</ul>
...
@@ -30,78 +34,113 @@
...
@@ -30,78 +34,113 @@
</el-input>
</el-input>
</div>
</div>
</div>
</div>
<div
class=
"ct_box
"
>
<div
class=
"hd_tabs"
>
<div
class=
"hd_tabs"
>
<el-tabs
v-model=
"activeName"
>
<el-tabs
v-model=
"activeName"
>
<el-tab-pane
label=
"单聊"
name=
"0"
>
<el-tab-pane
label=
"单聊"
name=
"0"
>
<div
class=
"ct_box"
>
<div
class=
"hd_tabs_content"
>
暂无联系人
<!--
<list
v-if=
"activeName==0"
:personList=
"personList"
:loading=
"loading"
>
</list>
-->
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"群聊"
name=
"1"
>
<el-tab-pane
label=
"群聊"
name=
"2"
>
<div
class=
"ct_box"
>
<list
v-if=
"activeName==2"
:personList=
"personList"
:loading=
"loading"
@
chatFn=
"chatFn"
>
暂无群聊记录
</list>
</div>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
</div></div>
</div>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<div
class=
"hd_box"
>
<div
class=
"hd_box"
>
<div
class=
"hd_name hd_nameRi"
>
下载会话
</div>
<div
class=
"hd_name"
><span
v-if=
"chatData&&chatData.finalChatContext"
>
与
{{
chatData
.
finalChatContext
.
roomInfo
.
name
}}
的聊天
</span>
<span
class=
"fr hd_nameRi"
>
下载会话
</span></div>
</div>
</div>
<div
class=
" hd_tabthree"
>
<div
class=
" hd_tabthree"
>
<el-tabs
v-model=
"activeNameThree"
>
<el-tabs
v-model=
"activeNameThree"
@
tab-click=
"activeNameThreeClick()"
>
<el-tab-pane
label=
"全部"
name=
"0"
>
<el-tab-pane
label=
"全部"
name=
"0"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<chat
:allChat=
"allChat"
v-if=
"allChat.length>=1"
></chat>
<el-pagination
background
v-if=
"allChat.length>=1"
layout=
"prev, pager, next"
class=
"pagination"
:current-page=
"currentPage"
@
current-change=
"currentChange"
:total=
"total"
>
</el-pagination>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"图片及视频"
name=
"1"
>
<el-tab-pane
label=
"图片及视频"
name=
"1"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<chat
:allChat=
"allChatImg"
v-if=
"allChatImg.length>=1"
></chat>
<el-pagination
background
v-if=
"allChatImg.length>=1"
class=
"pagination"
layout=
"prev, pager, next"
:total=
"total"
@
current-change=
"currentChange"
:current-page=
"currentPage"
>
</el-pagination>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"文件"
name=
"
3
"
>
<el-tab-pane
label=
"文件"
name=
"
2
"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<el-table
:data=
"
fileData
"
stripe
style=
"width: 100%"
<el-table
:data=
"
allFile
"
stripe
style=
"width: 100%"
:header-cell-style=
"
{background:'#fff'}">
:header-cell-style=
"
{background:'#fff'}">
<el-table-column
prop=
"
dat
e"
label=
"类型"
>
<el-table-column
prop=
"
msgtyp
e"
label=
"类型"
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"name"
label=
"名称"
>
<el-table-column
label=
"名称"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
file
.
filename
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"address"
label=
"大小"
>
<el-table-column
label=
"大小"
>
<
template
slot-scope=
"scope"
>
{{
filterSize
(
scope
.
row
.
file
.
filesize
)
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"address"
label=
"来源"
>
<el-table-column
prop=
"action"
label=
"来源"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
tolist
[
0
]
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"address"
label=
"操作"
>
<el-table-column
prop=
"action"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
size=
"small"
>
下载
</el-button>
<el-button
type=
"text"
size=
"small"
>
查看
</el-button>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"链接"
name=
"
4
"
>
<el-tab-pane
label=
"链接"
name=
"
3
"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"语音通话"
name=
"
5
"
>
<el-tab-pane
label=
"语音通话"
name=
"
4
"
>
<div
class=
"ct_box"
>
<div
class=
"ct_box"
>
<div
class=
"hds_time"
>
<div
class=
"hds_time"
>
<el-date-picker
v-model=
"takeTime"
type=
"date"
placeholder=
"选择日期"
>
<el-date-picker
v-model=
"takeTime"
type=
"datetimerange"
format=
'yyyy-MM-dd'
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
align=
"right"
@
change=
"activeNameThreeClick"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<el-table
:data=
"fileData"
stripe
style=
"width: 100%"
<el-table
:data=
"fileData"
stripe
style=
"width: 100%"
...
@@ -125,35 +164,147 @@
...
@@ -125,35 +164,147 @@
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
list
from
'../component/curList.vue'
import
chat
from
'../component/chat.vue'
import
{
content
}
from
'@/api/content.js'
import
{
yearMouthDay
}
from
'@/utils/common.js'
export
default
{
export
default
{
components
:{
list
,
chat
},
data
()
{
data
()
{
return
{
return
{
employAmount
:
1
,
employAmount
:
1
,
employName
:
''
,
employName
:
''
,
talkName
:
''
,
talkName
:
''
,
personIndex
:
'-1'
,
personIndex
:
'-1'
,
activeName
:
"
1
"
,
activeName
:
"
2
"
,
activeNameThree
:
'
1
'
,
activeNameThree
:
'
0
'
,
takeTime
:
''
,
takeTime
:
''
,
fileData
:
[]
fileData
:
[],
CList
:[],
personList
:[],
loading
:
false
,
employId
:
''
,
chatData
:{},
allChat
:[],
allChatImg
:[],
allFile
:[],
allLInk
:[],
allVoice
:[],
//分页
currentPage
:
1
,
total
:
0
};
};
},
},
methods
:
{
methods
:
{
personCheck
(
name
,
e
)
{
chatFn
(
data
){
this
.
chatData
=
data
if
(
data
.
fromId
)
{
this
.
activeNameThreeClick
()
}
},
currentChange
(){
this
.
currentPage
=
e
this
.
activeNameThreeClick
(
true
)
},
personCheck
(
data
,
e
)
{
this
.
personIndex
=
e
this
.
personIndex
=
e
this
.
talkName
=
name
this
.
talkName
=
data
.
name
;
this
.
employId
=
data
.
externalUserid
this
.
getChatList
()
},
getChatList
(
flag
){
if
(
!
this
.
employId
)
{
return
}
}
if
(
flag
)
{
this
.
loading
=
true
}
content
.
getTree
({
fromId
:
this
.
employId
,
searchType
:
this
.
activeName
}).
then
(({
rows
})
=>
{
console
.
log
(
rows
)
this
.
loading
=
false
this
.
personList
=
rows
}).
catch
(
err
=>
{
this
.
loading
=
false
})
},
activeNameThreeClick
(
page
){
if
(
!!!
page
)
{
this
.
currentPage
=
1
}
let
msgType
=
''
if
(
this
.
activeNameThree
==
0
)
{
msgType
=
''
}
else
if
(
this
.
activeNameThree
==
1
)
{
msgType
=
'image'
}
else
if
(
this
.
activeNameThree
==
2
)
{
msgType
=
'file'
}
else
if
(
this
.
activeNameThree
==
3
)
{
msgType
=
'link'
}
else
if
(
this
.
activeNameThree
==
4
)
{
msgType
=
'voice'
}
let
query
=
{
fromId
:
this
.
chatData
.
fromId
,
receiveId
:
this
.
chatData
.
roomId
,
msgType
,
pageSize
:
'10'
,
pageNum
:
this
.
currentPage
,
beginTime
:
this
.
takeTime
?
yearMouthDay
(
this
.
takeTime
[
0
])
:
""
,
endTime
:
this
.
takeTime
?
yearMouthDay
(
this
.
takeTime
[
1
])
:
''
,
}
content
.
chatList
(
query
).
then
(
res
=>
{
this
.
total
=
Number
(
res
.
total
)
console
.
log
(
res
,
'chatData'
)
if
(
this
.
activeNameThree
==
0
)
{
return
this
.
allChat
=
res
.
rows
}
if
(
this
.
activeNameThree
==
1
)
{
return
this
.
allChatImg
=
res
.
rows
}
if
(
this
.
activeNameThree
==
2
)
{
return
this
.
allFile
=
res
.
rows
}
if
(
this
.
activeNameThree
==
3
)
{
return
this
.
allLInk
=
res
.
rows
}
if
(
this
.
activeNameThree
==
4
)
{
return
this
.
allVoice
=
res
.
rows
}
})
},
customerList
(){
content
.
listByCustomer
().
then
(
res
=>
{
res
.
rows
=
res
.
rows
.
filter
((
a
,
b
)
=>
{
return
a
&&
a
.
name
})
this
.
CList
=
res
.
rows
this
.
employAmount
=
res
.
total
;
})
}
},
mounted
(){
this
.
customerList
()
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
/
deep
/
#tab-0
{
/
deep
/
.el-tabs__nav-scroll
{
text-inden
t
:
15px
;
padding-lef
t
:
15px
;
}
}
.fr
{
float
:
right
;}
.borderR
{
.borderR
{
border-right
:
2px
solid
#ccc
;
border-right
:
2px
solid
#ccc
;
}
}
...
@@ -184,7 +335,7 @@
...
@@ -184,7 +335,7 @@
font-size
:
18px
;
font-size
:
18px
;
min-height
:
20px
;
min-height
:
20px
;
}
}
.hd_tabs_content
{
width
:
100%
;
min-height
:
653px
;
border-bottom
:
1px
solid
#efefef
;
}
.hd_nameRi
{
.hd_nameRi
{
color
:
#199ed8
;
color
:
#199ed8
;
text-align
:
right
;
text-align
:
right
;
...
@@ -193,12 +344,13 @@
...
@@ -193,12 +344,13 @@
}
}
.ct_boxFirst
{
.ct_boxFirst
{
height
:
7
2
0px
;
height
:
7
0
0px
;
}
}
.ct_box
{
.ct_box
{
background
:
white
;
background
:
white
;
min-height
:
710px
;
border-bottom
:
1px
solid
#efefef
;
min-height
:
709px
;
padding
:
10px
;
padding
:
10px
;
overflow-y
:
scroll
;
overflow-y
:
scroll
;
color
:
#999
;
color
:
#999
;
...
@@ -214,12 +366,11 @@
...
@@ -214,12 +366,11 @@
}
}
ul
li
{
ul
li
{
margin-bottom
:
3px
;
padding
:
10px
20px
;
text-align
:
left
;
text-align
:
left
;
cursor
:
pointer
;
cursor
:
pointer
;
border-bottom
:
1px
solid
#efefef
;
border-bottom
:
1px
solid
#efefef
;
:hover{
background
:
#efefef
;}
img
{
img
{
width
:
40px
;
width
:
40px
;
}
}
...
@@ -229,13 +380,20 @@
...
@@ -229,13 +380,20 @@
.liActive
{
.liActive
{
background
:
lightblue
!important
;
background
:
lightblue
!important
;
color
:
#
fff
;
color
:
#
199ed8
;
}
}
.hds_time
{
.hds_time
{
float
:
left
;
text-align
:
left
;
width
:
100%
;
padding
:
10px
0
;
padding
:
10px
0
;
}
}
}
}
}
.pagination
{
padding
:
10px
0
;
height
:
30px
;
float
:
left
;
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeChatSide.java
View file @
2c6f74b
...
@@ -18,7 +18,7 @@ public class WeChatSide extends BaseEntity {
...
@@ -18,7 +18,7 @@ public class WeChatSide extends BaseEntity {
/**
/**
* 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
* 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
*/
*/
private
Lo
ng
mediaType
;
private
Stri
ng
mediaType
;
/**
/**
* 聊天工具栏名称
* 聊天工具栏名称
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeChatSideVo.java
0 → 100644
View file @
2c6f74b
package
com
.
linkwechat
.
wecom
.
domain
.
vo
;
import
lombok.Data
;
/**
* 聊天侧边栏
* @author kewen
*/
@Data
public
class
WeChatSideVo
{
/**
* 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
*/
private
String
mediaType
;
/**
* 素材id
*/
private
Long
materialId
;
/**
* 本地资源文件地址
*/
private
String
materialUrl
;
/**
* 文本内容、图片文案
*/
private
String
content
;
/**
* 图片名称
*/
private
String
materialName
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatCollectionMapper.java
View file @
2c6f74b
...
@@ -2,8 +2,11 @@ package com.linkwechat.wecom.mapper;
...
@@ -2,8 +2,11 @@ package com.linkwechat.wecom.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeChatCollection
;
import
com.linkwechat.wecom.domain.WeChatCollection
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* 聊天工具 侧边栏栏 素材收藏
* 聊天工具 侧边栏栏 素材收藏
*
*
...
@@ -37,4 +40,12 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
...
@@ -37,4 +40,12 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
*/
*/
public
int
countCollectionByMaterialIdAndUserId
(
@Param
(
"materialId"
)
Long
materialId
,
@Param
(
"userId"
)
Long
userId
);
public
int
countCollectionByMaterialIdAndUserId
(
@Param
(
"materialId"
)
Long
materialId
,
@Param
(
"userId"
)
Long
userId
);
/**
* 收藏列表
*
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public
List
<
WeChatSideVo
>
findCollections
(
Long
userId
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatItemMapper.java
View file @
2c6f74b
...
@@ -3,6 +3,7 @@ package com.linkwechat.wecom.mapper;
...
@@ -3,6 +3,7 @@ package com.linkwechat.wecom.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeChatItem
;
import
com.linkwechat.wecom.domain.WeChatItem
;
import
com.linkwechat.wecom.domain.dto.WeChatItemDto
;
import
com.linkwechat.wecom.domain.dto.WeChatItemDto
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -27,4 +28,12 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
...
@@ -27,4 +28,12 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
*/
*/
public
int
dropItem
(
@Param
(
"sideId"
)
Long
sideId
);
public
int
dropItem
(
@Param
(
"sideId"
)
Long
sideId
);
/**
* h5素材列表
*
* @param sideId 侧边栏id
* @return
*/
public
List
<
WeChatSideVo
>
findChatItems
(
@Param
(
"sideId"
)
Long
sideId
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatSideMapper.java
View file @
2c6f74b
...
@@ -2,6 +2,8 @@ package com.linkwechat.wecom.mapper;
...
@@ -2,6 +2,8 @@ package com.linkwechat.wecom.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeChatSide
;
import
com.linkwechat.wecom.domain.WeChatSide
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -13,10 +15,10 @@ public interface WeChatSideMapper extends BaseMapper<WeChatSide> {
...
@@ -13,10 +15,10 @@ public interface WeChatSideMapper extends BaseMapper<WeChatSide> {
/**
/**
* 查询侧边栏列表
* 查询侧边栏列表
*
*
@param h5 0 pc 1 h5
* @return {@link WeChatSide}s
* @return {@link WeChatSide}s
*/
*/
public
List
<
WeChatSide
>
selectWeChatSides
();
public
List
<
WeChatSide
>
selectWeChatSides
(
@Param
(
"h5"
)
String
h5
);
/**
/**
...
@@ -27,4 +29,6 @@ public interface WeChatSideMapper extends BaseMapper<WeChatSide> {
...
@@ -27,4 +29,6 @@ public interface WeChatSideMapper extends BaseMapper<WeChatSide> {
*/
*/
public
int
updateWeChatSideById
(
WeChatSide
weChatSide
);
public
int
updateWeChatSideById
(
WeChatSide
weChatSide
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatCollectionService.java
View file @
2c6f74b
...
@@ -2,6 +2,9 @@ package com.linkwechat.wecom.service;
...
@@ -2,6 +2,9 @@ package com.linkwechat.wecom.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeChatCollection
;
import
com.linkwechat.wecom.domain.WeChatCollection
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
java.util.List
;
/**
/**
* 聊天工具 侧边栏栏 素材收藏
* 聊天工具 侧边栏栏 素材收藏
...
@@ -28,4 +31,12 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
...
@@ -28,4 +31,12 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
*/
*/
public
int
cancleCollection
(
Long
materialId
,
Long
userId
);
public
int
cancleCollection
(
Long
materialId
,
Long
userId
);
/**
* 收藏列表
*
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public
List
<
WeChatSideVo
>
collections
(
Long
userId
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatContactMappingService.java
View file @
2c6f74b
...
@@ -70,7 +70,7 @@ public interface IWeChatContactMappingService extends IService<WeChatContactMapp
...
@@ -70,7 +70,7 @@ public interface IWeChatContactMappingService extends IService<WeChatContactMapp
*
*
* @param query
* @param query
*/
*/
public
List
<
ElasticSearchEntity
>
saveWeChatContactMapping
(
List
<
JSONObject
>
query
);
public
List
<
JSONObject
>
saveWeChatContactMapping
(
List
<
JSONObject
>
query
);
/**
/**
* 按客户查询关系映射列表
* 按客户查询关系映射列表
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatItemService.java
View file @
2c6f74b
...
@@ -3,6 +3,9 @@ package com.linkwechat.wecom.service;
...
@@ -3,6 +3,9 @@ package com.linkwechat.wecom.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeChatItem
;
import
com.linkwechat.wecom.domain.WeChatItem
;
import
com.linkwechat.wecom.domain.dto.WeChatItemDto
;
import
com.linkwechat.wecom.domain.dto.WeChatItemDto
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
java.util.List
;
/**
/**
* 聊天工具侧边栏
* 聊天工具侧边栏
...
@@ -18,4 +21,12 @@ public interface IWeChatItemService extends IService<WeChatItem> {
...
@@ -18,4 +21,12 @@ public interface IWeChatItemService extends IService<WeChatItem> {
*/
*/
public
int
checkItems
(
WeChatItemDto
chatItemDto
);
public
int
checkItems
(
WeChatItemDto
chatItemDto
);
/**
* h5素材列表
*
* @param sideId 侧边栏id
* @return
*/
public
List
<
WeChatSideVo
>
chatItems
(
Long
sideId
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatSideService.java
View file @
2c6f74b
...
@@ -16,7 +16,7 @@ public interface IWeChatSideService extends IService<WeChatSide> {
...
@@ -16,7 +16,7 @@ public interface IWeChatSideService extends IService<WeChatSide> {
*
*
* @return {@link WeChatSide}s
* @return {@link WeChatSide}s
*/
*/
public
List
<
WeChatSide
>
chatSides
();
public
List
<
WeChatSide
>
chatSides
(
String
h5
);
/**
/**
* 更新侧边栏信息
* 更新侧边栏信息
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatCollectionServiceImpl.java
View file @
2c6f74b
...
@@ -3,11 +3,14 @@ package com.linkwechat.wecom.service.impl;
...
@@ -3,11 +3,14 @@ package com.linkwechat.wecom.service.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.wecom.domain.WeChatCollection
;
import
com.linkwechat.wecom.domain.WeChatCollection
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
com.linkwechat.wecom.mapper.WeChatCollectionMapper
;
import
com.linkwechat.wecom.mapper.WeChatCollectionMapper
;
import
com.linkwechat.wecom.service.IWeChatCollectionService
;
import
com.linkwechat.wecom.service.IWeChatCollectionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
/**
* 聊天工具 侧边栏栏 素材收藏
* 聊天工具 侧边栏栏 素材收藏
*
*
...
@@ -34,4 +37,9 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
...
@@ -34,4 +37,9 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
return
weChatCollectionMapper
.
dropCollection
(
materialId
,
userId
);
return
weChatCollectionMapper
.
dropCollection
(
materialId
,
userId
);
}
}
@Override
public
List
<
WeChatSideVo
>
collections
(
Long
userId
)
{
return
weChatCollectionMapper
.
findCollections
(
userId
);
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatContactMappingServiceImpl.java
View file @
2c6f74b
...
@@ -160,11 +160,9 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
...
@@ -160,11 +160,9 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
* @param query
* @param query
*/
*/
@Override
@Override
public
List
<
ElasticSearchEntity
>
saveWeChatContactMapping
(
List
<
JSONObject
>
query
)
{
public
List
<
JSONObject
>
saveWeChatContactMapping
(
List
<
JSONObject
>
query
)
{
List
<
ElasticSearchEntity
>
resultList
=
new
ArrayList
<>();
List
<
JSONObject
>
resultList
=
new
ArrayList
<>();
query
.
stream
().
filter
(
chatData
->
StringUtils
.
isNotEmpty
(
chatData
.
getString
(
"from"
))).
forEach
(
chatData
->
{
query
.
stream
().
filter
(
chatData
->
StringUtils
.
isNotEmpty
(
chatData
.
getString
(
"from"
))).
forEach
(
chatData
->
{
ElasticSearchEntity
elasticSearchEntity
=
new
ElasticSearchEntity
();
elasticSearchEntity
.
setId
(
chatData
.
getString
(
"msgid"
));
//发送人映射数据
//发送人映射数据
WeChatContactMapping
fromWeChatContactMapping
=
new
WeChatContactMapping
();
WeChatContactMapping
fromWeChatContactMapping
=
new
WeChatContactMapping
();
String
fromId
=
chatData
.
getString
(
"from"
);
String
fromId
=
chatData
.
getString
(
"from"
);
...
@@ -194,8 +192,7 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
...
@@ -194,8 +192,7 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
WeChatContactMapping
reveiceWeChatContactMapping
=
from2ReveiceData
(
fromType
,
fromWeChatContactMapping
);
WeChatContactMapping
reveiceWeChatContactMapping
=
from2ReveiceData
(
fromType
,
fromWeChatContactMapping
);
insertWeChatContactMapping
(
fromWeChatContactMapping
);
insertWeChatContactMapping
(
fromWeChatContactMapping
);
insertWeChatContactMapping
(
reveiceWeChatContactMapping
);
insertWeChatContactMapping
(
reveiceWeChatContactMapping
);
elasticSearchEntity
.
setData
(
chatData
);
resultList
.
add
(
chatData
);
resultList
.
add
(
elasticSearchEntity
);
});
});
return
resultList
;
return
resultList
;
}
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatItemServiceImpl.java
View file @
2c6f74b
...
@@ -6,6 +6,7 @@ import com.linkwechat.wecom.domain.WeChatItem;
...
@@ -6,6 +6,7 @@ import com.linkwechat.wecom.domain.WeChatItem;
import
com.linkwechat.wecom.domain.WeChatSide
;
import
com.linkwechat.wecom.domain.WeChatSide
;
import
com.linkwechat.wecom.domain.WeMaterial
;
import
com.linkwechat.wecom.domain.WeMaterial
;
import
com.linkwechat.wecom.domain.dto.WeChatItemDto
;
import
com.linkwechat.wecom.domain.dto.WeChatItemDto
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
import
com.linkwechat.wecom.mapper.WeChatItemMapper
;
import
com.linkwechat.wecom.mapper.WeChatItemMapper
;
import
com.linkwechat.wecom.mapper.WeChatSideMapper
;
import
com.linkwechat.wecom.mapper.WeChatSideMapper
;
import
com.linkwechat.wecom.service.IWeChatItemService
;
import
com.linkwechat.wecom.service.IWeChatItemService
;
...
@@ -94,6 +95,11 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI
...
@@ -94,6 +95,11 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI
return
1
;
return
1
;
}
}
@Override
public
List
<
WeChatSideVo
>
chatItems
(
Long
sideId
)
{
return
weChatItemMapper
.
findChatItems
(
sideId
);
}
/**
/**
* 更新该次选择的素材数
* 更新该次选择的素材数
*
*
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatSideServiceImpl.java
View file @
2c6f74b
...
@@ -21,8 +21,8 @@ public class WeChatSideServiceImpl extends ServiceImpl<WeChatSideMapper, WeChatS
...
@@ -21,8 +21,8 @@ public class WeChatSideServiceImpl extends ServiceImpl<WeChatSideMapper, WeChatS
private
WeChatSideMapper
weChatSideMapper
;
private
WeChatSideMapper
weChatSideMapper
;
@Override
@Override
public
List
<
WeChatSide
>
chatSides
()
{
public
List
<
WeChatSide
>
chatSides
(
String
h5
)
{
return
weChatSideMapper
.
selectWeChatSides
();
return
weChatSideMapper
.
selectWeChatSides
(
h5
);
}
}
@Override
@Override
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeConversationArchiveServiceImpl.java
View file @
2c6f74b
...
@@ -68,8 +68,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
...
@@ -68,8 +68,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
.
minimumShouldMatch
(
1
);
.
minimumShouldMatch
(
1
);
//时间范围查询
//时间范围查询
if
(
StringUtils
.
isNotEmpty
(
query
.
getBeginTime
())
&&
StringUtils
.
isNotEmpty
(
query
.
getEndTime
()))
{
if
(
StringUtils
.
isNotEmpty
(
query
.
getBeginTime
())
&&
StringUtils
.
isNotEmpty
(
query
.
getEndTime
()))
{
Date
beginTime
=
DateUtils
.
dateTime
(
query
.
getBeginTime
(),
DateUtils
.
YYYY_MM_DD
);
Date
beginTime
=
DateUtils
.
dateTime
(
DateUtils
.
YYYY_MM_DD
,
query
.
getBeginTime
()
);
Date
endTime
=
DateUtils
.
dateTime
(
query
.
getEndTime
(),
DateUtils
.
YYYY_MM_DD
);
Date
endTime
=
DateUtils
.
dateTime
(
DateUtils
.
YYYY_MM_DD
,
query
.
getEndTime
()
);
boolQueryBuilder
.
filter
(
QueryBuilders
.
rangeQuery
(
"msgtime"
).
gte
(
beginTime
).
lte
(
endTime
));
boolQueryBuilder
.
filter
(
QueryBuilders
.
rangeQuery
(
"msgtime"
).
gte
(
beginTime
).
lte
(
endTime
));
}
}
builder
.
query
(
boolQueryBuilder
);
builder
.
query
(
boolQueryBuilder
);
...
@@ -105,8 +105,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
...
@@ -105,8 +105,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
//时间范围查询
//时间范围查询
if
(
StringUtils
.
isNotEmpty
(
query
.
getBeginTime
())
&&
StringUtils
.
isNotEmpty
(
query
.
getEndTime
()))
{
if
(
StringUtils
.
isNotEmpty
(
query
.
getBeginTime
())
&&
StringUtils
.
isNotEmpty
(
query
.
getEndTime
()))
{
Date
beginTime
=
DateUtils
.
dateTime
(
query
.
getBeginTime
(),
DateUtils
.
YYYY_MM_DD
);
Date
beginTime
=
DateUtils
.
dateTime
(
DateUtils
.
YYYY_MM_DD
,
query
.
getBeginTime
()
);
Date
endTime
=
DateUtils
.
dateTime
(
query
.
getEndTime
(),
DateUtils
.
YYYY_MM_DD
);
Date
endTime
=
DateUtils
.
dateTime
(
DateUtils
.
YYYY_MM_DD
,
query
.
getEndTime
()
);
boolQueryBuilder
.
filter
(
QueryBuilders
.
rangeQuery
(
"msgtime"
).
gte
(
beginTime
).
lte
(
endTime
));
boolQueryBuilder
.
filter
(
QueryBuilders
.
rangeQuery
(
"msgtime"
).
gte
(
beginTime
).
lte
(
endTime
));
}
}
...
@@ -194,8 +194,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
...
@@ -194,8 +194,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
//时间范围查询
//时间范围查询
if
(
StringUtils
.
isNotEmpty
(
query
.
getBeginTime
())
&&
StringUtils
.
isNotEmpty
(
query
.
getEndTime
()))
{
if
(
StringUtils
.
isNotEmpty
(
query
.
getBeginTime
())
&&
StringUtils
.
isNotEmpty
(
query
.
getEndTime
()))
{
Date
beginTime
=
DateUtils
.
dateTime
(
query
.
getBeginTime
(),
DateUtils
.
YYYY_MM_DD
);
Date
beginTime
=
DateUtils
.
dateTime
(
DateUtils
.
YYYY_MM_DD
,
query
.
getBeginTime
()
);
Date
endTime
=
DateUtils
.
dateTime
(
query
.
getEndTime
(),
DateUtils
.
YYYY_MM_DD
);
Date
endTime
=
DateUtils
.
dateTime
(
DateUtils
.
YYYY_MM_DD
,
query
.
getEndTime
()
);
boolQueryBuilder
.
filter
(
QueryBuilders
.
rangeQuery
(
"msgtime"
).
gte
(
beginTime
).
lte
(
endTime
));
boolQueryBuilder
.
filter
(
QueryBuilders
.
rangeQuery
(
"msgtime"
).
gte
(
beginTime
).
lte
(
endTime
));
}
}
builder
.
query
(
boolQueryBuilder
);
builder
.
query
(
boolQueryBuilder
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePosterServiceImpl.java
View file @
2c6f74b
...
@@ -7,10 +7,12 @@ import com.linkwechat.common.utils.file.FileUploadUtils;
...
@@ -7,10 +7,12 @@ import com.linkwechat.common.utils.file.FileUploadUtils;
import
com.linkwechat.common.utils.file.FileUtils
;
import
com.linkwechat.common.utils.file.FileUtils
;
import
com.linkwechat.common.utils.img.ImageUtils
;
import
com.linkwechat.common.utils.img.ImageUtils
;
import
com.linkwechat.common.utils.img.NetFileUtils
;
import
com.linkwechat.common.utils.img.NetFileUtils
;
import
com.linkwechat.wecom.domain.WeCategory
;
import
com.linkwechat.wecom.domain.WePoster
;
import
com.linkwechat.wecom.domain.WePoster
;
import
com.linkwechat.wecom.domain.WePosterFont
;
import
com.linkwechat.wecom.domain.WePosterFont
;
import
com.linkwechat.wecom.domain.WePosterSubassembly
;
import
com.linkwechat.wecom.domain.WePosterSubassembly
;
import
com.linkwechat.wecom.mapper.WePosterMapper
;
import
com.linkwechat.wecom.mapper.WePosterMapper
;
import
com.linkwechat.wecom.service.IWeCategoryService
;
import
com.linkwechat.wecom.service.IWePosterFontService
;
import
com.linkwechat.wecom.service.IWePosterFontService
;
import
com.linkwechat.wecom.service.IWePosterService
;
import
com.linkwechat.wecom.service.IWePosterService
;
import
com.linkwechat.wecom.service.IWePosterSubassemblyService
;
import
com.linkwechat.wecom.service.IWePosterSubassemblyService
;
...
@@ -54,6 +56,9 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
...
@@ -54,6 +56,9 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
@Resource
@Resource
private
ServerConfig
serverConfig
;
private
ServerConfig
serverConfig
;
@Resource
private
IWeCategoryService
weCategoryService
;
/**
/**
* 查询一条
* 查询一条
...
@@ -86,8 +91,10 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
...
@@ -86,8 +91,10 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
});
});
}
}
}
}
}
}
/*if(poster.getCategoryId() != null){
weCategoryService.findWeCategoryById(poster.getId());
}*/
return
poster
;
return
poster
;
}
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeSensitiveServiceImpl.java
View file @
2c6f74b
...
@@ -22,6 +22,8 @@ import com.linkwechat.wecom.service.IWeUserService;
...
@@ -22,6 +22,8 @@ import com.linkwechat.wecom.service.IWeUserService;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.elasticsearch.common.xcontent.XContentBuilder
;
import
org.elasticsearch.common.xcontent.XContentFactory
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
...
@@ -30,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -30,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -165,6 +166,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
...
@@ -165,6 +166,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
@Override
@Override
public
void
hitSensitive
(
List
<
JSONObject
>
entityList
)
{
public
void
hitSensitive
(
List
<
JSONObject
>
entityList
)
{
log
.
info
(
"执行敏感词命中过滤,time=[{}]"
,
System
.
currentTimeMillis
());
//获取所有的敏感词规则
//获取所有的敏感词规则
List
<
WeSensitive
>
allSensitiveRules
=
weSensitiveMapper
.
selectWeSensitiveList
(
new
WeSensitive
());
List
<
WeSensitive
>
allSensitiveRules
=
weSensitiveMapper
.
selectWeSensitiveList
(
new
WeSensitive
());
//根据规则过滤命中
//根据规则过滤命中
...
@@ -175,18 +177,14 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
...
@@ -175,18 +177,14 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
List
<
String
>
users
=
getScopeUsers
(
weSensitive
.
getAuditUserScope
());
List
<
String
>
users
=
getScopeUsers
(
weSensitive
.
getAuditUserScope
());
jsonList
.
addAll
(
hitSensitiveInES
(
patternWords
,
users
));
jsonList
.
addAll
(
hitSensitiveInES
(
patternWords
,
users
));
//将命中结果插入es
//将命中结果插入es
try
{
addHitSensitiveList
(
jsonList
,
weSensitive
);
addHitSensitiveList
(
jsonList
,
weSensitive
);
}
catch
(
IOException
e
)
{
log
.
warn
(
"添加敏感词命中信息失败, jsonList={}, auditUserId={}, exception={}"
,
jsonList
,
weSensitive
.
getAuditUserId
(),
ExceptionUtils
.
getStackTrace
(
e
));
}
});
});
}
}
}
}
@Override
@Override
public
PageInfo
<
JSONObject
>
getHitSensitiveList
(
WeSensitiveHitQuery
weSensitiveHitQuery
)
{
public
PageInfo
<
JSONObject
>
getHitSensitiveList
(
WeSensitiveHitQuery
weSensitiveHitQuery
)
{
elasticSearch
.
createIndex2
(
WeConstans
.
WECOM_SENSITIVE_HIT_INDEX
,
getSensitiveHitMapping
());
List
<
String
>
userIds
=
Lists
.
newArrayList
();
List
<
String
>
userIds
=
Lists
.
newArrayList
();
if
(
weSensitiveHitQuery
.
getScopeType
().
equals
(
WeConstans
.
USE_SCOP_BUSINESSID_TYPE_USER
))
{
if
(
weSensitiveHitQuery
.
getScopeType
().
equals
(
WeConstans
.
USE_SCOP_BUSINESSID_TYPE_USER
))
{
userIds
.
add
(
weSensitiveHitQuery
.
getAuditScopeId
());
userIds
.
add
(
weSensitiveHitQuery
.
getAuditScopeId
());
...
@@ -218,9 +216,8 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
...
@@ -218,9 +216,8 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
return
elasticSearch
.
searchPage
(
WeConstans
.
WECOM_SENSITIVE_HIT_INDEX
,
builder
,
pageNum
,
pageSize
,
JSONObject
.
class
);
return
elasticSearch
.
searchPage
(
WeConstans
.
WECOM_SENSITIVE_HIT_INDEX
,
builder
,
pageNum
,
pageSize
,
JSONObject
.
class
);
}
}
private
void
addHitSensitiveList
(
List
<
JSONObject
>
json
,
WeSensitive
weSensitive
)
throws
IOException
{
private
void
addHitSensitiveList
(
List
<
JSONObject
>
json
,
WeSensitive
weSensitive
)
{
//创建索引
elasticSearch
.
createIndex2
(
WeConstans
.
WECOM_SENSITIVE_HIT_INDEX
,
getSensitiveHitMapping
());
elasticSearch
.
createIndex2
(
WeConstans
.
WECOM_SENSITIVE_HIT_INDEX
,
elasticSearch
.
getFinanceMapping
());
if
(
weSensitive
.
getAlertFlag
().
equals
(
1
))
{
if
(
weSensitive
.
getAlertFlag
().
equals
(
1
))
{
//针对每一条命中信息发送消息通知给相应的审计人 TODO
//针对每一条命中信息发送消息通知给相应的审计人 TODO
}
}
...
@@ -270,4 +267,43 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
...
@@ -270,4 +267,43 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
builder
.
query
(
searchBuilder
);
builder
.
query
(
searchBuilder
);
return
elasticSearch
.
search
(
WeConstans
.
WECOM_FINANCE_INDEX
,
builder
,
JSONObject
.
class
);
return
elasticSearch
.
search
(
WeConstans
.
WECOM_FINANCE_INDEX
,
builder
,
JSONObject
.
class
);
}
}
private
XContentBuilder
getSensitiveHitMapping
()
{
try
{
//创建索引
XContentBuilder
mapping
=
XContentFactory
.
jsonBuilder
()
.
startObject
()
.
startObject
(
"properties"
)
.
startObject
(
"msgid"
)
.
field
(
"type"
,
"keyword"
)
.
endObject
()
.
startObject
(
"seq"
)
.
field
(
"type"
,
"long"
)
.
endObject
()
.
startObject
(
"action"
)
.
field
(
"type"
,
"keyword"
)
.
endObject
()
.
startObject
(
"from"
)
.
field
(
"type"
,
"keyword"
)
.
endObject
()
.
startObject
(
"roomid"
)
.
field
(
"type"
,
"keyword"
)
.
endObject
()
.
startObject
(
"msgtime"
)
.
field
(
"type"
,
"long"
)
.
endObject
()
.
startObject
(
"msgtype"
)
.
field
(
"type"
,
"keyword"
)
.
endObject
()
.
startObject
(
"alerted"
)
.
field
(
"type"
,
"keyword"
)
.
endObject
()
.
endObject
()
.
endObject
();
return
mapping
;
}
catch
(
Exception
e
)
{
log
.
warn
(
"create sensitive-hit mapping failed, exception={}"
,
ExceptionUtils
.
getStackTrace
(
e
));
}
return
null
;
}
}
}
linkwe-wecom/src/main/resources/mapper/wecom/WeChatCollectionMapper.xml
View file @
2c6f74b
...
@@ -23,5 +23,20 @@
...
@@ -23,5 +23,20 @@
material_id=#{materialId} AND user_id=#{userId}
material_id=#{materialId} AND user_id=#{userId}
</where>
</where>
</select>
</select>
<select
id=
"findCollections"
resultType=
"com.linkwechat.wecom.domain.vo.WeChatSideVo"
>
SELECT
wcc.material_id,
wm.material_name,
wm.material_url,
wm.content,
wc.media_type
FROM
we_chat_collection wcc
LEFT JOIN we_material wm ON wcc.material_id = wm.id
LEFT JOIN we_category wc ON wm.category_id = wc.id
<where>
wcc.user_id=#{userId}
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeChatItemMapper.xml
View file @
2c6f74b
...
@@ -20,4 +20,20 @@
...
@@ -20,4 +20,20 @@
side_id=#{sideId}
side_id=#{sideId}
</where>
</where>
</delete>
</delete>
<select
id=
"findChatItems"
resultType=
"com.linkwechat.wecom.domain.vo.WeChatSideVo"
>
SELECT
wci.material_id,
wm.material_name,
wm.material_url,
wm.content,
wc.media_type
FROM
we_chat_item wci
LEFT JOIN we_material wm ON wci.material_id = wm.id
LEFT JOIN we_category wc ON wm.category_id = wc.id
<where>
wci.side_id=#{sideId}
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeChatSideMapper.xml
View file @
2c6f74b
...
@@ -31,7 +31,10 @@
...
@@ -31,7 +31,10 @@
FROM
FROM
we_chat_side
we_chat_side
<where>
<where>
<if
test=
"h5!=null and h5!='' and h5=='1'.toString()"
>
`using`=0
`using`=0
</if>
</where>
</where>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
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