Commit 2c6f74b2 by xinlaa

Merge remote-tracking branch 'origin/master' into front_end_dev

2 parents f3fecc86 731238f9
Showing 40 changed files with 1402 additions and 271 deletions
......@@ -2,7 +2,7 @@
<p></p>
<p align="center">
<img alt="logo" src="https://images.gitee.com/uploads/images/2020/1203/143430_03205b51_1480777.png" width="120" style="margin-bottom: 0px;">
<img alt="logo" src="https://images.gitee.com/uploads/images/2021/0107/210318_e1f66c96_1480777.png" width="120" style="margin-bottom: 0px;">
</p>
<h2 align="center">LinkWeChat —— 让每个企业都是私域流量营销专家</h2>
......
......@@ -3,12 +3,16 @@ package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.vo.WeChatSideVo;
import com.linkwechat.wecom.service.IWeChatCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 聊天工具 侧边栏栏 素材收藏
*
......@@ -28,8 +32,8 @@ public class WeChatCollectionController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('chat:collection:add')")
@Log(title = "添加收藏", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult addCollection(@RequestParam(value = "materialId") Long materialId, @RequestParam(value = "userId") Long userId) {
@PutMapping("addCollection")
public AjaxResult addCollection(@RequestParam(value = "materialId") Long materialId,@RequestParam(value = "userId") Long userId) {
return toAjax(weChatCollectionService.addCollection(materialId, userId));
}
......@@ -39,9 +43,20 @@ public class WeChatCollectionController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('chat:collection:delete')")
@Log(title = "取消收藏", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult cancleCollection(@RequestParam(value = "materialId") Long materialId, @RequestParam(value = "userId") Long userId) {
@PostMapping(value = "cancleCollection")
public AjaxResult cancleCollection(@RequestParam(value = "materialId") Long materialId,@RequestParam(value = "userId") Long 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);
}
}
......@@ -3,15 +3,16 @@ package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.dto.WeChatItemDto;
import com.linkwechat.wecom.domain.vo.WeChatSideVo;
import com.linkwechat.wecom.service.IWeChatItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 聊天工具侧边栏
......@@ -35,6 +36,15 @@ public class WeChatItemController extends BaseController {
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);
}
}
......@@ -30,9 +30,9 @@ public class WeChatSideController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('chat:side:list')")
@GetMapping("/list")
public TableDataInfo list() {
public TableDataInfo list(@RequestParam(value = "h5") String h5) {
startPage();
List<WeChatSide> weChatSides = weChatSideService.chatSides();
List<WeChatSide> weChatSides = weChatSideService.chatSides(h5);
return getDataTable(weChatSides);
}
......
......@@ -5,22 +5,19 @@ import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.enums.MediaType;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.wecom.domain.WeMaterial;
import com.linkwechat.wecom.domain.WePoster;
import com.linkwechat.wecom.domain.WePosterFont;
import com.linkwechat.wecom.domain.WePosterSubassembly;
import com.linkwechat.wecom.service.IWePosterFontService;
import com.linkwechat.wecom.service.IWePosterService;
import com.linkwechat.wecom.service.IWePosterSubassemblyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -46,8 +43,9 @@ public class WePosterController extends BaseController {
@PostMapping(value = "insert")
@ApiOperation("创建海报")
@PreAuthorize("@ss.hasAnyPermi('wecom:poster:insert')")
@Transactional(rollbackFor = RuntimeException.class)
public AjaxResult insert(@RequestBody WePoster poster){
public AjaxResult insert(@RequestBody WePoster poster) {
wePosterService.generateSimpleImg(poster);
poster.setId(SnowFlakeUtil.nextId());
poster.setDelFlag(0);
......@@ -68,37 +66,38 @@ public class WePosterController extends BaseController {
@PutMapping(value = "update")
@ApiOperation("修改海报")
@PreAuthorize("@ss.hasAnyPermi('wecom:poster:update')")
@Transactional(rollbackFor = RuntimeException.class)
public AjaxResult update(@RequestBody WePoster poster){
if(poster.getId() == null){
public AjaxResult update(@RequestBody WePoster poster) {
if (poster.getId() == null) {
return AjaxResult.error("id为空");
}
poster.setMediaType(null);
wePosterService.generateSimpleImg(poster);
wePosterService.saveOrUpdate(poster);
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));
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));
List<WePosterSubassembly> insertList = new ArrayList<>();
List<WePosterSubassembly> updateList = new ArrayList<>();
poster.getPosterSubassemblyList().forEach(wePosterSubassembly -> {
if(wePosterSubassembly.getId() == null){
if (wePosterSubassembly.getId() == null) {
wePosterSubassembly.setId(SnowFlakeUtil.nextId());
wePosterSubassembly.setPosterId(poster.getId());
wePosterSubassembly.setDelFlag(0);
insertList.add(wePosterSubassembly);
}else {
} else {
posterSubassemblyMap.remove(wePosterSubassembly.getId());
updateList.add(wePosterSubassembly);
}
});
if(!CollectionUtils.isEmpty(insertList)) {
if (!CollectionUtils.isEmpty(insertList)) {
wePosterSubassemblyService.saveBatch(insertList);
}
if(!CollectionUtils.isEmpty(updateList)) {
if (!CollectionUtils.isEmpty(updateList)) {
wePosterSubassemblyService.updateBatchById(updateList);
}
List<WePosterSubassembly> deleteList = new ArrayList<>(posterSubassemblyMap.values());
if(!CollectionUtils.isEmpty(deleteList)){
if (!CollectionUtils.isEmpty(deleteList)) {
deleteList.forEach(wePosterSubassembly -> wePosterSubassembly.setDelFlag(1));
wePosterSubassemblyService.updateBatchById(deleteList);
}
......@@ -118,19 +117,21 @@ public class WePosterController extends BaseController {
}*/
@GetMapping(value = "entity/{id}")
@PreAuthorize("@ss.hasAnyPermi('wecom:poster:entity')")
@ApiOperation("查询海报详情")
public AjaxResult entity(@PathVariable Long id){
public AjaxResult entity(@PathVariable Long id) {
return AjaxResult.success(wePosterService.selectOne(id));
}
@GetMapping(value = "page")
@ApiOperation("分页查询海报")
public AjaxResult page(Long categoryId,String name){
@PreAuthorize("@ss.hasAnyPermi('wecom:poster:page')")
public AjaxResult page(Long categoryId, String name) {
startPage();
List<WePoster> fontList = wePosterService.lambdaQuery()
.eq(WePoster::getDelFlag,0)
.eq(categoryId != null,WePoster::getCategoryId,categoryId)
.like(StringUtils.isNotBlank(name),WePoster::getTitle,name)
.eq(WePoster::getDelFlag, 0)
.eq(categoryId != null, WePoster::getCategoryId, categoryId)
.like(StringUtils.isNotBlank(name), WePoster::getTitle, name)
.orderByDesc(WePoster::getCreateTime)
.list();
return AjaxResult.success(getDataTable(fontList));
......@@ -138,14 +139,15 @@ public class WePosterController extends BaseController {
@DeleteMapping(value = "delete/{id}")
@ApiOperation(value = "删除海报")
@PreAuthorize("@ss.hasAnyPermi('wecom:poster:delete')")
@Transactional(rollbackFor = RuntimeException.class)
public AjaxResult deletePosterFont(@PathVariable Long id){
wePosterService.lambdaUpdate().set(WePoster::getDelFlag,1).eq(WePoster::getId,id);
wePosterSubassemblyService.lambdaUpdate().set(WePosterSubassembly::getDelFlag,1).eq(WePosterSubassembly::getPosterId,id);
public AjaxResult deletePosterFont(@PathVariable Long id) {
wePosterService.update(
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("删除成功");
}
}
......@@ -4,7 +4,6 @@ import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.enums.MediaType;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.web.controller.common.CommonController;
import com.linkwechat.wecom.domain.WePosterFont;
import com.linkwechat.wecom.service.IWePosterFontService;
import io.swagger.annotations.Api;
......@@ -30,7 +29,7 @@ public class WePosterFontController extends BaseController {
@PostMapping(value = "posterFont")
@ApiOperation("创建海报字体")
@Transactional(rollbackFor = RuntimeException.class)
public AjaxResult insertPosterFont(@RequestBody WePosterFont posterFont){
public AjaxResult insertPosterFont(@RequestBody WePosterFont posterFont) {
posterFont.setId(SnowFlakeUtil.nextId());
posterFont.setDelFlag(0);
posterFont.setMediaType(MediaType.POSTER_FONT.getType());
......@@ -42,8 +41,8 @@ public class WePosterFontController extends BaseController {
@PutMapping(value = "posterFont")
@ApiOperation("修改海报字体")
@Transactional(rollbackFor = RuntimeException.class)
public AjaxResult updatePosterFont(@RequestBody WePosterFont posterFont){
if(posterFont.getId() == null){
public AjaxResult updatePosterFont(@RequestBody WePosterFont posterFont) {
if (posterFont.getId() == null) {
return AjaxResult.error("id为空");
}
posterFont.setMediaType(null);
......@@ -53,9 +52,9 @@ public class WePosterFontController extends BaseController {
@GetMapping(value = "posterFontList")
@ApiOperation("列表查询海报字体")
public AjaxResult selectPosterFontList(){
public AjaxResult selectPosterFontList() {
List<WePosterFont> fontList = wePosterFontService.lambdaQuery()
.eq(WePosterFont::getDelFlag,0)
.eq(WePosterFont::getDelFlag, 0)
.orderByDesc(WePosterFont::getOrder)
.orderByDesc(WePosterFont::getCreateTime)
.list();
......@@ -64,10 +63,10 @@ public class WePosterFontController extends BaseController {
@GetMapping(value = "posterFontPage")
@ApiOperation("分页查询海报字体")
public AjaxResult selectPosterFontPage(){
public AjaxResult selectPosterFontPage() {
startPage();
List<WePosterFont> fontList = wePosterFontService.lambdaQuery()
.eq(WePosterFont::getDelFlag,0)
.eq(WePosterFont::getDelFlag, 0)
.orderByDesc(WePosterFont::getOrder)
.orderByDesc(WePosterFont::getCreateTime)
.list();
......@@ -77,11 +76,11 @@ public class WePosterFontController extends BaseController {
@DeleteMapping(value = "posterFont/{id}")
@ApiOperation("删除海报字体")
@Transactional(rollbackFor = RuntimeException.class)
public AjaxResult deletePosterFont(@PathVariable Long id){
wePosterFontService.lambdaUpdate().set(WePosterFont::getDelFlag,1).eq(WePosterFont::getId,id);
public AjaxResult deletePosterFont(@PathVariable Long id) {
wePosterFontService.update(
wePosterFontService.lambdaUpdate().set(WePosterFont::getDelFlag, 1).eq(WePosterFont::getId, id));
return AjaxResult.success("删除成功");
}
}
......@@ -178,6 +178,8 @@ wecome:
- /externalcontact/get_unassigned_list
- /externalcontact/send_welcome_msg
- /externalcontact/unionid_to_external_userid
- /externalcontact/add_msg_template
- /externalcontact/get_group_msg_result
- /get_jsapi_ticket
- /ticket/get
fileUplodUrl: /media/upload,/media/uploadimg
......
......@@ -216,7 +216,7 @@ public class ElasticSearch {
*/
public void insertBatchAsync(String idxName, List<JSONObject> list, List<Consumer<List<JSONObject>>> consumers) {
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)));
try {
restHighLevelClient.bulkAsync(request, RequestOptions.DEFAULT, getActionListener(list, consumers));
......
......@@ -25,19 +25,6 @@ public class NetFileUtils {
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){
FileCallable fileCallable = new FileCallable();
......
......@@ -76,10 +76,10 @@ public class RyTask {
"", redisCache);
if (CollectionUtil.isNotEmpty(chatDataList)){
try {
List<JSONObject> elasticSearchEntities = weChatContactMappingService.saveWeChatContactMapping(chatDataList);
List<Consumer<List<JSONObject>>> consumerList = Lists.newArrayList();
consumerList.add(weChatContactMappingService::saveWeChatContactMapping);
consumerList.add(weSensitiveService::hitSensitive);
elasticSearch.insertBatchAsync(WeConstans.WECOM_FINANCE_INDEX, chatDataList, consumerList);
elasticSearch.insertBatchAsync(WeConstans.WECOM_FINANCE_INDEX, elasticSearchEntities, consumerList);
} catch (Exception e) {
log.error("消息处理异常:ex:{}", e);
e.printStackTrace();
......
......@@ -49,6 +49,7 @@
"js-beautify": "1.10.2",
"js-cookie": "2.2.0",
"jsencrypt": "3.0.0-rc.1",
"moment": "^2.29.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
......
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
......@@ -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) {
var search = params;
......
<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
<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
<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
<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
<template>
<div class="content">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="根据员工检测" name="1">
<el-tab-pane label="员工检索" name="1">
<employee></employee>
</el-tab-pane>
<el-tab-pane label="根据用户检测" name="2">
<user></user>
<el-tab-pane label="客户检索" name="2" >
<user v-if="activeName==2"></user>
</el-tab-pane>
<el-tab-pane label="全局检测" name="3">
<role></role>
<el-tab-pane label="全局检索" name="3">
<role v-if="activeName==3"></role>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
......@@ -33,3 +32,6 @@ import role from './page/roleTest.vue'
}
}
</script>
<style scoped>
*{margin: 0;padding: 0;}
</style>
......@@ -10,8 +10,8 @@
</div>
</div>
<div class="ct_box ct_boxFirst">
<el-tree class="filter-tree" :data="data" :filter-node-method="filterNode" ref="tree"
@node-click="handleNodeClick">
<el-tree class="filter-tree" :data="treeData" :props="defaultProps" :filter-node-method="filterNode"
ref="tree" @node-click="handleNodeClick" :default-expand-all="true">
</el-tree>
</div>
</el-col>
......@@ -20,139 +20,176 @@
<div class="hd_name">{{talkName}}</div>
</div>
<div class="hd_tabs">
<el-tabs v-model="activeName">
<el-tabs v-model="activeName" @tab-click="tabClick(true)">
<el-tab-pane label="内部联系人" name="0">
<div class="ct_box">
<!-- 应该是类似聊天记录的 后期弄成组件 看 -->
暂无联系人
<list v-if="activeName==0" :personList="personList" :loading="loading" @chatFn='chatFn'>
</list>
</div>
</el-tab-pane>
<el-tab-pane label="外部联系人" name="1">
<div class="ct_box">
<!-- ! -->
暂无联系人
</div>
<list v-if="activeName==1" :personList="personList" :loading="loading" @chatFn='chatFn'>
</list>
</el-tab-pane>
<el-tab-pane label="群聊" name="2">
<div class="ct_box">
<!-- ! -->
暂无联系人
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
<el-col :span="12">
<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 class=" hd_tabthree">
<el-tabs v-model="activeNameThree">
<el-tabs v-model="activeNameThree" @tab-click="activeNameThreeClick()">
<el-tab-pane label="全部" name="0">
<div class="ct_box">
<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>
</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>
</el-tab-pane>
<el-tab-pane label="图片及视频" name="1">
<div class="ct_box">
<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>
</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>
</el-tab-pane>
<el-tab-pane label="文件" name="3">
<el-tab-pane label="文件" name="2">
<div class="ct_box">
<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>
</div>
<el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="类型">
<el-table :data="allFile" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="msgtype" label="类型">
</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 prop="address" label="大小">
<el-table-column label="大小">
<template slot-scope="scope">
{{filterSize(scope.row.file.filesize)}}
</template>
</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 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>
</div>
</el-tab-pane>
<el-tab-pane label="链接" name="4">
<el-tab-pane label="链接" name="3">
<div class="ct_box">
<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>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="语音通话" name="5">
<el-tab-pane label="语音通话" name="4">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
<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>
</div>
<el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人">
</el-table-column>
<el-table-column prop="name" label="通话时间">
</el-table-column>
<el-table-column prop="address" label="时长">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
<el-table :data="fileData" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人">
</el-table-column>
<el-table-column prop="name" label="通话时间">
</el-table-column>
<el-table-column prop="address" label="时长">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
</el-row>
</div>
</template>
<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 {
components: {
list,
chat
},
data() {
return {
employAmount: 1,
employId: '',
employName: '',
talkName: '',
data: [{
id: 1,
label: '一级 1',
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'
}]
}],
treeData: [],
defaultProps: {
label: 'name',
children: 'children',
},
activeName: "1",
activeNameThree: '1',
activeNameThree: '0',
takeTime: '',
fileData: []
fileData: [],
chat: {},
personList: [],
loading: false,
allChat: [], //全部聊天记录
allChatImg: [], //图片,
allVoice: [],
allFile: [],
allLInk: [],
//分页
total: '',
currentPage: ''
};
},
watch: {
......@@ -160,15 +197,136 @@
this.$refs.tree.filter(val);
}
},
mounted() {
this.getTree()
},
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) {
console.log(value, data)
if (!value) return true;
return data.label.indexOf(value) !== -1;
return data.name.indexOf(value) !== -1;
},
handleNodeClick(data) {
if (!data.children) {
console.log(data.label)
this.talkName = data.label
handleNodeClick(data, add) {
if (!data.gender) {
let querys = {
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 @@
}
</script>
<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 {
......@@ -194,6 +361,10 @@
.hd_tabs {
background: #fff;
/deep/ .el-tabs__header {
margin: 0;
}
}
.hd_tabthree {
......@@ -219,25 +390,33 @@
}
.ct_boxFirst {
height: 720px;
height: 707px !important;
}
.ct_box {
background: white;
min-height: 710px;
height: 710px;
padding: 10px;
overflow-y: scroll;
border-bottom: 1px solid #efefef;
color: #999;
text-align: center;
::-webkit-scrollbar {
display: none;
}
.hds_time {
float: left;
text-align: left;
width: 100%;
padding: 10px 0;
}
}
}
.pagination {
padding: 10px 0;
height: 30px;
float: left;
}
</style>
\ No newline at end of file
......@@ -3,8 +3,8 @@
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-row>
<el-form-item label="员工名称">
<el-select v-model="form.Ename" placeholder="员工名称" style="width:300px">
</el-select>
<el-input v-model="form.Ename" placeholder="客户名称" style="width:300px"></el-input>
</el-form-item>
<el-form-item label="客户名称">
<el-input v-model="form.Cname" placeholder="客户名称" style="width:300px"></el-input>
......@@ -15,14 +15,16 @@
<el-input v-model="form.Scontent" placeholder="查找内容" style="width:300px"></el-input>
</el-form-item>
<el-form-item label="时间范围">
<el-time-picker is-range v-model="form.Stime" range-separator="至" start-placeholder="开始时间"
end-placeholder="结束时间" placeholder="选择时间范围">
</el-time-picker>
<el-date-picker v-model="form.Stime" type="datetimerange" format='yyyy-MM-dd'
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right">
</el-date-picker>
</el-form-item>
</el-row>
<el-row>
<el-form-item>
<el-button type="primary">查询</el-button>
<el-button type="primary" @click="init">查询</el-button>
</el-form-item>
<el-form-item>
<el-button>导出列表</el-button>
......@@ -31,36 +33,64 @@
</el-form>
<div class="content">
<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 prop="name" label=" 内容">
<template slot-scope="scope" v-if="scope.row.text">
{{scope.row.text.content}}
</template>
</el-table-column>
<el-table-column label="消息状态" width="200">
<template slot="header" >
{{floorRange}}
<el-select size="mini" v-model="floorRange" class="noborder" @change="chechName(floorRange)">
<el-table-column label="消息状态" width="200">
<template slot="header">
{{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"
:value="item.value">
</el-option>
</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 prop="address" label="发送时间" width="200">
<template slot-scope="scope" v-if="scope.row.text">
{{parseTime(scope.row.msgtime)}}
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="20"
style="padding:10px"
:pager-count="11"
layout="prev, pager, next"
:total="1000">
</el-pagination>
<el-pagination background class="pagination" layout="prev, pager, next" :total="total"
@current-change="currentChange" :current-page="currentPage">
</el-pagination>
</div>
</div>
</template>
<script>
import {
content
} from '@/api/content.js'
import {
yearMouthDay,
parseTime
} from '@/utils/common.js'
export default {
data() {
return {
......@@ -70,53 +100,125 @@
Scontent: '',
Stime: ''
},
currentPage: 1,
total: 0,
ac:'',
fileData: [],
floorRange:'全部',
displayOptions: [{
value: "0",
floorRange: '全部',
displayOptions: [{
value: "",
label: "全部"
},
{
value: "1",
value: "send",
label: "已发送"
},
{
value: "2",
value: "recall",
label: "已撤回"
},
{
value: "3",
value: "switch",
label: "切回企业日志"
}
]
}
},
methods:{
chechName(e){
if(e==0){
this.floorRange='全部'
mounted() {
this.init()
},
methods: {
currentChange(e) {
this.currentPage = e
this.init(true)
},
init(flag) {
if (!!!flag) {
this.currentPage = 1
}
let query = {
userName: this.form.Ename,
customerName: this.form.Cname,
keyWord: this.form.Scontent,
beginTime: this.form.Stime ? yearMouthDay(this.form.Stime[0]) : "",
endTime: this.form.Stime ? yearMouthDay(this.form.Stime[1]) : "",
pageNum: this.currentPage,
action:this.ac
}
else if(e==1){
this.floorRange='已发送'
}else if(e==2){
this.floorRange='已撤回'
}else{
this.floorRange='切回企业日志'
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>
<style lang="scss" scoped>
.demo-form-inline {
background: #efefef;
background: #f1f1f1;
padding: 18px 10px 0 10px;
}
.content {
margin-top: 15px;
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 {
/deep/ .el-input--mini .el-input__inner{width: 2px;border:none}
/deep/ .el-input--mini .el-input__inner {
width: 2px;
border: none
}
}
</style>
\ No newline at end of file
......@@ -11,12 +11,16 @@
</div>
<div class="ct_box ct_boxFirst">
<ul>
<li v-for="(i,t) in 49" :key="t" @click="personCheck(i,t)" :class="{'liActive':t==personIndex}">
<el-row :gutter="20">
<el-col :span="4"> <img
src="http://wx.qlogo.cn/mmhead/pburdzLK7PV4ZRaUcsb0X4ssicO9TqpQHZa26oHRvb1ONZT1r3dI0Aw/0"
alt=""></el-col>
<el-col :span="16"><span style="line-height:40px">{{i}}</span></el-col>
<!-- -->
<li v-for="(i,t) in CList" :key="t" @click="personCheck(i,t)" :class="{'liActive':t==personIndex}">
<el-row :gutter="20" style=" padding: 10px 0;margin:0">
<el-col :span="4">
<img
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>
</li>
</ul>
......@@ -30,78 +34,113 @@
</el-input>
</div>
</div>
<div class="ct_box
"> <div class="hd_tabs">
<div class="hd_tabs">
<el-tabs v-model="activeName">
<el-tab-pane label="单聊" name="0">
<div class="ct_box">
暂无联系人
</div>
<el-tab-pane label="单聊" name="0">
<div class="hd_tabs_content">
<!-- <list v-if="activeName==0" :personList="personList" :loading="loading" >
</list> -->
</div>
</el-tab-pane>
<el-tab-pane label="群聊" name="1">
<div class="ct_box">
暂无群聊记录
</div>
<el-tab-pane label="群聊" name="2">
<list v-if="activeName==2" :personList="personList" :loading="loading" @chatFn="chatFn">
</list>
</el-tab-pane>
</el-tabs>
</div></div>
</div>
</el-col>
<el-col :span="12">
<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 class=" hd_tabthree">
<el-tabs v-model="activeNameThree">
<el-tab-pane label="全部" name="0">
<el-tabs v-model="activeNameThree" @tab-click="activeNameThreeClick()">
<el-tab-pane label="全部" name="0">
<div class="ct_box">
<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>
</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>
</el-tab-pane>
<el-tab-pane label="图片及视频" name="1">
<div class="ct_box">
<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>
</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>
</el-tab-pane>
<el-tab-pane label="文件" name="3">
<el-tab-pane label="文件" name="2">
<div class="ct_box">
<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>
</div>
<el-table :data="fileData" stripe style="width: 100%"
<el-table :data="allFile" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="类型">
<el-table-column prop="msgtype" label="类型">
</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 prop="address" label="大小">
<el-table-column label="大小">
<template slot-scope="scope">
{{filterSize(scope.row.file.filesize)}}
</template>
</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 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>
</div>
</el-tab-pane>
<el-tab-pane label="链接" name="4">
<el-tab-pane label="链接" name="3">
<div class="ct_box">
<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>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="语音通话" name="5">
<el-tab-pane label="语音通话" name="4">
<div class="ct_box">
<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>
</div>
<el-table :data="fileData" stripe style="width: 100%"
......@@ -125,35 +164,147 @@
</div>
</template>
<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 {
components:{
list,chat
},
data() {
return {
employAmount: 1,
employName: '',
talkName: '',
personIndex: '-1',
activeName: "1",
activeNameThree: '1',
activeName: "2",
activeNameThree: '0',
takeTime: '',
fileData: []
fileData: [],
CList:[],
personList:[],
loading:false,
employId:'',
chatData:{},
allChat:[],
allChatImg:[],
allFile:[],
allLInk:[],
allVoice:[],
//分页
currentPage:1,
total:0
};
},
methods: {
personCheck(name, e) {
this.personIndex = e
this.talkName = name
chatFn(data){
this.chatData=data
if (data.fromId) {
this.activeNameThreeClick()
}
},
currentChange(){
this.currentPage = e
this.activeNameThreeClick(true)
},
personCheck(data, e) {
this.personIndex = e
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>
<style lang="scss" scoped>
/deep/ #tab-0 {
text-indent: 15px;
/deep/.el-tabs__nav-scroll {
padding-left: 15px;
}
.fr{float:right;}
.borderR {
border-right: 2px solid #ccc;
}
......@@ -184,7 +335,7 @@
font-size: 18px;
min-height: 20px;
}
.hd_tabs_content{ width: 100%;min-height: 653px;border-bottom: 1px solid #efefef; }
.hd_nameRi {
color: #199ed8;
text-align: right;
......@@ -193,12 +344,13 @@
}
.ct_boxFirst {
height: 720px;
height: 700px;
}
.ct_box {
background: white;
min-height: 710px;
border-bottom: 1px solid #efefef;
min-height: 709px;
padding: 10px;
overflow-y: scroll;
color: #999;
......@@ -214,12 +366,11 @@
}
ul li {
margin-bottom: 3px;
padding: 10px 20px;
text-align: left;
cursor: pointer;
border-bottom: 1px solid #efefef;
:hover{ background: #efefef;}
img {
width: 40px;
}
......@@ -229,13 +380,20 @@
.liActive {
background: lightblue !important;
color: #fff;
color: #199ed8;
}
.hds_time {
float: left;
text-align: left;
width: 100%;
padding: 10px 0;
}
}
}
.pagination {
padding: 10px 0;
height: 30px;
float: left;
}
</style>
\ No newline at end of file
......@@ -18,7 +18,7 @@ public class WeChatSide extends BaseEntity {
/**
* 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
*/
private Long mediaType;
private String mediaType;
/**
* 聊天工具栏名称
......
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;
}
......@@ -2,8 +2,11 @@ package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeChatCollection;
import com.linkwechat.wecom.domain.vo.WeChatSideVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 聊天工具 侧边栏栏 素材收藏
*
......@@ -37,4 +40,12 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
*/
public int countCollectionByMaterialIdAndUserId(@Param("materialId") Long materialId,@Param("userId") Long userId);
/**
* 收藏列表
*
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public List<WeChatSideVo> findCollections(Long userId);
}
......@@ -3,6 +3,7 @@ package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeChatItem;
import com.linkwechat.wecom.domain.dto.WeChatItemDto;
import com.linkwechat.wecom.domain.vo.WeChatSideVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -27,4 +28,12 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
*/
public int dropItem(@Param("sideId") Long sideId);
/**
* h5素材列表
*
* @param sideId 侧边栏id
* @return
*/
public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId);
}
......@@ -2,6 +2,8 @@ package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeChatSide;
import com.linkwechat.wecom.domain.vo.WeChatSideVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -13,10 +15,10 @@ public interface WeChatSideMapper extends BaseMapper<WeChatSide> {
/**
* 查询侧边栏列表
*
* @param h5 0 pc 1 h5
* @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> {
*/
public int updateWeChatSideById(WeChatSide weChatSide);
}
......@@ -2,6 +2,9 @@ package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
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> {
*/
public int cancleCollection( Long materialId, Long userId);
/**
* 收藏列表
*
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public List<WeChatSideVo> collections(Long userId);
}
......@@ -70,7 +70,7 @@ public interface IWeChatContactMappingService extends IService<WeChatContactMapp
*
* @param query
*/
public List<ElasticSearchEntity> saveWeChatContactMapping(List<JSONObject> query);
public List<JSONObject> saveWeChatContactMapping(List<JSONObject> query);
/**
* 按客户查询关系映射列表
......
......@@ -3,6 +3,9 @@ package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeChatItem;
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> {
*/
public int checkItems(WeChatItemDto chatItemDto);
/**
* h5素材列表
*
* @param sideId 侧边栏id
* @return
*/
public List<WeChatSideVo> chatItems(Long sideId);
}
......@@ -16,7 +16,7 @@ public interface IWeChatSideService extends IService<WeChatSide> {
*
* @return {@link WeChatSide}s
*/
public List<WeChatSide> chatSides();
public List<WeChatSide> chatSides(String h5);
/**
* 更新侧边栏信息
......
......@@ -3,11 +3,14 @@ package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.wecom.domain.WeChatCollection;
import com.linkwechat.wecom.domain.vo.WeChatSideVo;
import com.linkwechat.wecom.mapper.WeChatCollectionMapper;
import com.linkwechat.wecom.service.IWeChatCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 聊天工具 侧边栏栏 素材收藏
*
......@@ -34,4 +37,9 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
return weChatCollectionMapper.dropCollection(materialId,userId);
}
@Override
public List<WeChatSideVo> collections(Long userId) {
return weChatCollectionMapper.findCollections(userId);
}
}
......@@ -160,11 +160,9 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
* @param query
*/
@Override
public List<ElasticSearchEntity> saveWeChatContactMapping(List<JSONObject> query) {
List<ElasticSearchEntity> resultList = new ArrayList<>();
public List<JSONObject> saveWeChatContactMapping(List<JSONObject> query) {
List<JSONObject> resultList = new ArrayList<>();
query.stream().filter(chatData -> StringUtils.isNotEmpty(chatData.getString("from"))).forEach(chatData -> {
ElasticSearchEntity elasticSearchEntity = new ElasticSearchEntity();
elasticSearchEntity.setId(chatData.getString("msgid"));
//发送人映射数据
WeChatContactMapping fromWeChatContactMapping = new WeChatContactMapping();
String fromId = chatData.getString("from");
......@@ -194,8 +192,7 @@ public class WeChatContactMappingServiceImpl extends ServiceImpl<WeChatContactMa
WeChatContactMapping reveiceWeChatContactMapping = from2ReveiceData(fromType, fromWeChatContactMapping);
insertWeChatContactMapping(fromWeChatContactMapping);
insertWeChatContactMapping(reveiceWeChatContactMapping);
elasticSearchEntity.setData(chatData);
resultList.add(elasticSearchEntity);
resultList.add(chatData);
});
return resultList;
}
......
......@@ -6,6 +6,7 @@ import com.linkwechat.wecom.domain.WeChatItem;
import com.linkwechat.wecom.domain.WeChatSide;
import com.linkwechat.wecom.domain.WeMaterial;
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.WeChatSideMapper;
import com.linkwechat.wecom.service.IWeChatItemService;
......@@ -94,6 +95,11 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI
return 1;
}
@Override
public List<WeChatSideVo> chatItems(Long sideId) {
return weChatItemMapper.findChatItems(sideId);
}
/**
* 更新该次选择的素材数
*
......
......@@ -21,8 +21,8 @@ public class WeChatSideServiceImpl extends ServiceImpl<WeChatSideMapper, WeChatS
private WeChatSideMapper weChatSideMapper;
@Override
public List<WeChatSide> chatSides() {
return weChatSideMapper.selectWeChatSides();
public List<WeChatSide> chatSides(String h5) {
return weChatSideMapper.selectWeChatSides(h5);
}
@Override
......
......@@ -68,8 +68,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
.minimumShouldMatch(1);
//时间范围查询
if (StringUtils.isNotEmpty(query.getBeginTime()) && StringUtils.isNotEmpty(query.getEndTime())) {
Date beginTime = DateUtils.dateTime(query.getBeginTime(), DateUtils.YYYY_MM_DD);
Date endTime = DateUtils.dateTime(query.getEndTime(), DateUtils.YYYY_MM_DD);
Date beginTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD,query.getBeginTime());
Date endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD,query.getEndTime());
boolQueryBuilder.filter(QueryBuilders.rangeQuery("msgtime").gte(beginTime).lte(endTime));
}
builder.query(boolQueryBuilder);
......@@ -105,8 +105,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
//时间范围查询
if (StringUtils.isNotEmpty(query.getBeginTime()) && StringUtils.isNotEmpty(query.getEndTime())) {
Date beginTime = DateUtils.dateTime(query.getBeginTime(), DateUtils.YYYY_MM_DD);
Date endTime = DateUtils.dateTime(query.getEndTime(), DateUtils.YYYY_MM_DD);
Date beginTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD,query.getBeginTime());
Date endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD,query.getEndTime());
boolQueryBuilder.filter(QueryBuilders.rangeQuery("msgtime").gte(beginTime).lte(endTime));
}
......@@ -194,8 +194,8 @@ public class WeConversationArchiveServiceImpl implements IWeConversationArchiveS
//时间范围查询
if (StringUtils.isNotEmpty(query.getBeginTime()) && StringUtils.isNotEmpty(query.getEndTime())) {
Date beginTime = DateUtils.dateTime(query.getBeginTime(), DateUtils.YYYY_MM_DD);
Date endTime = DateUtils.dateTime(query.getEndTime(), DateUtils.YYYY_MM_DD);
Date beginTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD,query.getBeginTime());
Date endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD,query.getEndTime());
boolQueryBuilder.filter(QueryBuilders.rangeQuery("msgtime").gte(beginTime).lte(endTime));
}
builder.query(boolQueryBuilder);
......
......@@ -7,10 +7,12 @@ import com.linkwechat.common.utils.file.FileUploadUtils;
import com.linkwechat.common.utils.file.FileUtils;
import com.linkwechat.common.utils.img.ImageUtils;
import com.linkwechat.common.utils.img.NetFileUtils;
import com.linkwechat.wecom.domain.WeCategory;
import com.linkwechat.wecom.domain.WePoster;
import com.linkwechat.wecom.domain.WePosterFont;
import com.linkwechat.wecom.domain.WePosterSubassembly;
import com.linkwechat.wecom.mapper.WePosterMapper;
import com.linkwechat.wecom.service.IWeCategoryService;
import com.linkwechat.wecom.service.IWePosterFontService;
import com.linkwechat.wecom.service.IWePosterService;
import com.linkwechat.wecom.service.IWePosterSubassemblyService;
......@@ -54,6 +56,9 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
@Resource
private ServerConfig serverConfig;
@Resource
private IWeCategoryService weCategoryService;
/**
* 查询一条
......@@ -86,8 +91,10 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
});
}
}
}
/*if(poster.getCategoryId() != null){
weCategoryService.findWeCategoryById(poster.getId());
}*/
return poster;
}
......
......@@ -22,6 +22,8 @@ import com.linkwechat.wecom.service.IWeUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
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.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
......@@ -30,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
......@@ -165,6 +166,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
@Override
public void hitSensitive(List<JSONObject> entityList) {
log.info("执行敏感词命中过滤,time=[{}]", System.currentTimeMillis());
//获取所有的敏感词规则
List<WeSensitive> allSensitiveRules = weSensitiveMapper.selectWeSensitiveList(new WeSensitive());
//根据规则过滤命中
......@@ -175,18 +177,14 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
List<String> users = getScopeUsers(weSensitive.getAuditUserScope());
jsonList.addAll(hitSensitiveInES(patternWords, users));
//将命中结果插入es
try {
addHitSensitiveList(jsonList, weSensitive);
} catch (IOException e) {
log.warn("添加敏感词命中信息失败, jsonList={}, auditUserId={}, exception={}",
jsonList, weSensitive.getAuditUserId(), ExceptionUtils.getStackTrace(e));
}
addHitSensitiveList(jsonList, weSensitive);
});
}
}
@Override
public PageInfo<JSONObject> getHitSensitiveList(WeSensitiveHitQuery weSensitiveHitQuery) {
elasticSearch.createIndex2(WeConstans.WECOM_SENSITIVE_HIT_INDEX, getSensitiveHitMapping());
List<String> userIds = Lists.newArrayList();
if (weSensitiveHitQuery.getScopeType().equals(WeConstans.USE_SCOP_BUSINESSID_TYPE_USER)) {
userIds.add(weSensitiveHitQuery.getAuditScopeId());
......@@ -218,9 +216,8 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
return elasticSearch.searchPage(WeConstans.WECOM_SENSITIVE_HIT_INDEX, builder, pageNum, pageSize, JSONObject.class);
}
private void addHitSensitiveList(List<JSONObject> json, WeSensitive weSensitive) throws IOException {
//创建索引
elasticSearch.createIndex2(WeConstans.WECOM_SENSITIVE_HIT_INDEX, elasticSearch.getFinanceMapping());
private void addHitSensitiveList(List<JSONObject> json, WeSensitive weSensitive) {
elasticSearch.createIndex2(WeConstans.WECOM_SENSITIVE_HIT_INDEX, getSensitiveHitMapping());
if (weSensitive.getAlertFlag().equals(1)) {
//针对每一条命中信息发送消息通知给相应的审计人 TODO
}
......@@ -270,4 +267,43 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
builder.query(searchBuilder);
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;
}
}
......@@ -23,5 +23,20 @@
material_id=#{materialId} AND user_id=#{userId}
</where>
</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>
\ No newline at end of file
......@@ -20,4 +20,20 @@
side_id=#{sideId}
</where>
</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>
\ No newline at end of file
......@@ -31,7 +31,10 @@
FROM
we_chat_side
<where>
`using`=0
<if test="h5!=null and h5!='' and h5=='1'.toString()">
`using`=0
</if>
</where>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!