提交 e2f6bc2b 编写于 作者: 1 1539136324@qq.com

提交客户画像标签获取,标签更新;客户社交关系相关接口;

上级 7cb3470d
......@@ -3,12 +3,16 @@ package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.wecom.domain.WeCustomerPortrait;
import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
import com.linkwechat.wecom.domain.WeTagGroup;
import com.linkwechat.wecom.domain.vo.WeMakeCustomerTag;
import com.linkwechat.wecom.service.IWeCustomerService;
import com.linkwechat.wecom.service.IWeTagGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @description: 客户画像相关controller
* @author: HaoN
......@@ -78,5 +82,51 @@ public class WeCustomerPortraitController extends BaseController {
}
/**
* 更新客户画像标签
* @param weMakeCustomerTag
* @return
*/
@PostMapping(value = "/updateWeCustomerPorTraitTag")
public AjaxResult updateWeCustomerPorTraitTag(@RequestBody WeMakeCustomerTag weMakeCustomerTag){
iWeCustomerService.makeLabel(weMakeCustomerTag);
return AjaxResult.success();
}
/**
* 查看客户添加的员工
* @param externalUserid
* @return
*/
@GetMapping(value = "/findAddaddEmployes/{externalUserid}")
public AjaxResult findaddEmployes(@PathVariable String externalUserid){
return AjaxResult.success();
}
/**
* 获取用户添加的群
* @param externalUserid
* @param operUserid
* @return
*/
@GetMapping(value = "/findAddGroupNum")
public AjaxResult findAddGroupNum(String externalUserid,String operUserid){
return AjaxResult.success();
}
}
......@@ -42,4 +42,7 @@ public class WeCustomerPortrait {
//客户标签
private List<WeTagGroup> weTagGroupList;
//客户社交关系
private WeCustomerSocialConn socialConn;
}
package com.linkwechat.wecom.domain;
import lombok.Data;
/**
* 客户社交关系
*/
@Data
public class WeCustomerSocialConn {
/**添加员工数*/
private Integer addEmployeNum;
/**添加群聊数*/
private Integer addGroupNum;
/**共同群聊数*/
private Integer commonGroupNum;
}
......@@ -5,6 +5,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.WeCustomerSocialConn;
import com.linkwechat.wecom.domain.WeUser;
import org.apache.ibatis.annotations.Param;
......@@ -89,6 +90,13 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
WeCustomerPortrait findCustomerByOperUseridAndCustomerId(@Param("externalUserid") String externalUserid,@Param("operUserid") String operUserid);
/**
* 统计客户社交关系
* @param externalUserid 客户id
* @param operUserid 员工id
* @return
*/
WeCustomerSocialConn countSocialConn(@Param("externalUserid")String externalUserid,@Param("operUserid")String operUserid);
}
......@@ -127,4 +127,8 @@ public interface IWeCustomerService extends IService<WeCustomer>
*/
void updateWeCustomerPortrait(WeCustomerPortrait weCustomerPortrait);
}
......@@ -8,7 +8,6 @@ import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.utils.SecurityUtils;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.common.utils.Threads;
import com.linkwechat.common.utils.bean.BeanUtils;
import com.linkwechat.wecom.client.WeCropTagClient;
import com.linkwechat.wecom.client.WeCustomerClient;
......@@ -639,6 +638,12 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
weCustomerPortrait.getFlowerCustomerRelId()
)
);
//客户社交关系
weCustomerPortrait.setSocialConn(
this.baseMapper.countSocialConn(externalUserid,operUserid)
);
}
......@@ -667,4 +672,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
}
}
......@@ -323,5 +323,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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>
<select id="countSocialConn" resultType="com.linkwechat.wecom.domain.WeCustomerSocialConn">
SELECT
(
SELECT
count(*)
FROM
we_flower_customer_rel wfcr WHERE wfcr.external_userid=wc.external_userid
) AS addEmployeNum,
(
SELECT
COUNT(*)
FROM
we_group_member wgm where wgm.union_id=wc.external_userid
) AS addGroupNum,
(
SELECT
COUNT(*)
FROM we_group_member where chat_id in (
SELECT
chat_id
FROM
`we_group_member` where union_id=wc.external_userid
) and user_id=#{operUserid}
) AS commonGroupNum
FROM we_customer wc WHERE wc.external_userid=#{externalUserid}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册