Commit f684a91d by 水库浪子

客户画像获取客户基本信息接口提交

1 parent 7a50096b
package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.wecom.service.IWeCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @description: 客户画像相关controller
* @author: HaoN
* @create: 2021-03-03 15:10
**/
@RestController
@RequestMapping("/wecom/portrait")
public class WeCustomerPortraitController extends BaseController {
@Autowired
private IWeCustomerService iWeCustomerService;
/**
* 根据客户id和当前企业员工id获取员工详细信息
* @param externalUserid
* @param operUserid
* @return
*/
@GetMapping(value = "/findWeCustomerInfo")
public AjaxResult findWeCustomerInfo(String externalUserid, String operUserid){
return AjaxResult.success(
iWeCustomerService.findCustomerByOperUseridAndCustomerId(externalUserid,operUserid)
);
}
}
package com.linkwechat.wecom.domain;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @description: 客户画像实体VO
* @author: HaoN
* @create: 2021-03-03 11:49
**/
@Data
public class WeCustomerPortrait {
//客户昵称
private String name;
//客户备注
private String remark;
//备注客户手机号
private String remarkMobiles;
//客户生日
private Date birthday;
//邮箱
private String email;
//地址
private String address;
//qq
private String qq;
//职业
private String position;
//公司
private String remarkCorpName;
//描述
private String description;
//客户标签
private List<WeTagGroup> weTagGroupList;
}
......@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeCustomerPortrait;
import com.linkwechat.wecom.domain.WeUser;
import org.apache.ibatis.annotations.Param;
......@@ -77,4 +78,17 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @return
*/
List<WeUser> getCustomerByTag(List<String> ids);
/**
* 根据外部联系人ID和企业员工ID获取当前客户信息
* @param externalUserid
* @param operUserid
* @return
*/
WeCustomerPortrait findCustomerByOperUseridAndCustomerId(@Param("externalUserid") String externalUserid,@Param("operUserid") String operUserid);
}
......@@ -2,10 +2,12 @@ package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeCustomerPortrait;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.dto.WeWelcomeMsg;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeMakeCustomerTag;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -109,4 +111,15 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @return
*/
public List<WeUser> getCustomerByTag(List<String> ids);
/**
* 根据外部联系人ID和企业员工ID获取当前客户信息
* @param externalUserid
* @param operUserid
* @return
*/
WeCustomerPortrait findCustomerByOperUseridAndCustomerId(@Param("externalUserid") String externalUserid, @Param("operUserid") String operUserid);
}
......@@ -626,4 +626,11 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
}
@Override
public WeCustomerPortrait findCustomerByOperUseridAndCustomerId(String externalUserid, String operUserid) {
return weCustomerMapper.findCustomerByOperUseridAndCustomerId(externalUserid,operUserid);
}
}
......@@ -303,4 +303,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="findCustomerByOperUseridAndCustomerId" resultType="com.linkwechat.wecom.domain.WeCustomerPortrait">
SELECT
wc.`name`,
wfcr.remark,
wfcr.remark_mobiles,
wc.birthday,
wfcr.email,
wfcr.address,
wfcr.qq,
wc.position,
wfcr.remark_corp_name,
wfcr.description
FROM
we_customer wc
LEFT JOIN we_flower_customer_rel wfcr on wc.external_userid=wfcr.external_userid
WHERE wc.external_userid=#{externalUserid} and wfcr.oper_userid=#{operUserid}
</select>
</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!