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 7b9ac956
authored
Oct 28, 2020
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改离职分配相关bug
1 parent
89d2b0cd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
174 additions
and
14 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeUserController.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeAllocateCustomersVo.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeAllocateGroupsVo.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeUserMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeUserService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeUserServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeUserMapper.xml
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeUserController.java
View file @
7b9ac95
...
...
@@ -7,6 +7,8 @@ import com.linkwechat.common.core.domain.AjaxResult;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.wecom.domain.WeUser
;
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.service.IWeCustomerService
;
...
...
@@ -184,6 +186,33 @@ public class WeUserController extends BaseController {
}
/**
* 获取历史分配记录的成员
* @param weAllocateCustomersVo
* @return
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:user:getAllocateCustomers')"
)
@GetMapping
({
"/getAllocateCustomers"
})
public
TableDataInfo
getAllocateCustomers
(
WeAllocateCustomersVo
weAllocateCustomersVo
){
startPage
();
List
<
WeAllocateCustomersVo
>
list
=
weUserService
.
getAllocateCustomers
(
weAllocateCustomersVo
);
return
getDataTable
(
list
);
}
/**
* 获取历史分配记录的群
* @param weAllocateGroupsVo
* @return
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:user:getAllocateGroups')"
)
@GetMapping
({
"/getAllocateGroups"
})
public
TableDataInfo
getAllocateGroups
(
WeAllocateGroupsVo
weAllocateGroupsVo
){
startPage
();
List
<
WeAllocateGroupsVo
>
list
=
weUserService
.
getAllocateGroups
(
weAllocateGroupsVo
);
return
getDataTable
(
list
);
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeAllocateCustomersVo.java
View file @
7b9ac95
package
com
.
linkwechat
.
wecom
.
domain
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @description: 已分配
员工
信息
* @description: 已分配
客户
信息
* @author: HaoN
* @create: 2020-10-28 00:13
**/
@Data
public
class
WeAllocateCustomersVo
{
public
class
WeAllocateCustomersVo
extends
BaseEntity
{
/**客户名称*/
private
String
customerName
;
...
...
@@ -18,8 +20,12 @@ public class WeAllocateCustomersVo {
private
String
takeUserName
;
/**分配时间*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
allocateTime
;
/**接替人所在部门*/
private
String
department
;
/**原拥有着*/
private
String
handoverUserId
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeAllocateGroupsVo.java
0 → 100644
View file @
7b9ac95
package
com
.
linkwechat
.
wecom
.
domain
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @description: 已分配群信息
* @author: HaoN
* @create: 2020-10-28 00:13
**/
@Data
public
class
WeAllocateGroupsVo
extends
BaseEntity
{
/**群id*/
private
String
chatId
;
/**群名称*/
private
String
groupName
;
/**群客户数量*/
private
Integer
memberNum
;
/**群主所在部门*/
private
String
department
;
/**分配时间*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
allocateTime
;
/**新群主名称*/
private
String
newOwnerName
;
/**原群主id*/
private
String
oldOwner
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeUserMapper.java
View file @
7b9ac95
...
...
@@ -2,6 +2,8 @@ package com.linkwechat.wecom.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeUser
;
import
com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo
;
import
com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserVo
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -78,4 +80,21 @@ public interface WeUserMapper extends BaseMapper<WeUser>
* @return
*/
public
int
batchInsertWeUser
(
@Param
(
"weUsers"
)
List
<
WeUser
>
weUsers
);
/**
* 获取历史分配记录的成员
* @param weAllocateCustomersVo
* @return
*/
public
List
<
WeAllocateCustomersVo
>
getAllocateCustomers
(
WeAllocateCustomersVo
weAllocateCustomersVo
);
/**
* 获取历史分配群
* @param weAllocateGroupsVo
* @return
*/
public
List
<
WeAllocateGroupsVo
>
getAllocateGroups
(
WeAllocateGroupsVo
weAllocateGroupsVo
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeUserService.java
View file @
7b9ac95
...
...
@@ -2,6 +2,8 @@ package com.linkwechat.wecom.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeUser
;
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
;
...
...
@@ -90,4 +92,20 @@ public interface IWeUserService extends IService<WeUser>
*/
void
deleteUser
(
String
[]
ids
);
/**
* 获取历史分配记录的成员
* @param weAllocateCustomersVo
* @return
*/
List
<
WeAllocateCustomersVo
>
getAllocateCustomers
(
WeAllocateCustomersVo
weAllocateCustomersVo
);
/**
* 获取历史分配群
* @param weAllocateGroupsVo
* @return
*/
List
<
WeAllocateGroupsVo
>
getAllocateGroups
(
WeAllocateGroupsVo
weAllocateGroupsVo
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeUserServiceImpl.java
View file @
7b9ac95
...
...
@@ -14,6 +14,8 @@ import com.linkwechat.wecom.domain.dto.LeaveWeUserListsDto;
import
com.linkwechat.wecom.domain.dto.WeDepartMentDto
;
import
com.linkwechat.wecom.domain.dto.WeUserDto
;
import
com.linkwechat.wecom.domain.dto.WeUserListDto
;
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.mapper.WeUserMapper
;
...
...
@@ -232,4 +234,26 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
}
/**
* 获取历史分配记录的成员
* @param weAllocateCustomersVo
* @return
*/
@Override
public
List
<
WeAllocateCustomersVo
>
getAllocateCustomers
(
WeAllocateCustomersVo
weAllocateCustomersVo
)
{
return
this
.
baseMapper
.
getAllocateCustomers
(
weAllocateCustomersVo
);
}
/**
* 获取历史分配群
* @param weAllocateGroupsVo
* @return
*/
@Override
public
List
<
WeAllocateGroupsVo
>
getAllocateGroups
(
WeAllocateGroupsVo
weAllocateGroupsVo
)
{
return
this
.
baseMapper
.
getAllocateGroups
(
weAllocateGroupsVo
);
}
}
linkwe-wecom/src/main/resources/mapper/wecom/WeUserMapper.xml
View file @
7b9ac95
...
...
@@ -217,18 +217,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <select id="getAllocateCustomers">-->
<!-- SELECT-->
<!-- wc.`name`,-->
<!-- wu.user_name,-->
<!-- wac.allocate_time,-->
<!-- (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department-->
<!--FROM-->
<!-- we_allocate_customer wac-->
<!--LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid-->
<!--LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid-->
<!-- -->
<!-- </select>-->
<select
id=
"getAllocateCustomers"
parameterType=
"WeAllocateCustomersVo"
resultType=
"com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo"
>
SELECT
wc.`name` as customerName,
wu.user_name as takeUserName,
wac.allocate_time,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
FROM
we_allocate_customer wac
LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid
LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid
<where>
<if
test=
"handoverUserId != null and handoverUserId !=''"
>
and wac.handover_userid=#{handoverUserId}
</if>
<if
test=
"beginTime != null and beginTime !='' and endTime != null and endTime !=''"
>
DATE_FORMAT(wu.dimission_time,'%Y-%m-%d') BETWEEN #{beginTime} AND #{endTime}
</if>
</where>
</select>
<select
id=
"getAllocateGroups"
parameterType=
"WeAllocateGroupsVo"
resultType=
"com.linkwechat.wecom.domain.vo.WeAllocateGroupsVo"
>
SELECT
wu.user_name as newOwnerName,
wg.chat_id,
wg.group_name,
(SELECT count(*) FROM we_group_member wgm WHERE wgm.chat_id=wg.chat_id) as memberNum,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department,
wag.allocate_time
FROM
we_allocate_group wag
LEFT JOIN we_group wg ON wag.chat_id=wg.chat_id
LEFT JOIN we_user wu ON wu.user_id=wag.new_owner
<where>
<if
test=
"oldOwner != null and oldOwner !=''"
>
and wag.old_owner=#{oldOwner}
</if>
<if
test=
"beginTime != null and beginTime !='' and endTime != null and endTime !=''"
>
DATE_FORMAT(wu.dimission_time,'%Y-%m-%d') BETWEEN #{beginTime} AND #{endTime}
</if>
</where>
</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