Commit 7b9ac956 by 水库浪子

修改离职分配相关bug

1 parent 89d2b0cd
...@@ -7,6 +7,8 @@ import com.linkwechat.common.core.domain.AjaxResult; ...@@ -7,6 +7,8 @@ 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.wecom.domain.WeUser; 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.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import com.linkwechat.wecom.service.IWeCustomerService; import com.linkwechat.wecom.service.IWeCustomerService;
...@@ -184,6 +186,33 @@ public class WeUserController extends BaseController { ...@@ -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; package com.linkwechat.wecom.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
* @description: 已分配员工信息 * @description: 已分配客户信息
* @author: HaoN * @author: HaoN
* @create: 2020-10-28 00:13 * @create: 2020-10-28 00:13
**/ **/
@Data @Data
public class WeAllocateCustomersVo { public class WeAllocateCustomersVo extends BaseEntity {
/**客户名称*/ /**客户名称*/
private String customerName; private String customerName;
...@@ -18,8 +20,12 @@ public class WeAllocateCustomersVo { ...@@ -18,8 +20,12 @@ public class WeAllocateCustomersVo {
private String takeUserName; private String takeUserName;
/**分配时间*/ /**分配时间*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date allocateTime; private Date allocateTime;
/**接替人所在部门*/ /**接替人所在部门*/
private String department; 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; ...@@ -2,6 +2,8 @@ package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeUser; 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 com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -78,4 +80,21 @@ public interface WeUserMapper extends BaseMapper<WeUser> ...@@ -78,4 +80,21 @@ public interface WeUserMapper extends BaseMapper<WeUser>
* @return * @return
*/ */
public int batchInsertWeUser(@Param("weUsers") List<WeUser> weUsers); 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; ...@@ -2,6 +2,8 @@ package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeUser; 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.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
...@@ -90,4 +92,20 @@ public interface IWeUserService extends IService<WeUser> ...@@ -90,4 +92,20 @@ public interface IWeUserService extends IService<WeUser>
*/ */
void deleteUser(String[] ids); 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; ...@@ -14,6 +14,8 @@ import com.linkwechat.wecom.domain.dto.LeaveWeUserListsDto;
import com.linkwechat.wecom.domain.dto.WeDepartMentDto; import com.linkwechat.wecom.domain.dto.WeDepartMentDto;
import com.linkwechat.wecom.domain.dto.WeUserDto; import com.linkwechat.wecom.domain.dto.WeUserDto;
import com.linkwechat.wecom.domain.dto.WeUserListDto; 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.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import com.linkwechat.wecom.mapper.WeUserMapper; import com.linkwechat.wecom.mapper.WeUserMapper;
...@@ -232,4 +234,26 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen ...@@ -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" ...@@ -217,18 +217,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <select id="getAllocateCustomers">--> <select id="getAllocateCustomers" parameterType="WeAllocateCustomersVo" resultType="com.linkwechat.wecom.domain.vo.WeAllocateCustomersVo">
<!-- SELECT--> SELECT
<!-- wc.`name`,--> wc.`name` as customerName,
<!-- wu.user_name,--> wu.user_name as takeUserName,
<!-- wac.allocate_time,--> wac.allocate_time,
<!-- (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department--> (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
<!--FROM--> FROM
<!-- we_allocate_customer wac--> we_allocate_customer wac
<!--LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid--> LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid
<!--LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid--> LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid
<!-- --> <where>
<!-- </select>--> <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
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!