Commit 171a02a9 by 水库浪子

修复离职员工bug

1 parent 1f0cb422
...@@ -138,6 +138,8 @@ public class WeUserController extends BaseController { ...@@ -138,6 +138,8 @@ public class WeUserController extends BaseController {
@PutMapping({"/allocateLeaveUserAboutData"}) @PutMapping({"/allocateLeaveUserAboutData"})
public AjaxResult allocateLeaveUserAboutData(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) { public AjaxResult allocateLeaveUserAboutData(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) {
return AjaxResult.success("离职分配成功"); return AjaxResult.success("离职分配成功");
} }
......
...@@ -2,7 +2,10 @@ package com.linkwechat.wecom.domain; ...@@ -2,7 +2,10 @@ 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 com.linkwechat.common.utils.SnowFlakeUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
...@@ -13,6 +16,9 @@ import java.util.List; ...@@ -13,6 +16,9 @@ import java.util.List;
* @date 2020-09-19 * @date 2020-09-19
*/ */
@Data @Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WeFlowerCustomerRel extends BaseEntity public class WeFlowerCustomerRel extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -23,6 +29,9 @@ public class WeFlowerCustomerRel extends BaseEntity ...@@ -23,6 +29,9 @@ public class WeFlowerCustomerRel extends BaseEntity
/** 添加了此外部联系人的企业成员userid */ /** 添加了此外部联系人的企业成员userid */
private String userId; private String userId;
/** 外部联系人名称 */
private String userName;
/** 该成员对此外部联系人的描述 */ /** 该成员对此外部联系人的描述 */
private String description; private String description;
......
package com.linkwechat.wecom.domain.vo; package com.linkwechat.wecom.domain.vo;
import lombok.Data;
/** /**
* @Author: Robin * @Author: Robin
* @Description: * @Description:
* @Date: create in 2020/9/21 0021 23:45 * @Date: create in 2020/9/21 0021 23:45
*/ */
@Data
public class WeLeaveUserInfoAllocateVo { public class WeLeaveUserInfoAllocateVo {
private String handoverUserid; private String handoverUserid;
......
package com.linkwechat.wecom.service; package com.linkwechat.wecom.service;
import com.linkwechat.wecom.domain.WeUser; import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import java.util.List; import java.util.List;
...@@ -78,4 +79,11 @@ public interface IWeUserService ...@@ -78,4 +79,11 @@ public interface IWeUserService
*/ */
List<WeLeaveUserVo> leaveUserList(WeLeaveUserVo weLeaveUserVo); List<WeLeaveUserVo> leaveUserList(WeLeaveUserVo weLeaveUserVo);
/**
* 离职分配
* @param weLeaveUserInfoAllocateVo
*/
void allocateLeaveUserAboutData(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo);
} }
package com.linkwechat.wecom.service.impl; package com.linkwechat.wecom.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.linkwechat.common.constant.WeConstans; import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.exception.wecom.WeComException; import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.wecom.client.WeUserClient; import com.linkwechat.wecom.client.WeUserClient;
import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
import com.linkwechat.wecom.domain.WeUser; import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.dto.WeResultDto; import com.linkwechat.wecom.domain.dto.WeResultDto;
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;
import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
import com.linkwechat.wecom.service.IWeUserService; 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;
...@@ -30,6 +35,10 @@ public class WeUserServiceImpl implements IWeUserService ...@@ -30,6 +35,10 @@ public class WeUserServiceImpl implements IWeUserService
@Autowired @Autowired
private WeUserClient weUserClient; private WeUserClient weUserClient;
@Autowired
private IWeFlowerCustomerRelService iWeFlowerCustomerRelService;
/** /**
* 查询通讯录相关客户 * 查询通讯录相关客户
* *
...@@ -169,5 +178,26 @@ public class WeUserServiceImpl implements IWeUserService ...@@ -169,5 +178,26 @@ public class WeUserServiceImpl implements IWeUserService
return this.weUserMapper.leaveUserList(weLeaveUserVo); return this.weUserMapper.leaveUserList(weLeaveUserVo);
} }
@Override
public void allocateLeaveUserAboutData(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) {
List<WeFlowerCustomerRel> weFlowerCustomerRels = iWeFlowerCustomerRelService.selectWeFlowerCustomerRelList(WeFlowerCustomerRel.builder()
.userId(weLeaveUserInfoAllocateVo.getHandoverUserid())
.build());
if(CollectionUtil.isNotEmpty(weFlowerCustomerRels)){
//删除原有的
//保存新的
weFlowerCustomerRels.stream().forEach(k->{
k.setId(SnowFlakeUtil.nextId());
k.setUserId(weLeaveUserInfoAllocateVo.getTakeoverUserid());
});
//保存新
}
}
} }
...@@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="addWay" column="add_way" /> <result property="addWay" column="add_way" />
<result property="state" column="state" /> <result property="state" column="state" />
<result property="customerId" column="customer_id" /> <result property="customerId" column="customer_id" />
<result property="userName" column="user_name"/>
<collection property="weFlowerCustomerTagRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerTagRel"> <collection property="weFlowerCustomerTagRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerTagRel">
<result property="id" column="tagRelid" /> <result property="id" column="tagRelid" />
<result property="flowerCustomerRelId" column="flower_customer_rel_id" /> <result property="flowerCustomerRelId" column="flower_customer_rel_id" />
...@@ -70,25 +71,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -70,25 +71,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wfcrf.flower_customer_rel_id, wfcrf.flower_customer_rel_id,
wfcrf.tag_id, wfcrf.tag_id,
wfcrf.create_time, wfcrf.create_time,
wt.`name` as tagName wt.`name` as tagName,
wu.user_name
FROM FROM
we_customer wc we_customer wc
INNER JOIN we_flower_customer_rel wfcr ON wc.id = wfcr.customer_id INNER JOIN we_flower_customer_rel wfcr ON wc.id = wfcr.customer_id
INNER JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.id INNER JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.id
INNER JOIN we_tag wt ON wt.id = wfcrf.tag_id INNER JOIN we_tag wt ON wt.id = wfcrf.tag_id
<!-- <include refid="selectWeCustomerVo"/>--> INNER JOIN we_user wu ON wu.user_id=wfcr.user_id
<!-- <where> -->
<!-- <if test="externalUserid != null and externalUserid != ''"> and external_userid = #{externalUserid}</if>-->
<!-- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>-->
<!-- <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>-->
<!-- <if test="type != null "> and type = #{type}</if>-->
<!-- <if test="gender != null "> and gender = #{gender}</if>-->
<!-- <if test="unionid != null and unionid != ''"> and unionid = #{unionid}</if>-->
<!-- <if test="birthday != null "> and birthday = #{birthday}</if>-->
<!-- <if test="corpName != null and corpName != ''"> and corp_name like concat('%', #{corpName}, '%')</if>-->
<!-- <if test="corpFullName != null and corpFullName != ''"> and corp_full_name like concat('%', #{corpFullName}, '%')</if>-->
<!-- <if test="position != null and position != ''"> and position = #{position}</if>-->
<!-- </where>-->
</select> </select>
<select id="selectWeCustomerById" parameterType="Long" resultMap="WeCustomerResult"> <select id="selectWeCustomerById" parameterType="Long" resultMap="WeCustomerResult">
......
...@@ -151,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -151,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<select id="leaveUserList" parameterType="leaveUser" resultType="com.linkwechat.wecom.domain.vo.WeLeaveUserVo"> <select id="leaveUserList" parameterType="WeLeaveUserVo" resultType="com.linkwechat.wecom.domain.vo.WeLeaveUserVo">
SELECT SELECT
we.user_name, we.user_name,
we.department, we.department,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!