Commit 0ecaf93f by qiyeqing

Merge branch 'master' of https://gitee.com/LinkWeChat/link-wechat

2 parents d4cb67b7 d89dfebd
Showing 189 changed files with 3656 additions and 280 deletions
target
bak
.pmd
.project
.settings
.classpath
.idea.xml
.idea
*.class
*.bak
*.iml
*.ipr
*.iws
bak
null/
tree.log
tmp/
velocity.log
.DS_Store
logs
.m2
......@@ -2,14 +2,14 @@
<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>
<div align="center">
![GVP Stars](http://img.shields.io/badge/GPV%20Stars-400+-yellow)
![GVP Forks](http://img.shields.io/badge/GPV%20Forks-150+-yellow)
![GVP Stars](http://img.shields.io/badge/GPV%20Stars-600+-yellow)
![GVP Forks](http://img.shields.io/badge/GPV%20Forks-200+-yellow)
![license](http://img.shields.io/badge/license-GPL%203.0-green)
</div>
......@@ -19,19 +19,30 @@
<p></p>
<p></p>
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/233450_65d03349_1480777.png "LinkWeChat 企业微信私域流量营销专家-V1.0.4_00.png")
### 平台简介
LinkWeChat,是一款基于企业微信的开源 SCRM 系统,为企业构建私域流量系统的综合解决方案,能显著提升企业社交运营效率。
> LinkWeChat, Link to WeChat
LinkWeChat 是一款基于人工智能的企业微信 SCRM 系统,为企业构建私域流量营销系统的综合解决方案,助力企业提高社交客户运营效率。
![输入图片说明](https://images.gitee.com/uploads/images/2020/1130/232011_57bea01c_1480777.png "1.png")
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/234154_394dea33_1480777.png "LinkWeChat 企业微信私域流量营销专家-V1.0.4_12.png")
#### 应用场景
泛零售、电商行业企业微信用户,提供多种工具、多渠道、多方式添加客户到企业微信好友,通过营销互动与客户标签管理等建立强连接。
主要应用与泛零售、电商、金融等行业企业微信用户,提供多种工具、多渠道、多方式添加客户为企业微信好友,并通过营销互动与客户标签管理等建立强连接。
#### 功能特性
![输入图片说明](https://images.gitee.com/uploads/images/2020/1130/232033_41bc0f37_1480777.png "2.png")
四大模块助力企业营销能力升级:
* 客户管理:搭建私域流量池,高效运营客户
* 引流获客:多渠道引流,实现精准获客
* 会话存档:会话合规存档,提供多重服务保障
* 营销中心:多类型营销工具,实现场景化营销
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/232207_6a0f4a67_1480777.png "LinkWeChat 企业微信私域流量营销专家-V1.0.4_13.png")
### 环境部署
......@@ -72,7 +83,7 @@ npm install --registry=https://registry.npm.taobao.org
npm run serve
```
打开浏览器,输入 `http://localhost:80 `,默认账密为:`admin/123admin123` 。
打开浏览器,输入 `http://localhost:80 `,默认账密为:`admin/admin123` 。
若能正确展示登录页面,并能成功登录,菜单及页面展示正常,则表明环境搭建成功。
......@@ -196,7 +207,9 @@ com.linkwechat
#### 业务架构
![输入图片说明](https://images.gitee.com/uploads/images/2020/1130/232051_b320bf37_1480777.png "3.png")
利用 NLP 技术对聊天记录进行智能语义分析,实现敏感词自动告警及自动打标签功能。
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/232301_2dcf24b2_1480777.png "LinkWeChat 企业微信私域流量营销专家-V1.0.4_22.png")
#### 在线体验
......@@ -206,16 +219,15 @@ com.linkwechat
#### 开发进度
![输入图片说明](https://images.gitee.com/uploads/images/2020/1109/094949_d2490571_409467.png "屏幕截图.png")
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/233603_09dc4ac4_1480777.png "LinkWeChat 1.0.png")
### 联系作者加入群
![输入图片说明](https://images.gitee.com/uploads/images/2020/1226/183631_251ea80c_409467.png "屏幕截图.png")
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/234016_20fdd151_1480777.png "江总微信.png")
### 特别鸣谢
感谢[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue?_from=gitee_search)提供框架代码。
感谢[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue?_from=gitee_search)提供框架代码。
### 部分演示图,持续更新
......@@ -228,6 +240,10 @@ com.linkwechat
![输入图片说明](https://images.gitee.com/uploads/images/2020/1109/094122_dfd73b9e_409467.png "屏幕截图.png")
![输入图片说明](https://images.gitee.com/uploads/images/2020/1109/094154_e5052872_409467.png "屏幕截图.png")
### 合作伙伴
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/234054_ede1ef54_1480777.png "LinkWeChat 企业微信私域流量营销专家-V1.0.4_33.png")
### 版权声明
LinkWeChat开源版遵循[GPL-3.0](https://gitee.com/LinkWeChat/link-wechat/blob/master/LICENSE)开源协议发布,并提供免费使用,但不允许修改后和衍生的代码做为闭源的商业软件发布和销售!
\ No newline at end of file
LinkWeChat 开源版遵循 [GPL-3.0](https://gitee.com/LinkWeChat/link-wechat/blob/master/LICENSE) 开源协议发布,并提供免费使用,但 **绝不允许修改后和衍生的代码做为闭源的商业软件发布和销售!**
\ No newline at end of file
......@@ -24,6 +24,12 @@
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- 参数校验 -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
......
......@@ -6,6 +6,7 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* 启动程序
......@@ -15,6 +16,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, PageHelperAutoConfiguration.class })
@MapperScan("com.linkwechat.*.mapper")
@ForestScan(basePackages = "com.linkwechat.wecom.client")
@EnableAsync
public class LinkWeChatApplication
{
public static void main(String[] args)
......
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;
/**
* 聊天工具 侧边栏栏 素材收藏
*
* @author kwen
*/
@RequestMapping(value = "/wecom/chat/collection")
@RestController
public class WeChatCollectionController extends BaseController {
@Autowired
private IWeChatCollectionService weChatCollectionService;
/**
* 添加收藏
*/
@PreAuthorize("@ss.hasPermi('chat:collection:add')")
@Log(title = "添加收藏", businessType = BusinessType.INSERT)
@PutMapping("addCollection")
public AjaxResult addCollection(@RequestParam(value = "materialId") Long materialId,@RequestParam(value = "userId") Long userId) {
return toAjax(weChatCollectionService.addCollection(materialId, userId));
}
/**
* 取消收藏
*/
@PreAuthorize("@ss.hasPermi('chat:collection:delete')")
@Log(title = "取消收藏", businessType = BusinessType.UPDATE)
@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);
}
}
package com.linkwechat.web.controller.wecom;
import com.github.pagehelper.PageInfo;
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.common.utils.poi.ExcelUtil;
import com.linkwechat.wecom.domain.WeChatContactMapping;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.service.IWeChatContactMappingService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 聊天关系映射Controller
*
* @author ruoyi
* @date 2020-12-27
*/
@RestController
@RequestMapping("/chat/mapping")
public class WeChatContactMappingController extends BaseController
{
@Autowired
private IWeChatContactMappingService weChatContactMappingService;
/**
* 查询聊天关系映射列表
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:list')")
@GetMapping("/list")
public TableDataInfo list(WeChatContactMapping weChatContactMapping)
{
startPage();
List<WeChatContactMapping> list = weChatContactMappingService.selectWeChatContactMappingList(weChatContactMapping);
return getDataTable(list);
}
/**
* 按客户查询关系映射列表
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:listByCustomer')")
@GetMapping("/listByCustomer")
public TableDataInfo listByCustomer()
{
startPage();
PageInfo<WeCustomer> weCustomerPageInfo = weChatContactMappingService.listByCustomer();
return getDataTable(weCustomerPageInfo);
}
/**
* 导出聊天关系映射列表
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:export')")
@Log(title = "聊天关系映射", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeChatContactMapping weChatContactMapping)
{
List<WeChatContactMapping> list = weChatContactMappingService.selectWeChatContactMappingList(weChatContactMapping);
ExcelUtil<WeChatContactMapping> util = new ExcelUtil<WeChatContactMapping>(WeChatContactMapping.class);
return util.exportExcel(list, "mapping");
}
/**
* 获取聊天关系映射详细信息
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(weChatContactMappingService.selectWeChatContactMappingById(id));
}
/**
* 新增聊天关系映射
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:add')")
@Log(title = "聊天关系映射", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeChatContactMapping weChatContactMapping)
{
return toAjax(weChatContactMappingService.insertWeChatContactMapping(weChatContactMapping));
}
/**
* 修改聊天关系映射
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:edit')")
@Log(title = "聊天关系映射", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeChatContactMapping weChatContactMapping)
{
return toAjax(weChatContactMappingService.updateWeChatContactMapping(weChatContactMapping));
}
/**
* 删除聊天关系映射
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:remove')")
@Log(title = "聊天关系映射", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(weChatContactMappingService.deleteWeChatContactMappingByIds(ids));
}
}
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.*;
import java.util.List;
/**
* 聊天工具侧边栏
* @author kewen
*/
@RequestMapping(value = "/wecom/chat/item")
@RestController
public class WeChatItemController extends BaseController {
@Autowired
private IWeChatItemService weChatItemService;
/**
* 侧边栏抓取素材
*/
@PreAuthorize("@ss.hasPermi('chat:item:add')")
@Log(title = "侧边栏抓取素材", businessType = BusinessType.INSERT)
@PutMapping
public AjaxResult add(@RequestBody WeChatItemDto 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);
}
}
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.WeChatSide;
import com.linkwechat.wecom.service.IWeChatSideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 聊天工具侧边栏
* @author kewen
*/
@RequestMapping(value = "/wecom/chat/side")
@RestController
public class WeChatSideController extends BaseController {
@Autowired
public IWeChatSideService weChatSideService;
/**
* 群发侧边栏列表
*/
@PreAuthorize("@ss.hasPermi('chat:side:list')")
@GetMapping("/list")
public TableDataInfo list(@RequestParam(value = "h5") String h5) {
startPage();
List<WeChatSide> weChatSides = weChatSideService.chatSides(h5);
return getDataTable(weChatSides);
}
/**
* 更新侧边栏信息
*/
@PreAuthorize("@ss.hasPermi('chat:side:edit')")
@Log(title = "更新侧边栏信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeChatSide weChatSide) {
return toAjax(weChatSideService.updateWeChatSide(weChatSide));
}
}
package com.linkwechat.web.controller.wecom;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.api.R;
import com.github.pagehelper.PageInfo;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.ConversationArchiveQuery;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.wecom.service.IWeConversationArchiveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -19,18 +19,50 @@ import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/wecom/finance")
public class WeConversationArchiveController {
public class WeConversationArchiveController extends BaseController {
@Autowired
private IWeConversationArchiveService weConversationArchiveService;
/**
* 获取内部联系人列表
* 获取单聊会话数据接口
*
* @param query 入参
* @param /fromId 发送人id
* @param /reveiceId 接收人id
* @return
*/
@PreAuthorize("@ss.hasPermi('conversationArchive:InternalContact:list')")
@GetMapping("/getInternalContactList")
public R<PageInfo<JSONObject>> getInternalContactList(String userId, int pageSize, int pageNum) {
return R.ok(weConversationArchiveService.getInternalContactList(userId, pageSize, pageNum));
@PreAuthorize("@ss.hasPermi('conversationArchive:chatContact:list')")
@GetMapping("/getChatContactList")
public TableDataInfo getChatContactList(ConversationArchiveQuery query) {
return getDataTable(weConversationArchiveService.getChatContactList(query));
}
/**
* 获取群聊会话数据接口
*
* @param query 入参
* @param /fromId 发送人id
* @param /room 接收人id
* @return
*/
@PreAuthorize("@ss.hasPermi('conversationArchive:chatRoomContact:list')")
@GetMapping("/getChatRoomContactList")
public TableDataInfo getChatRoomContactList(ConversationArchiveQuery query) {
return getDataTable(weConversationArchiveService.getChatRoomContactList(query));
}
/**
* 获取全局会话数据接口
*
* @param query 入参
* @return
*/
@PreAuthorize("@ss.hasPermi('conversationArchive:chatAllContact:list')")
@GetMapping("/getChatAllList")
public TableDataInfo getChatAllList(ConversationArchiveQuery query) {
return getDataTable(weConversationArchiveService.getChatAllList(query));
}
}
......@@ -22,7 +22,7 @@ import java.util.List;
/**
* 企业微信客户Controller
*
*
* @author ruoyi
* @date 2020-09-13
*/
......@@ -106,16 +106,12 @@ public class WeCustomerController extends BaseController
@PreAuthorize("@ss.hasPermi('customerManage:customer:sync')")
@Log(title = "企业微信客户同步接口", businessType = BusinessType.DELETE)
@GetMapping("/synchWeCustomer")
public AjaxResult synchWeCustomer(){
SecurityContext securityContext = SecurityContextHolder.getContext();
public AjaxResult synchWeCustomer() {
try {
Threads.SINGLE_THREAD_POOL.execute(new Runnable() {
@Override
public void run() {
SecurityContextHolder.setContext(securityContext);
weCustomerService.synchWeCustomer();
}
});
SecurityContext context = SecurityContextHolder.getContext();
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
SecurityContextHolder.setContext(context);
weCustomerService.synchWeCustomer();
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -6,10 +6,12 @@ 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.WeCustomer;
import com.linkwechat.wecom.domain.dto.message.CustomerMessagePushDto;
import com.linkwechat.wecom.domain.vo.CustomerMessagePushVo;
import com.linkwechat.wecom.domain.vo.WeCustomerMessageResultVo;
import com.linkwechat.wecom.service.IWeCustomerMessageOriginalService;
import com.linkwechat.wecom.service.IWeCustomerMessagePushService;
import com.linkwechat.wecom.service.IWeCustomerMessgaeResultService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -31,13 +33,20 @@ public class WeCustomerMessagePushController extends BaseController {
@Autowired
private IWeCustomerMessagePushService weCustomerMessagePushService;
@Autowired
private IWeCustomerMessageOriginalService weCustomerMessageOriginalService;
@Autowired
private IWeCustomerMessgaeResultService weCustomerMessgaeResultService;
/**
* 新增群发消息发送
*/
@PreAuthorize("@ss.hasPermi('system:push:add')")
@PreAuthorize("@ss.hasPermi('customerMessagePush:push:add')")
@Log(title = "新增群发消息发送", businessType = BusinessType.INSERT)
@PostMapping(value = "add")
public AjaxResult add(@RequestBody CustomerMessagePushDto customerMessagePushDto) {
public AjaxResult add(@RequestBody CustomerMessagePushDto customerMessagePushDto) {
try {
weCustomerMessagePushService.addWeCustomerMessagePush(customerMessagePushDto);
} catch (JsonProcessingException e) {
......@@ -51,16 +60,37 @@ public class WeCustomerMessagePushController extends BaseController {
/**
* 群发消息列表
*/
@PreAuthorize("@ss.hasPermi('system:push:list')")
@PreAuthorize("@ss.hasPermi('customerMessagePush:push:list')")
@GetMapping(value = "/list")
public TableDataInfo list(@RequestParam(value = "sender",required = false) String sender
,@RequestParam(value = "content",required = false) String content
,@RequestParam(value = "pushType",required = false) String pushType
,@RequestParam(value = "beginTime",required = false) String beginTime
,@RequestParam(value = "endTime",required = false) String endTime) {
public TableDataInfo list(@RequestParam(value = "sender", required = false) String sender
, @RequestParam(value = "content", required = false) String content
, @RequestParam(value = "pushType", required = false) String pushType
, @RequestParam(value = "beginTime", required = false) String beginTime
, @RequestParam(value = "endTime", required = false) String endTime) {
startPage();
List<CustomerMessagePushVo> list = weCustomerMessagePushService.customerMessagePushs(sender,content,pushType,beginTime,endTime);
List<CustomerMessagePushVo> list = weCustomerMessagePushService.customerMessagePushs(sender, content, pushType, beginTime, endTime);
return getDataTable(list);
}
/**
* 群发消息详情
*/
@PreAuthorize("@ss.hasPermi('customerMessagePush:push:view')")
@GetMapping(value = "/getInfo")
public AjaxResult getInfo(@RequestParam(value = "messageId") Long messageId) {
CustomerMessagePushVo customerMessagePushVo = weCustomerMessageOriginalService.CustomerMessagePushDetail(messageId);
return AjaxResult.success(customerMessagePushVo);
}
/**
* 群发消息结果列表
*/
@PreAuthorize("@ss.hasPermi('customerMessagePush:push:pushResults')")
@GetMapping(value = "/pushResults")
public TableDataInfo customerMessagePushResult(@RequestParam(value = "messageId") Long messageId,@RequestParam(value = "status") String status){
startPage();
List<WeCustomerMessageResultVo> weCustomerMessageResuls = weCustomerMessgaeResultService.customerMessagePushs(messageId, status);
return getDataTable(weCustomerMessageResuls);
}
}
......@@ -11,6 +11,8 @@ import com.linkwechat.wecom.service.IWeGroupMemberService;
import com.linkwechat.wecom.service.IWeGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -59,10 +61,14 @@ public class WeGroupController extends BaseController {
@PreAuthorize("@ss.hasPermi('customerManage:group:sync')")
@GetMapping({"/synchWeGroup"})
public AjaxResult synchWeGroup(){
weGroupService.synchWeGroup();
try {
SecurityContext context = SecurityContextHolder.getContext();
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
SecurityContextHolder.setContext(context);
weGroupService.synchWeGroup();
} catch (Exception e) {
e.printStackTrace();
}
return AjaxResult.success(WeConstans.SYNCH_TIP);
}
......
......@@ -5,19 +5,24 @@ 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.common.enums.MediaType;
import com.linkwechat.wecom.domain.WeMaterial;
import com.linkwechat.wecom.domain.dto.ResetCategoryDto;
import com.linkwechat.wecom.domain.dto.WeMediaDto;
import com.linkwechat.wecom.domain.vo.WeMaterialFileVO;
import com.linkwechat.wecom.service.IWeMaterialService;
import com.linkwechat.wecom.service.IWePosterService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* 企业微信素材Controller
......@@ -33,6 +38,9 @@ public class WeMaterialController extends BaseController {
@Autowired
private IWeMaterialService materialService;
@Resource
private IWePosterService wePosterService;
/**
* 查询素材列表
*/
......@@ -41,7 +49,19 @@ public class WeMaterialController extends BaseController {
public TableDataInfo list(@RequestParam(value = "categoryId", required = false) String categoryId
, @RequestParam(value = "search", required = false) String search,@RequestParam(value = "mediaType") String mediaType) {
startPage();
List<WeMaterial> list = materialService.findWeMaterials(categoryId, search,mediaType);
List<WeMaterial> list;
if(StringUtils.isNotBlank(mediaType) && mediaType.equals(MediaType.POSTER.getType())){
list = wePosterService.list(StringUtils.isBlank(categoryId)?null:Long.valueOf(categoryId),search).stream().map(wePoster -> {
WeMaterial weMaterial = new WeMaterial();
weMaterial.setMaterialName(wePoster.getTitle());
weMaterial.setMaterialUrl(wePoster.getSampleImgPath());
weMaterial.setId(wePoster.getId());
return weMaterial;
}).collect(Collectors.toList());
}else {
list = materialService.findWeMaterials(categoryId, search,mediaType);
}
return getDataTable(list);
}
......@@ -114,7 +134,7 @@ public class WeMaterialController extends BaseController {
@PreAuthorize("@ss.hasPermi('wechat:material:temporaryMaterialMediaId')")
@Log(title = "获取素材media_id", businessType = BusinessType.OTHER)
@PutMapping("/temporaryMaterialMediaId")
@PostMapping("/temporaryMaterialMediaId")
@ApiOperation("获取素材media_id")
public AjaxResult temporaryMaterialMediaId(@RequestParam(value = "url") String url, @RequestParam(value = "type") String type,@RequestParam(value = "name") String name){
WeMediaDto weMediaDto = materialService.uploadTemporaryMaterial(url, type,name);
......
......@@ -2,19 +2,20 @@ package com.linkwechat.web.controller.wecom;
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.common.utils.StringUtils;
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.util.ArrayList;
......@@ -22,6 +23,9 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author ws
*/
@RestController
@RequestMapping(value = "wecom/poster/")
@Api(description = "海报")
......@@ -39,14 +43,19 @@ 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(1);
poster.setDelFlag(0);
poster.setMediaType(MediaType.POSTER.getType());
/*if(poster.getCategoryId() == null){
return AjaxResult.error("请选择海报分类");
}*/
wePosterService.saveOrUpdate(poster);
poster.getPosterSubassemblyList().forEach(wePosterSubassembly -> {
wePosterSubassembly.setDelFlag(1);
wePosterSubassembly.setDelFlag(0);
wePosterSubassembly.setId(SnowFlakeUtil.nextId());
wePosterSubassembly.setPosterId(poster.getId());
});
......@@ -57,64 +66,72 @@ 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(1);
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)){
deleteList.forEach(wePosterSubassembly -> wePosterSubassembly.setDelFlag(0));
if (!CollectionUtils.isEmpty(deleteList)) {
deleteList.forEach(wePosterSubassembly -> wePosterSubassembly.setDelFlag(1));
wePosterSubassemblyService.updateBatchById(deleteList);
}
return AjaxResult.success("修改成功");
}
@GetMapping(value = "list")
/*@GetMapping(value = "list")
@ApiOperation("列表查询海报")
public AjaxResult list(){
public AjaxResult list(Long categoryId,String name){
List<WePoster> fontList = wePosterService.lambdaQuery()
.eq(WePoster::getDelFlag,1)
.eq(WePoster::getDelFlag,0)
.eq(categoryId != null,WePoster::getCategoryId,categoryId)
.like(StringUtils.isNotBlank(name),WePoster::getTitle,name)
.orderByDesc(WePoster::getCreateTime)
.list();
return AjaxResult.success(fontList);
}
}*/
@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(){
@PreAuthorize("@ss.hasAnyPermi('wecom:poster:page')")
public AjaxResult page(Long categoryId, String name) {
startPage();
List<WePoster> fontList = wePosterService.lambdaQuery()
.eq(WePoster::getDelFlag,1)
.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));
......@@ -122,13 +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,0).eq(WePoster::getId,id);
wePosterSubassemblyService.lambdaUpdate().set(WePosterSubassembly::getDelFlag,0).eq(WePosterSubassembly::getPosterId,id).eq(WePosterSubassembly::getFontId,1);
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("删除成功");
}
}
......@@ -2,8 +2,8 @@ package com.linkwechat.web.controller.wecom;
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;
......@@ -14,6 +14,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @author ws
*/
@RestController
@RequestMapping(value = "wecom/posterFont/")
@Api(description = "海报字体")
......@@ -26,9 +29,10 @@ 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(1);
posterFont.setDelFlag(0);
posterFont.setMediaType(MediaType.POSTER_FONT.getType());
wePosterFontService.save(posterFont);
return AjaxResult.success("创建成功");
}
......@@ -37,19 +41,20 @@ 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);
wePosterFontService.saveOrUpdate(posterFont);
return AjaxResult.success("修改成功");
}
@GetMapping(value = "posterFontList")
@ApiOperation("列表查询海报字体")
public AjaxResult selectPosterFontList(){
public AjaxResult selectPosterFontList() {
List<WePosterFont> fontList = wePosterFontService.lambdaQuery()
.eq(WePosterFont::getDelFlag,1)
.eq(WePosterFont::getDelFlag, 0)
.orderByDesc(WePosterFont::getOrder)
.orderByDesc(WePosterFont::getCreateTime)
.list();
......@@ -58,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,1)
.eq(WePosterFont::getDelFlag, 0)
.orderByDesc(WePosterFont::getOrder)
.orderByDesc(WePosterFont::getCreateTime)
.list();
......@@ -71,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,0).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("删除成功");
}
}
package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.constant.HttpStatus;
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.WeSensitive;
import com.linkwechat.wecom.domain.query.WeSensitiveHitQuery;
import com.linkwechat.wecom.service.IWeSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 敏感词Controller
*
* @author ruoyi
* @date 2020-12-29
*/
@RestController
@RequestMapping("/wecom/sensitive")
public class WeSensitiveController extends BaseController {
@Autowired
private IWeSensitiveService weSensitiveService;
/**
* 查询敏感词设置列表
*/
@PreAuthorize("@ss.hasPermi('wecom:sensitive:list')")
@GetMapping("/list")
public TableDataInfo list(WeSensitive weSensitive) {
startPage();
List<WeSensitive> list = weSensitiveService.selectWeSensitiveList(weSensitive);
return getDataTable(list);
}
/**
* 获取敏感词设置详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:sensitive:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(weSensitiveService.selectWeSensitiveById(id));
}
/**
* 新增敏感词设置
*/
@PreAuthorize("@ss.hasPermi('wecom:sensitive:add')")
@Log(title = "敏感词设置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Valid @RequestBody WeSensitive weSensitive) {
return toAjax(weSensitiveService.insertWeSensitive(weSensitive));
}
/**
* 修改敏感词设置
*/
@PreAuthorize("@ss.hasPermi('wecom:sensitive:edit')")
@Log(title = "敏感词设置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Valid @RequestBody WeSensitive weSensitive) {
Long id = weSensitive.getId();
WeSensitive originData = weSensitiveService.selectWeSensitiveById(id);
if (originData == null) {
return AjaxResult.error(HttpStatus.NOT_FOUND, "数据不存在");
}
return toAjax(weSensitiveService.updateWeSensitive(weSensitive));
}
/**
* 删除敏感词设置
*/
@PreAuthorize("@ss.hasPermi('wecom:sensitive:remove')")
@Log(title = "敏感词设置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable("ids") String ids) {
String[] id = ids.split(",");
Long[] idArray = new Long[id.length];
Arrays.stream(id).map(Long::parseLong).collect(Collectors.toList()).toArray(idArray);
return toAjax(weSensitiveService.destroyWeSensitiveByIds(idArray));
}
/**
* 敏感词命中查询
*/
@PreAuthorize("@ss.hasPermi('wecom:sensitivehit:list')")
@GetMapping("/hit/list")
public TableDataInfo hitList(WeSensitiveHitQuery query) {
return getDataTable(weSensitiveService.getHitSensitiveList(query));
}
}
package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.redis.RedisCache;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.common.utils.wecom.TicketUtils;
import com.linkwechat.wecom.client.WeTicketClient;
import com.linkwechat.wecom.domain.WeH5TicketDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.TimeUnit;
/**
* @author danmo
* @description h5 ticket校验接口
* @date 2021/1/6 11:23
**/
@Slf4j
@RequestMapping(value = "/wecom/ticket/")
@RestController
public class WeTicketController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired
private WeTicketClient weTicketClient;
/**
* 获取企业的jsapi_ticket
*
* @param url JS接口页面的完整URL
* @return
*/
@Log(title = "获取企业的jsapi_ticket", businessType = BusinessType.OTHER)
@GetMapping("/getAppTicket")
public AjaxResult getAppTicket(String url) {
String ticketVaule = redisCache.getCacheObject(WeConstans.AppTicketKey);
if (StringUtils.isEmpty(ticketVaule)) {
WeH5TicketDto ticketRes = weTicketClient.getJsapiTicket();
if (ticketRes != null && StringUtils.isNotEmpty(ticketRes.getTicket())) {
redisCache.setCacheObject(WeConstans.AppTicketKey, ticketRes.getTicket(), ticketRes.getExpiresIn(), TimeUnit.SECONDS);
}
ticketVaule = ticketRes.getTicket();
}
return AjaxResult.success(TicketUtils.getSignatureMap(ticketVaule, url));
}
/**
* 获取应用的jsapi_ticket
*
* @param url JS接口页面的完整URL
* @return
*/
@Log(title = "获取应用的jsapi_ticket", businessType = BusinessType.OTHER)
@GetMapping("/getAgentTicket")
public AjaxResult getAgentTicket(String url) {
String ticketVaule = redisCache.getCacheObject(WeConstans.AgentTicketKey);
if (StringUtils.isEmpty(ticketVaule)) {
WeH5TicketDto ticketRes = weTicketClient.getTicket();
if (ticketRes != null && StringUtils.isNotEmpty(ticketRes.getTicket())) {
redisCache.setCacheObject(WeConstans.AgentTicketKey, ticketRes.getTicket(), ticketRes.getExpiresIn(), TimeUnit.SECONDS);
}
ticketVaule = ticketRes.getTicket();
}
return AjaxResult.success(TicketUtils.getSignatureMap(ticketVaule, url));
}
}
......@@ -37,6 +37,9 @@ logging:
level:
com.ruoyi: debug
org.springframework: warn
path: ./logs
path:
log: ./logs
# Spring配置
spring:
......@@ -53,6 +56,11 @@ spring:
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
task:
execution:
pool:
keep-alive: 10s
thread-name-prefix: common-pool-
# 服务模块
devtools:
restart:
......@@ -132,7 +140,7 @@ xss:
# elasticsearch配置
elasticsearch:
schema: http
address: 129.211.173.127:9200
address: localhost
connectTimeout: 10000
socketTimeout: 10000
connectionRequestTimeout: 10000
......@@ -169,11 +177,19 @@ wecome:
- /externalcontact/groupchat/transfer
- /externalcontact/get_unassigned_list
- /externalcontact/send_welcome_msg
- /msgaudit/get_permit_user_list
- /externalcontact/unionid_to_external_userid
- /externalcontact/add_msg_template
- /externalcontact/get_group_msg_result
- /get_jsapi_ticket
- /ticket/get
fileUplodUrl: /media/upload,/media/uploadimg
needProviderTokenUrl:
- /service/get_login_info
needChatTokenUrl:
- /msgaudit/get_permit_user_list
- /msgaudit/check_single_agree
- /msgaudit/check_room_agree
- /msgaudit/groupchat/get
#企微回调通知配置
callBack:
appIdOrCorpId:
......
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" />
<springProperty name="LOG_PATH" source="logging.path" defaultValue="./logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
......@@ -14,11 +14,11 @@
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<file>${LOG_PATH}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<fileNamePattern>${LOG_PATH}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
......@@ -36,11 +36,11 @@
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<file>${LOG_PATH}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<fileNamePattern>${LOG_PATH}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
......@@ -59,10 +59,10 @@
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<file>${LOG_PATH}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<fileNamePattern>${LOG_PATH}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
......
......@@ -30,4 +30,7 @@ public class WeComeConfig {
/** 需要供应商token的url*/
private String[] needProviderTokenUrl;
/** 会话存档所需token 的url */
private String[] needChatTokenUrl;
}
package com.linkwechat.common.constant;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
......@@ -29,6 +28,11 @@ public class WeConstans {
*/
public static final String WE_PROVIDER_ACCESS_TOKEN = "we_provider_access_token";
/**
* 会话存档相关token
*/
public static final String WE_CHAT_ACCESS_TOKEN = "we_chat_access_token";
/**
* 企业微信接口返回成功code
......@@ -144,7 +148,7 @@ public class WeConstans {
/**
* 批量生成的单人码 活动场景
*/
public static final String ONE_PERSON_CODE_GENERATED_BATCH="批量生成的单人码";
public static final String ONE_PERSON_CODE_GENERATED_BATCH = "批量生成的单人码";
/**
* 微信接口相应端错误字段
......@@ -206,6 +210,25 @@ public class WeConstans {
*/
public static final String DEL_FOLLOW_USER_SWITCH_CLOSE = "0";
public static final String DEL_FOLLOW_USER_SWITCH_OPEN = "1";
public static final String CONTACT_SEQ_KEY = "seq";
/**
* id类型 0:成员 1:客户,2:机器
*/
public static final Integer ID_TYPE_USER = 0;
public static final Integer ID_TYPE_EX = 1;
public static final Integer ID_TYPE_MACHINE = 2;
/**
* 一次拉取的消息条数,最大值1000条,超过1000条会返回错误
*/
public static final long LIMIT = 1_000L;
public static final String AppTicketKey = "ticket:AppGet";
public static final String AgentTicketKey = "ticket:AgentGet";
/**
* 企微回调事件类型路由
*/
......@@ -270,6 +293,10 @@ public class WeConstans {
public static final String WECOM_FINANCE_INDEX = "finance";
/** 开启会话存档成员列表 **/
public static final String WECOM_SENSITIVE_HIT_INDEX = "sensitive";
/**
* 开启会话存档成员列表
**/
public static final String weMsgAuditKey = "wecom_msg_audit:user:ids";
}
......@@ -75,6 +75,20 @@ public class BaseController
}
/**
* 响应请求分页数据
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
protected TableDataInfo getDataTable(PageInfo<?> pageInfo)
{
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(pageInfo.getList());
rspData.setTotal(pageInfo.getTotal());
return rspData;
}
/**
* 响应返回结果
*
* @param rows 影响行数
......
package com.linkwechat.common.core.domain;
import lombok.Data;
/**
* @author sxw
* @description 会话存档接口入参实体
* @date 2020/12/29 14:23
**/
@Data
public class ConversationArchiveQuery extends BaseEntity {
/** 发送人Id */
private String fromId;
/** 成员名称 */
private String userName;
/** 接收人Id */
private String receiveId;
/** 客户姓名 */
private String customerName;
/** 群聊Id */
private String roomId;
/** 类型 */
private String msgType;
/** 关键词 **/
private String keyWord;
}
package com.linkwechat.common.core.elasticsearch;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.linkwechat.common.core.domain.elastic.ElasticSearchEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.delete.DeleteRequest;
......@@ -17,6 +20,7 @@ import org.elasticsearch.client.indices.CreateIndexRequest;
import org.elasticsearch.client.indices.CreateIndexResponse;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.text.Text;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
......@@ -24,16 +28,16 @@ import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightField;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
/**
* @author sxw
......@@ -60,7 +64,7 @@ public class ElasticSearch {
public void createIndex(String idxName, String idxSQL) {
try {
if (!this.indexExist(idxName)) {
log.error(" idxName={} 已经存在,idxSql={}", idxName, idxSQL);
//log.error(" idxName={} 已经存在,idxSql={}", idxName, idxSQL);
return;
}
CreateIndexRequest request = new CreateIndexRequest(idxName);
......@@ -89,7 +93,7 @@ public class ElasticSearch {
public void createIndex2(String idxName, XContentBuilder builder) {
try {
if (!this.indexExist(idxName)) {
log.error(" idxName={} 已经存在,idxSql={}", idxName, builder);
//log.error(" idxName={} 已经存在,idxSql={}", idxName, builder);
return;
}
CreateIndexRequest request = new CreateIndexRequest(idxName);
......@@ -98,7 +102,7 @@ public class ElasticSearch {
// request.settings() 手工指定Setting
CreateIndexResponse res = restHighLevelClient.indices().create(request, RequestOptions.DEFAULT);
if (!res.isAcknowledged()) {
throw new RuntimeException("初始化失败");
log.info("初始化失败");
}
} catch (Exception e) {
e.printStackTrace();
......@@ -168,7 +172,7 @@ public class ElasticSearch {
*/
public void insertOrUpdateOne(String idxName, ElasticSearchEntity entity) {
IndexRequest request = new IndexRequest(idxName, "_doc");
log.error("Data : id={},entity={}", entity.getId(), JSON.toJSONString(entity.getData()));
log.info("Data : id={},entity={}", entity.getId(), JSON.toJSONString(entity.getData()));
request.id(entity.getId());
request.source(entity.getData(), XContentType.JSON);
// request.source(JSON.toJSONString(entity.getData()), XContentType.JSON);
......@@ -204,6 +208,24 @@ public class ElasticSearch {
}
/**
* 异步批量插入,并执行回调方法
*
* @param idxName
* @param list
* @param consumers
*/
public void insertBatchAsync(String idxName, List<JSONObject> list, List<Consumer<List<JSONObject>>> consumers) {
BulkRequest request = new BulkRequest();
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));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 批量删除
*
* @param idxName index
......@@ -258,11 +280,26 @@ public class ElasticSearch {
request.source(builder);
try {
SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);
int totalHits =(int) response.getHits().getTotalHits().value;
int totalHits = (int) response.getHits().getTotalHits().value;
SearchHit[] hits = response.getHits().getHits();
List<T> res = new ArrayList<>(hits.length);
for (SearchHit hit : hits) {
res.add(JSON.parseObject(hit.getSourceAsString(), c));
//解析高亮字段
//获取当前命中的对象的高亮的字段
Map<String, HighlightField> highlightFields = hit.getHighlightFields();
HighlightField hghlightContent = highlightFields.get("text.content");
String newName = "";
if (hghlightContent != null) {
//获取该高亮字段的高亮信息
Text[] fragments = hghlightContent.getFragments();
//将前缀、关键词、后缀进行拼接
for (Text fragment : fragments) {
newName += fragment;
}
}
Map<String, Object> sourceAsMap = hit.getSourceAsMap();
sourceAsMap.put("content", newName);
res.add(JSON.parseObject(JSONObject.toJSONString(sourceAsMap), c));
}
// 封装分页
PageInfo<T> page = new PageInfo<>();
......@@ -292,7 +329,7 @@ public class ElasticSearch {
public void deleteIndex(String idxName) {
try {
if (!this.indexExist(idxName)) {
log.error(" idxName={} 已经存在", idxName);
//log.error(" idxName={} 已经存在", idxName);
return;
}
restHighLevelClient.indices().delete(new DeleteIndexRequest(idxName), RequestOptions.DEFAULT);
......@@ -325,6 +362,20 @@ public class ElasticSearch {
}
}
public ActionListener getActionListener(List<JSONObject> list, List<Consumer<List<JSONObject>>> consumers) {
return new ActionListener() {
@Override
public void onResponse(Object o) {
consumers.forEach(consumer -> consumer.accept(list));
}
@Override
public void onFailure(Exception e) {
log.warn("work with es failed, exception={}", ExceptionUtils.getStackTrace(e));
}
};
}
public XContentBuilder getFinanceMapping() throws IOException {
// 创建 会话文本Mapping
XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()
......@@ -355,4 +406,4 @@ public class ElasticSearch {
.endObject();
return xContentBuilder;
}
}
}
\ No newline at end of file
......@@ -14,7 +14,15 @@ public enum MediaType {
IMAGE("0", "image"),
VOICE("1", "voice"),
VIDEO("2", "video"),
FILE("3", "file");
FILE("3", "file"),
/**
* 海报
*/
POSTER("5", "poster"),
/**
* 海报字体
*/
POSTER_FONT("6", "poster_font");
/**
* 媒体类型
......@@ -22,7 +30,7 @@ public enum MediaType {
String mediaType;
/**
* 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本
* 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报 6 海报字体
*/
String type;
......
......@@ -490,6 +490,23 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
/**
* 企微用户客户机器判断
* @param str
* @return
*/
public static int weCustomTypeJudgment(String str){
if (isNotEmpty(str)){
if (str.startsWith("wo") || str.startsWith("wm")){
return 1;
}
if (str.startsWith("wb")){
return 2;
}
}
return 0;
}
public static void main(String[] args) {
Integer[] arrays = { 1,2,3,4,5,6,7 };
String join = join(arrays, ",");
......
......@@ -21,8 +21,14 @@ public class Threads
/**
* 创建线程池
*/
public static final ThreadPoolExecutor SINGLE_THREAD_POOL = new ThreadPoolExecutor(CORE_POOL_SIZE, CORE_POOL_SIZE+1, 10l, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(1024),NAMED_THREAD_FACTORY);
public static final ThreadPoolExecutor SINGLE_THREAD_POOL = new ThreadPoolExecutor(CORE_POOL_SIZE, CORE_POOL_SIZE + 1, 10l, TimeUnit.SECONDS,
new SynchronousQueue<>(), NAMED_THREAD_FACTORY, (r, executor) -> {
try {
executor.getQueue().put(r);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
......
......@@ -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();
......
package com.linkwechat.common.utils.wecom;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.RandomStringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* @author danmo
* @description
* @date 2021/1/6 12:00
**/
@Slf4j
public class TicketUtils {
public static Map<String, Object> getSignatureMap(String ticketVaule, String url) {
String nonceStr = RandomStringUtils.randomAlphanumeric(10);
Long timestamp = System.currentTimeMillis() / 1000;
StringBuilder strBuild = new StringBuilder();
strBuild.append("jsapi_ticket=").append(ticketVaule)
.append("&noncestr=").append(nonceStr)
.append("&timestamp=").append(timestamp)
.append("&url=").append(url);
log.info("H5加密串:{}",strBuild.toString());
String signature = DigestUtils.sha1Hex(strBuild.toString());
return new HashMap(16) {{
put("nonceStr", nonceStr);
put("timestamp", timestamp);
put("signature", signature);
}};
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# link-wechat-mobile
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"]
};
This diff could not be displayed because it is too large.
{
"name": "link-wechat-mobile",
"version": "0.1.0",
"description": "LinkWeChat mobile",
"license": "GPL-3.0",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"vant": "^2.12.2",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.2.2",
"html-webpack-plugin": "^4.5.1",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"prettier": "^1.19.1",
"script-ext-html-webpack-plugin": "^2.1.5",
"style-resources-loader": "^1.3.2",
"vue-cli-plugin-style-resources-loader": "~0.1.4",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended",
"@vue/prettier"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
No preview for this file type
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<script>
export default {
name: 'App',
data() {
return {
timestamp: '',
nonceStr: '',
signature: '',
}
},
created() {
// 调取服务端signature
},
watch: {
// 通过config接口注入权限验证配置
// 所有需要使用JS-SDK的页面必须先注入配置信息,否则将无法调用(同一个url仅需调用一次,对于变化url的SPA(single-page application)的web app可在每次url变化时进行调用)
$router() {
wx.config({
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '123456', // 必填,企业微信的corpID
timestamp: this.timestamp, // 必填,生成签名的时间戳
nonceStr: this.nonceStr, // 必填,生成签名的随机串
signature: this.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList: [], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
})
},
},
}
</script>
<template>
<div id="app">
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view />
</div>
</template>
<style lang="less">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
#nav {
padding: 30px;
a {
font-weight: bold;
color: #2c3e50;
&.router-link-exact-active {
color: #42b983;
}
}
}
</style>
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br />
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener"
>vue-cli documentation</a
>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
target="_blank"
rel="noopener"
>babel</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
target="_blank"
rel="noopener"
>router</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
target="_blank"
rel="noopener"
>vuex</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
target="_blank"
rel="noopener"
>eslint</a
>
</li>
</ul>
<h3>Essential Links</h3>
<ul>
<li>
<a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
</li>
<li>
<a href="https://forum.vuejs.org" target="_blank" rel="noopener"
>Forum</a
>
</li>
<li>
<a href="https://chat.vuejs.org" target="_blank" rel="noopener"
>Community Chat</a
>
</li>
<li>
<a href="https://twitter.com/vuejs" target="_blank" rel="noopener"
>Twitter</a
>
</li>
<li>
<a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
</li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li>
<a href="https://router.vuejs.org" target="_blank" rel="noopener"
>vue-router</a
>
</li>
<li>
<a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
</li>
<li>
<a
href="https://github.com/vuejs/vue-devtools#vue-devtools"
target="_blank"
rel="noopener"
>vue-devtools</a
>
</li>
<li>
<a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener"
>vue-loader</a
>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
rel="noopener"
>awesome-vue</a
>
</li>
</ul>
</div>
</template>
<script>
export default {
name: "HelloWorld",
props: {
msg: String
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
const config = {
/**
* @description token在Cookie中存储的天数,默认1天
*/
cookieExpires: 1,
/**
* @description 是否使用国际化,默认为false
* 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
* 用来在菜单中显示文字
*/
useI18n: false,
/**
* @description api请求基础路径
*/
// 测试服
domain: process.env.NODE_ENV === 'development' ? 'http://192.168.1.32:8888' : 'http://192.168.1.26:8888', //
// 正式服
// domain: process.env.NODE_ENV === 'development' ? 'http://192.168.1.35:8118' : 'https://gateway.visualinsur.cn:8888', //
/**
* @description 默认打开的首页的路由name值,默认为home
*/
homeName: 'home',
/**
* @description 需要加载的插件
*/
plugin: {
// 'error-store': {
// showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
// developmentOff: false // 设为true后在开发环境不会收集错误信息,方便开发中排查错误
// }
},
// get domain() {
// return process.env.NODE_ENV === 'development' ? this.baseUrl.dev : this.baseUrl.pro
// }
}
config.services = {
}
export default config
\ No newline at end of file
import wx from '@/utils/jweixin-1.2.0.js'
import Vue from 'vue'
import Vant from 'vant'
import 'vant/lib/index.css'
Vue.use(Vant)
import App from './App.vue'
import router from './router'
import store from './store'
window.wx = wx
Vue.config.productionTip = false
new Vue({
router,
store,
render: (h) => h(App),
}).$mount('#app')
import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
Vue.use(VueRouter);
const routes = [
{
path: "/",
name: "Home",
component: Home
},
{
path: "/about",
name: "About",
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(/* webpackChunkName: "about" */ "../views/About.vue")
}
];
const router = new VueRouter({
routes
});
export default router;
import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
state: {},
mutations: {},
actions: {},
modules: {}
});
// 全屏转场动画
.slide-left-enter-active,
.slide-right-enter-active {
transition: all 0.2s ease;
}
.slide-left-leave-active,
.slide-right-leave-active {
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-left-enter,
.slide-right-leave-to {
transform: translateX(10px);
opacity: 0;
}
.slide-left-leave-to,
.slide-right-enter {
transform: translateX(-10px);
opacity: 0;
}
// 内页转场动画
.slide-inside-enter-active {
transition: all 0.3s ease;
}
.slide-inside-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-inside-enter,
.slide-inside-leave-to
/* .slide-down-leave-active for below version 2.1.8 */
{
// position: absolute;
transform: translateY(-10px);
opacity: 0;
}
\ No newline at end of file
@charset "utf-8";
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/**,*:before,*:after{-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;-webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-tap-highlight-color: transparent;max-height: 100000px;}*/
body,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
blockquote,
dl,
dt,
dd,
ul,
ol,
li,
pre,
form,
fieldset,
legend,
button,
input,
textarea,
th,
td {
margin: 0;
padding: 0;
}
body,input, select, textarea /* for ie */ {
font: 14px Microsoft YaHei, "宋体", arial, -apple-system, "PingFang SC",
"Helvetica Neue", Helvetica, "DejaVu Sans", "Lucida Grande", Tahoma,
"Hiragino Sans GB", STHeiti, SimSun, sans-serif;
line-height: 1.15;
color: #333; /*touch-action: none*/
} /** 设置默认字体 **/
header,
section,
footer,
aside,
nav,
article,
figure {
display: block;
}
input,
button,
select,
textarea {
outline: none;
vertical-align: middle; /*解决父级底部多余空白*/
-webkit-appearance: none; /*去掉webkit默认的表单样式*/
font-size: 100%; /* 使得表单元素在 ie 下能继承字体大小 */
border: none;
background: none;
color: inherit;
}
address,
cite,
dfn,
em,
var {
font-style: normal;
} /* 将斜体扶正 , 注:optgroup 无法扶正 */
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: 100%;
background: none;
}
code,
kbd,
pre,
samp {
font-family: courier new, courier, monospace;
} /* 统一等宽字体 */
object,
embed,
video {
max-width: 100%;
}
a:link,
a:active,
a:visited,
a:hover {
text-decoration: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
img {
border: 0;
max-width: 100%;
vertical-align: middle;
} /*解决父级底部多余空白*/
small {
font-size: 12px;
} /* 小于 12px 的中文很难阅读,让 small 正常化 */
legend {
color: #000;
} /*for ie6*/
fieldset {
border: 0;
}
li {
list-style: none;
}
a {
color: inherit;
}
/*click outline for firefox*/
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
border: none;
}
/*click outline for IE and other browser*/
button:focus,
input[type="reset"]:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
input[type="file"] > input[type="button"]:focus {
outline: none;
}
/* 注意此处合并写法无效 */
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
color: #fff;
font-size: 16px;
}
input::-moz-placeholder,
textarea::-moz-placeholder {
color: #fff;
font-size: 16px;
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
color: #fff;
font-size: 16px;
}
*:not(input, select, textarea) {
-webkit-user-select: none;
} /*禁止选中文本内容*/
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
height: 10px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px;
/*深色模式*/
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #bbb;
/*浅色模式*/
/*-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
background: rgb(245, 245, 245);
border: 1px solid #333;
border-bottom-width: 2px;*/
}
::-webkit-scrollbar-track {
/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 10px;
background: #eee;
}
/* common class */
/*bfc model*/
.bfc-o {
overflow: hidden;
position: relative;
}
.bfc-d {
display: inline-block;
vertical-align: top;
position: relative;
}
.bfc-p {
position: absolute;
}
.fl {
float: left;
position: relative;
}
.fr {
float: right;
position: relative;
}
.al {
text-align: left;
}
.ac {
text-align: center;
}
.ar {
text-align: right;
}
.hide {
display: none;
}
/*top-fixed and bottom-fixed*/
.tf,
.bf {
position: fixed;
width: 100%;
height: 50px;
z-index: 999;
}
.tf {
top: 0;
}
.bf {
bottom: 0;
}
/*mask*/
.mask {
position: fixed;
width: 100%;
height: 100%;
background: rgba(39, 39, 39, 0.76);
left: 0;
bottom: 0;
margin: auto;
z-index: 9;
}
/*center-center*/
.cc {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
overflow: auto;
}
/*t-o-h-e*/
.toe {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/*close*/
.close {
position: relative;
float: right;
width: 20px;
height: 20px;
line-height: 20px;
background: #f8f8f8;
text-align: center;
cursor: pointer;
}
/* pc frame */
.wrapper {
position: relative;
max-width: 1920px;
min-width: 1020px;
margin: 0 auto;
padding: 0 15px;
overflow: hidden;
}
.cp {
cursor: pointer;
}
@color: #42b9fd;
@colorSub: #4ee699;
@colorSubDeep: #34b071;
@borderColor: #106ed2;
@inputBgColor: #14344b;
@fontColor: #999;
// 画三角形
.triangle(@_, @wwww, @ccccc) {
width: 0px;
height: 0px;
overflow: hidden;
}
.triangle(L, @w, @c) {
border-width: @w;
border-style: dashed solid dashed dashed;
border-color: transparent @c transparent transparent;
}
.triangle(R, @w, @c) {
border-width: @w;
border-style: dashed dashed dashed solid;
border-color: transparent transparent transparent @c;
}
.triangle(T, @w, @c) {
border-width: @w;
border-style: dashed dashed solid dashed;
border-color: transparent transparent @c transparent;
}
.triangle(B, @w, @c) {
border-width: @w;
border-style: solid dashed dashed dashed;
border-color: @c transparent transparent transparent;
}
// 单边框
.border(single, @position: bottom, @color, @width: 1px) {
border-@{position}: @width solid @color;
}
// 全边框
.border(@color, @width: 1px) when (default()) {
border: @width solid @color;
}
import axios from axios
import config from "@/config"
function createAxios(baseUrl) {
const instance = axios.create({
baseUrl,
headers: {
Auth_token: ""
},
timeout: 3000,
})
// 请求拦截
instance.interceptors.request.use(config => {
// console.log('request config: ' + JSON.stringify(config))
return config
}, error => {
return Promise.reject(error)
})
// 响应拦截
instance.interceptors.response.use(res => {
// console.log('res: ' + res)
const { data, status } = res
// code 0:成功,-1/其它:错误
if (status === 200 && data.code === 0) {
return JSON.stringify(data.result) ? data.result : data.data
} else if (data.code === 201) {
// Message.error({
// content: `产品已存在`,
// duration: 3
// })
} else {
addErrorLog(res)
}
if (process.env.NODE_ENV === 'development') {
return Promise.reject(res) // 这样控制台会显示报错日志
} else {
return new Promise(() => { }) // 中断promise
}
}, error => {
if (error.response) {
addErrorLog(error.response)
} else {
// Message.error({
// content: `服务器未启动或连接超时`,
// duration: 3
// })
console.error("服务器未启动或连接超时")
}
return Promise.reject(error)
})
// 错误日志
const addErrorLog = errorInfo => {
const { data, statusText, status, request: { responseText, responseURL } } = errorInfo
// let info = {
// type: 'ajax',
// code: status,
// mes: statusText,
// url: responseURL
// }
// if (!responseURL.includes('save_error_logger')) store.dispatch('addErrorLog', info)
process.env.NODE_ENV === 'development'
? console.error(`错误: 路径: ${responseURL}, 返回值 : ${responseText}`,)
: console.error(`${JSON.parse(responseText).message}`,)
}
return instance
}
// const httpRequest = createAxios()
export default createAxios(config.domain)
\ No newline at end of file
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png" />
<HelloWorld msg="Welcome to Your Vue.js App" />
</div>
</template>
<script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";
export default {
name: "Home",
components: {
HelloWorld
}
};
</script>
const path = require('path')
const resolve = (dir) => {
return path.join(__dirname, dir)
}
process.env.VUE_APP_TITLE = require('./package.json').description
// 项目部署基础
// 默认情况下,我们假设你的应用将被部署在域的根目录下,
// 例如:https://www.my-app.com/
// 默认:'/'
// 如果您的应用程序部署在子路径中,则需要在这指定子路径
// 例如:https://www.my-app.com/my-app/
// 需要将它改为'/my-app/'
const BASE_URL = process.env.NODE_ENV === 'development' ? '/' : '/mobile'
module.exports = {
publicPath: BASE_URL,
outputDir: 'mobile', // 打包名称
// 打包时不生成.map文件
productionSourceMap: false,
// 如果你不需要使用eslint,把lintOnSave设为false即可
lintOnSave: false,
// 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
devServer: {
host: '0.0.0.0',
port: 8082,
// 自动打开浏览器
open: true,
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
['http']: {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true,
// pathRewrite: {
// ['^' + process.env.VUE_APP_BASE_API]: ''
// }
},
},
disableHostCheck: true,
},
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [path.resolve(__dirname, './src/styles/varibles.less')],
},
},
configureWebpack: {
resolve: {
alias: {
'@': resolve('src'),
},
},
},
chainWebpack(config) {
config.plugin('preload').tap(() => [
{
rel: 'preload',
// to ignore runtime.js
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial',
},
])
config.when(process.env.NODE_ENV !== 'development', (config) => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/,
},
])
.end()
config.optimization.minimizer('terser').tap((options) => {
options[0].terserOptions.compress.drop_console = true
options[0].terserOptions.compress.drop_debugger = true
return options
})
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial', // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-vant', // split vant into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?vant(.*)/, // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true,
},
},
})
config.optimization.runtimeChunk('single')
})
},
}
......@@ -34,6 +34,10 @@
<groupId>com.linkwechat</groupId>
<artifactId>linkwe-common</artifactId>
</dependency>
<dependency>
<groupId>com.linkwechat</groupId>
<artifactId>linkwe-wecom</artifactId>
</dependency>
</dependencies>
......
......@@ -2,12 +2,17 @@ package com.linkwechat.quartz.task;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.domain.elastic.ElasticSearchEntity;
import com.linkwechat.common.core.elasticsearch.ElasticSearch;
import com.linkwechat.common.core.redis.RedisCache;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.wecom.service.IWeChatContactMappingService;
import com.linkwechat.wecom.service.IWeSensitiveService;
import com.tencent.wework.FinanceUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortBuilder;
import org.elasticsearch.search.sort.SortBuilders;
......@@ -17,7 +22,9 @@ import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
/**
* 定时任务调度测试
......@@ -29,6 +36,12 @@ import java.util.concurrent.atomic.AtomicLong;
public class RyTask {
@Autowired
private ElasticSearch elasticSearch;
@Autowired
private RedisCache redisCache;
@Autowired
private IWeChatContactMappingService weChatContactMappingService;
@Autowired
private IWeSensitiveService weSensitiveService;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
......@@ -47,26 +60,42 @@ public class RyTask {
log.info("执行有参方法: params:{},{}", corpId, secret);
//创建索引
elasticSearch.createIndex2(WeConstans.WECOM_FINANCE_INDEX,elasticSearch.getFinanceMapping());
AtomicLong index = new AtomicLong(0);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
SortBuilder<?> sortBuilderPrice = SortBuilders.fieldSort("seq").order( SortOrder.DESC);
searchSourceBuilder.sort(sortBuilderPrice);
List<JSONObject> searchResultList = elasticSearch.search(WeConstans.WECOM_FINANCE_INDEX, searchSourceBuilder, JSONObject.class);
searchResultList.stream().findFirst().ifPresent(result ->{
index.set(result.getLong("seq")+1);
});
//从缓存中获取消息标识
Object seqObject = Optional.ofNullable(redisCache.getCacheObject(WeConstans.CONTACT_SEQ_KEY)).orElse(0L);
Long seqLong = Long.valueOf(String.valueOf(seqObject));
AtomicLong index = new AtomicLong(seqLong);
if (index.get() == 0){
setRedisCacheSeqValue(index);
}
log.info(">>>>>>>seq:{}",index.get());
FinanceUtils.initSDK(corpId, secret);
List<ElasticSearchEntity> chatDataList = FinanceUtils.getChatData(index.get(), "", "");
List<JSONObject> chatDataList = FinanceUtils.getChatData(index.get(),
"",
"", redisCache);
if (CollectionUtil.isNotEmpty(chatDataList)){
try {
elasticSearch.insertBatch(WeConstans.WECOM_FINANCE_INDEX, chatDataList);
List<JSONObject> elasticSearchEntities = weChatContactMappingService.saveWeChatContactMapping(chatDataList);
List<Consumer<List<JSONObject>>> consumerList = Lists.newArrayList();
consumerList.add(weSensitiveService::hitSensitive);
elasticSearch.insertBatchAsync(WeConstans.WECOM_FINANCE_INDEX, elasticSearchEntities, consumerList);
} catch (Exception e) {
log.error("消息处理异常:ex:{}", e);
e.printStackTrace();
}
index.incrementAndGet();
}
}
private void setRedisCacheSeqValue(AtomicLong index){
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
SortBuilder<?> sortBuilderPrice = SortBuilders.fieldSort(WeConstans.CONTACT_SEQ_KEY).order( SortOrder.DESC);
searchSourceBuilder.sort(sortBuilderPrice);
searchSourceBuilder.size(1);
List<JSONObject> searchResultList = elasticSearch.search(WeConstans.WECOM_FINANCE_INDEX, searchSourceBuilder, JSONObject.class);
searchResultList.stream().findFirst().ifPresent(result ->{
index.set(result.getLong(WeConstans.CONTACT_SEQ_KEY) + 1);
});
redisCache.setCacheObject(WeConstans.CONTACT_SEQ_KEY,index);
}
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
\ No newline at end of file
......@@ -2,7 +2,7 @@
ENV = 'production'
# 塬微管理系统/生产环境api
VUE_APP_BASE_API = 'http://106.13.201.219'
VUE_APP_BASE_API = 'http://106.13.236.58:8080'
# 生产环境IP
VUE_APP_BASE_URL = 'http://106.13.201.219'
VUE_APP_BASE_URL = 'http://106.13.236.58:8080'
......@@ -2,10 +2,10 @@
```bash
# 克隆项目
git clone https://gitee.com/y_project/RuoYi-Vue
git clone https://gitee.com/LinkWeChat/link-wechat.git
# 进入项目目录
cd ruoyi-ui
cd linkwe-ui
# 安装依赖
npm install
......@@ -14,7 +14,7 @@ npm install
npm install --registry=https://registry.npm.taobao.org
# 启动服务
npm run dev
npm run serve
```
浏览器访问 http://localhost:80
......
{
"name": "linkwechat",
"version": "0.1.0",
"description": "塬微管理系统",
"license": "MIT",
"description": "LinkWeChat",
"license": "GPL-3.0",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
......@@ -63,6 +63,7 @@
"vue-quill-editor": "3.0.6",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vue-ueditor-wrap": "^2.4.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0"
},
......
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/customerMessagePush'
import request from "@/utils/request";
const service = window.CONFIG.services.wecom + "/customerMessagePush";
/**
* 新增企业id
......@@ -35,26 +35,49 @@ const service = window.CONFIG.services.wecom + '/customerMessagePush'
*/
export function add(data) {
return request({
url: service + '/add',
method: 'post',
data,
})
url: service + "/add",
method: "post",
data
});
}
/**
*
* @param {*} data
*
* @param {*} data
* {
* sender:创建人
content:内容
pushType:群发类型 0 发给客户 1 发给客户群
beginTime:开始时间
beginTime:开始时间
endTime:结束时间}
*/
export function getList(data) {
export function getList(params) {
return request({
url: service + '/list',
method: 'get',
data,
})
url: service + "/list",
params
});
}
/**
* 群发消息详情
* @param {*} messageId:微信消息id
*/
export function getDetail(messageId) {
return request({
url: service + "/getInfo",
params: { messageId }
});
}
/**
*
* @param {*}
* messageId:微信消息id
status:发送状态 0-未发送 1-已发送 2-因客户不是好友导致发送失败 3-因客户已经收到其他群发消息导致发送失败
*/
export function getPushResult(params) {
return request({
url: service + "/pushResults",
params
});
}
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/material'
const serviceCategory = window.CONFIG.services.wecom + '/poster'
/**
* 查询海报列表
* @param {*} params
*/
export function getList(params) {
return request({ url: service + '/list', params })
}
/**
* 添加海报
* @param {*} data
*/
export function addPoster(data) {
return request({ url: serviceCategory + '/insert', method: 'post', data })
}
/**
* 查询海报详情
* @param {*} data
*/
export function getPosterInfo(data) {
return request({ url: serviceCategory + '/entity', method: 'get', data })
}
/**
* 删除海报
* @param {*} data
*/
export function removePoster(ids) {
return request({
url: serviceCategory + '/delete/' + ids,
method: 'DELETE'
})
}
<style lang="scss" scoped>
.chat-preview {
border-radius: 4px;
position: relative;
margin-left: 40px;
display: inline-block;
width: 150px;
min-height: 263px;
background-repeat: no-repeat;
background-size: cover;
top: 15px;
.logo {
width: 40px;
height: 40px;
position: absolute;
top: 18px;
left: 50%;
transform: translateX(-50%);
border-radius: 50%;
}
.company-name {
font-size: 12px;
position: absolute;
top: 70px;
text-align: center;
color: #ffe7be;
width: 100%;
}
}
</style>
<script>
export default {
components: {},
props: {},
data() {
return {
dialogVisible: false,
list: [
{ type: "文本类型", name: "企业资料", number: 105, isStart: 1 },
{ type: "图片类型", name: "图片类型", number: 86, isStart: 1 },
{ type: "网页类型", name: "网页类型", number: 55, isStart: 1 },
{ type: "文件类型", name: "文件类型", number: 667, isStart: 1 },
{ type: "视频类型", name: "视频类型", number: 29, isStart: 1 }
]
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
</script>
<template>
<div>
<div>
配置聊天工具栏,方便成员在外部会话中查看和使用,提高服务效率。
<el-button type="text" @click="$router.push('/appTool/explain')">图文详解</el-button>
<el-button type="text" @click="$router.push('/appTool/config')">查看已配置信息</el-button>
<el-button type="text" @click="$router.push('/appTool/explain')"
>图文详解</el-button
>
<el-button type="text" @click="$router.push('/appTool/config')"
>查看已配置信息</el-button
>
</div>
<div>
<span>抓取快捷回复素材</span> 素材抓取后,即可在聊天工具栏使用
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="素材类型" align="center" prop="operId" />
<el-table-column label="聊天工具栏名称" align="center" prop="title" />
<el-table-column label="已抓取素材数量" align="center" prop="businessType" :formatter="typeFormat" />
<el-table-column label="是否启用" align="center" prop="operTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" prop="operId">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
>抓取素材</el-button>
</template>
</el-table-column>
</el-table>
<el-card shadow="never" header="红包工具栏">
<div slot="header">
<span>抓取快捷回复素材</span> 素材抓取后,即可在聊天工具栏使用
</div>
<el-table
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="素材类型" align="center" prop="type" />
<el-table-column label="聊天工具栏名称" align="center" prop="name" />
<el-table-column label="已抓取素材数量" align="center" prop="number" />
<el-table-column
label="是否启用"
align="center"
prop="isStart"
width="180"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.isStart"
:active-value="1"
:inactive-value="0"
inactive-color="#ff4949"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" prop="operId">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleView(scope.row, scope.index)"
>抓取素材</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card class="mt20" shadow="never" header="红包工具栏">
<!-- <div slot="header"></div> -->
<el-row :gutter="10">
<el-col :span="10">
......@@ -83,7 +94,12 @@
</div>
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="企业logo">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<el-upload
action
:show-file-list="false"
:on-success="d"
:before-upload="d"
>
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
......@@ -100,7 +116,7 @@
<el-col :span="10">
<div
class="chat-preview"
style="background-image: url(&quot;https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/red-packet.png&quot;);"
style='background-image: url("https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/red-packet.png");'
>
<div class="el-image logo" style>
<div class="el-image__error">加载失败</div>
......@@ -132,32 +148,56 @@
</div>
<el-table :data="data" style="width: 100%">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="prop" label="文本内容" width="width"></el-table-column>
<el-table-column prop="prop" label="时间" width="width"></el-table-column>
<el-table-column
prop="prop"
label="文本内容"
width="width"
></el-table-column>
<el-table-column
prop="prop"
label="时间"
width="width"
></el-table-column>
</el-table>
</el-col>
</el-row>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
<el-button type="primary" @click="dialogVisible = false"
>确 定</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {
dialogVisible: true,
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.chat-preview {
border-radius: 4px;
position: relative;
margin-left: 40px;
display: inline-block;
width: 150px;
min-height: 263px;
background-repeat: no-repeat;
background-size: cover;
top: 15px;
.logo {
width: 40px;
height: 40px;
position: absolute;
top: 18px;
left: 50%;
transform: translateX(-50%);
border-radius: 50%;
}
.company-name {
font-size: 12px;
position: absolute;
top: 70px;
text-align: center;
color: #ffe7be;
width: 100%;
}
}
</style>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
<template>
<div>
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
<el-tabs type="card" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="朋友圈动态" name="1">
<div>
<div class="mb20">
* 该朋友圈为展示在企业成员对外资料显示中的企业朋友圈,
<!-- <el-button type="primary">查看功能介绍</el-button> -->
<el-link type="primary" href="/appTool/friendIntroduce">查看功能介绍</el-link>
<el-link type="primary" href="/appTool/friendIntroduce"
>查看功能介绍</el-link
>
</div>
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="100px">
<el-form
class="top-search"
:model="queryParams"
ref="queryForm"
:inline="true"
label-width="100px"
>
<el-form-item label="关键词" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
/>
</el-form-item>
......@@ -25,7 +31,6 @@
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
......@@ -34,66 +39,84 @@
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button type="primary" @click="handleQuery">查询</el-button>
</el-form-item>
</el-form>
<div class="ar">
<div class="ar mb15">
<el-button type="primary">发布动态</el-button>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="所选成员" align="center" prop="operId" />
<el-table-column label="发布内容" align="center" prop="title" />
<el-table-column label="创建人" align="center" prop="businessType" />
<el-table-column label="发布时间" align="center" prop="operTime" width="180">
<el-table-column
label="发布时间"
align="center"
prop="operTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
@click="handleView(scope.row, scope.index)"
v-hasPermi="['monitor:operlog:query']"
>下载</el-button>
>下载</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
@click="handleView(scope.row, scope.index)"
v-hasPermi="['monitor:operlog:query']"
>复制链接</el-button>
>复制链接</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
@click="handleView(scope.row, scope.index)"
v-hasPermi="['monitor:operlog:query']"
>查看详情</el-button>
>查看详情</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
@click="handleView(scope.row, scope.index)"
v-hasPermi="['monitor:operlog:query']"
>编辑</el-button>
>编辑</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
@click="handleView(scope.row, scope.index)"
v-hasPermi="['monitor:operlog:query']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
......@@ -101,20 +124,36 @@
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog title="编辑图片" :visible.sync="open" width="600px" append-to-body>
<el-dialog
title="编辑图片"
:visible.sync="open"
width="600px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="图片名称">
<el-input v-model="sd" placeholder></el-input>
</el-form-item>
<el-form-item label="图片文案">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
></el-input>
</el-form-item>
<el-form-item label="图片">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<el-upload
action
:show-file-list="false"
:on-success="d"
:before-upload="d"
>
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div>支持JPG,PNG格式,图片大小不超过2M,建议上传宽高1:1的图片</div>
<div>
支持JPG,PNG格式,图片大小不超过2M,建议上传宽高1:1的图片
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -124,40 +163,54 @@
</el-dialog>
</el-tab-pane>
<el-tab-pane label="设置" name="2">
<div class="ar">
<div class="ar mb15">
<el-input
placeholder="请输入内容"
prefix-icon="el-icon-search"
style="width: 240px;"
v-model="input2"
></el-input>
<el-button @click="$router.push('/appTool/friendBackground')">设置默认背景图片</el-button>
<el-button
class="ml10"
@click="$router.push('/appTool/friendBackground')"
>设置默认背景图片</el-button
>
<el-button type="primary">一键设置朋友圈地址</el-button>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table-column label="员工" align="center" prop="operId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
@click="handleView(scope.row, scope.index)"
v-hasPermi="['monitor:operlog:query']"
>编辑头像背景</el-button>
>编辑头像背景</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
@click="handleView(scope.row, scope.index)"
v-hasPermi="['monitor:operlog:query']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
......@@ -176,13 +229,13 @@ export default {
return {
queryParams: {},
form: {},
activeName: "1",
activeName: "1"
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
methods: {}
};
</script>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
</script>
<template>
<div>
<img src="@/assets/example/groupFission.jpg" alt="" />
</div>
</template>
<style lang="less" scoped></style>
<script>
import * as api from "@/api/customer";
// import clipboard from "clipboard";
export default {
components: {},
props: {},
data() {
return {
query: {
pageNum: 1,
pageSize: 10,
name: ""
},
dateRange: [], // 添加日期
total: 0,
form: {},
list: [],
dialogVisible: false,
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
}),
status: ["正常", "停用"]
};
},
watch: {},
computed: {},
created() {
this.getList();
},
mounted() {
// new clipboard(".copy-btn");
},
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
} else {
this.query.beginTime = "";
this.query.endTime = "";
}
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
},
submit() {
this.$refs["form"].validate(valid => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
})
.catch(() => {
this.dialogVisible = false;
});
}
});
},
goRoute(id, path) {
this.$router.push({
path: "/appTool/groupFissionAev",
query: { id }
});
}
}
};
</script>
<template>
<div>
<div class="top-search">
<el-form inline label-position="right" :model="form" label-width="80px">
<el-form-item label="裂变名">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="活动日期">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button type="primary" @click="getList(1)">查询</el-button>
<el-button @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="ar mb10">
<el-button
v-hasPermi="['enterpriseWechat:add']"
type="primary"
icon="el-icon-plus"
@click="goRoute()"
>新建群裂变任务</el-button
>
</div>
<!-- <el-card shadow="never" :body-style="{padding: '20px 0 0'}">
</el-card>-->
<el-table v-loading="loading" :data="list">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column
label="群裂变名称"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column prop="createTime" label="裂变客户数量" align="center">
<template slot-scope="scope">{{
Math.floor(Math.random() * 10000)
}}</template>
</el-table-column>
<el-table-column prop="createTime" label="活动状态" align="center">
已结束
</el-table-column>
<el-table-column
label="活动时间"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="操作"
align="center"
width="180"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-hasPermi="['enterpriseWechat:view']"
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<el-dialog title="查看企业微信号" :visible.sync="dialogVisible">
<el-form
ref="form"
label-position="right"
:model="form"
:rules="rules"
label-width="160px"
:disabled="disabled"
>
<el-form-item label="企业名称" prop="name">
<el-input v-model="form.name" :disabled="form.id"></el-input>
</el-form-item>
<el-form-item label="企业ID(CorpID)" prop="corpId">
<el-input
:disabled="form.id"
v-model="form.corpId"
style="width: 80%"
placeholder="可在新闻公告应用的生日祝福等场景使用"
></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="Token">
<el-input disabled id="copy-input" v-model="form.name" placeholder="成员唯一标识,不支持更改,不支持中文"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input">复制</el-button>
</el-form-item>
<el-form-item label="EncodingAESKey">
<el-input disabled id="copy-input1" v-model="form.name"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input1">复制</el-button>
</el-form-item>-->
<el-form-item label="服务商secret" prop="providerSecret">
<el-input v-model="form.providerSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<el-form-item label="通讯录管理secret" prop="corpSecret">
<el-input v-model="form.corpSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.contactSecret">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.model">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
prop="wxQrLoginRedirectUri"
>
<el-input v-model="form.wxQrLoginRedirectUri"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submit" v-show="!disabled"
>确 定</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
</script>
<template>
<div>
<img src="@/assets/example/task.jpg" alt="" />
</div>
</template>
<style lang="less" scoped></style>
<script>
import * as api from "@/api/customer";
// import clipboard from "clipboard";
export default {
components: {},
props: {},
data() {
return {
query: {
pageNum: 1,
pageSize: 10,
name: ""
},
dateRange: [], // 添加日期
total: 0,
form: {},
list: [],
dialogVisible: false,
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
}),
status: ["正常", "停用"]
};
},
watch: {},
computed: {},
created() {
this.getList();
},
mounted() {
// new clipboard(".copy-btn");
},
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
} else {
this.query.beginTime = "";
this.query.endTime = "";
}
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
},
submit() {
this.$refs["form"].validate(valid => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
})
.catch(() => {
this.dialogVisible = false;
});
}
});
},
goRoute(id, path) {
this.$router.push({
path: "/appTool/taskAev",
query: { id }
});
}
}
};
</script>
<template>
<div>
<div class="top-search">
<el-form inline label-position="right" :model="form" label-width="80px">
<el-form-item label="任务名">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="活动日期">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button type="primary" @click="getList(1)">查询</el-button>
<el-button @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="ar mb10">
<el-button
v-hasPermi="['enterpriseWechat:add']"
type="primary"
icon="el-icon-plus"
@click="goRoute()"
>新建任务</el-button
>
</div>
<!-- <el-card shadow="never" :body-style="{padding: '20px 0 0'}">
</el-card>-->
<el-table v-loading="loading" :data="list">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column
label="任务活动名称"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column prop="createTime" label="裂变客户数量" align="center">
<template slot-scope="scope">{{
Math.floor(Math.random() * 10000)
}}</template>
</el-table-column>
<el-table-column prop="createTime" label="活动状态" align="center">
已结束
</el-table-column>
<el-table-column
label="活动时间"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="操作"
align="center"
width="180"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-hasPermi="['enterpriseWechat:view']"
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<el-dialog title="查看企业微信号" :visible.sync="dialogVisible">
<el-form
ref="form"
label-position="right"
:model="form"
:rules="rules"
label-width="160px"
:disabled="disabled"
>
<el-form-item label="企业名称" prop="name">
<el-input v-model="form.name" :disabled="form.id"></el-input>
</el-form-item>
<el-form-item label="企业ID(CorpID)" prop="corpId">
<el-input
:disabled="form.id"
v-model="form.corpId"
style="width: 80%"
placeholder="可在新闻公告应用的生日祝福等场景使用"
></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="Token">
<el-input disabled id="copy-input" v-model="form.name" placeholder="成员唯一标识,不支持更改,不支持中文"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input">复制</el-button>
</el-form-item>
<el-form-item label="EncodingAESKey">
<el-input disabled id="copy-input1" v-model="form.name"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input1">复制</el-button>
</el-form-item>-->
<el-form-item label="服务商secret" prop="providerSecret">
<el-input v-model="form.providerSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<el-form-item label="通讯录管理secret" prop="corpSecret">
<el-input v-model="form.corpSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.contactSecret">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.model">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
prop="wxQrLoginRedirectUri"
>
<el-input v-model="form.wxQrLoginRedirectUri"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submit" v-show="!disabled"
>确 定</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
</script>
<template>
<div>
<img src="@/assets/example/groupSOP.jpg" alt="" />
</div>
</template>
<style lang="less" scoped></style>
<script>
import * as api from "@/api/customer";
export default {
components: {},
props: {},
data() {
return {
query: {
pageNum: 1,
pageSize: 10,
name: ""
},
dateRange: [], // 添加日期
total: 0,
form: {},
list: [],
dialogVisible: false,
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
}),
status: ["正常", "停用"],
pushType: {
0: "发给客户",
1: "发给客户群"
}
};
},
watch: {},
computed: {},
created() {
this.getList();
},
mounted() {
// new clipboard(".copy-btn");
},
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
} else {
this.query.beginTime = "";
this.query.endTime = "";
}
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
},
submit() {
this.$refs["form"].validate(valid => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
})
.catch(() => {
this.dialogVisible = false;
});
}
});
},
goRoute(id, path) {
this.$router.push({
path: "/communityOperating/groupSOPAev",
query: { id }
});
}
}
};
</script>
<template>
<div>
<div class="fxbw mb10 aic">
<div class="total">
群SOP 制定推送规则后,通知群主定时给指定客户群发送消息。
</div>
<div>
<el-button type="primary" icon="el-icon-plus" @click="goRoute()"
>创建规则</el-button
>
<el-input
placeholder="请输入规则名称"
prefix-icon="el-icon-search"
v-model="query.welcomeMsg"
style="width: 240px; margin-left: 10px;"
@change="getList(0)"
></el-input>
</div>
</div>
<!-- <el-card shadow="never" :body-style="{padding: '20px 0 0'}">
</el-card>-->
<el-table v-loading="loading" :data="list">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column
label="规则名称"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column prop="createTime" label="创建人" align="center">
<template slot-scope="scope">{{
Math.floor(Math.random() * 10000)
}}</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
></el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-hasPermi="['enterpriseWechat:view']"
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<el-dialog title="查看企业微信号" :visible.sync="dialogVisible">
<el-form
ref="form"
label-position="right"
:model="form"
:rules="rules"
label-width="160px"
:disabled="disabled"
>
<el-form-item label="企业名称" prop="name">
<el-input v-model="form.name" :disabled="form.id"></el-input>
</el-form-item>
<el-form-item label="企业ID(CorpID)" prop="corpId">
<el-input
:disabled="form.id"
v-model="form.corpId"
style="width: 80%"
placeholder="可在新闻公告应用的生日祝福等场景使用"
></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="Token">
<el-input disabled id="copy-input" v-model="form.name" placeholder="成员唯一标识,不支持更改,不支持中文"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input">复制</el-button>
</el-form-item>
<el-form-item label="EncodingAESKey">
<el-input disabled id="copy-input1" v-model="form.name"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input1">复制</el-button>
</el-form-item>-->
<el-form-item label="服务商secret" prop="providerSecret">
<el-input v-model="form.providerSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<el-form-item label="通讯录管理secret" prop="corpSecret">
<el-input v-model="form.corpSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.contactSecret">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.model">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
prop="wxQrLoginRedirectUri"
>
<el-input v-model="form.wxQrLoginRedirectUri"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submit" v-show="!disabled"
>确 定</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
</script>
<template>
<div>
<img src="@/assets/example/keywords.jpg" alt="" />
</div>
</template>
<style lang="less" scoped></style>
<script>
import * as api from "@/api/customer";
export default {
components: {},
props: {},
data() {
return {
query: {
pageNum: 1,
pageSize: 10,
name: ""
},
dateRange: [], // 添加日期
total: 0,
form: {},
list: [],
dialogVisible: false,
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
}),
status: ["正常", "停用"],
pushType: {
0: "发给客户",
1: "发给客户群"
}
};
},
watch: {},
computed: {},
created() {
this.getList();
},
mounted() {
// new clipboard(".copy-btn");
},
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
} else {
this.query.beginTime = "";
this.query.endTime = "";
}
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
},
submit() {
this.$refs["form"].validate(valid => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
})
.catch(() => {
this.dialogVisible = false;
});
}
});
},
goRoute(id, path) {
this.$router.push({
path: "/communityOperating/keywordsAev",
query: { id }
});
}
}
};
</script>
<template>
<div>
<div class="fxbw mb10 aic">
<div class="total">
关键词拉群
配置聊天工具栏,管理员创建关键词拉群后,员工可在聊天功能栏使用。
</div>
<div>
<el-button type="primary" icon="el-icon-plus" @click="goRoute()"
>新建关键词拉群</el-button
>
<el-input
placeholder="请输入活动名称"
prefix-icon="el-icon-search"
v-model="query.welcomeMsg"
style="width: 240px; margin-left: 10px;"
@change="getList(0)"
></el-input>
</div>
</div>
<!-- <el-card shadow="never" :body-style="{padding: '20px 0 0'}">
</el-card>-->
<el-table v-loading="loading" :data="list">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column
label="群活码"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column prop="createTime" label="活动名称" align="center">
<template slot-scope="scope">{{
Math.floor(Math.random() * 10000)
}}</template>
</el-table-column>
<el-table-column prop="createTime" label="关键词" align="center">
已结束
</el-table-column>
<el-table-column
label="群聊"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="操作"
align="center"
width="180"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-hasPermi="['enterpriseWechat:view']"
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<el-dialog title="查看企业微信号" :visible.sync="dialogVisible">
<el-form
ref="form"
label-position="right"
:model="form"
:rules="rules"
label-width="160px"
:disabled="disabled"
>
<el-form-item label="企业名称" prop="name">
<el-input v-model="form.name" :disabled="form.id"></el-input>
</el-form-item>
<el-form-item label="企业ID(CorpID)" prop="corpId">
<el-input
:disabled="form.id"
v-model="form.corpId"
style="width: 80%"
placeholder="可在新闻公告应用的生日祝福等场景使用"
></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="Token">
<el-input disabled id="copy-input" v-model="form.name" placeholder="成员唯一标识,不支持更改,不支持中文"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input">复制</el-button>
</el-form-item>
<el-form-item label="EncodingAESKey">
<el-input disabled id="copy-input1" v-model="form.name"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input1">复制</el-button>
</el-form-item>-->
<el-form-item label="服务商secret" prop="providerSecret">
<el-input v-model="form.providerSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<el-form-item label="通讯录管理secret" prop="corpSecret">
<el-input v-model="form.corpSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.contactSecret">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.model">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
prop="wxQrLoginRedirectUri"
>
<el-input v-model="form.wxQrLoginRedirectUri"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submit" v-show="!disabled"
>确 定</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
</script>
<template>
<div>
<img src="@/assets/example/newCustomer.jpg" alt="" />
</div>
</template>
<style lang="less" scoped></style>
<script>
import * as api from "@/api/customer";
export default {
components: {},
props: {},
data() {
return {
query: {
pageNum: 1,
pageSize: 10,
name: ""
},
dateRange: [], // 添加日期
total: 0,
form: {},
list: [],
dialogVisible: false,
disabled: false,
loading: false,
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }]
}),
status: ["正常", "停用"],
pushType: {
0: "发给客户",
1: "发给客户群"
}
};
},
watch: {},
computed: {},
created() {
this.getList();
},
mounted() {
// new clipboard(".copy-btn");
},
methods: {
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
} else {
this.query.beginTime = "";
this.query.endTime = "";
}
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
edit(data, type) {
this.form = Object.assign({}, data || {});
this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true);
},
submit() {
this.$refs["form"].validate(valid => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form)
.then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList(!this.form.id && 1);
})
.catch(() => {
this.dialogVisible = false;
});
}
});
},
goRoute(id, path) {
this.$router.push({
path: "/communityOperating/newCustomerAev",
query: { id }
});
}
}
};
</script>
<template>
<div>
<div class="fxbw mb10 aic">
<div class="total">
新客自动拉群
客户通过员工活码添加员工,自动发送入群引导语、群活码,客户扫码入群。
</div>
<div>
<el-button type="primary" icon="el-icon-plus" @click="goRoute()"
>新建自动拉群</el-button
>
<el-input
placeholder="请输入活动名称"
prefix-icon="el-icon-search"
v-model="query.welcomeMsg"
style="width: 240px; margin-left: 10px;"
@change="getList(0)"
></el-input>
</div>
</div>
<!-- <el-card shadow="never" :body-style="{padding: '20px 0 0'}">
</el-card>-->
<el-table v-loading="loading" :data="list">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
<el-table-column
label="员工活码"
align="center"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column prop="createTime" label="活动名称" align="center">
<template slot-scope="scope">{{
Math.floor(Math.random() * 10000)
}}</template>
</el-table-column>
<el-table-column prop="createTime" label="使用成员" align="center">
已结束
</el-table-column>
<el-table-column
label="标签"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="群聊"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="添加好友数"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="操作"
align="center"
width="180"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-hasPermi="['enterpriseWechat:view']"
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row, 0)"
>查看</el-button
>
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
icon="el-icon-edit"
@click="edit(scope.row, 1)"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<el-dialog title="查看企业微信号" :visible.sync="dialogVisible">
<el-form
ref="form"
label-position="right"
:model="form"
:rules="rules"
label-width="160px"
:disabled="disabled"
>
<el-form-item label="企业名称" prop="name">
<el-input v-model="form.name" :disabled="form.id"></el-input>
</el-form-item>
<el-form-item label="企业ID(CorpID)" prop="corpId">
<el-input
:disabled="form.id"
v-model="form.corpId"
style="width: 80%"
placeholder="可在新闻公告应用的生日祝福等场景使用"
></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="Token">
<el-input disabled id="copy-input" v-model="form.name" placeholder="成员唯一标识,不支持更改,不支持中文"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input">复制</el-button>
</el-form-item>
<el-form-item label="EncodingAESKey">
<el-input disabled id="copy-input1" v-model="form.name"></el-input>
<el-button type="primary" class="copy-btn" data-clipboard-target="#copy-input1">复制</el-button>
</el-form-item>-->
<el-form-item label="服务商secret" prop="providerSecret">
<el-input v-model="form.providerSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<el-form-item label="通讯录管理secret" prop="corpSecret">
<el-input v-model="form.corpSecret" style="width: 80%"></el-input>
<el-link class="fr" type="primary">如何获取?</el-link>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.contactSecret">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将成员、部门的增删改以及成员的标签变更实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item label="外部联系人管理secret" prop="contactSecret">
<el-input v-model="form.contactSecret"></el-input>
</el-form-item>
<!-- <el-form-item label="通讯录事件服务">
<el-radio-group v-model="form.model">
<el-radio label="label">开启</el-radio>
<el-radio label="label">不开启</el-radio>
</el-radio-group>
<div>开启后,可以将企业客户的添加、编辑以及主动删除客户和被动被客户删除实时的同步到塬微SCRM,无需手动更新同步。</div>
</el-form-item>-->
<el-form-item
label="企业微信扫码登陆回调地址"
prop="wxQrLoginRedirectUri"
>
<el-input v-model="form.wxQrLoginRedirectUri"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submit" v-show="!disabled"
>确 定</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
</script>
<template>
<div>
<img :src="require('@/assets/example/oldCustomer.jpg')" alt="" />
</div>
</template>
<style lang="less" scoped></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!