Commit 2c6f74b2 by xinlaa

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

2 parents f3fecc86 731238f9
Showing 40 changed files with 933 additions and 139 deletions
...@@ -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/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> </p>
<h2 align="center">LinkWeChat —— 让每个企业都是私域流量营销专家</h2> <h2 align="center">LinkWeChat —— 让每个企业都是私域流量营销专家</h2>
......
...@@ -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)
@PostMapping @PutMapping("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)
@PutMapping @PostMapping(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);
}
} }
...@@ -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);
}
} }
...@@ -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);
} }
......
...@@ -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("删除成功");
} }
} }
...@@ -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("删除成功");
} }
} }
...@@ -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
......
...@@ -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));
......
...@@ -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();
......
...@@ -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();
......
...@@ -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",
......
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
...@@ -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;
......
<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
<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
<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
<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
<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>
...@@ -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,36 +33,64 @@ ...@@ -31,36 +33,64 @@
</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"
:value="item.value"> :value="item.value">
</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
}
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){ content.getChatAllList(query).then(res => {
this.floorRange='已发送' console.log(res)
}else if(e==2){ this.fileData = res.rows;
this.floorRange='已撤回' this.total = Number(res.total)
}else{ })
this.floorRange='切回企业日志' },
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
...@@ -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 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; ...@@ -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);
} }
...@@ -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);
} }
...@@ -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);
} }
...@@ -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);
} }
...@@ -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);
/** /**
* 按客户查询关系映射列表 * 按客户查询关系映射列表
......
...@@ -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);
} }
...@@ -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);
/** /**
* 更新侧边栏信息 * 更新侧边栏信息
......
...@@ -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);
}
} }
...@@ -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;
} }
......
...@@ -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);
}
/** /**
* 更新该次选择的素材数 * 更新该次选择的素材数
* *
......
...@@ -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
......
...@@ -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);
......
...@@ -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;
} }
......
...@@ -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;
}
} }
...@@ -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
...@@ -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
...@@ -31,7 +31,10 @@ ...@@ -31,7 +31,10 @@
FROM FROM
we_chat_side we_chat_side
<where> <where>
`using`=0 <if test="h5!=null and h5!='' and h5=='1'.toString()">
`using`=0
</if>
</where> </where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file \ 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!