Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a5962c56
authored
Oct 25, 2020
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交添加客户标签,移除客户标签,离职获取,离职分配等功能
1 parent
12843a42
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
490 additions
and
258 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeUserController.java
linkwe-admin/src/main/resources/application.yml
linkwe-common/src/main/java/com/linkwechat/common/constant/WeConstans.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeUserClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeAllocateCustomer.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeAllocateGroup.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerTagRel.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeUser.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/AllocateWeCustomerDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/AllocateWeGroupDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/customer/CutomerTagEdit.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeLeaveUserVo.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeMakeCustomerTag.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeAllocateCustomerMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeAllocateGroupMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeAllocateCustomerService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeAllocateGroupService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeFlowerCustomerRelService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAllocateCustomerServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAllocateGroupServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeFlowerCustomerRelServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeUserServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeAllocateCustomerMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeAllocateGroupMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeUserMapper.xml
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
View file @
a5962c5
...
@@ -9,6 +9,7 @@ import com.linkwechat.common.core.domain.AjaxResult;
...
@@ -9,6 +9,7 @@ import com.linkwechat.common.core.domain.AjaxResult;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.utils.poi.ExcelUtil
;
import
com.linkwechat.common.utils.poi.ExcelUtil
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -99,4 +100,36 @@ public class WeCustomerController extends BaseController
...
@@ -99,4 +100,36 @@ public class WeCustomerController extends BaseController
}
}
/**
* 客户打标签
* @param weMakeCustomerTag
* @return
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:customer:makeLabel')"
)
@Log
(
title
=
"客户打标签"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
"/makeLabel"
)
public
AjaxResult
makeLabel
(
@RequestBody
WeMakeCustomerTag
weMakeCustomerTag
){
weCustomerService
.
makeLabel
(
weMakeCustomerTag
);
return
AjaxResult
.
success
();
}
/**
* 移除客户标签
* @return
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:customer:removeLabel')"
)
@Log
(
title
=
"移除客户标签"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/removeLabel"
)
public
AjaxResult
removeLabel
(
@RequestBody
WeMakeCustomerTag
weMakeCustomerTag
){
weCustomerService
.
removeLabel
(
weMakeCustomerTag
);
return
AjaxResult
.
success
();
}
}
}
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeUserController.java
View file @
a5962c5
...
@@ -128,7 +128,8 @@ public class WeUserController extends BaseController {
...
@@ -128,7 +128,8 @@ public class WeUserController extends BaseController {
@GetMapping
({
"/leaveUserNoAllocateList"
})
@GetMapping
({
"/leaveUserNoAllocateList"
})
public
TableDataInfo
leaveUserNoAllocateList
(
WeLeaveUserVo
weLeaveUserVo
)
{
public
TableDataInfo
leaveUserNoAllocateList
(
WeLeaveUserVo
weLeaveUserVo
)
{
startPage
();
startPage
();
weLeaveUserVo
.
setIsActivate
(
WeConstans
.
LEAVE_NO_ALLOCATE_STATE
);
weLeaveUserVo
.
setIsActivate
(
WeConstans
.
WE_USER_IS_LEAVE
);
weLeaveUserVo
.
setIsAllocate
(
WeConstans
.
LEAVE_NO_ALLOCATE_STATE
);
List
<
WeLeaveUserVo
>
list
=
this
.
weUserService
.
leaveUserList
(
weLeaveUserVo
);
List
<
WeLeaveUserVo
>
list
=
this
.
weUserService
.
leaveUserList
(
weLeaveUserVo
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
...
...
linkwe-admin/src/main/resources/application.yml
View file @
a5962c5
...
@@ -144,4 +144,7 @@ wecome:
...
@@ -144,4 +144,7 @@ wecome:
-
/externalcontact/get
-
/externalcontact/get
-
/externalcontact/groupchat/list
-
/externalcontact/groupchat/list
-
/externalcontact/groupchat/get
-
/externalcontact/groupchat/get
-
/externalcontact/mark_tag
-
/externalcontact/transfer
-
/externalcontact/groupchat/transfer
fileUplodUrl
:
/media/upload,/media/uploadimg
fileUplodUrl
:
/media/upload,/media/uploadimg
linkwe-common/src/main/java/com/linkwechat/common/constant/WeConstans.java
View file @
a5962c5
...
@@ -52,12 +52,42 @@ public class WeConstans {
...
@@ -52,12 +52,42 @@ public class WeConstans {
/**
/**
* 离职未分配
* 离职未分配
*/
*/
public
static
final
Integer
LEAVE_NO_ALLOCATE_STATE
=
5
;
public
static
final
Integer
LEAVE_NO_ALLOCATE_STATE
=
0
;
/**
/**
* 离职已分配分配
* 离职已分配分配
*/
*/
public
static
final
Integer
LEAVE_ALLOCATE_STATE
=
6
;
public
static
final
Integer
LEAVE_ALLOCATE_STATE
=
1
;
/**
* 已激活
*/
public
static
final
Integer
WE_USER_IS_ACTIVATE
=
1
;
/**
* 已禁用
*/
public
static
final
Integer
WE_USER_IS_FORBIDDEN
=
2
;
/**
* 已离职
*/
public
static
final
Integer
WE_USER_IS_LEAVE
=
5
;
/**
* 未激活
*/
public
static
final
Integer
WE_USER_IS_NO_ACTIVATE
=
4
;
/**
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerClient.java
View file @
a5962c5
...
@@ -5,6 +5,7 @@ import com.dtflys.forest.annotation.Query;
...
@@ -5,6 +5,7 @@ import com.dtflys.forest.annotation.Query;
import
com.dtflys.forest.annotation.Request
;
import
com.dtflys.forest.annotation.Request
;
import
com.linkwechat.wecom.domain.dto.WeCustomerDto
;
import
com.linkwechat.wecom.domain.dto.WeCustomerDto
;
import
com.linkwechat.wecom.domain.dto.WeResultDto
;
import
com.linkwechat.wecom.domain.dto.WeResultDto
;
import
com.linkwechat.wecom.domain.dto.customer.CutomerTagEdit
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserDetail
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserDetail
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserList
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserList
;
import
com.linkwechat.wecom.domain.dto.customer.FollowUserList
;
import
com.linkwechat.wecom.domain.dto.customer.FollowUserList
;
...
@@ -53,4 +54,14 @@ public interface WeCustomerClient {
...
@@ -53,4 +54,14 @@ public interface WeCustomerClient {
WeResultDto
remark
(
@DataObject
WeCustomerDto
.
WeCustomerRemark
weCustomerRemark
);
WeResultDto
remark
(
@DataObject
WeCustomerDto
.
WeCustomerRemark
weCustomerRemark
);
/**
* 编辑客户标签
* @return
*/
@Request
(
url
=
"/externalcontact/mark_tag"
,
type
=
"POST"
)
WeResultDto
makeCustomerLabel
(
@DataObject
CutomerTagEdit
cutomerTagEdit
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeUserClient.java
View file @
a5962c5
...
@@ -3,9 +3,7 @@ package com.linkwechat.wecom.client;
...
@@ -3,9 +3,7 @@ package com.linkwechat.wecom.client;
import
com.dtflys.forest.annotation.DataObject
;
import
com.dtflys.forest.annotation.DataObject
;
import
com.dtflys.forest.annotation.Query
;
import
com.dtflys.forest.annotation.Query
;
import
com.dtflys.forest.annotation.Request
;
import
com.dtflys.forest.annotation.Request
;
import
com.linkwechat.wecom.domain.dto.WeResultDto
;
import
com.linkwechat.wecom.domain.dto.*
;
import
com.linkwechat.wecom.domain.dto.WeUserDto
;
import
com.linkwechat.wecom.domain.dto.WeUserListDto
;
/**
/**
* @description: 企业微信通讯录成员
* @description: 企业微信通讯录成员
...
@@ -62,4 +60,24 @@ public interface WeUserClient {
...
@@ -62,4 +60,24 @@ public interface WeUserClient {
*/
*/
@Request
(
url
=
"/user/list"
)
@Request
(
url
=
"/user/list"
)
WeUserListDto
list
(
@Query
(
"department_id"
)
Long
departmentId
,
@Query
(
"fetch_child"
)
Integer
fetchChild
);
WeUserListDto
list
(
@Query
(
"department_id"
)
Long
departmentId
,
@Query
(
"fetch_child"
)
Integer
fetchChild
);
/**
* 分配客户
* @return
*/
@Request
(
url
=
"/externalcontact/transfer"
,
type
=
"POST"
)
WeResultDto
allocateCustomer
(
@DataObject
AllocateWeCustomerDto
allocateWeCustomerDto
);
/**
* 分配成员群
* @return
*/
@Request
(
url
=
"/externalcontact/groupchat/transfer"
,
type
=
"POST"
)
WeResultDto
allocateGroup
(
@DataObject
AllocateWeGroupDto
allocateWeGroupDto
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeAllocateCustomer.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* 离职分配的客户列对象 we_allocate_customer
*
* @author ruoyi
* @date 2020-10-24
*/
@Data
@TableName
(
"we_allocate_customer"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeAllocateCustomer
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
private
Long
id
;
/** 接替成员的userid */
private
String
takeoverUserid
;
/** 被分配的客户id */
private
String
externalUserid
;
/** 分配时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
allocateTime
;
/** 原跟进成员的userid */
private
String
handoverUserid
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeAllocateGroup.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* 分配的群租对象 we_allocate_group
*
* @author ruoyi
* @date 2020-10-24
*/
@Data
@TableName
(
"we_allocate_group"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeAllocateGroup
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
private
Long
id
=
SnowFlakeUtil
.
nextId
();;
/** 分配的群id */
private
String
chatId
;
/** 新群主 */
private
String
newOwner
;
/** 原群主 */
private
String
oldOwner
;
/** 分配时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
allocateTime
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerTagRel.java
View file @
a5962c5
...
@@ -2,6 +2,7 @@ package com.linkwechat.wecom.domain;
...
@@ -2,6 +2,7 @@ package com.linkwechat.wecom.domain;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
@@ -16,7 +17,7 @@ public class WeCustomerTagRel extends BaseEntity
...
@@ -16,7 +17,7 @@ public class WeCustomerTagRel extends BaseEntity
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
/** $column.columnComment */
private
Long
id
;
private
Long
id
=
SnowFlakeUtil
.
nextId
();
;
/** 客户id */
/** 客户id */
private
Long
customerId
;
private
Long
customerId
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeUser.java
View file @
a5962c5
...
@@ -25,7 +25,6 @@ import java.util.Date;
...
@@ -25,7 +25,6 @@ import java.util.Date;
* @date 2020-08-31
* @date 2020-08-31
*/
*/
@Data
@Data
@ApiModel
(
"通讯录用户"
)
@TableName
(
"we_user"
)
@TableName
(
"we_user"
)
public
class
WeUser
extends
BaseEntity
public
class
WeUser
extends
BaseEntity
{
{
...
@@ -35,86 +34,70 @@ public class WeUser extends BaseEntity
...
@@ -35,86 +34,70 @@ public class WeUser extends BaseEntity
private
Long
id
=
SnowFlakeUtil
.
nextId
();
private
Long
id
=
SnowFlakeUtil
.
nextId
();
/** 用户头像 */
/** 用户头像 */
@ApiModelProperty
(
"用户头像,该值来自素材库"
)
private
String
avatarMediaid
;
private
String
avatarMediaid
;
/** 用户名称 */
/** 用户名称 */
@ApiModelProperty
(
"姓名"
)
@NotBlank
(
message
=
"姓名不可为空"
)
@NotBlank
(
message
=
"姓名不可为空"
)
private
String
name
;
private
String
name
;
/** 用户昵称 */
/** 用户昵称 */
@ApiModelProperty
(
"昵称"
)
private
String
alias
;
private
String
alias
;
/** 账号 */
/** 账号 */
@ApiModelProperty
(
"账号"
)
@NotBlank
(
message
=
"账号不可为空"
)
@NotBlank
(
message
=
"账号不可为空"
)
private
String
userId
;
private
String
userId
;
/** 性别。1表示男性,2表示女性 */
/** 性别。1表示男性,2表示女性 */
@ApiModelProperty
(
"性别。1表示男性,2表示女性"
)
private
Integer
gender
=
new
Integer
(
1
);
private
Integer
gender
=
new
Integer
(
1
);
/** 手机号 */
/** 手机号 */
@ApiModelProperty
(
"手机号"
)
@NotBlank
(
message
=
"手机号不可为空"
)
@NotBlank
(
message
=
"手机号不可为空"
)
private
String
mobile
;
private
String
mobile
;
/** 邮箱 */
/** 邮箱 */
@ApiModelProperty
(
"邮箱"
)
private
String
email
;
private
String
email
;
/** 个人微信号 */
/** 个人微信号 */
@ApiModelProperty
(
"个人微信号"
)
private
String
wxAccount
;
private
String
wxAccount
;
/** 用户所属部门,使用逗号隔开,字符串格式存储 */
/** 用户所属部门,使用逗号隔开,字符串格式存储 */
@ApiModelProperty
(
"用户所属部门,使用逗号隔开,字符串格式存储"
)
private
String
[]
department
;
private
String
[]
department
;
/** 职务 */
/** 职务 */
@ApiModelProperty
(
"职务"
)
private
String
position
;
private
String
position
;
/** 1表示为上级,0表示普通成员(非上级)。 */
/** 1表示为上级,0表示普通成员(非上级)。 */
@ApiModelProperty
(
"1表示为上级,0表示普通成员(非上级)"
)
private
String
[]
isLeaderInDept
;
private
String
[]
isLeaderInDept
;
/** 入职时间 */
/** 入职时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@ApiModelProperty
(
"入职时间"
)
private
Date
joinTime
;
private
Date
joinTime
;
/** 是否启用(1表示启用成员,0表示禁用成员) */
/** 是否启用(1表示启用成员,0表示禁用成员) */
@ApiModelProperty
(
"是否启用(1表示启用成员,0表示禁用成员)"
)
private
Integer
enable
=
new
Integer
(
1
);
private
Integer
enable
=
new
Integer
(
1
);
/** 身份证号 */
/** 身份证号 */
@ApiModelProperty
(
"身份证号"
)
private
String
idCard
;
private
String
idCard
;
/** QQ号 */
/** QQ号 */
@ApiModelProperty
(
"QQ号"
)
private
String
qqAccount
;
private
String
qqAccount
;
/** 座机 */
/** 座机 */
@ApiModelProperty
(
"座机"
)
private
String
telephone
;
private
String
telephone
;
/** 地址 */
/** 地址 */
@ApiModelProperty
(
"地址"
)
private
String
address
;
private
String
address
;
/** 生日 */
/** 生日 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@ApiModelProperty
(
"生日"
)
private
Date
birthday
;
private
Date
birthday
;
/** 是否激活(1:是;2:否)该字段主要表示当前信息是否同步微信 */
/** 是否激活(1:是;2:否)该字段主要表示当前信息是否同步微信 */
@ApiModelProperty
(
"是否激活(1:是;2:否)该字段主要表示当前信息是否同步微信 "
)
private
Integer
isActivate
=
new
Integer
(
2
);
private
Integer
isActivate
=
new
Integer
(
2
);
/** 离职是否分配(1:已分配;0:未分配;) */
private
Integer
isAllocate
;
/** 转化成企业微信需要的dto对象 */
/** 转化成企业微信需要的dto对象 */
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/AllocateWeCustomerDto.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
domain
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @description: 分配客户
* @author: HaoN
* @create: 2020-10-24 23:26
**/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
AllocateWeCustomerDto
{
/**外部联系人的userid,注意不是企业成员的帐号*/
private
String
handover_userid
;
/**原跟进成员的userid*/
private
String
external_userid
;
/**接替成员的userid*/
private
String
takeover_userid
;
/**转移成功后发给客户的消息,最多200个字符,不填则使用默认文案,目前只对在职成员分配客户的情况生效*/
private
String
transfer_success_msg
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/AllocateWeGroupDto.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
domain
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @description: 离职成员群分配
* @author: HaoN
* @create: 2020-10-24 23:37
**/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
AllocateWeGroupDto
{
/**需要转群主的客户群ID列表。*/
private
String
[]
chat_id_list
;
/**新群主ID。*/
private
String
new_owner
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/customer/CutomerTagEdit.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
domain
.
dto
.
customer
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @description: 客户标签编辑
* @author: HaoN
* @create: 2020-10-24 21:01
**/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
CutomerTagEdit
{
/**添加外部联系人的userid*/
private
String
userid
;
/**外部联系人userid*/
private
String
external_userid
;
/**要标记的标签列表*/
private
String
[]
add_tag
;
/**要移除的标签列表*/
private
String
[]
remove_tag
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeLeaveUserVo.java
View file @
a5962c5
...
@@ -24,4 +24,8 @@ public class WeLeaveUserVo extends BaseEntity {
...
@@ -24,4 +24,8 @@ public class WeLeaveUserVo extends BaseEntity {
private
Integer
isActivate
;
private
Integer
isActivate
;
private
String
userId
;
private
Integer
isAllocate
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeMakeCustomerTag.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
domain
.
vo
;
import
com.linkwechat.wecom.domain.WeTag
;
import
lombok.Data
;
import
java.util.List
;
/**
* @description: 客户打标签实体
* @author: HaoN
* @create: 2020-10-24 20:09
**/
@Data
public
class
WeMakeCustomerTag
{
private
String
externalUserid
;
private
List
<
WeTag
>
addTag
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeAllocateCustomerMapper.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeAllocateCustomer
;
/**
* 离职分配的客户列Mapper接口
*
* @author ruoyi
* @date 2020-10-24
*/
public
interface
WeAllocateCustomerMapper
extends
BaseMapper
<
WeAllocateCustomer
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeAllocateGroupMapper.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeAllocateGroup
;
/**
* 分配的群租Mapper接口
*
* @author ruoyi
* @date 2020-10-24
*/
public
interface
WeAllocateGroupMapper
extends
BaseMapper
<
WeAllocateGroup
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeAllocateCustomerService.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeAllocateCustomer
;
/**
* 离职分配的客户列Service接口
*
* @author ruoyi
* @date 2020-10-24
*/
public
interface
IWeAllocateCustomerService
extends
IService
<
WeAllocateCustomer
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeAllocateGroupService.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeAllocateGroup
;
/**
* 分配的群租Service接口
*
* @author ruoyi
* @date 2020-10-24
*/
public
interface
IWeAllocateGroupService
extends
IService
<
WeAllocateGroup
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
View file @
a5962c5
...
@@ -5,6 +5,7 @@ import java.util.List;
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
/**
/**
* 企业微信客户Service接口
* 企业微信客户Service接口
...
@@ -30,38 +31,6 @@ public interface IWeCustomerService extends IService<WeCustomer>
...
@@ -30,38 +31,6 @@ public interface IWeCustomerService extends IService<WeCustomer>
*/
*/
public
List
<
WeCustomer
>
selectWeCustomerList
(
WeCustomer
weCustomer
);
public
List
<
WeCustomer
>
selectWeCustomerList
(
WeCustomer
weCustomer
);
// /**
// * 新增企业微信客户
// *
// * @param weCustomer 企业微信客户
// * @return 结果
// */
// public int insertWeCustomer(WeCustomer weCustomer);
//
// /**
// * 修改企业微信客户
// *
// * @param weCustomer 企业微信客户
// * @return 结果
// */
// public int updateWeCustomer(WeCustomer weCustomer);
//
// /**
// * 批量删除企业微信客户
// *
// * @param ids 需要删除的企业微信客户ID
// * @return 结果
// */
// public int deleteWeCustomerByIds(Long[] ids);
//
// /**
// * 删除企业微信客户信息
// *
// * @param id 企业微信客户ID
// * @return 结果
// */
// public int deleteWeCustomerById(Long id);
/**
/**
* 同步客户接口
* 同步客户接口
...
@@ -75,4 +44,18 @@ public interface IWeCustomerService extends IService<WeCustomer>
...
@@ -75,4 +44,18 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param weLeaveUserInfoAllocateVo
* @param weLeaveUserInfoAllocateVo
*/
*/
public
void
allocateWeCustomer
(
WeLeaveUserInfoAllocateVo
weLeaveUserInfoAllocateVo
);
public
void
allocateWeCustomer
(
WeLeaveUserInfoAllocateVo
weLeaveUserInfoAllocateVo
);
/**
* 客户打标签
* @param weMakeCustomerTag
*/
public
void
makeLabel
(
WeMakeCustomerTag
weMakeCustomerTag
);
/**
* 移除客户标签
* @param weMakeCustomerTag
*/
public
void
removeLabel
(
WeMakeCustomerTag
weMakeCustomerTag
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeFlowerCustomerRelService.java
View file @
a5962c5
...
@@ -13,69 +13,5 @@ import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
...
@@ -13,69 +13,5 @@ import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
*/
*/
public
interface
IWeFlowerCustomerRelService
extends
IService
<
WeFlowerCustomerRel
>
public
interface
IWeFlowerCustomerRelService
extends
IService
<
WeFlowerCustomerRel
>
{
{
/**
* 查询具有外部联系人功能企业员工也客户的关系
*
* @param id 具有外部联系人功能企业员工也客户的关系ID
* @return 具有外部联系人功能企业员工也客户的关系
*/
public
WeFlowerCustomerRel
selectWeFlowerCustomerRelById
(
Long
id
);
/**
* 查询具有外部联系人功能企业员工也客户的关系列表
*
* @param weFlowerCustomerRel 具有外部联系人功能企业员工也客户的关系
* @return 具有外部联系人功能企业员工也客户的关系集合
*/
public
List
<
WeFlowerCustomerRel
>
selectWeFlowerCustomerRelList
(
WeFlowerCustomerRel
weFlowerCustomerRel
);
/**
* 新增具有外部联系人功能企业员工也客户的关系
*
* @param weFlowerCustomerRel 具有外部联系人功能企业员工也客户的关系
* @return 结果
*/
public
int
insertWeFlowerCustomerRel
(
WeFlowerCustomerRel
weFlowerCustomerRel
);
/**
* 修改具有外部联系人功能企业员工也客户的关系
*
* @param weFlowerCustomerRel 具有外部联系人功能企业员工也客户的关系
* @return 结果
*/
public
int
updateWeFlowerCustomerRel
(
WeFlowerCustomerRel
weFlowerCustomerRel
);
/**
* 批量删除具有外部联系人功能企业员工也客户的关系
*
* @param ids 需要删除的具有外部联系人功能企业员工也客户的关系ID
* @return 结果
*/
public
int
deleteWeFlowerCustomerRelByIds
(
Long
[]
ids
);
/**
* 删除具有外部联系人功能企业员工也客户的关系信息
*
* @param id 具有外部联系人功能企业员工也客户的关系ID
* @return 结果
*/
public
int
deleteWeFlowerCustomerRelById
(
Long
id
);
/**
* 批量插入
* @param WeFlowerCustomerRels
* @return
*/
public
int
batchInsetWeFlowerCustomerRel
(
List
<
WeFlowerCustomerRel
>
WeFlowerCustomerRels
);
/**
* 批量逻辑删除
* @param ids
* @return
*/
public
int
batchLogicDeleteByIds
(
List
<
Long
>
ids
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupService.java
View file @
a5962c5
...
@@ -16,10 +16,6 @@ public interface IWeGroupService extends IService<WeGroup> {
...
@@ -16,10 +16,6 @@ public interface IWeGroupService extends IService<WeGroup> {
List
<
WeGroup
>
selectWeGroupList
(
WeGroup
paramWeGroup
);
List
<
WeGroup
>
selectWeGroupList
(
WeGroup
paramWeGroup
);
// int batchLogicDeleteByIds(List<Long> ids);
//
// int batchInsetWeGroup(List<WeGroup> weGroups);
void
allocateWeGroup
(
WeLeaveUserInfoAllocateVo
weLeaveUserInfoAllocateVo
);
void
allocateWeGroup
(
WeLeaveUserInfoAllocateVo
weLeaveUserInfoAllocateVo
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAllocateCustomerServiceImpl.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.wecom.domain.WeAllocateCustomer
;
import
com.linkwechat.wecom.mapper.WeAllocateCustomerMapper
;
import
com.linkwechat.wecom.service.IWeAllocateCustomerService
;
import
org.springframework.stereotype.Service
;
/**
* 离职分配的客户列Service业务层处理
*
* @author ruoyi
* @date 2020-10-24
*/
@Service
public
class
WeAllocateCustomerServiceImpl
extends
ServiceImpl
<
WeAllocateCustomerMapper
,
WeAllocateCustomer
>
implements
IWeAllocateCustomerService
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAllocateGroupServiceImpl.java
0 → 100644
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.wecom.domain.WeAllocateGroup
;
import
com.linkwechat.wecom.mapper.WeAllocateGroupMapper
;
import
com.linkwechat.wecom.service.IWeAllocateGroupService
;
import
org.springframework.stereotype.Service
;
/**
* 分配的群租Service业务层处理
*
* @author ruoyi
* @date 2020-10-24
*/
@Service
public
class
WeAllocateGroupServiceImpl
extends
ServiceImpl
<
WeAllocateGroupMapper
,
WeAllocateGroup
>
implements
IWeAllocateGroupService
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
a5962c5
This diff is collapsed.
Click to expand it.
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeFlowerCustomerRelServiceImpl.java
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.linkwechat.wecom.mapper.WeFlowerCustomerRelMapper
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerRel
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerRel
;
import
com.linkwechat.wecom.mapper.WeFlowerCustomerRelMapper
;
import
com.linkwechat.wecom.service.IWeFlowerCustomerRelService
;
import
com.linkwechat.wecom.service.IWeFlowerCustomerRelService
;
import
org.springframework.stereotype.Service
;
/**
/**
* 具有外部联系人功能企业员工也客户的关系Service业务层处理
* 具有外部联系人功能企业员工也客户的关系Service业务层处理
...
@@ -19,101 +15,7 @@ import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
...
@@ -19,101 +15,7 @@ import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
@Service
@Service
public
class
WeFlowerCustomerRelServiceImpl
extends
ServiceImpl
<
WeFlowerCustomerRelMapper
,
WeFlowerCustomerRel
>
implements
IWeFlowerCustomerRelService
public
class
WeFlowerCustomerRelServiceImpl
extends
ServiceImpl
<
WeFlowerCustomerRelMapper
,
WeFlowerCustomerRel
>
implements
IWeFlowerCustomerRelService
{
{
@Autowired
private
WeFlowerCustomerRelMapper
weFlowerCustomerRelMapper
;
/**
* 查询具有外部联系人功能企业员工也客户的关系
*
* @param id 具有外部联系人功能企业员工也客户的关系ID
* @return 具有外部联系人功能企业员工也客户的关系
*/
@Override
public
WeFlowerCustomerRel
selectWeFlowerCustomerRelById
(
Long
id
)
{
return
weFlowerCustomerRelMapper
.
selectWeFlowerCustomerRelById
(
id
);
}
/**
* 查询具有外部联系人功能企业员工也客户的关系列表
*
* @param weFlowerCustomerRel 具有外部联系人功能企业员工也客户的关系
* @return 具有外部联系人功能企业员工也客户的关系
*/
@Override
public
List
<
WeFlowerCustomerRel
>
selectWeFlowerCustomerRelList
(
WeFlowerCustomerRel
weFlowerCustomerRel
)
{
return
weFlowerCustomerRelMapper
.
selectWeFlowerCustomerRelList
(
weFlowerCustomerRel
);
}
/**
* 新增具有外部联系人功能企业员工也客户的关系
*
* @param weFlowerCustomerRel 具有外部联系人功能企业员工也客户的关系
* @return 结果
*/
@Override
public
int
insertWeFlowerCustomerRel
(
WeFlowerCustomerRel
weFlowerCustomerRel
)
{
weFlowerCustomerRel
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
weFlowerCustomerRelMapper
.
insertWeFlowerCustomerRel
(
weFlowerCustomerRel
);
}
/**
* 修改具有外部联系人功能企业员工也客户的关系
*
* @param weFlowerCustomerRel 具有外部联系人功能企业员工也客户的关系
* @return 结果
*/
@Override
public
int
updateWeFlowerCustomerRel
(
WeFlowerCustomerRel
weFlowerCustomerRel
)
{
return
weFlowerCustomerRelMapper
.
updateWeFlowerCustomerRel
(
weFlowerCustomerRel
);
}
/**
* 批量删除具有外部联系人功能企业员工也客户的关系
*
* @param ids 需要删除的具有外部联系人功能企业员工也客户的关系ID
* @return 结果
*/
@Override
public
int
deleteWeFlowerCustomerRelByIds
(
Long
[]
ids
)
{
return
weFlowerCustomerRelMapper
.
deleteWeFlowerCustomerRelByIds
(
ids
);
}
/**
* 删除具有外部联系人功能企业员工也客户的关系信息
*
* @param id 具有外部联系人功能企业员工也客户的关系ID
* @return 结果
*/
@Override
public
int
deleteWeFlowerCustomerRelById
(
Long
id
)
{
return
weFlowerCustomerRelMapper
.
deleteWeFlowerCustomerRelById
(
id
);
}
/**
* 批量插入
* @param WeFlowerCustomerRels
* @return
*/
@Override
public
int
batchInsetWeFlowerCustomerRel
(
List
<
WeFlowerCustomerRel
>
WeFlowerCustomerRels
)
{
return
weFlowerCustomerRelMapper
.
batchInsetWeFlowerCustomerRel
(
WeFlowerCustomerRels
);
}
/**
* 批量逻辑删除
* @param ids
* @return
*/
@Override
public
int
batchLogicDeleteByIds
(
List
<
Long
>
ids
)
{
return
weFlowerCustomerRelMapper
.
batchLogicDeleteByIds
(
ids
);
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupServiceImpl.java
View file @
a5962c5
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.wecom.client.WeCustomerGroupClient
;
import
com.linkwechat.wecom.client.WeCustomerGroupClient
;
import
com.linkwechat.wecom.client.WeUserClient
;
import
com.linkwechat.wecom.domain.WeAllocateGroup
;
import
com.linkwechat.wecom.domain.WeGroup
;
import
com.linkwechat.wecom.domain.WeGroup
;
import
com.linkwechat.wecom.domain.WeGroupMember
;
import
com.linkwechat.wecom.domain.WeGroupMember
;
import
com.linkwechat.wecom.domain.dto.AllocateWeGroupDto
;
import
com.linkwechat.wecom.domain.dto.customer.CustomerGroupDetail
;
import
com.linkwechat.wecom.domain.dto.customer.CustomerGroupDetail
;
import
com.linkwechat.wecom.domain.dto.customer.CustomerGroupList
;
import
com.linkwechat.wecom.domain.dto.customer.CustomerGroupList
;
import
com.linkwechat.wecom.domain.dto.customer.CustomerGroupMember
;
import
com.linkwechat.wecom.domain.dto.customer.CustomerGroupMember
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.mapper.WeGroupMapper
;
import
com.linkwechat.wecom.mapper.WeGroupMapper
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.*
;
import
com.linkwechat.wecom.service.IWeGroupMemberService
;
import
com.linkwechat.wecom.service.IWeGroupService
;
import
com.linkwechat.wecom.service.IWeUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -48,6 +50,14 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple
...
@@ -48,6 +50,14 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple
private
IWeCustomerService
weCustomerService
;
private
IWeCustomerService
weCustomerService
;
@Autowired
private
IWeAllocateGroupService
iWeAllocateGroupService
;
@Autowired
private
WeUserClient
weUserClient
;
public
List
<
WeGroup
>
selectWeGroupList
(
WeGroup
weGroup
)
{
public
List
<
WeGroup
>
selectWeGroupList
(
WeGroup
weGroup
)
{
return
this
.
baseMapper
.
selectWeGroupList
(
weGroup
);
return
this
.
baseMapper
.
selectWeGroupList
(
weGroup
);
}
}
...
@@ -60,23 +70,38 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple
...
@@ -60,23 +70,38 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple
@Override
@Override
@Transactional
@Transactional
public
void
allocateWeGroup
(
WeLeaveUserInfoAllocateVo
weLeaveUserInfoAllocateVo
)
{
public
void
allocateWeGroup
(
WeLeaveUserInfoAllocateVo
weLeaveUserInfoAllocateVo
)
{
// //分配群
// List<WeGroup> weGroups = this.selectWeGroupList(WeGroup.builder()
List
<
WeGroup
>
weGroups
// .groupLeaderUserId(weLeaveUserInfoAllocateVo.getHandoverUserid())
=
this
.
list
(
new
LambdaQueryWrapper
<
WeGroup
>().
eq
(
WeGroup:
:
getOwner
,
weLeaveUserInfoAllocateVo
.
getHandoverUserid
()));
// .build());
if
(
CollectionUtil
.
isNotEmpty
(
weGroups
)){
// if(CollectionUtil.isNotEmpty(weGroups)){
List
<
WeAllocateGroup
>
weAllocateGroups
=
new
ArrayList
<>();
//
//更改本地群主
// this.batchLogicDeleteByIds(
weGroups
.
stream
().
forEach
(
k
->{
// weGroups.stream().map(WeGroup::getId).collect(Collectors.toList())
k
.
setOwner
(
weLeaveUserInfoAllocateVo
.
getTakeoverUserid
());
// );
weAllocateGroups
.
add
(
WeAllocateGroup
.
builder
()
//
.
allocateTime
(
new
Date
())
// weGroups.stream().forEach(k->{
.
chatId
(
k
.
getChatId
())
// k.setId(SnowFlakeUtil.nextId());
.
newOwner
(
weLeaveUserInfoAllocateVo
.
getTakeoverUserid
())
// k.setGroupLeaderUserId(weLeaveUserInfoAllocateVo.getTakeoverUserid());
.
oldOwner
(
weLeaveUserInfoAllocateVo
.
getHandoverUserid
())
// });
.
build
());
//
});
// this.batchInsetWeGroup(weGroups);
this
.
saveOrUpdateBatch
(
weGroups
);
// }
//分配记录保存
if
(
CollectionUtil
.
isNotEmpty
(
weAllocateGroups
)){
if
(
iWeAllocateGroupService
.
saveOrUpdateBatch
(
weAllocateGroups
)){
//同步企业微信端
weUserClient
.
allocateGroup
(
AllocateWeGroupDto
.
builder
()
.
chat_id_list
(
ArrayUtil
.
toArray
(
weAllocateGroups
.
stream
().
map
(
WeAllocateGroup:
:
getChatId
).
collect
(
Collectors
.
toList
()),
String
.
class
))
.
new_owner
(
weLeaveUserInfoAllocateVo
.
getTakeoverUserid
())
.
build
()
);
}
}
}
}
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeUserServiceImpl.java
View file @
a5962c5
...
@@ -170,7 +170,7 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
...
@@ -170,7 +170,7 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
* @param weLeaveUserInfoAllocateVo
* @param weLeaveUserInfoAllocateVo
*/
*/
@Override
@Override
@Transactional
(
isolation
=
Isolation
.
DEFAULT
,
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
allocateLeaveUserAboutData
(
WeLeaveUserInfoAllocateVo
weLeaveUserInfoAllocateVo
)
{
public
void
allocateLeaveUserAboutData
(
WeLeaveUserInfoAllocateVo
weLeaveUserInfoAllocateVo
)
{
try
{
try
{
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeAllocateCustomerMapper.xml
0 → 100644
View file @
a5962c5
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.linkwechat.wecom.mapper.WeAllocateCustomerMapper"
>
</mapper>
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeAllocateGroupMapper.xml
0 → 100644
View file @
a5962c5
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.linkwechat.wecom.mapper.WeAllocateGroupMapper"
>
</mapper>
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeUserMapper.xml
View file @
a5962c5
...
@@ -144,19 +144,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -144,19 +144,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"leaveUserList"
parameterType=
"WeLeaveUserVo"
resultType=
"com.linkwechat.wecom.domain.vo.WeLeaveUserVo"
>
<select
id=
"leaveUserList"
parameterType=
"WeLeaveUserVo"
resultType=
"com.linkwechat.wecom.domain.vo.WeLeaveUserVo"
>
SELECT
SELECT
we.user_name as userName,
wu.user_id,
we.department,
wu.user_name,
we.dimission_time as dimissionTime,
wu.dimission_time,
(SELECT count(wfcr.id) FROM we_flower_customer_rel wfcr WHERE wfcr.user_id=we.user_id) allocateCustomerNum,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department,
(SELECT count(wg.id) FROM we_group wg WHERE wg.group_leader_user_id=we.user_id) allocateGroupNum
(SELECT COUNT(*) FROM we_flower_customer_rel wfcr WHERE wfcr.user_id=wu.user_id) as allocateCustomerNum,
(SELECT COUNT(*) FROM we_group wg WHERE wg.`owner`=wu.user_id) as allocateGroupNum
FROM
FROM
we_user w
e
we_user w
u
<where>
<where>
<if
test=
"userName != null and userName !=''"
>
and w
e
.user_name=#{userName}
</if>
<if
test=
"userName != null and userName !=''"
>
and w
u
.user_name=#{userName}
</if>
<if
test=
"beginTime != null and beginTime !='' and endTime != null and endTime !=''"
>
<if
test=
"beginTime != null and beginTime !='' and endTime != null and endTime !=''"
>
DATE_FORMAT(w
e
.dimission_time,'%Y-%m-%d') BETWEEN #{beginTime} AND #{endTime}
DATE_FORMAT(w
u
.dimission_time,'%Y-%m-%d') BETWEEN #{beginTime} AND #{endTime}
</if>
</if>
<if
test=
"isActivate != null "
>
and we.is_activate = #{isActivate}
</if>
<if
test=
"isActivate != null "
>
and wu.is_activate = #{isActivate}
</if>
<if
test=
"isAllocate != null "
>
and wu.is_allocate = #{isAllocate}
</if>
</where>
</where>
</select>
</select>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment