Commit e201ceeb by 水库浪子

根据员工id获取客户

1 parent 7ee4478a
......@@ -48,6 +48,19 @@ public class WeCustomerController extends BaseController
return getDataTable(list);
}
/**
* 根据员工ID获取客户
* @return
*/
@PreAuthorize("@ss.hasPermi('customerManage:customer:list')")
@GetMapping("/getCustomersByUserId/{userId}")
public AjaxResult getCustomersByUserId(@PathVariable String userId){
return AjaxResult.success(weCustomerService.getCustomersByUserId(userId));
}
// /**
// * 导出企业微信客户列表
// */
......
......@@ -4,6 +4,8 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeUser;
import org.apache.ibatis.annotations.Param;
/**
* 企业微信客户Mapper接口
......@@ -60,4 +62,12 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @return 结果
*/
public int deleteWeCustomerByIds(Long[] ids);
/**
* 根据员工ID获取客户
* @param userId
* @return
*/
public List<WeUser> getCustomersByUserId(@Param("userId") String userId);
}
package com.linkwechat.wecom.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeMakeCustomerTag;
import java.util.List;
/**
* 企业微信客户Service接口
*
......@@ -58,4 +59,12 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param weMakeCustomerTag
*/
public void removeLabel(WeMakeCustomerTag weMakeCustomerTag);
/**
* 根据员工ID获取客户
* @param userId
* @return
*/
public List<WeUser> getCustomersByUserId(String userId);
}
......@@ -449,4 +449,15 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
}
/**
* 根据员工ID获取客户
* @param userId
* @return
*/
@Override
public List<WeUser> getCustomersByUserId(String userId) {
return this.baseMapper.getCustomersByUserId(userId);
}
}
......@@ -137,5 +137,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getCustomersByUserId" resultType="com.linkwechat.wecom.domain.WeUser">
SELECT
wc.external_userid,
wc.`name`,
wc.avatar,
wc.type,
wc.gender,
wc.unionid,
wc.birthday,
wc.corp_name,
wc.corp_full_name,
wc.position
FROM
`we_flower_customer_rel` wfcr
LEFT JOIN we_customer wc ON wc.external_userid = wfcr.external_userid
WHERE
wfcr.user_id = #{userId}
</select>
</mapper>
\ No newline at end of file
......@@ -270,4 +270,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!