Commit 171a02a9 by 水库浪子

修复离职员工bug

1 parent 1f0cb422
......@@ -138,6 +138,8 @@ public class WeUserController extends BaseController {
@PutMapping({"/allocateLeaveUserAboutData"})
public AjaxResult allocateLeaveUserAboutData(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) {
return AjaxResult.success("离职分配成功");
}
......
......@@ -2,7 +2,10 @@ package com.linkwechat.wecom.domain;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
......@@ -13,6 +16,9 @@ import java.util.List;
* @date 2020-09-19
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WeFlowerCustomerRel extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -23,6 +29,9 @@ public class WeFlowerCustomerRel extends BaseEntity
/** 添加了此外部联系人的企业成员userid */
private String userId;
/** 外部联系人名称 */
private String userName;
/** 该成员对此外部联系人的描述 */
private String description;
......
package com.linkwechat.wecom.domain.vo;
import lombok.Data;
/**
* @Author: Robin
* @Description:
* @Date: create in 2020/9/21 0021 23:45
*/
@Data
public class WeLeaveUserInfoAllocateVo {
private String handoverUserid;
......
package com.linkwechat.wecom.service;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserVo;
import java.util.List;
......@@ -78,4 +79,11 @@ public interface IWeUserService
*/
List<WeLeaveUserVo> leaveUserList(WeLeaveUserVo weLeaveUserVo);
/**
* 离职分配
* @param weLeaveUserInfoAllocateVo
*/
void allocateLeaveUserAboutData(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo);
}
package com.linkwechat.wecom.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.wecom.client.WeUserClient;
import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
import com.linkwechat.wecom.domain.WeUser;
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.mapper.WeUserMapper;
import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
import com.linkwechat.wecom.service.IWeUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -30,6 +35,10 @@ public class WeUserServiceImpl implements IWeUserService
@Autowired
private WeUserClient weUserClient;
@Autowired
private IWeFlowerCustomerRelService iWeFlowerCustomerRelService;
/**
* 查询通讯录相关客户
*
......@@ -169,5 +178,26 @@ public class WeUserServiceImpl implements IWeUserService
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"
<result property="addWay" column="add_way" />
<result property="state" column="state" />
<result property="customerId" column="customer_id" />
<result property="userName" column="user_name"/>
<collection property="weFlowerCustomerTagRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerTagRel">
<result property="id" column="tagRelid" />
<result property="flowerCustomerRelId" column="flower_customer_rel_id" />
......@@ -70,25 +71,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wfcrf.flower_customer_rel_id,
wfcrf.tag_id,
wfcrf.create_time,
wt.`name` as tagName
wt.`name` as tagName,
wu.user_name
FROM
we_customer wc
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_tag wt ON wt.id = wfcrf.tag_id
<!-- <include refid="selectWeCustomerVo"/>-->
<!-- <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>-->
INNER JOIN we_user wu ON wu.user_id=wfcr.user_id
</select>
<select id="selectWeCustomerById" parameterType="Long" resultMap="WeCustomerResult">
......
......@@ -151,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</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
we.user_name,
we.department,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!