提交 7b9ac956 编写于 作者: 水库浪子

修改离职分配相关bug

上级 89d2b0cd
......@@ -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);
}
......
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;
}
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;
}
......@@ -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);
}
......@@ -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);
}
......@@ -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);
}
}
......@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册