Commit 56136e32 by 姚宇航

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

2 parents fd546ea3 d460b281
Showing 132 changed files with 2638 additions and 91 deletions
package com.linkwechat.web.controller.system;
import cn.hutool.core.collection.CollectionUtil;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.constant.UserConstants;
import com.linkwechat.common.core.controller.BaseController;
......@@ -17,19 +18,23 @@ import com.linkwechat.framework.web.service.TokenService;
import com.linkwechat.system.service.ISysPostService;
import com.linkwechat.system.service.ISysRoleService;
import com.linkwechat.system.service.ISysUserService;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.service.IWeUserService;
import io.swagger.annotations.ApiOperation;
import io.vertx.ext.auth.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.stream.Collectors;
/**
* 用户信息
*
*
* @author ruoyi
*/
@RestController
......@@ -48,6 +53,10 @@ public class SysUserController extends BaseController
@Autowired
private TokenService tokenService;
@Autowired
private IWeUserService iWeUserService;
/**
* 获取用户列表
*/
......@@ -56,6 +65,7 @@ public class SysUserController extends BaseController
public TableDataInfo list(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);
}
......@@ -193,4 +203,27 @@ public class SysUserController extends BaseController
user.setUpdateBy(SecurityUtils.getUsername());
return toAjax(userService.updateUserStatus(user));
}
@GetMapping("/findCurrentLoginUser")
public AjaxResult findCurrentLoginUser(HttpServletRequest request){
String userId="";
LoginUser loginUser = tokenService.getLoginUser(request);
if(null != loginUser){
SysUser user = loginUser.getUser();
if(null != user){
List<WeUser> weUsers = iWeUserService.selectWeUserList(WeUser.builder()
.mobile(user.getPhonenumber())
.build());
if(CollectionUtil.isNotEmpty(weUsers)){
userId=weUsers.get(0).getUserId();
}
}
}
return AjaxResult.success(userId);
}
}
package com.linkwechat.web.controller.wecom;
import com.alibaba.fastjson.JSONObject;
import com.linkwechat.common.utils.Threads;
import com.linkwechat.common.utils.wecom.WxCryptUtil;
import com.linkwechat.web.controller.common.CommonController;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
......@@ -47,7 +48,7 @@ public class WeCallBackController extends CommonController {
try {
WeCallBackEventFactory factory = weEventHandle.factory(wxCpXmlMessage.getEvent());
if (factory !=null){
factory.eventHandle(wxCpXmlMessage);
Threads.SINGLE_THREAD_POOL.submit(() -> factory.eventHandle(wxCpXmlMessage));
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -53,9 +53,9 @@ public class WeChatCollectionController extends BaseController {
*/
// @PreAuthorize("@ss.hasPermi('chat:collection:list')")
@GetMapping("/list")
public TableDataInfo list(@RequestParam(value = "userId") Long userId) {
public TableDataInfo list(@RequestParam(value = "userId") Long userId,@RequestParam(value = "keyword",required = false) String keyword) {
startPage();
List<WeChatSideVo> collections = weChatCollectionService.collections(userId);
List<WeChatSideVo> collections = weChatCollectionService.collections(userId,keyword);
return getDataTable(collections);
}
......
......@@ -16,6 +16,7 @@ import java.util.List;
/**
* 聊天工具侧边栏
*
* @author kewen
*/
@RequestMapping(value = "/wecom/chat/item")
......@@ -41,9 +42,10 @@ public class WeChatItemController extends BaseController {
*/
//@PreAuthorize("@ss.hasPermi('chat:item:list')")
@GetMapping("/list")
public TableDataInfo list(@RequestParam(value = "sideId") Long sideId) {
public TableDataInfo list(@RequestParam(value = "sideId") Long sideId
, @RequestParam(value = "keyword", required = false) String keyword) {
startPage();
List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId);
List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId,keyword);
return getDataTable(weChatSideVos);
}
......
......@@ -15,6 +15,7 @@ import java.util.List;
/**
* 聊天工具侧边栏
*
* @author kewen
*/
@RequestMapping(value = "/wecom/chat/side")
......@@ -28,11 +29,11 @@ public class WeChatSideController extends BaseController {
/**
* 群发侧边栏列表
*/
// @PreAuthorize("@ss.hasPermi('chat:side:list')")
@PreAuthorize("@ss.hasPermi('chat:side:list')")
@GetMapping("/list")
public TableDataInfo list(@RequestParam(value = "h5") String h5) {
public TableDataInfo list() {
startPage();
List<WeChatSide> weChatSides = weChatSideService.chatSides(h5);
List<WeChatSide> weChatSides = weChatSideService.chatSides("0");
return getDataTable(weChatSides);
}
......@@ -46,4 +47,14 @@ public class WeChatSideController extends BaseController {
return toAjax(weChatSideService.updateWeChatSide(weChatSide));
}
/**
* 群发侧边栏列表
*/
@GetMapping("/h5List")
public TableDataInfo h5List() {
startPage();
List<WeChatSide> weChatSides = weChatSideService.chatSides("1");
return getDataTable(weChatSides);
}
}
......@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author sxw
* @author danmo
* @description 会话存档controller
* @date 2020/12/19 13:51
**/
......
......@@ -87,10 +87,21 @@ public class WeCustomerMessagePushController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('customerMessagePush:push:pushResults')")
@GetMapping(value = "/pushResults")
public TableDataInfo customerMessagePushResult(@RequestParam(value = "messageId") Long messageId,@RequestParam(value = "status") String status){
public TableDataInfo customerMessagePushResult(@RequestParam(value = "messageId") Long messageId, @RequestParam(value = "status") String status) {
startPage();
List<WeCustomerMessageResultVo> weCustomerMessageResuls = weCustomerMessgaeResultService.customerMessagePushs(messageId, status);
return getDataTable(weCustomerMessageResuls);
}
/**
* 同步消息发送结果
*/
@PreAuthorize("@ss.hasPermi('customerMessagePush:push:asyncResult')")
@PostMapping(value = "asyncResult")
public AjaxResult asyncResult(@RequestParam(value = "msgid") String msgid, @RequestParam(value = "messageId") Long messageId) {
weCustomerMessageOriginalService.asyncResult(msgid, messageId);
return AjaxResult.success();
}
}
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.common.utils.poi.ExcelUtil;
import com.linkwechat.wecom.domain.WeTaskFission;
import com.linkwechat.wecom.service.IWeTaskFissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 任务宝Controller
*
* @author leejoker
* @date 2021-01-20
*/
@RestController
@RequestMapping("/wecom/fission")
public class WeTaskFissionController extends BaseController {
@Autowired
private IWeTaskFissionService weTaskFissionService;
/**
* 查询任务宝列表
*/
@PreAuthorize("@ss.hasPermi('wecom:fission:list')")
@GetMapping("/list")
public TableDataInfo list(WeTaskFission weTaskFission) {
startPage();
List<WeTaskFission> list = weTaskFissionService.selectWeTaskFissionList(weTaskFission);
return getDataTable(list);
}
/**
* 导出任务宝列表
*/
@PreAuthorize("@ss.hasPermi('wecom:fission:export')")
@Log(title = "任务宝", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeTaskFission weTaskFission) {
List<WeTaskFission> list = weTaskFissionService.selectWeTaskFissionList(weTaskFission);
ExcelUtil<WeTaskFission> util = new ExcelUtil<WeTaskFission>(WeTaskFission.class);
return util.exportExcel(list, "fission");
}
/**
* 获取任务宝详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:fission:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(weTaskFissionService.selectWeTaskFissionById(id));
}
/**
* 新增任务宝
*/
@PreAuthorize("@ss.hasPermi('wecom:fission:add')")
@Log(title = "任务宝", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeTaskFission weTaskFission) {
return toAjax(weTaskFissionService.insertWeTaskFission(weTaskFission));
}
/**
* 修改任务宝
*/
@PreAuthorize("@ss.hasPermi('wecom:fission:edit')")
@Log(title = "任务宝", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeTaskFission weTaskFission) {
return toAjax(weTaskFissionService.updateWeTaskFission(weTaskFission));
}
/**
* 删除任务宝
*/
@PreAuthorize("@ss.hasPermi('wecom:fission:remove')")
@Log(title = "任务宝", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(weTaskFissionService.deleteWeTaskFissionByIds(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.common.utils.poi.ExcelUtil;
import com.linkwechat.wecom.domain.WeTaskFissionRecord;
import com.linkwechat.wecom.service.IWeTaskFissionRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 裂变任务完成记录Controller
*
* @author leejoker
* @date 2021-01-20
*/
@RestController
@RequestMapping("/wecom/record")
public class WeTaskFissionRecordController extends BaseController {
@Autowired
private IWeTaskFissionRecordService weTaskFissionRecordService;
/**
* 查询裂变任务完成记录列表
*/
@PreAuthorize("@ss.hasPermi('wecom:record:list')")
@GetMapping("/list")
public TableDataInfo list(WeTaskFissionRecord weTaskFissionRecord) {
startPage();
List<WeTaskFissionRecord> list = weTaskFissionRecordService.selectWeTaskFissionRecordList(weTaskFissionRecord);
return getDataTable(list);
}
/**
* 导出裂变任务完成记录列表
*/
@PreAuthorize("@ss.hasPermi('wecom:record:export')")
@Log(title = "裂变任务完成记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeTaskFissionRecord weTaskFissionRecord) {
List<WeTaskFissionRecord> list = weTaskFissionRecordService.selectWeTaskFissionRecordList(weTaskFissionRecord);
ExcelUtil<WeTaskFissionRecord> util = new ExcelUtil<WeTaskFissionRecord>(WeTaskFissionRecord.class);
return util.exportExcel(list, "record");
}
/**
* 获取裂变任务完成记录详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:record:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(weTaskFissionRecordService.selectWeTaskFissionRecordById(id));
}
/**
* 新增裂变任务完成记录
*/
@PreAuthorize("@ss.hasPermi('wecom:record:add')")
@Log(title = "裂变任务完成记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeTaskFissionRecord weTaskFissionRecord) {
return toAjax(weTaskFissionRecordService.insertWeTaskFissionRecord(weTaskFissionRecord));
}
/**
* 修改裂变任务完成记录
*/
@PreAuthorize("@ss.hasPermi('wecom:record:edit')")
@Log(title = "裂变任务完成记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeTaskFissionRecord weTaskFissionRecord) {
return toAjax(weTaskFissionRecordService.updateWeTaskFissionRecord(weTaskFissionRecord));
}
/**
* 删除裂变任务完成记录
*/
@PreAuthorize("@ss.hasPermi('wecom:record:remove')")
@Log(title = "裂变任务完成记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(weTaskFissionRecordService.deleteWeTaskFissionRecordByIds(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.common.utils.poi.ExcelUtil;
import com.linkwechat.wecom.domain.WeTaskFissionReward;
import com.linkwechat.wecom.service.IWeTaskFissionRewardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 任务裂变奖励Controller
*
* @author leejoker
* @date 2021-01-20
*/
@RestController
@RequestMapping("/wecom/reward")
public class WeTaskFissionRewardController extends BaseController {
@Autowired
private IWeTaskFissionRewardService weTaskFissionRewardService;
/**
* 查询任务裂变奖励列表
*/
@PreAuthorize("@ss.hasPermi('wecom:reward:list')")
@GetMapping("/list")
public TableDataInfo list(WeTaskFissionReward weTaskFissionReward) {
startPage();
List<WeTaskFissionReward> list = weTaskFissionRewardService.selectWeTaskFissionRewardList(weTaskFissionReward);
return getDataTable(list);
}
/**
* 导出任务裂变奖励列表
*/
@PreAuthorize("@ss.hasPermi('wecom:reward:export')")
@Log(title = "任务裂变奖励", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeTaskFissionReward weTaskFissionReward) {
List<WeTaskFissionReward> list = weTaskFissionRewardService.selectWeTaskFissionRewardList(weTaskFissionReward);
ExcelUtil<WeTaskFissionReward> util = new ExcelUtil<WeTaskFissionReward>(WeTaskFissionReward.class);
return util.exportExcel(list, "reward");
}
/**
* 获取任务裂变奖励详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:reward:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(weTaskFissionRewardService.selectWeTaskFissionRewardById(id));
}
/**
* 新增任务裂变奖励
*/
@PreAuthorize("@ss.hasPermi('wecom:reward:add')")
@Log(title = "任务裂变奖励", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeTaskFissionReward weTaskFissionReward) {
return toAjax(weTaskFissionRewardService.insertWeTaskFissionReward(weTaskFissionReward));
}
/**
* 修改任务裂变奖励
*/
@PreAuthorize("@ss.hasPermi('wecom:reward:edit')")
@Log(title = "任务裂变奖励", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeTaskFissionReward weTaskFissionReward) {
return toAjax(weTaskFissionRewardService.updateWeTaskFissionReward(weTaskFissionReward));
}
/**
* 删除任务裂变奖励
*/
@PreAuthorize("@ss.hasPermi('wecom:reward:remove')")
@Log(title = "任务裂变奖励", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(weTaskFissionRewardService.deleteWeTaskFissionRewardByIds(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.common.utils.poi.ExcelUtil;
import com.linkwechat.wecom.domain.WeTaskFissionStaff;
import com.linkwechat.wecom.service.IWeTaskFissionStaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 裂变任务员工列Controller
*
* @author leejoker
* @date 2021-01-20
*/
@RestController
@RequestMapping("/wecom/staff")
public class WeTaskFissionStaffController extends BaseController {
@Autowired
private IWeTaskFissionStaffService weTaskFissionStaffService;
/**
* 查询裂变任务员工列列表
*/
@PreAuthorize("@ss.hasPermi('wecom:staff:list')")
@GetMapping("/list")
public TableDataInfo list(WeTaskFissionStaff weTaskFissionStaff) {
startPage();
List<WeTaskFissionStaff> list = weTaskFissionStaffService.selectWeTaskFissionStaffList(weTaskFissionStaff);
return getDataTable(list);
}
/**
* 导出裂变任务员工列列表
*/
@PreAuthorize("@ss.hasPermi('wecom:staff:export')")
@Log(title = "裂变任务员工列", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeTaskFissionStaff weTaskFissionStaff) {
List<WeTaskFissionStaff> list = weTaskFissionStaffService.selectWeTaskFissionStaffList(weTaskFissionStaff);
ExcelUtil<WeTaskFissionStaff> util = new ExcelUtil<WeTaskFissionStaff>(WeTaskFissionStaff.class);
return util.exportExcel(list, "staff");
}
/**
* 获取裂变任务员工列详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:staff:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(weTaskFissionStaffService.selectWeTaskFissionStaffById(id));
}
/**
* 新增裂变任务员工列
*/
@PreAuthorize("@ss.hasPermi('wecom:staff:add')")
@Log(title = "裂变任务员工列", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeTaskFissionStaff weTaskFissionStaff) {
return toAjax(weTaskFissionStaffService.insertWeTaskFissionStaff(weTaskFissionStaff));
}
/**
* 修改裂变任务员工列
*/
@PreAuthorize("@ss.hasPermi('wecom:staff:edit')")
@Log(title = "裂变任务员工列", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeTaskFissionStaff weTaskFissionStaff) {
return toAjax(weTaskFissionStaffService.updateWeTaskFissionStaff(weTaskFissionStaff));
}
/**
* 删除裂变任务员工列
*/
@PreAuthorize("@ss.hasPermi('wecom:staff:remove')")
@Log(title = "裂变任务员工列", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(weTaskFissionStaffService.deleteWeTaskFissionStaffByIds(ids));
}
}
......@@ -58,10 +58,10 @@ public class WeUserController extends BaseController {
* 获取通讯录相关客户详细信息
*/
@PreAuthorize("@ss.hasPermi('contacts:organization:view')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") String userId)
{
return AjaxResult.success(weUserService.selectWeUserById(id));
return AjaxResult.success(weUserService.selectWeUserById(userId));
}
/**
......@@ -215,6 +215,20 @@ public class WeUserController extends BaseController {
}
/**
* 内部应用获取用户userId
* @param code
* @return
*/
@GetMapping("/getUserInfo")
public AjaxResult getUserInfo(String code)
{
return AjaxResult.success(
weUserService.getUserInfo(code)
);
}
......
......@@ -19,8 +19,8 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 8089
# 服务器的HTTP端口,默认为8090
port: 8090
servlet:
# 应用的访问路径
context-path: /
......@@ -145,7 +145,7 @@ xss:
# elasticsearch配置
elasticsearch:
schema: http
address: ${ES_ADDRESS:localhost}
address: ${ES_ADDRESS:localhost:9200}
connectTimeout: 10000
socketTimeout: 10000
connectionRequestTimeout: 10000
......@@ -200,8 +200,10 @@ wecome:
- /msgaudit/check_single_agree
- /msgaudit/check_room_agree
- /msgaudit/groupchat/get
needAgentTokenUrl:
- /message/send
#企微回调通知配置
callBack:
appIdOrCorpId:
token:
encodingAesKey:
\ No newline at end of file
appIdOrCorpId: ww38152475d1bca752
token: uEyhhuTKfpS
encodingAesKey: diTFQ6B4IW14UN2JplADuhMZsBZHjvuBG24kHFrr4Px
\ No newline at end of file
......@@ -11,7 +11,7 @@ import java.util.ArrayList;
import java.util.List;
/**
* @author sxw
* @author danmo
* @description ElasticSearch 配置
* @date 2020/12/4 9:59
**/
......
......@@ -33,4 +33,6 @@ public class WeComeConfig {
/** 会话存档所需token 的url */
private String[] needChatTokenUrl;
/** 应用所需token 的url **/
private String[] needAgentTokenUrl;
}
......@@ -33,6 +33,10 @@ public class WeConstans {
*/
public static final String WE_CHAT_ACCESS_TOKEN = "we_chat_access_token";
/**
* 应用相关token
*/
public static final String WE_AGENT_ACCESS_TOKEN = "we_agent_access_token";
/**
* 企业微信接口返回成功code
......@@ -250,9 +254,10 @@ public class WeConstans {
put("batch_job_result", "weEventBatchJobResultImpl");
//外部联系人事件
put("change_external_contact", "weEventChangeExternalContactImpl");
//客户群聊事件
//客户群事件
put("change_external_chat", "weEventChangeExternalChatImpl");
//客户标签事件
put("change_external_tag", "weEventChangeExternalTagImpl");
}
};
......
......@@ -3,7 +3,7 @@ package com.linkwechat.common.core.domain;
import lombok.Data;
/**
* @author sxw
* @author danmo
* @description 会话存档接口入参实体
* @date 2020/12/29 14:23
**/
......
......@@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author sxw
* @author danmo
* @description http交互Vo对象
* @date 2020/12/9 14:14
**/
......
......@@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @author sxw
* @author danmo
* @description
* @date 2020/12/9 14:11
**/
......
......@@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @author sxw
* @author danmo
* @description
* @date 2020/12/9 14:18
**/
......
......@@ -40,7 +40,7 @@ import java.util.Map;
import java.util.function.Consumer;
/**
* @author sxw
* @author danmo
* @description es工具类
* @date 2020/12/9 14:02
**/
......
package com.linkwechat.common.enums;
import lombok.Getter;
/**
* @author danmo
* @description 接替失败的原因
* @date 2021/1/20 0:14
**/
@Getter
public enum TransferFailReason {
/**
* 客户拒绝
*/
CUSTOMER_REFUSED(3,"customer_refused", "客户拒绝"),
/**
* 接替成员的客户数达到上限
*/
CUSTOMER_LIMIT_EXCEED(4,"customer_limit_exceed", "接替成员的客户数达到上限");
private int num;
private String name;
private String reason;
TransferFailReason(int num, String name, String reason) {
this.num = num;
this.name = name;
this.reason = reason;
}
public static String getReason(String name){
TransferFailReason[] values = TransferFailReason.values();
for(TransferFailReason transferFailReason:values){
if(transferFailReason.getName().equals(name)){
return transferFailReason.getReason();
}
}
throw new RuntimeException("无对应原因");
}
public static int getNum(String name){
TransferFailReason[] values = TransferFailReason.values();
for(TransferFailReason transferFailReason:values){
if(transferFailReason.getName().equals(name)){
return transferFailReason.getNum();
}
}
throw new RuntimeException("无对应类型");
}
}
......@@ -18,7 +18,7 @@ import java.security.spec.RSAPrivateCrtKeySpec;
import java.util.Base64;
/**
* @author sxw
* @author danmo
* @description
* @date 2020/12/7 23:37
**/
......
......@@ -21,7 +21,7 @@ import java.util.Optional;
import java.util.concurrent.atomic.AtomicLong;
/**
* @author sxw
* @author danmo
* @description
* @date 2020/12/2 16:01
**/
......
......@@ -120,7 +120,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers("/wecom/chat/collection/list").anonymous()
.antMatchers("/wecom/chat/collection/cancleCollection").anonymous()
.antMatchers("/wecom/chat/collection/addCollection").anonymous()
.antMatchers("/wecom/chat/side/list").anonymous()
.antMatchers("/wecom/chat/side/h5List").anonymous()
.antMatchers("/wecom/ticket/**").anonymous()
.antMatchers("/wecom/user/getUserInfo").anonymous()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
......
......@@ -98,4 +98,14 @@ public class RyTask {
});
redisCache.setCacheObject(WeConstans.CONTACT_SEQ_KEY,index);
}
/**
*
* @param corpId 企业id
* @param secret 会话密钥
*/
public void getPermitUserList(String corpId, String secret){
log.info("执行有参方法: params:{},{}", corpId, secret);
}
}
package com.linkwechat.wecom.client;
import com.dtflys.forest.annotation.Body;
import com.dtflys.forest.annotation.DataObject;
import com.dtflys.forest.annotation.Request;
import com.linkwechat.wecom.domain.dto.WeResultDto;
......@@ -40,7 +41,7 @@ public interface WeCropTagClient {
@Request(url = "/externalcontact/get_corp_tag_list",
type = "POST"
)
WeCropGroupTagListDto getCorpTagListByTagIds(@DataObject WeFindCropTagParam weFindCropTagParam);
WeCropGroupTagListDto getCorpTagListByTagIds(@Body WeFindCropTagParam weFindCropTagParam);
/**
......
......@@ -7,7 +7,7 @@ import com.linkwechat.wecom.domain.dto.msgaudit.WeMsgAuditDto;
import com.linkwechat.wecom.domain.vo.WeMsgAuditVo;
/**
* @author sxw
* @author danmo
* @description 会话存档接口
* @date 2020/12/2 16:45
**/
......
......@@ -91,4 +91,13 @@ public interface WeUserClient {
type = "POST"
)
LeaveWeUserListsDto leaveWeUsers();
/**
* 获取访问用户身份(内部应用)
* @param code
* @return
*/
@Request(url = "/user/getuserinfo")
WeUserInfoDto getuserinfo(@Query("code")String code);
}
......@@ -40,5 +40,19 @@ public class WeAllocateCustomer
/** 原跟进成员的userid */
private String handoverUserid;
/**
* 接替状态, 1-接替完毕 2-等待接替 3-客户拒绝 4-接替成员客户达到上限 5-无接替记录
*/
private Integer status;
/**
* 接替客户的时间,如果是等待接替状态,则为未来的自动接替时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date takeoverTime;
/**
* 失败原因
*/
private String failReason;
}
......@@ -61,6 +61,8 @@ public class WeCorpAccount extends BaseEntity
@ApiModelProperty("应用id")
private String agentId;
@ApiModelProperty("应用密钥")
private String agentSecret;
@ApiModelProperty("服务商密钥")
private String providerSecret;
......
......@@ -66,5 +66,11 @@ public class WeGroup {
@TableField(exist = false)
private String userIds;
/**
* 群头像
*/
@TableField(exist = false)
private String avatar;
}
package com.linkwechat.wecom.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 任务宝对象 we_task_fission
*
* @author leejoker
* @date 2021-01-20
*/
@Data
public class WeTaskFission extends BaseEntity {
private static final long serialVersionUID = -6092187482853822532L;
/**
* 主键
*/
private Long id;
/**
* 任务活动名称
*/
@Excel(name = "任务活动名称")
private String taskName;
/**
* 裂变引导语
*/
@Excel(name = "裂变引导语")
private String fissInfo;
/**
* 裂变客户数量
*/
@Excel(name = "裂变客户数量")
private Long fissNum;
/**
* 活动开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "活动开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/**
* 活动结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "活动结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date overTime;
/**
* 客户标签id列表,当为全部时保存为all
*/
@Excel(name = "客户标签id列表,当为全部时保存为all")
private String customerTagId;
/**
* 客户标签名称列表,为all是可为空
*/
@Excel(name = "客户标签名称列表,为all是可为空")
private String customerTag;
/**
* 裂变海报路径
*/
@Excel(name = "裂变海报路径")
private String postersPath;
/**
* 任务裂变目标员工
*/
@Excel(name = "任务裂变目标员工")
private String fissStaffId;
/**
* 任务裂变目标员工姓名
*/
@Excel(name = "任务裂变目标员工姓名")
private String fissStaff;
/**
* 任务裂变目标员工二维码
*/
@Excel(name = "任务裂变目标员工二维码")
private String fissStaffQrcode;
/**
* 兑奖链接
*/
@Excel(name = "兑奖链接")
private String rewardUrl;
/**
* 兑奖链接图片
*/
@Excel(name = "兑奖链接图片")
private String rewardImagePath;
/**
* 兑奖规则
*/
@Excel(name = "兑奖规则")
private String rewardRule;
/**
* 任务裂变活动状态,1 进行中 2 已结束
*/
@Excel(name = "任务裂变活动状态,1 进行中 2 已结束")
private Integer fissStatus;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("taskName", getTaskName())
.append("fissInfo", getFissInfo())
.append("fissNum", getFissNum())
.append("startTime", getStartTime())
.append("overTime", getOverTime())
.append("customerTagId", getCustomerTagId())
.append("customerTag", getCustomerTag())
.append("postersPath", getPostersPath())
.append("fissStaffId", getFissStaffId())
.append("fissStaff", getFissStaff())
.append("fissStaffQrcode", getFissStaffQrcode())
.append("rewardUrl", getRewardUrl())
.append("rewardImagePath", getRewardImagePath())
.append("rewardRule", getRewardRule())
.append("fissStatus", getFissStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 裂变任务完成记录对象 we_task_fission_record
*
* @author leejoker
* @date 2021-01-20
*/
@Data
public class WeTaskFissionRecord extends BaseEntity {
private static final long serialVersionUID = -3547099425154996193L;
/**
* 主键
*/
private Long id;
/**
* 任务裂变表id
*/
@Excel(name = "任务裂变表id")
private Long taskFissionId;
/**
* 发成员工id
*/
@Excel(name = "发成员工id")
private String staffId;
/**
* 裂变客户id
*/
@Excel(name = "裂变客户id")
private String customerId;
/**
* 客户姓名
*/
@Excel(name = "客户姓名")
private String customerName;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("taskFissionId", getTaskFissionId())
.append("staffId", getStaffId())
.append("customerId", getCustomerId())
.append("customerName", getCustomerName())
.toString();
}
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 任务裂变奖励对象 we_task_fission_reward
*
* @author leejoker
* @date 2021-01-20
*/
@Data
public class WeTaskFissionReward extends BaseEntity {
private static final long serialVersionUID = -8385656412785458012L;
/**
* 活动奖励主键
*/
private Long id;
/**
* 任务裂变id
*/
@Excel(name = "任务裂变id")
private Long taskFissionId;
/**
* 兑奖码
*/
@Excel(name = "兑奖码")
private String rewardCode;
/**
* 兑奖码状态,0 未使用 1 已使用
*/
@Excel(name = "兑奖码状态,0 未使用 1 已使用")
private Integer rewardCodeStatus;
/**
* 兑奖用户id
*/
@Excel(name = "兑奖用户id")
private String rewardUserId;
/**
* 兑奖人姓名
*/
@Excel(name = "兑奖人姓名")
private String rewardUser;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("taskFissionId", getTaskFissionId())
.append("rewardCode", getRewardCode())
.append("rewardCodeStatus", getRewardCodeStatus())
.append("rewardUserId", getRewardUserId())
.append("rewardUser", getRewardUser())
.append("createTime", getCreateTime())
.toString();
}
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 裂变任务员工列对象 we_task_fission_staff
*
* @author leejoker
* @date 2021-01-20
*/
@Data
public class WeTaskFissionStaff extends BaseEntity {
private static final long serialVersionUID = -8615355081305655759L;
/**
* 主键
*/
private Long id;
/**
* 任务裂变表id
*/
@Excel(name = "任务裂变表id")
private Long taskFissionId;
/**
* 员工或机构,1 组织机构 2 成员 3 全部
*/
@Excel(name = "员工或机构,1 组织机构 2 成员 3 全部")
private Integer staffType;
/**
* 员工或组织机构id,为全部时为空
*/
@Excel(name = "员工或组织机构id,为全部时为空")
private String staffId;
/**
* 员工或组织机构姓名,类型为全部时,为空
*/
@Excel(name = "员工或组织机构姓名,类型为全部时,为空")
private String staffName;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("taskFissionId", getTaskFissionId())
.append("staffType", getStaffType())
.append("staffId", getStaffId())
.append("staffName", getStaffName())
.toString();
}
}
......@@ -111,6 +111,7 @@ public class WeUser
private Date dimissionTime;
private String remark;
......
package com.linkwechat.wecom.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* @Author: Robin
* @Description:
* @Date: create in 2020/9/21 0021 23:56
*/
@Data
public class WeGroupMemberDto {
private static final long serialVersionUID = 1L;
private String chatId;
private String memberName;
private String memberAvatar;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date joinTime;
/**
* 入群方式: 1 - 由成员邀请入群(直接邀请入群) ; 2 - 由成员邀请入群(通过邀请链接入群); 3 - 通过扫描群二维码入群
*/
private Integer joinScene;
private Integer joinType;
}
......@@ -13,22 +13,22 @@ import java.util.List;
public class WeMessagePushDto {
/**
* 指定接收消息的成员,成员ID列表(多个接收者用‘,’分隔,最多支持1000个)。
* 指定接收消息的成员,成员ID列表(多个接收者用‘|’分隔,最多支持1000个)。
* 特殊情况:指定为”@all”,则向该企业应用的全部成员发送
*/
private List<String> touser;
private String touser;
/**
* 指定接收消息的部门,部门ID列表,多个接收者用‘,’分隔,最多支持100个。
* 指定接收消息的部门,部门ID列表,多个接收者用‘|’分隔,最多支持100个。
* 当touser为”@all”时忽略本参数
*/
private List<String> toparty;
private String toparty;
/**
* 指定接收消息的标签,标签ID列表,多个接收者用‘,’分隔,最多支持100个。
* 指定接收消息的标签,标签ID列表,多个接收者用‘|’分隔,最多支持100个。
* 当touser为”@all”时忽略本参数
*/
private List<String> totag;
private String totag;
/**
* 消息类型,此时固定为:text
......
package com.linkwechat.wecom.domain.dto;
import lombok.Data;
/**
* @description: 用户身份
* @author: HaoN
* @create: 2021-01-20 00:11
**/
@Data
public class WeUserInfoDto extends WeResultDto{
/**
* a) 当用户为企业成员时返回字段
*/
//成员UserID。若需要获得用户详情信息,可调用通讯录接口:读取成员。如果是互联企业或者企业互联,则返回的UserId格式如:CorpId/userid
private String UserId;
/**
* b) 非企业成员时返回字段
*/
//非企业成员的标识,对当前企业唯一。不超过64字节
private String OpenId;
//外部联系人id,当且仅当用户是企业的客户,且跟进人在应用的可见范围内时返回。如果是第三方应用调用,针对同一个客户,同一个服务商不同应用获取到的id相同
private String external_userid;
//手机设备号(由企业微信在安装时随机生成,删除重装会改变,升级不受影响)
private String DeviceId;
}
......@@ -29,7 +29,7 @@ public class ExternalUserDetail extends WeResultDto {
@Data
public static class ExternalContact{
/** 外部联系人userId */
private String external_userid;
private String externalUserid;
/** 外部联系人名称 */
private String name;
/** 外部联系人职位 */
......@@ -37,9 +37,9 @@ public class ExternalUserDetail extends WeResultDto {
/** 外部联系人头像 */
private String avatar;
/** 外部联系人所在企业简称 */
private String corp_name;
private String corpName;
/** 外部联系人所在企业全称 */
private String corp_full_name;
private String corpFullName;
/** 外部联系人的类型,1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户 */
private Integer type;
/** 外部联系人性别 0-未知 1-男性 2-女性 */
......@@ -60,13 +60,13 @@ public class ExternalUserDetail extends WeResultDto {
/**该成员添加此外部联系人的时间*/
private long createtime;
/**该成员对此客户备注的企业名称*/
private String remark_company;
private String remarkCorpName;
/**该成员对此客户备注的手机号码*/
private String[] remark_mobiles;
private String[] remarkMobiles;
/**该成员添加此客户的来源*/
private Integer add_way;
private Integer addWay;
/**发起添加的userid,如果成员主动添加,为成员的userid;如果是客户主动添加,则为客户的外部联系人userid;如果是内部成员共享/管理员分配,则为对应的成员/管理员userid*/
private String oper_userid;
private String operUserid;
/** 企业自定义的state参数,用于区分客户具体是通过哪个「联系我」添加,由企业通过创建「联系我」方式指定 */
private String state;
/**标签**/
......
......@@ -42,7 +42,7 @@ public class CustomerMessagePushDto {
private String settingTime;
/**
* 消息类型 0 文本消息 1 图片消息 2 链接消息 3 小程序消息
* 消息类型 0 文本消息 1 图片消息 2 链接消息 3 小程序消息 4 图文消息
*/
private String messageType;
......
......@@ -9,7 +9,7 @@ import java.util.Date;
import java.util.List;
/**
* @author sxw
* @author danmo
* @description 会话存档
* @date 2020/12/2 16:47
**/
......
......@@ -27,6 +27,7 @@ public class WeCropGroupTagDto {
private String group_id;
private String group_name;
private Integer order;
private Boolean deleted;
private Long create_time;
private List<WeCropTagDto> tag;
......
......@@ -23,6 +23,7 @@ public class WeCropTagDto {
private String id;
private String name;
private String order;
private Boolean deleted;
private Long create_time;
public static List<WeCropTagDto> transFormto(List<WeTag> weTags){
......
......@@ -3,6 +3,8 @@ package com.linkwechat.wecom.domain.dto.tag;
import lombok.Builder;
import lombok.Data;
import java.util.List;
/**
* @description: 获取标签接口参数实体
* @author: HaoN
......@@ -12,4 +14,5 @@ import lombok.Data;
@Builder
public class WeFindCropTagParam {
private String[] tag_id;
private List<String> group_id;
}
......@@ -5,7 +5,7 @@ import lombok.Data;
import java.util.List;
/**
* @author sxw
* @author danmo
* @description 会话存档入参实体
* @date 2020/12/19 12:38
**/
......
package com.linkwechat.wecom.domain.vo;
import lombok.Builder;
import lombok.Data;
/**
* @description: 用户身份相关
* @author: HaoN
* @create: 2021-01-20 00:21
**/
@Data
@Builder
public class WeUserInfoVo {
/**
* a) 当用户为企业成员时返回字段
*/
private String userId;
/**
* b) 非企业成员时返回字段
*/
//非企业成员的标识,对当前企业唯一。不超过64字节
private String openId;
//外部联系人id,当且仅当用户是企业的客户,且跟进人在应用的可见范围内时返回。如果是第三方应用调用,针对同一个客户,同一个服务商不同应用获取到的id相同
private String externalUserId;
//手机设备号(由企业微信在安装时随机生成,删除重装会改变,升级不受影响)
private String deviceId;
}
......@@ -29,6 +29,17 @@ public class WxCpXmlMessageVO extends WxCpXmlMessage {
@XStreamAlias("BatchJob")
private BatchJob batchJob = new BatchJob();
@XStreamAlias("FailReason")
@XStreamConverter(value = XStreamCDataConverter.class)
private String failReason;
@XStreamAlias("TagType")
@XStreamConverter(value = XStreamCDataConverter.class)
private String tagType;
@XStreamAlias("Id")
@XStreamConverter(value = XStreamCDataConverter.class)
private String tagId;
@Data
public static class BatchJob implements Serializable {
......
package com.linkwechat.wecom.factory;
import com.linkwechat.wecom.domain.WeDepartment;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import java.util.Arrays;
/**
* @author danmo
* @description 事件类型策略接口
* @date 2021/1/20 22:00
**/
public abstract class WeEventStrategy {
protected final String tag = "tag";
protected final String tagGroup = "tag_group";
public abstract void eventHandle(WxCpXmlMessageVO message);
//生成成员数据
public WeUser setWeUserData(WxCpXmlMessageVO message) {
WeUser weUser = WeUser.builder().userId(message.getUserId())
.email(message.getEmail())
.name(message.getName())
.alias(message.getAlias())
.gender(message.getGender())
.address(message.getAddress())
.telephone(message.getTelephone())
.mobile(message.getMobile())
.avatarMediaid(message.getAvatar())
.position(message.getPosition())
.build();
if (message.getStatus() != null) {
weUser.setIsActivate(Integer.valueOf(message.getStatus()));
}
if (message.getIsLeaderInDept() != null) {
String[] isLeaderInDeptArr = Arrays.stream(message.getIsLeaderInDept())
.map(String::valueOf).toArray(String[]::new);
weUser.setIsLeaderInDept(isLeaderInDeptArr);
}
if (message.getDepartments() != null) {
String[] departmentsArr = Arrays.stream(message.getDepartments())
.map(String::valueOf).toArray(String[]::new);
weUser.setDepartment(departmentsArr);
}
return weUser;
}
//部门信息
public WeDepartment setWeDepartMent(WxCpXmlMessageVO message){
WeDepartment weDepartment = new WeDepartment();
if (message.getId() != null) {
weDepartment.setId(message.getId());
}
if (message.getName() != null) {
weDepartment.setName(message.getName());
}
if (message.getParentId() != null) {
weDepartment.setParentId(Long.valueOf(message.getParentId()));
}
return weDepartment;
}
}
package com.linkwechat.wecom.factory;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author danmo
* @description 策略工厂
* @date 2021/1/20 22:02
**/
@Service
public class WeStrategyBeanFactory {
@Autowired
private final Map<String, WeEventStrategy> eventStrategyMap = new ConcurrentHashMap<>();
public WeStrategyBeanFactory(Map<String, WeEventStrategy> strategyMap) {
this.eventStrategyMap.clear();
strategyMap.forEach((k, v) -> this.eventStrategyMap.put(k, v));
}
public void getResource(String type, WxCpXmlMessageVO message) {
eventStrategyMap.get(type).eventHandle(message);
}
}
package com.linkwechat.wecom.factory.impl;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.wecom.domain.WeGroupCodeActual;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeCallBackEventFactory;
import com.linkwechat.wecom.service.IWeGroupCodeActualService;
import com.linkwechat.wecom.factory.WeStrategyBeanFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 客户群变更回调事件处理
*/
* @author danmo
* @description 客户群事件
* @date 2021/1/20 1:15
**/
@Service
@Slf4j
public class WeEventChangeExternalChatImpl implements WeCallBackEventFactory {
@Autowired
private IWeGroupCodeActualService weGroupCodeActualService;
private WeStrategyBeanFactory weStrategyBeanFactory;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
String changeType = message.getChangeType();
// 客户群状态变更(群名变更,群成员增加或移除,群主变更,群公告变更)
if (changeType.equals("update")) {
WeGroupCodeActual weGroupCodeActual = weGroupCodeActualService.selectActualCodeByChatId(message.getChatId());
if (StringUtils.isNotNull(weGroupCodeActual))
{
// 扫码次数+1
weGroupCodeActual.setScanCodeTimes(weGroupCodeActual.getScanCodeTimes() + 1);
if (weGroupCodeActual.getScanCodeTimes().equals(weGroupCodeActual.getScanCodeTimesLimit()))
{
weGroupCodeActual.setStatus(WeConstans.WE_GROUP_CODE_DISABLE.longValue());
log.info("客户群 " + weGroupCodeActual.getGroupName() + " 二维码扫描次数已达上限");
}
weGroupCodeActualService.updateWeGroupCodeActual(weGroupCodeActual);
}
}
weStrategyBeanFactory.getResource(changeType,message);
}
}
package com.linkwechat.wecom.factory.impl;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeCallBackEventFactory;
import com.linkwechat.wecom.factory.WeStrategyBeanFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author danmo
* @description 客户标签事件
* @date 2021/1/20 1:13
**/
@Service
@Slf4j
public class WeEventChangeExternalTagImpl implements WeCallBackEventFactory {
@Autowired
private WeStrategyBeanFactory weStrategyBeanFactory;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
String changeType = message.getChangeType()+"CustomerTag";
weStrategyBeanFactory.getResource(changeType,message);
}
}
package com.linkwechat.wecom.factory.impl.customer;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.enums.MediaType;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.common.utils.Threads;
import com.linkwechat.wecom.domain.WeEmpleCodeTag;
import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
import com.linkwechat.wecom.domain.dto.WeEmpleCodeDto;
import com.linkwechat.wecom.domain.dto.WeMediaDto;
import com.linkwechat.wecom.domain.dto.WeWelcomeMsg;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
/**
* @author danmo
* @description 新增客户事件
* @date 2021/1/20 23:18
**/
@Slf4j
@Component("add_external_contact")
public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
@Autowired
private IWeCustomerService weCustomerService;
@Autowired
private IWeEmpleCodeTagService weEmpleCodeTagService;
@Autowired
private IWeEmpleCodeService weEmpleCodeService;
@Autowired
private IWeFlowerCustomerRelService weFlowerCustomerRelService;
@Autowired
private IWeFlowerCustomerTagRelService weFlowerCustomerTagRelService;
@Autowired
private IWeMaterialService weMaterialService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
if (message.getExternalUserId() != null) {
weCustomerService.getCustomersInfoAndSynchWeCustomer(message.getExternalUserId());
}
//向扫码客户发送欢迎语
if (message.getState() != null && message.getWelcomeCode() != null) {
log.info("执行发送欢迎语>>>>>>>>>>>>>>>");
WeWelcomeMsg.WeWelcomeMsgBuilder weWelcomeMsgBuilder = WeWelcomeMsg.builder().welcome_code(message.getWelcomeCode());
WeEmpleCodeDto messageMap = weEmpleCodeService.selectWelcomeMsgByActivityScene(message.getState(),message.getUserId());
String empleCodeId = messageMap.getEmpleCodeId();
//查询活码对应标签
List<WeEmpleCodeTag> tagList = weEmpleCodeTagService.list(new LambdaQueryWrapper<WeEmpleCodeTag>()
.eq(WeEmpleCodeTag::getEmpleCodeId, empleCodeId));
//查询外部联系人与通讯录关系数据
WeFlowerCustomerRel weFlowerCustomerRel = weFlowerCustomerRelService.getOne(new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getUserId, message.getUserId())
.eq(WeFlowerCustomerRel::getExternalUserid, message.getExternalUserId()));
//为外部联系人添加员工活码标签
List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels = new ArrayList<>();
Optional.ofNullable(weFlowerCustomerRel).ifPresent(weFlowerCustomerRel1 -> {
Optional.ofNullable(tagList).orElseGet(ArrayList::new).forEach(tag ->{
weFlowerCustomerTagRels.add(
WeFlowerCustomerTagRel.builder()
.flowerCustomerRelId(weFlowerCustomerRel.getId())
.tagId(tag.getTagId())
.createTime(new Date())
.build()
);
});
weFlowerCustomerTagRelService.saveOrUpdateBatch(weFlowerCustomerTagRels);
});
log.debug(">>>>>>>>>欢迎语查询结果:{}", JSONObject.toJSONString(messageMap));
if (messageMap != null) {
if (StringUtils.isNotEmpty(messageMap.getWelcomeMsg())){
weWelcomeMsgBuilder.text(WeWelcomeMsg.Text.builder()
.content(messageMap.getWelcomeMsg()).build());
}
if(StringUtils.isNotEmpty(messageMap.getCategoryId())){
WeMediaDto weMediaDto = weMaterialService
.uploadTemporaryMaterial(messageMap.getMaterialUrl(),messageMap.getMaterialName(), MediaType.IMAGE.getMediaType());
Optional.ofNullable(weMediaDto).ifPresent(media ->{
weWelcomeMsgBuilder.image(WeWelcomeMsg.Image.builder().media_id(media.getMedia_id())
.pic_url(media.getUrl()).build());
});
}
weCustomerService.sendWelcomeMsg(weWelcomeMsgBuilder.build());
}
}
} catch (Exception e) {
e.printStackTrace();
log.error("执行发送欢迎语失败!",e);
}
}
}
package com.linkwechat.wecom.factory.impl.customer;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.enums.MediaType;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.wecom.domain.WeEmpleCodeTag;
import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
import com.linkwechat.wecom.domain.dto.WeEmpleCodeDto;
import com.linkwechat.wecom.domain.dto.WeMediaDto;
import com.linkwechat.wecom.domain.dto.WeWelcomeMsg;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
/**
* @author danmo
* @description 外部联系人免验证添加成员事件
* @date 2021/1/20 23:28
**/
@Slf4j
@Component("add_half_external_contact")
public class WeCallBackAddHalfExternalContactImpl extends WeEventStrategy {
@Autowired
private IWeCustomerService weCustomerService;
@Autowired
private IWeEmpleCodeTagService weEmpleCodeTagService;
@Autowired
private IWeEmpleCodeService weEmpleCodeService;
@Autowired
private IWeFlowerCustomerRelService weFlowerCustomerRelService;
@Autowired
private IWeFlowerCustomerTagRelService weFlowerCustomerTagRelService;
@Autowired
private IWeMaterialService weMaterialService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
if (message.getExternalUserId() != null) {
weCustomerService.getCustomersInfoAndSynchWeCustomer(message.getExternalUserId());
}
//向扫码客户发送欢迎语
if (message.getState() != null && message.getWelcomeCode() != null) {
log.info("执行发送欢迎语>>>>>>>>>>>>>>>");
WeWelcomeMsg.WeWelcomeMsgBuilder weWelcomeMsgBuilder = WeWelcomeMsg.builder().welcome_code(message.getWelcomeCode());
WeEmpleCodeDto messageMap = weEmpleCodeService.selectWelcomeMsgByActivityScene(message.getState(),message.getUserId());
String empleCodeId = messageMap.getEmpleCodeId();
//查询活码对应标签
List<WeEmpleCodeTag> tagList = weEmpleCodeTagService.list(new LambdaQueryWrapper<WeEmpleCodeTag>()
.eq(WeEmpleCodeTag::getEmpleCodeId, empleCodeId));
//查询外部联系人与通讯录关系数据
WeFlowerCustomerRel weFlowerCustomerRel = weFlowerCustomerRelService.getOne(new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getUserId, message.getUserId())
.eq(WeFlowerCustomerRel::getExternalUserid, message.getExternalUserId()));
//为外部联系人添加员工活码标签
List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels = new ArrayList<>();
Optional.ofNullable(weFlowerCustomerRel).ifPresent(weFlowerCustomerRel1 -> {
Optional.ofNullable(tagList).orElseGet(ArrayList::new).forEach(tag ->{
weFlowerCustomerTagRels.add(
WeFlowerCustomerTagRel.builder()
.flowerCustomerRelId(weFlowerCustomerRel.getId())
.tagId(tag.getTagId())
.createTime(new Date())
.build()
);
});
weFlowerCustomerTagRelService.saveOrUpdateBatch(weFlowerCustomerTagRels);
});
log.debug(">>>>>>>>>欢迎语查询结果:{}", JSONObject.toJSONString(messageMap));
if (messageMap != null) {
if (StringUtils.isNotEmpty(messageMap.getWelcomeMsg())){
weWelcomeMsgBuilder.text(WeWelcomeMsg.Text.builder()
.content(messageMap.getWelcomeMsg()).build());
}
if(StringUtils.isNotEmpty(messageMap.getCategoryId())){
WeMediaDto weMediaDto = weMaterialService
.uploadTemporaryMaterial(messageMap.getMaterialUrl(),messageMap.getMaterialName(), MediaType.IMAGE.getMediaType());
Optional.ofNullable(weMediaDto).ifPresent(media ->{
weWelcomeMsgBuilder.image(WeWelcomeMsg.Image.builder().media_id(media.getMedia_id())
.pic_url(media.getUrl()).build());
});
}
weCustomerService.sendWelcomeMsg(weWelcomeMsgBuilder.build());
}
}
} catch (Exception e) {
e.printStackTrace();
log.error("执行发送欢迎语失败!",e);
}
}
}
package com.linkwechat.wecom.factory.impl.customer;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeCustomerService;
import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 删除企业客户事件
* @date 2021/1/20 23:33
**/
@Slf4j
@Component("del_external_contact")
public class WeCallBackDelExternalContactImpl extends WeEventStrategy {
@Autowired
private IWeCustomerService weCustomerService;
@Autowired
private IWeFlowerCustomerRelService weFlowerCustomerRelService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
if (message.getExternalUserId() != null) {
weCustomerService.deleteCustomersByEid(message.getExternalUserId());
weFlowerCustomerRelService.deleteFollowUser(message.getUserId(),message.getExternalUserId());
}
}
}
package com.linkwechat.wecom.factory.impl.customer;
import com.alibaba.fastjson.JSONObject;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.enums.MessageType;
import com.linkwechat.wecom.client.WeMessagePushClient;
import com.linkwechat.wecom.domain.WeCorpAccount;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.dto.WeMessagePushDto;
import com.linkwechat.wecom.domain.dto.message.TextMessageDto;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeCorpAccountService;
import com.linkwechat.wecom.service.IWeCustomerService;
import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @author danmo
* @description 删除跟进成员事件
* @date 2021/1/20 23:36
**/
@Slf4j
@Component("del_follow_user")
public class WeCallBackDelFollowUserImpl extends WeEventStrategy {
@Autowired
private IWeCustomerService weCustomerService;
@Autowired
private IWeFlowerCustomerRelService weFlowerCustomerRelService;
@Autowired
private IWeCorpAccountService weCorpAccountService;
@Autowired
private WeMessagePushClient weMessagePushClient;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
if (message.getUserId() != null && message.getExternalUserId() != null) {
weFlowerCustomerRelService.deleteFollowUser(message.getUserId(), message.getExternalUserId());
WeCorpAccount validWeCorpAccount = weCorpAccountService.findValidWeCorpAccount();
Optional.ofNullable(validWeCorpAccount).ifPresent(weCorpAccount -> {
String customerChurnNoticeSwitch = weCorpAccount.getCustomerChurnNoticeSwitch();
if (WeConstans.DEL_FOLLOW_USER_SWITCH_OPEN.equals(customerChurnNoticeSwitch)){
WeCustomer weCustomer = weCustomerService.selectWeCustomerById(message.getExternalUserId());
String content = "您已经被客户@"+weCustomer.getName()+"删除!" ;
TextMessageDto textMessageDto = new TextMessageDto();
textMessageDto.setContent(content);
WeMessagePushDto weMessagePushDto = new WeMessagePushDto();
weMessagePushDto.setMsgtype(MessageType.TEXT.getMessageType());
weMessagePushDto.setTouser(message.getUserId());
weMessagePushDto.setText(textMessageDto);
Optional.ofNullable(validWeCorpAccount).map(WeCorpAccount::getAgentId).ifPresent(agentId -> {
weMessagePushDto.setAgentid(Integer.valueOf(agentId));
});
weMessagePushClient.sendMessageToUser(weMessagePushDto);
}
});
}
} catch (Exception e) {
e.printStackTrace();
log.error("del_follow_user>>>>>>>>>>>>>param:{},ex:{}", JSONObject.toJSONString(message),e);
}
}
}
package com.linkwechat.wecom.factory.impl.customer;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 编辑客户事件
* @date 2021/1/20 23:25
**/
@Slf4j
@Component("edit_external_contact")
public class WeCallBackEditExternalContactImpl extends WeEventStrategy {
@Autowired
private IWeCustomerService weCustomerService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
if (message.getExternalUserId() != null) {
weCustomerService.getCustomersInfoAndSynchWeCustomer(message.getExternalUserId());
}
}
}
package com.linkwechat.wecom.factory.impl.customer;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.wecom.client.WeMessagePushClient;
import com.linkwechat.wecom.domain.WeChatContactMapping;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 客户同意进行聊天内容存档事件回调
* @date 2021/1/21 1:24
**/
@Slf4j
@Component("msg_audit_approved")
public class WeCallBackMsgAuditApprovedImpl extends WeEventStrategy {
@Autowired
private IWeCustomerService weCustomerService;
@Autowired
private IWeChatContactMappingService weChatContactMappingService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
String userId = message.getUserId();
String externalUserId = message.getExternalUserId();
WeChatContactMapping fromMapping = new WeChatContactMapping();
fromMapping.setFromId(userId);
fromMapping.setReceiveId(externalUserId);
fromMapping.setIsCustom(WeConstans.ID_TYPE_EX);
weChatContactMappingService.insertWeChatContactMapping(fromMapping);
WeChatContactMapping receiveMapping = new WeChatContactMapping();
receiveMapping.setFromId(externalUserId);
receiveMapping.setReceiveId(userId);
receiveMapping.setIsCustom(WeConstans.ID_TYPE_USER);
weChatContactMappingService.insertWeChatContactMapping(receiveMapping);
weCustomerService.updateCustomerChatStatus(externalUserId);
}
}
\ No newline at end of file
package com.linkwechat.wecom.factory.impl.customer;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.enums.TransferFailReason;
import com.linkwechat.wecom.domain.WeAllocateCustomer;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeAllocateCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 客户接替失败事件
* @date 2021/1/20 23:41
**/
@Slf4j
@Component("transfer_fail")
public class WeCallbackTransferFailImpl extends WeEventStrategy {
@Autowired
private IWeAllocateCustomerService iWeAllocateCustomerService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
String userId = message.getUserId();
String externalUserId = message.getExternalUserId();
String failReason = message.getFailReason();
WeAllocateCustomer weAllocateCustomer = WeAllocateCustomer.builder().failReason(TransferFailReason.getReason(failReason))
.status(TransferFailReason.getNum(failReason)).build();
iWeAllocateCustomerService.update(weAllocateCustomer,new LambdaQueryWrapper<WeAllocateCustomer>().eq(WeAllocateCustomer::getTakeoverUserid,userId)
.eq(WeAllocateCustomer::getExternalUserid,externalUserId));
}
}
package com.linkwechat.wecom.factory.impl.customergroup;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeGroupService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 客户群创建事件
* @date 2021/1/20 0:28
**/
@Slf4j
@Component("create")
public class WeCallBackCreateGroupImpl extends WeEventStrategy {
@Autowired
private IWeGroupService weGroupService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weGroupService.createWeGroup(message.getChatId());
} catch (Exception e) {
e.printStackTrace();
log.error("create>>>>>>>>>param:{},ex:{}",message.getChatId(),e);
}
}
}
package com.linkwechat.wecom.factory.impl.customergroup;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeGroupService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 客户群解散事件
* @date 2021/1/20 1:07
**/
@Slf4j
@Component("dismiss")
public class WeCallBackDismissImpl extends WeEventStrategy {
@Autowired
private IWeGroupService weGroupService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weGroupService.deleteWeGroup(message.getChatId());
} catch (Exception e) {
e.printStackTrace();
log.error("dismiss>>>>>>>>>param:{},ex:{}",message.getChatId(),e);
}
}
}
package com.linkwechat.wecom.factory.impl.customergroup;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeGroupService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 客户群变更事件
* @date 2021/1/20 0:39
**/
@Slf4j
@Component("update")
public class WeCallBackUpdateGroupImpl extends WeEventStrategy {
@Autowired
private IWeGroupService weGroupService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weGroupService.updateWeGroup(message.getChatId());
} catch (Exception e) {
e.printStackTrace();
log.error("update>>>>>>>>>param:{},ex:{}",message.getChatId(),e);
}
}
}
package com.linkwechat.wecom.factory.impl.party;
import com.linkwechat.wecom.domain.WeDepartment;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeDepartmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 创建部门事件
* @date 2021/1/20 22:54
**/
@Slf4j
@Component("create_party")
public class WeCallBackCreatePartyImpl extends WeEventStrategy {
@Autowired
private IWeDepartmentService weDepartmentService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weDepartmentService.insertWeDepartmentNoToWeCom(setWeDepartMent(message));
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
}
package com.linkwechat.wecom.factory.impl.party;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeDepartmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 删除部门事件
* @date 2021/1/20 23:04
**/
@Slf4j
@Component("delete_party")
public class WeCallBackDeletePartyImpl extends WeEventStrategy {
@Autowired
private IWeDepartmentService weDepartmentService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weDepartmentService.removeById(message.getId());
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
}
package com.linkwechat.wecom.factory.impl.party;
import com.linkwechat.wecom.domain.WeDepartment;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeDepartmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 修改部门事件
* @date 2021/1/20 23:00
**/
@Slf4j
@Component("update_party")
public class WeCallBackUpdatePartyImpl extends WeEventStrategy {
@Autowired
private IWeDepartmentService weDepartmentService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weDepartmentService.updateById(setWeDepartMent(message));
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
}
package com.linkwechat.wecom.factory.impl.tag;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeTagGroupService;
import com.linkwechat.wecom.service.IWeTagService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 创建标签事件
* @date 2021/1/21 1:18
**/
@Slf4j
@Component("createCustomerTag")
public class WeCallBackCreateCustomerTagImpl extends WeEventStrategy {
@Autowired
private IWeTagGroupService weTagGroupService;
@Autowired
private IWeTagService weTagService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
switch (message.getTagType()){
case tagGroup:
weTagGroupService.createTagGroup(message.getTagId());
break;
case tag:
weTagService.creatTag(message.getTagId());
break;
default:
break;
}
} catch (Exception e) {
e.printStackTrace();
log.error("createCustomerTag>>>>>>>>>param:{},ex:{}",message.getId(),e);
}
}
}
package com.linkwechat.wecom.factory.impl.tag;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeTagGroupService;
import com.linkwechat.wecom.service.IWeTagService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 企业客户标签删除事件
* @date 2021/1/21 1:18
**/
@Slf4j
@Component("deleteCustomerTag")
public class WeCallBackDeleteCustomerTagImpl extends WeEventStrategy {
@Autowired
private IWeTagGroupService weTagGroupService;
@Autowired
private IWeTagService weTagService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
switch (message.getTagType()){
case tagGroup:
weTagGroupService.deleteTagGroup(message.getTagId());
break;
case tag:
weTagService.deleteTag(message.getTagId());
break;
default:
break;
}
} catch (Exception e) {
e.printStackTrace();
log.error("deleteCustomerTag>>>>>>>>>param:{},ex:{}",message.getId(),e);
}
}
}
package com.linkwechat.wecom.factory.impl.tag;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeTagGroupService;
import com.linkwechat.wecom.service.IWeTagService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 企业客户标签变更事件
* @date 2021/1/21 1:21
**/
@Slf4j
@Component("updateCustomerTag")
public class WeCallBackUpdateCustomerTagImpl extends WeEventStrategy {
@Autowired
private IWeTagGroupService weTagGroupService;
@Autowired
private IWeTagService weTagService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
switch (message.getTagType()){
case tagGroup:
weTagGroupService.updateTagGroup(message.getTagId());
break;
case tag:
weTagService.updateTag(message.getTagId());
break;
default:
break;
}
} catch (Exception e) {
e.printStackTrace();
log.error("updateCustomerTag>>>>>>>>>param:{},ex:{}",message.getId(),e);
}
}
}
package com.linkwechat.wecom.factory.impl.tag;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
import com.linkwechat.wecom.service.IWeFlowerCustomerTagRelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @author danmo
* @description 标签变更事件
* @date 2021/1/20 23:10
**/
@Slf4j
@Component("update_tag")
public class WeCallBackUpdateUserTagImpl extends WeEventStrategy {
@Autowired
private IWeFlowerCustomerTagRelService weFlowerCustomerTagRelService;
@Autowired
private IWeFlowerCustomerRelService weFlowerCustomerRelService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
String tagId = message.getTagId();
//标签中新增的成员userid列表,用逗号分隔
List<String> addUserItemsList = Arrays.stream(Optional.ofNullable(message.getAddUserItems())
.orElse("").split(",")).collect(Collectors.toList());
//标签中删除的成员userid列表,用逗号分隔
List<String> delUserItemsList = Arrays.stream(Optional.ofNullable(message.getDelUserItems())
.orElse("").split(",")).collect(Collectors.toList());
//标签中新增的成员userid列表,建立关联
List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels = new ArrayList<>();
LambdaQueryWrapper<WeFlowerCustomerRel> relLambdaQueryWrapper = new LambdaQueryWrapper<>();
relLambdaQueryWrapper.in(WeFlowerCustomerRel::getUserId, addUserItemsList);
List<WeFlowerCustomerRel> flowerCustomerRelList = weFlowerCustomerRelService.list(relLambdaQueryWrapper);
List<Long> idList = Optional.ofNullable(flowerCustomerRelList).orElseGet(ArrayList::new)
.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList());
idList.forEach(id -> {
weFlowerCustomerTagRels.add(WeFlowerCustomerTagRel.builder().flowerCustomerRelId(id)
.tagId(tagId)
.build());
});
weFlowerCustomerTagRelService.batchInsetWeFlowerCustomerTagRel(weFlowerCustomerTagRels);
//当前标签对应成员列表
LambdaQueryWrapper<WeFlowerCustomerTagRel> tagRelLambdaQueryWrapper = new LambdaQueryWrapper<>();
tagRelLambdaQueryWrapper.eq(WeFlowerCustomerTagRel::getTagId, tagId);
List<WeFlowerCustomerTagRel> tagRelList = weFlowerCustomerTagRelService.list(tagRelLambdaQueryWrapper);
List<Long> flowerCustomerRelIdList = Optional.ofNullable(tagRelList).orElseGet(ArrayList::new)
.stream().map(WeFlowerCustomerTagRel::getFlowerCustomerRelId).collect(Collectors.toList());
if (!flowerCustomerRelIdList.isEmpty()) {
LambdaQueryWrapper<WeFlowerCustomerRel> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(WeFlowerCustomerRel::getId, flowerCustomerRelIdList)
.in(WeFlowerCustomerRel::getUserId, delUserItemsList);
List<WeFlowerCustomerRel> relList = weFlowerCustomerRelService.list(queryWrapper);
List<Long> relIdList = Optional.ofNullable(relList).orElseGet(ArrayList::new)
.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList());
//标签中删除的成员userid列表
LambdaQueryWrapper<WeFlowerCustomerTagRel> tagRelQueryWrapper = new LambdaQueryWrapper<>();
tagRelQueryWrapper.in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, relIdList);
weFlowerCustomerTagRelService.remove(tagRelQueryWrapper);
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
}
package com.linkwechat.wecom.factory.impl.user;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 新建外部联系人事件
* @date 2021/1/20 22:19
**/
@Slf4j
@Component("create_user")
public class WeCallBackCreateUserImpl extends WeEventStrategy {
@Autowired
private IWeUserService weUserService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weUserService.insertWeUserNoToWeCom(setWeUserData(message));
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
}
package com.linkwechat.wecom.factory.impl.user;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 删除成员事件
* @date 2021/1/20 22:44
**/
@Slf4j
@Component("delete_user")
public class WeCallBackDeleteUserImpl extends WeEventStrategy {
@Autowired
private IWeUserService weUserService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weUserService.deleteUserNoToWeCom(message.getUserId());
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
}
package com.linkwechat.wecom.factory.impl.user;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author danmo
* @description 成员更新事件
* @date 2021/1/20 22:28
**/
@Slf4j
@Component("update_user")
public class WeCallBackUpdateUserImpl extends WeEventStrategy {
@Autowired
private IWeUserService weUserService;
@Override
public void eventHandle(WxCpXmlMessageVO message) {
try {
weUserService.updateWeUserNoToWeCom(setWeUserData(message));
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
}
......@@ -62,9 +62,14 @@ public class WeAccessTokenInterceptor implements Interceptor{
token=iWeAccessTokenService.findProviderAccessToken();
}else if(Arrays.asList(weComeConfig.getNeedChatTokenUrl()).contains(uri)){ //需要会话存档token
token=iWeAccessTokenService.findChatAccessToken();
}else if(Arrays.asList(weComeConfig.getNeedAgentTokenUrl()).contains(uri)){ //需要应用token
token=iWeAccessTokenService.findAgentAccessToken();
}else{
token=iWeAccessTokenService.findCommonAccessToken();
}
if (uri.contains("ticket/get")){
request.addQuery("type","agent_config");
}
request.addQuery("access_token",token);
}
......
......@@ -46,6 +46,6 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public List<WeChatSideVo> findCollections(Long userId);
public List<WeChatSideVo> findCollections(@Param("userId") Long userId,@Param("keyword") String keyword);
}
......@@ -10,12 +10,14 @@ import java.util.List;
/**
* 聊天工具侧边栏
*
* @author kewen
*/
public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
/**
* 批量添加侧边栏素材
*
* @param items 侧边栏素材列表
* @return 结果
*/
......@@ -23,6 +25,7 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
/**
* 删除侧边栏素材
*
* @param sideId 侧边栏id
* @return 结果
*/
......@@ -32,8 +35,9 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
/**
* h5素材列表
*
* @param sideId 侧边栏id
* @param sideId 侧边栏id
* @param keyword 关键词
* @return
*/
public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId);
public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId, @Param("keyword") String keyword);
}
......@@ -2,6 +2,7 @@ package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeGroupMember;
import com.linkwechat.wecom.domain.dto.WeGroupMemberDto;
import java.util.List;
......@@ -15,6 +16,8 @@ public interface WeGroupMemberMapper extends BaseMapper<WeGroupMember> {
List<WeGroupMember> selectWeGroupMemberList(WeGroupMember paramWeGroupMember);
List<WeGroupMemberDto> selectWeGroupMemberListByChatId(String chatId);
// int insertWeGroupMember(WeGroupMember paramWeGroupMember);
//
// int updateWeGroupMember(WeGroupMember paramWeGroupMember);
......
......@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeTag;
import org.apache.ibatis.annotations.Param;
/**
* 企业微信标签Mapper接口
......@@ -51,7 +52,7 @@ public interface WeTagMapper extends BaseMapper<WeTag>
* @param id 企业微信标签ID
* @return 结果
*/
public int deleteWeTagById(Long id);
public int deleteWeTagById(@Param("id") String id);
/**
* 批量删除企业微信标签
......@@ -59,7 +60,7 @@ public interface WeTagMapper extends BaseMapper<WeTag>
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeTagByIds(Long[] ids);
public int deleteWeTagByIds(@Param("ids") String[] ids);
/**
......
package com.linkwechat.wecom.mapper;
import com.linkwechat.wecom.domain.WeTaskFission;
import java.util.List;
/**
* 任务宝Mapper接口
*
* @author leejoker
* @date 2021-01-20
*/
public interface WeTaskFissionMapper {
/**
* 查询任务宝
*
* @param id 任务宝ID
* @return 任务宝
*/
public WeTaskFission selectWeTaskFissionById(Long id);
/**
* 查询任务宝列表
*
* @param weTaskFission 任务宝
* @return 任务宝集合
*/
public List<WeTaskFission> selectWeTaskFissionList(WeTaskFission weTaskFission);
/**
* 新增任务宝
*
* @param weTaskFission 任务宝
* @return 结果
*/
public int insertWeTaskFission(WeTaskFission weTaskFission);
/**
* 修改任务宝
*
* @param weTaskFission 任务宝
* @return 结果
*/
public int updateWeTaskFission(WeTaskFission weTaskFission);
/**
* 删除任务宝
*
* @param id 任务宝ID
* @return 结果
*/
public int deleteWeTaskFissionById(Long id);
/**
* 批量删除任务宝
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeTaskFissionByIds(Long[] ids);
}
package com.linkwechat.wecom.mapper;
import com.linkwechat.wecom.domain.WeTaskFissionRecord;
import java.util.List;
/**
* 裂变任务完成记录Mapper接口
*
* @author leejoker
* @date 2021-01-20
*/
public interface WeTaskFissionRecordMapper {
/**
* 查询裂变任务完成记录
*
* @param id 裂变任务完成记录ID
* @return 裂变任务完成记录
*/
public WeTaskFissionRecord selectWeTaskFissionRecordById(Long id);
/**
* 查询裂变任务完成记录列表
*
* @param weTaskFissionRecord 裂变任务完成记录
* @return 裂变任务完成记录集合
*/
public List<WeTaskFissionRecord> selectWeTaskFissionRecordList(WeTaskFissionRecord weTaskFissionRecord);
/**
* 新增裂变任务完成记录
*
* @param weTaskFissionRecord 裂变任务完成记录
* @return 结果
*/
public int insertWeTaskFissionRecord(WeTaskFissionRecord weTaskFissionRecord);
/**
* 修改裂变任务完成记录
*
* @param weTaskFissionRecord 裂变任务完成记录
* @return 结果
*/
public int updateWeTaskFissionRecord(WeTaskFissionRecord weTaskFissionRecord);
/**
* 删除裂变任务完成记录
*
* @param id 裂变任务完成记录ID
* @return 结果
*/
public int deleteWeTaskFissionRecordById(Long id);
/**
* 批量删除裂变任务完成记录
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeTaskFissionRecordByIds(Long[] ids);
}
package com.linkwechat.wecom.mapper;
import com.linkwechat.wecom.domain.WeTaskFissionReward;
import java.util.List;
/**
* 任务裂变奖励Mapper接口
*
* @author leejoker
* @date 2021-01-20
*/
public interface WeTaskFissionRewardMapper {
/**
* 查询任务裂变奖励
*
* @param id 任务裂变奖励ID
* @return 任务裂变奖励
*/
public WeTaskFissionReward selectWeTaskFissionRewardById(Long id);
/**
* 查询任务裂变奖励列表
*
* @param weTaskFissionReward 任务裂变奖励
* @return 任务裂变奖励集合
*/
public List<WeTaskFissionReward> selectWeTaskFissionRewardList(WeTaskFissionReward weTaskFissionReward);
/**
* 新增任务裂变奖励
*
* @param weTaskFissionReward 任务裂变奖励
* @return 结果
*/
public int insertWeTaskFissionReward(WeTaskFissionReward weTaskFissionReward);
/**
* 修改任务裂变奖励
*
* @param weTaskFissionReward 任务裂变奖励
* @return 结果
*/
public int updateWeTaskFissionReward(WeTaskFissionReward weTaskFissionReward);
/**
* 删除任务裂变奖励
*
* @param id 任务裂变奖励ID
* @return 结果
*/
public int deleteWeTaskFissionRewardById(Long id);
/**
* 批量删除任务裂变奖励
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeTaskFissionRewardByIds(Long[] ids);
}
package com.linkwechat.wecom.mapper;
import com.linkwechat.wecom.domain.WeTaskFissionStaff;
import java.util.List;
/**
* 裂变任务员工列Mapper接口
*
* @author leejoker
* @date 2021-01-20
*/
public interface WeTaskFissionStaffMapper {
/**
* 查询裂变任务员工列
*
* @param id 裂变任务员工列ID
* @return 裂变任务员工列
*/
public WeTaskFissionStaff selectWeTaskFissionStaffById(Long id);
/**
* 查询裂变任务员工列列表
*
* @param weTaskFissionStaff 裂变任务员工列
* @return 裂变任务员工列集合
*/
public List<WeTaskFissionStaff> selectWeTaskFissionStaffList(WeTaskFissionStaff weTaskFissionStaff);
/**
* 新增裂变任务员工列
*
* @param weTaskFissionStaff 裂变任务员工列
* @return 结果
*/
public int insertWeTaskFissionStaff(WeTaskFissionStaff weTaskFissionStaff);
/**
* 修改裂变任务员工列
*
* @param weTaskFissionStaff 裂变任务员工列
* @return 结果
*/
public int updateWeTaskFissionStaff(WeTaskFissionStaff weTaskFissionStaff);
/**
* 删除裂变任务员工列
*
* @param id 裂变任务员工列ID
* @return 结果
*/
public int deleteWeTaskFissionStaffById(Long id);
/**
* 批量删除裂变任务员工列
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeTaskFissionStaffByIds(Long[] ids);
}
......@@ -20,10 +20,10 @@ public interface WeUserMapper extends BaseMapper<WeUser>
/**
* 查询通讯录相关客户
*
* @param id 通讯录相关客户ID
* @param userId 通讯录相关客户ID
* @return 通讯录相关客户
*/
public WeUser selectWeUserById(Long id);
public WeUser selectWeUserById(String userId);
/**
* 查询通讯录相关客户列表
......
......@@ -18,4 +18,6 @@ public interface IWeAccessTokenService {
public String findChatAccessToken();
public void removeToken();
String findAgentAccessToken();
}
\ No newline at end of file
......@@ -37,6 +37,6 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public List<WeChatSideVo> collections(Long userId);
public List<WeChatSideVo> collections(Long userId,String keyword);
}
......@@ -27,6 +27,6 @@ public interface IWeChatItemService extends IService<WeChatItem> {
* @param sideId 侧边栏id
* @return
*/
public List<WeChatSideVo> chatItems(Long sideId);
public List<WeChatSideVo> chatItems(Long sideId,String keyword);
}
......@@ -7,7 +7,7 @@ import com.linkwechat.common.core.domain.ConversationArchiveQuery;
import java.util.List;
/**
* @author sxw
* @author danmo
* @description 会话存档业务接口
* @date 2020/12/19 13:59
**/
......
......@@ -40,4 +40,12 @@ public interface IWeCustomerMessageOriginalService extends IService<WeCustomerMe
*/
CustomerMessagePushVo CustomerMessagePushDetail(Long messageId);
/**
* 同步发送结果
*
* @param msgid 可以用于获取发送结果
*/
void asyncResult(String msgid, Long messageId);
}
......@@ -30,6 +30,8 @@ public interface IWeDepartmentService extends IService<WeDepartment>
*/
public void insertWeDepartment(WeDepartment weDepartment);
public int insertWeDepartmentNoToWeCom(WeDepartment weDepartment);
/**
* 修改企业微信组织架构相关
*
......
......@@ -2,6 +2,7 @@ package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeGroupMember;
import com.linkwechat.wecom.domain.dto.WeGroupMemberDto;
import java.util.List;
......@@ -14,4 +15,6 @@ public interface IWeGroupMemberService extends IService<WeGroupMember> {
List<WeGroupMember> selectWeGroupMemberList(WeGroupMember paramWeGroupMember);
List<WeGroupMemberDto> selectWeGroupMemberListByChatId(String chatId);
}
......@@ -20,4 +20,10 @@ public interface IWeGroupService extends IService<WeGroup> {
void synchWeGroup();
void createWeGroup(String chatId);
void updateWeGroup(String chatId);
void deleteWeGroup(String chatId);
}
......@@ -63,4 +63,10 @@ public interface IWeTagGroupService extends IService<WeTagGroup>
* @param isSync
*/
public void batchSaveOrUpdateTagGroupAndTag(List<WeCropGroupTagDto> tagGroup,Boolean isSync);
void createTagGroup(String id);
void deleteTagGroup(String id);
void updateTagGroup(String id);
}
......@@ -52,7 +52,7 @@ public interface IWeTagService extends IService<WeTag>
* @param ids 需要删除的企业微信标签ID
* @return 结果
*/
public int deleteWeTagByIds(Long[] ids);
public int deleteWeTagByIds(String[] ids);
/**
* 删除企业微信标签信息
......@@ -60,7 +60,7 @@ public interface IWeTagService extends IService<WeTag>
* @param id 企业微信标签ID
* @return 结果
*/
public int deleteWeTagById(Long id);
public int deleteWeTagById(String id);
/**
......@@ -70,4 +70,9 @@ public interface IWeTagService extends IService<WeTag>
*/
public int insertWeTagFromWeTagDto(WeTagDto weTagDto);
void creatTag(String tagId);
void deleteTag(String tagId);
void updateTag(String tagId);
}
package com.linkwechat.wecom.service;
import com.linkwechat.wecom.domain.WeTaskFissionRecord;
import java.util.List;
/**
* 裂变任务完成记录Service接口
*
* @author leejoker
* @date 2021-01-20
*/
public interface IWeTaskFissionRecordService {
/**
* 查询裂变任务完成记录
*
* @param id 裂变任务完成记录ID
* @return 裂变任务完成记录
*/
public WeTaskFissionRecord selectWeTaskFissionRecordById(Long id);
/**
* 查询裂变任务完成记录列表
*
* @param weTaskFissionRecord 裂变任务完成记录
* @return 裂变任务完成记录集合
*/
public List<WeTaskFissionRecord> selectWeTaskFissionRecordList(WeTaskFissionRecord weTaskFissionRecord);
/**
* 新增裂变任务完成记录
*
* @param weTaskFissionRecord 裂变任务完成记录
* @return 结果
*/
public int insertWeTaskFissionRecord(WeTaskFissionRecord weTaskFissionRecord);
/**
* 修改裂变任务完成记录
*
* @param weTaskFissionRecord 裂变任务完成记录
* @return 结果
*/
public int updateWeTaskFissionRecord(WeTaskFissionRecord weTaskFissionRecord);
/**
* 批量删除裂变任务完成记录
*
* @param ids 需要删除的裂变任务完成记录ID
* @return 结果
*/
public int deleteWeTaskFissionRecordByIds(Long[] ids);
/**
* 删除裂变任务完成记录信息
*
* @param id 裂变任务完成记录ID
* @return 结果
*/
public int deleteWeTaskFissionRecordById(Long id);
}
package com.linkwechat.wecom.service;
import com.linkwechat.wecom.domain.WeTaskFissionReward;
import java.util.List;
/**
* 任务裂变奖励Service接口
*
* @author leejoker
* @date 2021-01-20
*/
public interface IWeTaskFissionRewardService {
/**
* 查询任务裂变奖励
*
* @param id 任务裂变奖励ID
* @return 任务裂变奖励
*/
public WeTaskFissionReward selectWeTaskFissionRewardById(Long id);
/**
* 查询任务裂变奖励列表
*
* @param weTaskFissionReward 任务裂变奖励
* @return 任务裂变奖励集合
*/
public List<WeTaskFissionReward> selectWeTaskFissionRewardList(WeTaskFissionReward weTaskFissionReward);
/**
* 新增任务裂变奖励
*
* @param weTaskFissionReward 任务裂变奖励
* @return 结果
*/
public int insertWeTaskFissionReward(WeTaskFissionReward weTaskFissionReward);
/**
* 修改任务裂变奖励
*
* @param weTaskFissionReward 任务裂变奖励
* @return 结果
*/
public int updateWeTaskFissionReward(WeTaskFissionReward weTaskFissionReward);
/**
* 批量删除任务裂变奖励
*
* @param ids 需要删除的任务裂变奖励ID
* @return 结果
*/
public int deleteWeTaskFissionRewardByIds(Long[] ids);
/**
* 删除任务裂变奖励信息
*
* @param id 任务裂变奖励ID
* @return 结果
*/
public int deleteWeTaskFissionRewardById(Long id);
}
package com.linkwechat.wecom.service;
import com.linkwechat.wecom.domain.WeTaskFission;
import java.util.List;
/**
* 任务宝Service接口
*
* @author leejoker
* @date 2021-01-20
*/
public interface IWeTaskFissionService {
/**
* 查询任务宝
*
* @param id 任务宝ID
* @return 任务宝
*/
public WeTaskFission selectWeTaskFissionById(Long id);
/**
* 查询任务宝列表
*
* @param weTaskFission 任务宝
* @return 任务宝集合
*/
public List<WeTaskFission> selectWeTaskFissionList(WeTaskFission weTaskFission);
/**
* 新增任务宝
*
* @param weTaskFission 任务宝
* @return 结果
*/
public int insertWeTaskFission(WeTaskFission weTaskFission);
/**
* 修改任务宝
*
* @param weTaskFission 任务宝
* @return 结果
*/
public int updateWeTaskFission(WeTaskFission weTaskFission);
/**
* 批量删除任务宝
*
* @param ids 需要删除的任务宝ID
* @return 结果
*/
public int deleteWeTaskFissionByIds(Long[] ids);
/**
* 删除任务宝信息
*
* @param id 任务宝ID
* @return 结果
*/
public int deleteWeTaskFissionById(Long id);
}
package com.linkwechat.wecom.service;
import com.linkwechat.wecom.domain.WeTaskFissionStaff;
import java.util.List;
/**
* 裂变任务员工列Service接口
*
* @author leejoker
* @date 2021-01-20
*/
public interface IWeTaskFissionStaffService {
/**
* 查询裂变任务员工列
*
* @param id 裂变任务员工列ID
* @return 裂变任务员工列
*/
public WeTaskFissionStaff selectWeTaskFissionStaffById(Long id);
/**
* 查询裂变任务员工列列表
*
* @param weTaskFissionStaff 裂变任务员工列
* @return 裂变任务员工列集合
*/
public List<WeTaskFissionStaff> selectWeTaskFissionStaffList(WeTaskFissionStaff weTaskFissionStaff);
/**
* 新增裂变任务员工列
*
* @param weTaskFissionStaff 裂变任务员工列
* @return 结果
*/
public int insertWeTaskFissionStaff(WeTaskFissionStaff weTaskFissionStaff);
/**
* 修改裂变任务员工列
*
* @param weTaskFissionStaff 裂变任务员工列
* @return 结果
*/
public int updateWeTaskFissionStaff(WeTaskFissionStaff weTaskFissionStaff);
/**
* 批量删除裂变任务员工列
*
* @param ids 需要删除的裂变任务员工列ID
* @return 结果
*/
public int deleteWeTaskFissionStaffByIds(Long[] ids);
/**
* 删除裂变任务员工列信息
*
* @param id 裂变任务员工列ID
* @return 结果
*/
public int deleteWeTaskFissionStaffById(Long id);
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dtflys.forest.annotation.Query;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.dto.WeUserInfoDto;
import com.linkwechat.wecom.domain.dto.msgaudit.WeMsgAuditDto;
import com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo;
import com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import com.linkwechat.wecom.domain.vo.*;
import java.util.List;
......@@ -21,10 +20,10 @@ public interface IWeUserService extends IService<WeUser>
/**
* 查询通讯录相关客户
*
* @param id 通讯录相关客户ID
* @param userId 通讯录相关客户ID
* @return 通讯录相关客户
*/
public WeUser selectWeUserById(Long id);
public WeUser selectWeUserById(String userId);
/**
* 查询通讯录相关客户列表
......@@ -43,6 +42,13 @@ public interface IWeUserService extends IService<WeUser>
public void insertWeUser(WeUser weUser);
/**
* 新增通讯录相关客户(不同步企微)
* @param weUser 通讯录相关客户
* @return
*/
public int insertWeUserNoToWeCom(WeUser weUser);
/**
* 修改通讯录相关客户
*
* @param weUser 通讯录相关客户
......@@ -50,6 +56,13 @@ public interface IWeUserService extends IService<WeUser>
*/
public void updateWeUser(WeUser weUser);
/**
* 修改通讯录相关客户(不同步企微)
* @param weUser 通讯录相关客户
* @return
*/
public int updateWeUserNoToWeCom(WeUser weUser);
/**
* 启用或禁用用户
......@@ -93,6 +106,13 @@ public interface IWeUserService extends IService<WeUser>
*/
void deleteUser(String[] ids);
/**
* 删除成员
* @param userId 成员id
* @return
*/
int deleteUserNoToWeCom(String userId);
/**
* 获取历史分配记录的成员
......@@ -116,4 +136,12 @@ public interface IWeUserService extends IService<WeUser>
* @return
*/
List<WeUser> getPermitUserList(WeMsgAuditDto msgAuditDto);
/**
* 获取访问用户身份(内部应用)
* @param code
* @return
*/
WeUserInfoVo getUserInfo(@Query("code")String code);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!