客户相关接口提交

1 parent ea3ded1d
Showing 41 changed files with 640 additions and 472 deletions
......@@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>linkwe-admin</artifactId>
<artifactId>linkwe-admin-dev</artifactId>
<description>
web服务入口
......
......@@ -13,11 +13,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -39,23 +36,36 @@ public class WeUserController extends BaseController {
/**
* 查询通讯录相关客户列表
*/
//@PreAuthorize("@ss.hasPermi('contacts:organization:query')")
@Log(title = "查询通讯录相关客户列表", businessType = BusinessType.SELECT)
@GetMapping("/list")
@ApiOperation(value = "获取通讯录人员列表", httpMethod = "GET")
public TableDataInfo<List<WeUser>> list(WeUser weUser) {
startPage();
List<WeUser> list = weUserService.getList(weUser);
return getDataTable(list);
return getDataTable(weUserService.getList(weUser));
}
/**
* 获取所有员工接口(不分页)
* @param weUser
* @return
*/
@GetMapping("/findAllWeUser")
public AjaxResult findAllWeUser(WeUser weUser){
return AjaxResult.success(
weUserService.getList(weUser)
);
}
/**
* 获取通讯录相关客户详细信息
*
* @return
*/
//@PreAuthorize("@ss.hasPermi('contacts:organization:view')")
@Log(title = "获取通讯录相关客户详细信息", businessType = BusinessType.SELECT)
@GetMapping(value = "/{id}")
@ApiOperation(value = "获取通讯录相关客户详细信息", httpMethod = "GET")
......@@ -66,7 +76,6 @@ public class WeUserController extends BaseController {
/**
* 新增通讯录相关客户
*/
//@PreAuthorize("@ss.hasPermi('contacts:organization:addMember')")
@Log(title = "通讯录相关客户", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation("新增通讯录客户")
......@@ -78,7 +87,6 @@ public class WeUserController extends BaseController {
/**
* 修改通讯录相关客户
*/
//@PreAuthorize("@ss.hasPermi('contacts:organization:edit')")
@Log(title = "更新通讯录客户", businessType = BusinessType.UPDATE)
@PutMapping
@ApiOperation("更新通讯录客户")
......@@ -94,7 +102,6 @@ public class WeUserController extends BaseController {
* @param weUser
* @return
*/
//@PreAuthorize("@ss.hasPermi('contacts:organization:forbidden')")
@Log(title = "启用禁用用户", businessType = BusinessType.UPDATE)
@PutMapping("/startOrStop")
@ApiOperation("是否启用(1表示启用成员,0表示禁用成员)")
......@@ -110,13 +117,12 @@ public class WeUserController extends BaseController {
* @param weLeaveUserVo
* @return
*/
// @PreAuthorize("@ss.hasPermi('customerManage:dimission:filter')")
@ApiOperation("离职已分配")
@Log(title = "离职已分配", businessType = BusinessType.SELECT)
@GetMapping({"/leaveUserAllocateList"})
public TableDataInfo<List<WeLeaveUserVo>> leaveUserAllocateList(WeLeaveUserVo weLeaveUserVo) {
startPage();
weLeaveUserVo.setIsActivate(WeConstans.WE_USER_IS_LEAVE);
weLeaveUserVo.setIsActivate(WeConstans.corpUserEnum.ACTIVE_STATE_FIVE.getKey());
weLeaveUserVo.setIsAllocate(WeConstans.LEAVE_ALLOCATE_STATE);
List<WeLeaveUserVo> list = this.weUserService.leaveAllocateUserList(weLeaveUserVo);
return getDataTable(list);
......@@ -129,13 +135,12 @@ public class WeUserController extends BaseController {
* @param weLeaveUserVo
* @return
*/
// @PreAuthorize("@ss.hasPermi('customerManage:dimission:query')")
@ApiOperation("离职未分配")
@Log(title = "离职未分配", businessType = BusinessType.SELECT)
@GetMapping({"/leaveUserNoAllocateList"})
public TableDataInfo<List<WeLeaveUserVo>> leaveUserNoAllocateList(WeLeaveUserVo weLeaveUserVo) {
startPage();
weLeaveUserVo.setIsActivate(WeConstans.WE_USER_IS_LEAVE);
weLeaveUserVo.setIsActivate(WeConstans.corpUserEnum.ACTIVE_STATE_FIVE.getKey());
weLeaveUserVo.setIsAllocate(WeConstans.LEAVE_NO_ALLOCATE_STATE);
List<WeLeaveUserVo> list = weUserService.leaveNoAllocateUserList(weLeaveUserVo);
return getDataTable(list);
......@@ -148,12 +153,11 @@ public class WeUserController extends BaseController {
* @param weLeaveUserInfoAllocateVo
* @return
*/
// @PreAuthorize("@ss.hasPermi('customerManage:dimission:allocate')")
@ApiOperation("离职分配")
@Log(title = "离职分配", businessType = BusinessType.UPDATE)
@PutMapping({"/allocateLeaveUserAboutData"})
public AjaxResult allocateLeaveUserAboutData(@RequestBody WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) {
weLeaveUserInfoAllocateVo.setExtentType(new Integer(0));
weUserService.allocateLeaveUserAboutData(weLeaveUserInfoAllocateVo);
return AjaxResult.success("离职分配成功");
......@@ -165,14 +169,11 @@ public class WeUserController extends BaseController {
*
* @return
*/
// @PreAuthorize("@ss.hasPermi('contacts:organization:sync')")
@ApiOperation("同步成员")
@Log(title = "同步成员", businessType = BusinessType.OTHER)
@GetMapping({"/synchWeUser"})
public AjaxResult synchWeUser() {
SecurityContext context = SecurityContextHolder.getContext();
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
SecurityContextHolder.setContext(context);
weUserService.synchWeUser();
return AjaxResult.success(WeConstans.SYNCH_TIP);
}
......@@ -182,7 +183,6 @@ public class WeUserController extends BaseController {
*
* @return
*/
// @PreAuthorize("@ss.hasPermi('contacts:organization:removeMember')")
@ApiOperation("删除用户")
@Log(title = "删除用户", businessType = BusinessType.DELETE)
@DeleteMapping({"/{ids}"})
......
#linkwechat.nacos.host=
#linkwechat.nacos.port=
#linkwechat.nacos.namespace=
#linkwechat.nacos.username=
#linkwechat.nacos.password=
\ No newline at end of file
linkwechat.nacos.host=119.45.28.29
linkwechat.nacos.port=10848
linkwechat.nacos.namespace=627a666a-76b2-42ad-a1b0-70a12d2c73fd
linkwechat.nacos.username=nacos
linkwechat.nacos.password=jerryjin666
\ No newline at end of file
......@@ -74,6 +74,8 @@ public class BaseController
return rspData;
}
/**
* 响应请求分页数据
*/
......
package com.linkwechat.common.core.page;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
......@@ -24,6 +25,12 @@ public class TableDataInfo<T> implements Serializable
/** 消息内容 */
private String msg;
/**最后同步时间*/
private Date lastSyncTime;
/**去重复客户数*/
private long noRepeatCustomerTotal;
/**
* 表格数据对象
*/
......@@ -82,4 +89,20 @@ public class TableDataInfo<T> implements Serializable
{
this.msg = msg;
}
public Date getLastSyncTime() {
return lastSyncTime;
}
public void setLastSyncTime(Date lastSyncTime) {
this.lastSyncTime = lastSyncTime;
}
public long getNoRepeatCustomerTotal() {
return noRepeatCustomerTotal;
}
public void setNoRepeatCustomerTotal(long noRepeatCustomerTotal) {
this.noRepeatCustomerTotal = noRepeatCustomerTotal;
}
}
......@@ -373,5 +373,20 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
}
/**
* 当前时间向推几小时
* @param ihour 小时
* @return String
*/
public static String getBeforeByHourTime(int ihour){
String returnstr = "";
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - ihour);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
returnstr = df.format(calendar.getTime());
return returnstr;
}
}
package com.linkwechat.wecom.annotation;
import java.lang.annotation.*;
/**
* 同步记录注解
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface SynchRecord {
int synchType() default 1; //1:默认客户模块;2:员工与部门;
}
package com.linkwechat.wecom.aspectj;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.wecom.annotation.SynchRecord;
import com.linkwechat.wecom.domain.WeSynchRecord;
import com.linkwechat.wecom.service.IWeSynchRecordService;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.*;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.List;
/**
* 回调接口调用记录
*/
@Aspect
@Component
@SuppressWarnings({"unused"})
public class SynchRecordAop {
@Autowired
private IWeSynchRecordService iWeSynchRecordService;
@Pointcut("@annotation(com.linkwechat.wecom.annotation.SynchRecord)")
public void annotationPointcut() {
}
@Around("annotationPointcut()")
public void doBefore(ProceedingJoinPoint joinPoint) throws Throwable {
SynchRecord annotationLog = getAnnotationLog(joinPoint);
if(null != annotationLog){
List<WeSynchRecord> weSynchRecords = iWeSynchRecordService.list(new LambdaQueryWrapper<WeSynchRecord>()
.apply("date_format (synch_time,'%Y-%m-%d HH:mm:ss') >= date_format('" + DateUtils.getBeforeByHourTime(2) + "','%Y-%m-%d HH:mm:ss')")
.apply("date_format (synch_time,'%Y-%m-%d HH:mm:ss') <= date_format('" + DateUtils.getBeforeByHourTime(0) + "','%Y-%m-%d HH:mm:ss')"));
if(CollectionUtil.isEmpty(weSynchRecords)||weSynchRecords.size()<=1){
joinPoint.proceed();
}
}
}
@After("annotationPointcut()")
public void doAfter(JoinPoint joinPoint) throws Throwable {
SynchRecord annotationLog = getAnnotationLog(joinPoint);
if(null != annotationLog){
iWeSynchRecordService.save(
WeSynchRecord.builder()
.synchTime(new Date())
.synchType(annotationLog.synchType())
.build()
);
}
}
/**
* 是否存在注解,如果存在就获取
*/
private SynchRecord getAnnotationLog(JoinPoint joinPoint) throws Exception
{
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method != null)
{
return method.getAnnotation(SynchRecord.class);
}
return null;
}
}
......@@ -72,13 +72,25 @@ public interface WeUserClient {
/**
* 分配客户
* 分配客户(离职继承分配客户)
* @return
*/
@Request(url="/externalcontact/resigned/transfer_customer", type = "POST")
WeResultDto allocateCustomer(@JSONBody AllocateWeCustomerDto allocateWeCustomerDto);
/**
* 在职继承分配客户(在职继承)
* @param allocateWeCustomerDto
* @return
*/
@Request(url = "/externalcontact/transfer_customer", type = "POST")
WeResultDto transferCustomer(@JSONBody AllocateWeCustomerDto allocateWeCustomerDto);
/**
* 分配成员群
* @return
......
......@@ -55,4 +55,10 @@ public class WeAllocateCustomer
* 失败原因
*/
private String failReason;
/**
* 0:离职继承;1:在职继承;
*/
private Integer extentType;
}
package com.linkwechat.wecom.domain;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;
/**
* 企业微信客户对象 we_customer
......@@ -34,170 +27,83 @@ public class WeCustomer extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 外部联系人的userid
*/
@NotBlank(message = "外部联系人的id不可为空")
@ApiModelProperty("外部联系人的userid")
//客户id
private String externalUserid;
/**
* 首位添加人
*/
private String firstUserId;
//客户名称
@TableField(value = "name")
private String customerName;
/**
* 外部联系人名称
*/
@Excel(name = "客户")
@ApiModelProperty("外部联系人名称")
private String name;
//客户类型
private Integer customerType;
/**
* 外部联系人头像
*/
@ApiModelProperty("外部联系人头像")
//头像
private String avatar;
/**
* 外部联系人的类型,1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户
*/
@ApiModelProperty("外部联系人的类型,1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户")
@Excel(name = "客户类型", readConverterExp = "1=微信,2=企业微信")
private Integer type;
/**
* 外部联系人性别 0-未知 1-男性 2-女性
*/
@ApiModelProperty("外部联系人性别 0-未知 1-男性 2-女性")
@Excel(name = "性别", readConverterExp = "0=未知,1=男性,2=女性")
//0-未知 1-男性 2-女性
private Integer gender;
/**
* 外部联系人在微信开放平台的唯一身份标识,通过此字段企业可将外部联系人与公众号/小程序用户关联起来。
*/
@ApiModelProperty("外部联系人在微信开放平台的唯一身份标识,通过此字段企业可将外部联系人与公众号/小程序用户关联起来")
private String unionid;
/**
* 生日
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("生日")
private Date birthday;
/**
* 客户企业简称
*/
@ApiModelProperty("客户企业简称")
@Excel(name = "公司名称")
private String corpName;
/**
* 客户企业全称
*/
@ApiModelProperty("客户企业全称")
private String corpFullName;
/**
* 职位
*/
@ApiModelProperty("职位")
private String position;
/**
* 是否开启会话存档 0:关闭 1:开启
*/
@ApiModelProperty("是否开启会话存档 0:关闭 1:开启")
private Integer isOpenChat;
/**
* 添加人员
*/
@TableField(exist = false)
private List<WeFlowerCustomerRel> weFlowerCustomerRels;
/**
* 添加人id
*/
@TableField(exist = false)
private String userIds;
/**
* 标签
*/
@TableField(exist = false)
private String tagIds;
@TableField(exist = false)
@JSONField(defaultValue = "0")
private Integer status;
/**
* 部门
*/
@TableField(exist = false)
private String departmentIds;
/**
* 添加人名称
*/
@TableField(exist = false)
private String userName;
/**
* 员工id
*/
@TableField(exist = false)
private String userId;
/**
* 创建者
*/
@ApiModelProperty(hidden = true)
@TableField(exist = false)
private String createBy;
/**
* 更新者
*/
@ApiModelProperty(hidden = true)
@TableField(exist = false)
private String updateBy;
/**
* 首位添加时间
*/
private String firstUserId;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date firstAddTime;
private Integer trackState;
//qq
private String qq;
//邮箱
private String trackContent;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date trackTime;
private String phone;
private String email;
//地址
private String qq;
private String otherDescr;
private String address;
//手机号
private String phone;
private Integer addMethod;
/**
* 0:正常;1:删除
*/
@TableLogic
private Integer delFlag;
//添加方式
private Integer addMethod;
private String state;
}
......@@ -24,4 +24,5 @@ public class WeCustomerAddGroup {
//是否共同群 0:不是共同群;1:是共同群
private Integer commonGroup;
}
package com.linkwechat.wecom.domain;
import lombok.Builder;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 客户详情
*/
@Data
public class WeCustomerDetail {
//头像
private String avatar;
//客户名称
private String customerName;
//客户类型
private Integer customerType;
//客户标签,多个用逗号隔开
private String tagNames;
//跟进员工
private List<TrackUser> trackUsers;
//所在客群
private List<Groups> groups;
private String commonGroupChat;
private String phone;
private String address;
private int age;
private String qq;
private Date birthday;
private String position;
private String email;
private String corpName;
private String otherDescr;
private List<CompanyOrPersonTag> companyTags;
private List<CompanyOrPersonTag> personTags;
@Data
@Builder
public static class TrackUser {
//添加员工名称
private String userName;
//添加方式
private Integer addMethod;
//添加时间
private Date firstAddTime;
//跟进状态
private Integer trackState;
}
@Data
public static class Groups{
//群id
private String chatId;
//群名
private String groupName;
//加入时间
private Date joinTime;
}
//企业或个人标签
@Data
@Builder
public static class CompanyOrPersonTag{
private String userName;
private String tagsNames;
private String tagIds;
}
@Data
public static class TrackStates{
//跟进人
private String userName;
//跟进状态列表
private List<WeCustomerTrajectory> trackStateList;
}
}
......@@ -24,12 +24,18 @@ public class WeCustomerList {
//客户类型
private Integer customerType;
//查询标签id
//查询标签id(企业标签id)
private String tagIds;
//标签名称,使用逗号隔开
//标签名称,使用逗号隔开(企业标签名)
private String tagNames;
//个人标签id
private String personTagIds;
//个人标签名
private String personTagNames;
//跟进人名称
private String userName;
......@@ -87,6 +93,8 @@ public class WeCustomerList {
private String departmentIds;
//0正常;1:删除;
private Integer delFlag=new Integer(0);
}
......@@ -49,8 +49,6 @@ public class WeCustomerPortrait {
//客户头像
private String avatar;
//客户标签
private List<WeTagGroup> weTagGroupList;
//客户社交关系
private WeCustomerSocialConn socialConn;
......
package com.linkwechat.wecom.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 同步记录表
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("we_synch_record")
public class WeSynchRecord {
@TableId
private Long id;
private Integer synchType;
private Date synchTime;
}
......@@ -127,8 +127,8 @@ public class WeUser extends BaseEntity
private Date birthday;
/** 是否激活(1:是;2:否)该字段主要表示当前信息是否同步微信 */
/** 激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业,6=删除 */
@ApiModelProperty("激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业,6=删除")
/** 激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业*/
@ApiModelProperty("激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业")
private Integer isActivate=new Integer(4);
/** 离职是否分配(1:已分配;0:未分配;) */
......@@ -147,6 +147,10 @@ public class WeUser extends BaseEntity
private Integer isOpenChat;
@ApiModelProperty("是否配置客户联系人功能 1:是;0:否")
private Integer isConfigCustomerContact;
/** 转化成企业微信需要的dto对象 */
public WeUserDto transformWeUserDto(){
WeUserDto weUserDto=new WeUserDto();
......
......@@ -25,7 +25,7 @@ public class AllocateWeCustomerDto{
/**接替成员的userid*/
private String takeover_userid;
// /**转移成功后发给客户的消息,最多200个字符,不填则使用默认文案,目前只对在职成员分配客户的情况生效*/
// private String transfer_success_msg;
/**转移成功后发给客户的消息,最多200个字符,不填则使用默认文案,目前只对在职成员分配客户的情况生效*/
private String transfer_success_msg;
}
package com.linkwechat.wecom.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author: Robin
......@@ -8,9 +11,18 @@ import lombok.Data;
* @Date: create in 2020/9/21 0021 23:45
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WeLeaveUserInfoAllocateVo {
//移交人
private String handoverUserid;
//接管人
private String takeoverUserid;
//客户id,多个客户使用逗号隔开
private String externalUserid;
//0:离职继承;1:在职继承;
private Integer extentType;
}
......@@ -56,8 +56,8 @@ public class WeCallBackDelExternalContactImpl extends WeEventStrategy {
.eq(WeCustomer::getExternalUserid,message.getExternalUserId())
.eq(WeCustomer::getFirstUserId,message.getUserId()));
weSensitiveActHit.setOperateTargetId(weCustomer.getUserId());
weSensitiveActHit.setOperateTarget(weCustomer.getName());
weSensitiveActHit.setOperateTargetId(weCustomer.getFirstUserId());
weSensitiveActHit.setOperateTarget(weCustomer.getCustomerName());
weSensitiveActHitService.insertWeSensitiveActHit(weSensitiveActHit);
}
......
......@@ -54,7 +54,7 @@ public class WeCallBackDelFollowUserImpl extends WeEventStrategy {
WeCustomer weCustomer = weCustomerService.getOne(new LambdaQueryWrapper<WeCustomer>().eq(WeCustomer::getFirstUserId,message.getUserId())
.eq(WeCustomer::getExternalUserid,message.getExternalUserId()));
String content = "您已经被客户@" + weCustomer.getName() + "删除!";
String content = "您已经被客户@" + weCustomer.getCustomerName() + "删除!";
TextMessageDto textMessageDto = new TextMessageDto();
textMessageDto.setContent(content);
WeMessagePushDto weMessagePushDto = new WeMessagePushDto();
......@@ -77,8 +77,8 @@ public class WeCallBackDelFollowUserImpl extends WeEventStrategy {
weSensitiveActHit.setCreateTime(new Date(message.getCreateTime()));
weSensitiveActHit.setCreateBy("admin");
WeUser user = weUserService.getById(message.getUserId());
weSensitiveActHit.setOperatorId(weCustomer.getUserId());
weSensitiveActHit.setOperator(weCustomer.getName());
weSensitiveActHit.setOperatorId(weCustomer.getFirstUserId());
weSensitiveActHit.setOperator(weCustomer.getCustomerName());
weSensitiveActHit.setOperateTargetId(user.getUserId());
weSensitiveActHit.setOperateTarget(user.getName());
weSensitiveActHitService.insertWeSensitiveActHit(weSensitiveActHit);
......
......@@ -15,81 +15,28 @@ import org.apache.ibatis.annotations.Param;
*/
public interface WeCustomerMapper extends BaseMapper<WeCustomer>
{
/**
* 查询企业微信客户
*
* @param externalUserId 企业微信客户ID
* @return 企业微信客户
*/
public WeCustomer selectWeCustomerById(@Param("externalUserId") String externalUserId,@Param("userId") String userId);
/**
* 查询企业微信客户列表
*
* @param weCustomer 企业微信客户
* @return 企业微信客户集合
*/
public List<WeCustomer> selectWeCustomerList(WeCustomer weCustomer);
/**
* 新增企业微信客户
*
* @param weCustomer 企业微信客户
* @return 结果
*/
public int insertWeCustomer(WeCustomer weCustomer);
/**
* 修改企业微信客户
*
* @param weCustomer 企业微信客户
* @return 结果
*/
public int updateWeCustomer(WeCustomer weCustomer);
/**
* 删除企业微信客户
*
* @param externalUserId 企业微信客户ID
* @return 结果
*/
public int deleteWeCustomerById(String externalUserId);
/**
* 批量删除企业微信客户
*
* @param userIds 需要删除的数据ID
* @return 结果
*/
public int deleteWeCustomerByUserIds(String[] userIds);
/**
* 批量删除企业微信客户
*
* @param externalUserIds 需要删除的数据ID
* @return 结果
* 重构版客户列表接口
* @param weCustomerList
* @return
*/
public int deleteWeCustomerByIds(String[] externalUserIds);
List<WeCustomerList> findWeCustomerList(@Param("weCustomerList") WeCustomerList weCustomerList);
/**
* 根据员工ID获取客户
* @param externalUserid
* 获取客户所在群
* @param userId
* @return
*/
public List<WeUser> getCustomersByUserId(@Param("externalUserid") String externalUserid,@Param("userId") String userId);
WeCustomerDetail.Groups findWecustomerGroups(@Param("userId") String userId);
/**
* 通过标签查询客户列表
* @param ids 标签id
* @return
*/
List<WeUser> getCustomerByTag(List<String> ids);
/**
* 根据外部联系人ID和企业员工ID获取当前客户信息
* 根据外部联系人ID和企业员工ID获取当前客户信息(客户画像)
* @param externalUserid
* @param userid
* @return
......@@ -107,47 +54,27 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
/**
* 查询企业微信客户列表,不查询一对多关系相关数据
*
* @param weCustomer 企业微信客户
* @return 企业微信客户集合
*/
public List<WeCustomer> selectWeCustomerListNoRel(WeCustomer weCustomer);
/**
* 重构版客户列表接口
* @param weCustomerList
* @return
*/
List<WeCustomerList> findWeCustomerList(@Param("weCustomerList") WeCustomerList weCustomerList);
/**
* 客户添加的员工名称
* 客户所属员工相关
* @return
*/
String findAddWeUserNames(@Param("externalUserId") String externalUserId);
List<CusertomerBelongUserInfo> findCusertomerBelongUserInfo(@Param("externalUserId") String externalUserId);
/**
* 客户添加的群标签
* @return
* 批量更新或新增
* @param weCustomer
*/
String findCustomerGroupTag(@Param("externalUserId") String externalUserId);
void batchAddOrUpdate(@Param("weCustomers") List<WeCustomer> weCustomer);
/**
* 客户所属员工相关
* 去重复统计
* @return
*/
List<CusertomerBelongUserInfo> findCusertomerBelongUserInfo(@Param("externalUserId") String externalUserId);
void batchAddOrUpdate(@Param("weCustomers") List<WeCustomer> weCustomer);
long noRepeatCountCustomer();
}
......@@ -13,7 +13,7 @@ import java.util.List;
* @Date: create in 2020/9/21 0021 23:58
*/
public interface WeGroupMemberMapper extends BaseMapper<WeGroupMember> {
// WeGroupMember selectWeGroupMemberById(Long paramLong);
List<WeGroupMember> selectWeGroupMemberList(WeGroupMember paramWeGroupMember);
......@@ -21,11 +21,4 @@ public interface WeGroupMemberMapper extends BaseMapper<WeGroupMember> {
void insertBatch(@Param("weGroupMembers") List<WeGroupMember> weGroupMembers);
// int insertWeGroupMember(WeGroupMember paramWeGroupMember);
//
// int updateWeGroupMember(WeGroupMember paramWeGroupMember);
//
// int deleteWeGroupMemberById(Long paramLong);
//
// int deleteWeGroupMemberByIds(Long[] paramArrayOfLong);
}
package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeSynchRecord;
public interface WeSynchRecordMapper extends BaseMapper<WeSynchRecord> {
}
......@@ -63,15 +63,15 @@ public interface WeTagGroupMapper extends BaseMapper<WeTagGroup>
*/
public int batchInsetWeTagGroup(@Param("weTagGroups") List<WeTagGroup> weTagGroups);
/**
* 根据企业员工与添加客户关系id给客户打标签
* @param externalUserid
* @param userid
* @return
*/
public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(@Param("externalUserid") String externalUserid, @Param("userid") String userid);
//
// /**
// * 根据企业员工与添加客户关系id给客户打标签
// * @param externalUserid
// * @param userid
// * @return
// */
// public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(@Param("externalUserid") String externalUserid, @Param("userid") String userid);
//
......
package com.linkwechat.wecom.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeCustomerList;
import com.linkwechat.wecom.domain.WeCustomerPortrait;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.*;
import com.linkwechat.wecom.domain.dto.WeWelcomeMsg;
import com.linkwechat.wecom.domain.vo.WeCustomerDetailVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeMakeCustomerTag;
import java.util.List;
/**
......@@ -21,73 +16,45 @@ import java.util.List;
*/
public interface IWeCustomerService extends IService<WeCustomer>
{
// /**
// * 查询企业微信客户
// *
// * @param externalUserId 企业微信客户ID
// * @return 企业微信客户
// */
// public WeCustomer selectWeCustomerById(String externalUserId);
// /**
// * 新增/修改企业微信客户
// *
// * @param weCustomer 企业微信客户
// * @return 修改结果
// */
// @Override
// public boolean saveOrUpdate(WeCustomer weCustomer);
//
/**
* 查询企业微信客户列表
*
* @param weCustomer 企业微信客户
* @return 企业微信客户集合
*/
public List<WeCustomer> selectWeCustomerList(WeCustomer weCustomer);
/**
* 同步客户接口
* @return
*/
public void synchWeCustomer();
void synchWeCustomer();
/**
* 分配离职员工客户
* @param weLeaveUserInfoAllocateVo
*/
public void allocateWeCustomer(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo);
void allocateWeCustomer(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo);
/**
* 客户打标签
* @param weMakeCustomerTag
*/
public void makeLabel(WeMakeCustomerTag weMakeCustomerTag);
void makeLabel(WeMakeCustomerTag weMakeCustomerTag);
// /**
// * 移除客户标签
// * @param weMakeCustomerTag
// */
// public void removeLabel(WeMakeCustomerTag weMakeCustomerTag);
/**
* 根据员工ID获取客户
* @param externalUserid
* @return
*/
public List<WeUser> getCustomersByUserId(String externalUserid);
// /**
// * 根据员工ID获取客户
// * @param externalUserid
// * @return
// */
// List<WeUser> getCustomersByUserId(String externalUserid);
/**
* 获取客户详情并同步客户数据
* @param externalUserid
* @param userId
*/
public void getCustomersInfoAndSynchWeCustomer(String externalUserid,String userId);
void getCustomersInfoAndSynchWeCustomer(String externalUserid,String userId);
......@@ -95,13 +62,13 @@ public interface IWeCustomerService extends IService<WeCustomer>
* 向客户发送欢迎语
* @param weWelcomeMsg
*/
public void sendWelcomeMsg(WeWelcomeMsg weWelcomeMsg);
void sendWelcomeMsg(WeWelcomeMsg weWelcomeMsg);
/**
* 修改客户是否开启会话状态
* @param externalUserId 客户id
*/
public boolean updateCustomerChatStatus(String externalUserId);
boolean updateCustomerChatStatus(String externalUserId);
......@@ -123,36 +90,45 @@ public interface IWeCustomerService extends IService<WeCustomer>
void updateWeCustomerPortrait(WeCustomerPortrait weCustomerPortrait);
/**
* 查询全部客户列表
* @param weCustomer
* 重构版客户列表
* @param weCustomerList
* @return
*/
public List<WeCustomer> selectWeCustomerAllList(WeCustomer weCustomer);
List<WeCustomerList> findWeCustomerList(WeCustomerList weCustomerList);
/**
* 查询企业微信客户列表,不查询一对多关系相关数据
*
* @param weCustomer 企业微信客户
* @return 企业微信客户集合
* 客户详情基础数据
* @param externalUserid
* @param userId
* @return
*/
List<WeCustomer> selectWeCustomerListNoRel(WeCustomer weCustomer);
WeCustomerDetail findWeCustomerDetail(String externalUserid,String userId);
/**
* 重构版客户列表
* @param weCustomerList
* 客户画像汇总
* @return
*/
List<WeCustomerList> findWeCustomerList(WeCustomerList weCustomerList);
WeCustomerDetail findWeCustomerInfoSummary(String externalUserid,String userId);
/**
* 单个跟进人客户
* @return
*/
WeCustomerDetail findWeCustomerInfoByUserId(String externalUserid,String userId);
WeCustomerDetailVo findWeCustomerDetail(String externalUserid);
/**
* 客户条件检索
* @param params
* 去重统计
* @return
*/
void getCustomerByCondition(JSONObject params);
long noRepeatCountCustomer();
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeSynchRecord;
public interface IWeSynchRecordService extends IService<WeSynchRecord> {
}
......@@ -72,10 +72,10 @@ public interface IWeTagGroupService extends IService<WeTagGroup>
/**
* 根据企业员工与添加客户关系id给客户打标签
* @param flowerCustomerRelId
* @return
*/
public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(String externalUserid, String userid);
// /**
// * 根据企业员工与添加客户关系id给客户打标签
// * @param flowerCustomerRelId
// * @return
// */
// public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(String externalUserid, String userid);
}
......@@ -17,13 +17,7 @@ import java.util.List;
public interface IWeUserService extends IService<WeUser>
{
/**
* 根据id查询通讯录相关客户
*
* @param idList id列表
* @return 通讯录相关客户
*/
public List<WeUser> getListByIds(List<Long> idList);
/**
* 根据id查询通讯录相关客户
......@@ -32,13 +26,6 @@ public interface IWeUserService extends IService<WeUser>
*/
public WeUser getById(Long id);
/**
* 查询通讯录相关客户
*
* @param userId 通讯录相关客户ID
* @return 通讯录相关客户
*/
public WeUser getByUserId(String userId);
/**
* 查询通讯录相关客户列表
......@@ -145,11 +132,6 @@ public interface IWeUserService extends IService<WeUser>
List<WeAllocateGroupsVo> getAllocateGroups(WeAllocateGroupsVo weAllocateGroupsVo);
/**
* 获取会话内容存档开启成员列表
* @return
*/
List<WeUser> getPermitUserList(WeMsgAuditDto msgAuditDto);
/**
......
......@@ -73,7 +73,7 @@ public class WeCustomerTrajectoryServiceImpl extends ServiceImpl<WeCustomerTraje
.msgtype(MessageType.TEXT.getMessageType())
.agentid(Integer.parseInt(k.getAgentId()))
.text(TextMessageDto.builder()
.content("您有一项关于客户"+weCustomerMap.get(k.getExternalUserid()).getName()+"的待办任务提醒,请尽快处理,\n<a href="+url+">点击查看客户详情。</a>")
.content("您有一项关于客户"+weCustomerMap.get(k.getExternalUserid()).getCustomerName()+"的待办任务提醒,请尽快处理,\n<a href="+url+">点击查看客户详情。</a>")
.build())
.build(),
String.valueOf(1000012)
......
......@@ -256,8 +256,10 @@ public class WePresTagGroupTaskServiceImpl extends ServiceImpl<WePresTagGroupTas
if (StringUtils.isNotEmpty(resultDto.getDetail_list())) {
for (DetailMessageStatusResultDto detail : resultDto.getDetail_list()) {
WePresTagGroupTaskStatVo statVo = new WePresTagGroupTaskStatVo();
WeCustomer customer = customerMapper.selectWeCustomerById(detail.getExternal_userid(),detail.getUserid());
statVo.setCustomerName(customer.getName());
WeCustomer customer =customerMapper.selectOne(new LambdaQueryWrapper<WeCustomer>()
.eq(WeCustomer::getExternalUserid,detail.getExternal_userid())
.eq(WeCustomer::getFirstUserId,detail.getUserid()));
statVo.setCustomerName(customer.getCustomerName());
statVo.setStatus(detail.getStatus());
statVo.setInGroup(externalIdList.contains(detail.getExternal_userid()));
statVoList.add(statVo);
......
......@@ -122,7 +122,7 @@ public class WeSensitiveActHitServiceImpl extends ServiceImpl<WeSensitiveActHitM
List<WeCustomer> weCustomers = weCustomerMapper.selectList(new LambdaQueryWrapper<WeCustomer>()
.eq(WeCustomer::getExternalUserid, userId));
if(CollectionUtils.isNotEmpty(weCustomers)){
return weCustomers.stream().findFirst().get().getName();
return weCustomers.stream().findFirst().get().getCustomerName();
}
// if (weCustomer != null) {
// return weCustomer.getName();
......
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeSynchRecord;
import com.linkwechat.wecom.mapper.WeSynchRecordMapper;
import com.linkwechat.wecom.service.IWeSynchRecordService;
import org.springframework.stereotype.Service;
@Service
public class WeSynchRecordServiceImpl extends ServiceImpl<WeSynchRecordMapper, WeSynchRecord> implements IWeSynchRecordService {
}
......@@ -393,10 +393,10 @@ public class WeTagGroupServiceImpl extends ServiceImpl<WeTagGroupMapper, WeTagGr
}
}
@Override
public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(String externalUserid, String userid) {
return this.baseMapper.findCustomerTagByFlowerCustomerRelId(externalUserid, userid);
}
// @Override
// public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(String externalUserid, String userid) {
// return this.baseMapper.findCustomerTagByFlowerCustomerRelId(externalUserid, userid);
// }
}
......@@ -257,7 +257,7 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W
.eq(WeCustomer::getUnionid, weTaskFissionPosterDTO.getUnionId()));
if (weCustomer != null) {
//任务表添加当前客户任务
WeTaskFissionRecord record = getTaskFissionRecordId(weTaskFissionPosterDTO.getTaskFissionId(), weCustomer.getUnionid(), weCustomer.getName());
WeTaskFissionRecord record = getTaskFissionRecordId(weTaskFissionPosterDTO.getTaskFissionId(), weCustomer.getUnionid(), weCustomer.getCustomerName());
String posterUrl = record.getPoster();
if (StringUtils.isBlank(posterUrl)) {
String qrcode = getPosterQRCode(weTaskFissionPosterDTO.getFissionTargetId(), record, weCustomer);
......@@ -379,7 +379,7 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W
WeCustomer weCustomer = new WeCustomer();
weCustomer.setAvatar(completeRecord.getCustomerAvatar());
weCustomer.setUnionid(completeRecord.getCustomerId());
weCustomer.setName(completeRecord.getCustomerName());
weCustomer.setCustomerName(completeRecord.getCustomerName());
list.add(weCustomer);
});
}
......
......@@ -13,12 +13,15 @@ import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.redis.RedisCache;
import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.common.utils.SecurityUtils;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.common.utils.spring.SpringUtils;
import com.linkwechat.wecom.client.WeCustomerClient;
import com.linkwechat.wecom.client.WeMsgAuditClient;
import com.linkwechat.wecom.client.WeUserClient;
import com.linkwechat.wecom.domain.WeCustomerAddUser;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.dto.WeUserInfoDto;
import com.linkwechat.wecom.domain.dto.customer.FollowUserList;
import com.linkwechat.wecom.domain.dto.msgaudit.WeMsgAuditDto;
import com.linkwechat.wecom.domain.vo.*;
import com.linkwechat.wecom.mapper.WeUserMapper;
......@@ -52,34 +55,24 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper, WeUser> impleme
@Autowired
private WeUserClient weUserClient;
@Autowired
private WeMsgAuditClient weMsgAuditClient;
@Autowired
private RuoYiConfig ruoYiConfig;
@Override
public List<WeUser> getListByIds(List<Long> idList) {
return this.list(new LambdaQueryWrapper<WeUser>().in(WeUser::getUserId,idList));
}
@Autowired
private WeCustomerClient weCustomerClient;
@Override
public WeUser getById(Long id) {
return super.getById(id);
}
/**
* 查询通讯录相关客户
*
* @param userId 通讯录相关客户ID
* @return 通讯录相关客户
*/
@Override
public WeUser getByUserId(String userId) {
return this.getOne(new LambdaQueryWrapper<WeUser>()
.eq(WeUser::getUserId, userId));
}
/**
* 查询通讯录相关客户列表
......@@ -89,7 +82,17 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper, WeUser> impleme
*/
@Override
public List<WeUser> getList(WeUser weUser) {
return weUserMapper.getList(weUser);
return this.list(new LambdaQueryWrapper<WeUser>()
.like(StringUtils.isNotEmpty(weUser.getName()),WeUser::getName,weUser.getName())
.eq(weUser.getIsActivate() !=null,WeUser::getIsActivate,weUser.getIsActivate())
.eq(weUser.getIsConfigCustomerContact() != null,WeUser::getIsConfigCustomerContact,weUser.getIsConfigCustomerContact())
.apply(StringUtils.isNotBlank( weUser.getBeginTime()),
"date_format (create_time,'%Y-%m-%d') >= date_format('" + weUser.getBeginTime() + "','%Y-%m-%d')")
.apply(StringUtils.isNotBlank(weUser.getEndTime()),
"date_format (create_time,'%Y-%m-%d') <= date_format('" + weUser.getEndTime() + "','%Y-%m-%d')")
);
}
/**
......@@ -232,6 +235,24 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper, WeUser> impleme
for(List<WeUser> list : lists){
this.weUserMapper.insertBatch(list);
}
//获取外部联系人列表
FollowUserList followUserList = weCustomerClient.getFollowUserList();
if (WeConstans.WE_SUCCESS_CODE.equals(followUserList.getErrcode())
&& ArrayUtil.isNotEmpty(followUserList.getFollow_user())) {
//设置员工是否开启外部联系人功能
this.update(WeUser.builder()
.isConfigCustomerContact(new Integer(1))
.build(),new LambdaQueryWrapper<WeUser>()
.eq(WeUser::getUserId,ListUtil.toList(followUserList.getFollow_user())));
}
}
}
......@@ -249,7 +270,7 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper, WeUser> impleme
CollectionUtil.newArrayList(userIds).forEach(userId-> weUsers.add(
WeUser.builder()
.userId(userId)
.isActivate(WeConstans.WE_USER_IS_LEAVE)
.isActivate(WeConstans.corpUserEnum.ACTIVE_STATE_FIVE.getKey())
.dimissionTime(new Date())
.build()
));
......@@ -294,12 +315,6 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper, WeUser> impleme
return this.baseMapper.getAllocateGroups(weAllocateGroupsVo);
}
@Override
public List<WeUser> getPermitUserList(WeMsgAuditDto msgAuditDto) {
WeMsgAuditDto permitUserList = weMsgAuditClient.getPermitUserList(msgAuditDto);
return this.list(new LambdaQueryWrapper<WeUser>()
.in(WeUser::getUserId,permitUserList.getIds()));
}
@Override
public WeUserInfoVo getUserInfo(String code, String agentId) {
......
......@@ -20,45 +20,45 @@
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<resultMap type="com.linkwechat.wecom.domain.vo.qr.WeQrCodeDetailVo" id="WeQrCodeDetailResult">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="groupId" column="group_id" jdbcType="INTEGER"/>
<result property="autoAdd" column="auto_add" jdbcType="INTEGER"/>
<result property="type" column="type" jdbcType="INTEGER"/>
<result property="ruleType" column="rule_type" jdbcType="INTEGER"/>
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="configId" column="config_id" jdbcType="VARCHAR"/>
<result property="qrCode" column="qr_code" jdbcType="VARCHAR"/>
<collection property="qrTags" ofType="com.linkwechat.wecom.domain.vo.tag.WeTagVo">
<result property="tagId" column="tag_id" jdbcType="INTEGER"/>
</collection>
<collection property="qrUserInfos" ofType="com.linkwechat.wecom.domain.vo.qr.WeQrScopeVo">
<result property="type" column="type" jdbcType="INTEGER"/>
<result property="beginTime" column="begin_time" jdbcType="VARCHAR"/>
<result property="endTime" column="end_time" jdbcType="VARCHAR"/>
<result property="workCycle" column="work_cycle" jdbcType="VARCHAR"/>
<collection property="qrUserInfos" ofType="com.linkwechat.wecom.domain.vo.qr.WeQrScopeUserVo">
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
</collection>
<collection property="qrUserInfos" ofType="com.linkwechat.wecom.domain.vo.qr.WeQrScopePartyVo">
<result property="party" column="party" jdbcType="VARCHAR"/>
<result property="partyName" column="party_name" jdbcType="VARCHAR"/>
</collection>
</collection>
<collection property="qrAttachments" ofType="com.linkwechat.wecom.domain.WeQrAttachments">
<result property="msgType" column="msg_type" jdbcType="VARCHAR"/>
<result property="content" column="content" jdbcType="VARCHAR"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
<result property="picUrl" column="pic_url" jdbcType="VARCHAR"/>
<result property="linkUrl" column="link_url" jdbcType="VARCHAR"/>
<result property="mediaId" column="media_id" jdbcType="VARCHAR"/>
<result property="fileUrl" column="file_url" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
</collection>
</resultMap>
<!-- <resultMap type="com.linkwechat.wecom.domain.vo.qr.WeQrCodeDetailVo" id="WeQrCodeDetailResult">-->
<!-- <result property="id" column="id" jdbcType="INTEGER"/>-->
<!-- <result property="name" column="name" jdbcType="VARCHAR"/>-->
<!-- <result property="groupId" column="group_id" jdbcType="INTEGER"/>-->
<!-- <result property="autoAdd" column="auto_add" jdbcType="INTEGER"/>-->
<!-- <result property="type" column="type" jdbcType="INTEGER"/>-->
<!-- <result property="ruleType" column="rule_type" jdbcType="INTEGER"/>-->
<!-- <result property="state" column="state" jdbcType="VARCHAR"/>-->
<!-- <result property="configId" column="config_id" jdbcType="VARCHAR"/>-->
<!-- <result property="qrCode" column="qr_code" jdbcType="VARCHAR"/>-->
<!-- <collection property="qrTags" ofType="com.linkwechat.wecom.domain.vo.tag.WeTagVo">-->
<!-- <result property="tagId" column="tag_id" jdbcType="INTEGER"/>-->
<!-- </collection>-->
<!-- <collection property="qrUserInfos" ofType="com.linkwechat.wecom.domain.vo.qr.WeQrScopeVo">-->
<!-- <result property="type" column="type" jdbcType="INTEGER"/>-->
<!-- <result property="beginTime" column="begin_time" jdbcType="VARCHAR"/>-->
<!-- <result property="endTime" column="end_time" jdbcType="VARCHAR"/>-->
<!-- <result property="workCycle" column="work_cycle" jdbcType="VARCHAR"/>-->
<!-- <collection property="qrUserInfos" ofType="com.linkwechat.wecom.domain.vo.qr.WeQrScopeUserVo">-->
<!-- <result property="userId" column="user_id" jdbcType="VARCHAR"/>-->
<!-- <result property="userName" column="user_name" jdbcType="VARCHAR"/>-->
<!-- </collection>-->
<!-- <collection property="qrUserInfos" ofType="com.linkwechat.wecom.domain.vo.qr.WeQrScopePartyVo">-->
<!-- <result property="party" column="party" jdbcType="VARCHAR"/>-->
<!-- <result property="partyName" column="party_name" jdbcType="VARCHAR"/>-->
<!-- </collection>-->
<!-- </collection>-->
<!-- <collection property="qrAttachments" ofType="com.linkwechat.wecom.domain.WeQrAttachments">-->
<!-- <result property="msgType" column="msg_type" jdbcType="VARCHAR"/>-->
<!-- <result property="content" column="content" jdbcType="VARCHAR"/>-->
<!-- <result property="title" column="title" jdbcType="VARCHAR"/>-->
<!-- <result property="description" column="description" jdbcType="VARCHAR"/>-->
<!-- <result property="picUrl" column="pic_url" jdbcType="VARCHAR"/>-->
<!-- <result property="linkUrl" column="link_url" jdbcType="VARCHAR"/>-->
<!-- <result property="mediaId" column="media_id" jdbcType="VARCHAR"/>-->
<!-- <result property="fileUrl" column="file_url" jdbcType="VARCHAR"/>-->
<!-- <result property="appId" column="app_id" jdbcType="VARCHAR"/>-->
<!-- </collection>-->
<!-- </resultMap>-->
<sql id="selectWeQrCodeVo">
select id, name, group_id, auto_add, type, rule_type, state, scan_num, config_id, qr_code, create_by, create_time, update_by, update_time, del_flag from we_qr_code
......@@ -106,22 +106,22 @@
where 1=1
</sql>
<select id="getQrDetailByQrId" resultMap="WeQrCodeDetailResult">
<include refid="selectWeQrCodeDetailVo"/>
<if test="qrId != null">
and wqc.id = #{qrId}
</if>
</select>
<!-- <select id="getQrDetailByQrId" resultMap="WeQrCodeDetailResult">-->
<!-- <include refid="selectWeQrCodeDetailVo"/>-->
<!-- <if test="qrId != null">-->
<!-- and wqc.id = #{qrId}-->
<!-- </if>-->
<!-- </select>-->
<select id="getQrDetailByQrIds" resultMap="WeQrCodeDetailResult">
<include refid="selectWeQrCodeDetailVo"/>
<if test="qrIds != null and qrIds.size > 0">
and wqc.id in
<foreach item="qrId" collection="qrIds" index="index" open="(" separator="," close=")">
#{qrId}
</foreach>
</if>
</select>
<!-- <select id="getQrDetailByQrIds" resultMap="WeQrCodeDetailResult">-->
<!-- <include refid="selectWeQrCodeDetailVo"/>-->
<!-- <if test="qrIds != null and qrIds.size > 0">-->
<!-- and wqc.id in-->
<!-- <foreach item="qrId" collection="qrIds" index="index" open="(" separator="," close=")">-->
<!-- #{qrId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- </select>-->
<select id="getQrCodeList" resultType="java.lang.Long">
select
......
......@@ -104,18 +104,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<select id="findCustomerTagByFlowerCustomerRelId" resultMap="WeTagGroupResult">
SELECT
wt.tag_id,
wt.`name`,
wtg.gourp_name,
wtg.group_id
FROM
we_flower_customer_tag_rel wfctr
INNER JOIN we_tag wt ON wfctr.tag_id = wt.tag_id
INNER JOIN we_tag_group wtg ON wt.group_id = wtg.group_id
WHERE wt.`status`=0 and wtg.`status`=0 and wfctr.user_id=#{userid} and wfctr.external_userid=#{externalUserid}
</select>
<!-- <select id="findCustomerTagByFlowerCustomerRelId" resultMap="WeTagGroupResult">-->
<!-- SELECT-->
<!-- wt.tag_id,-->
<!-- wt.`name`,-->
<!-- wtg.gourp_name,-->
<!-- wtg.group_id-->
<!-- FROM-->
<!-- we_flower_customer_tag_rel wfctr-->
<!-- INNER JOIN we_tag wt ON wfctr.tag_id = wt.tag_id-->
<!-- INNER JOIN we_tag_group wtg ON wt.group_id = wtg.group_id-->
<!-- WHERE wt.`status`=0 and wtg.`status`=0 and wfctr.user_id=#{userid} and wfctr.external_userid=#{externalUserid}-->
<!-- </select>-->
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!