提交 18abb724 编写于 作者: 水库浪子

客户画像,客户标签获取接口提交

上级 17ebedbf
......@@ -30,7 +30,7 @@ public class WeCategoryController extends BaseController {
/**
* 类目树
*/
@PreAuthorize("@ss.hasPermi('wechat:category:list')")
// @PreAuthorize("@ss.hasPermi('wechat:category:list')")
@GetMapping("/list")
@ApiOperation("类目树")
public AjaxResult list(@RequestParam("mediaType") String mediaType) {
......@@ -40,7 +40,7 @@ public class WeCategoryController extends BaseController {
/**
* 通过id查询类目详细信息
*/
@PreAuthorize("@ss.hasPermi('wechat:category:query')")
// @PreAuthorize("@ss.hasPermi('wechat:category:query')")
@GetMapping(value = "/{id}")
@ApiOperation("通过id查询类目详细信息")
public AjaxResult getInfo(@PathVariable("id") Long id) {
......@@ -50,7 +50,7 @@ public class WeCategoryController extends BaseController {
/**
* 添加类目
*/
@PreAuthorize("@ss.hasPermi('wechat:category:add')")
// @PreAuthorize("@ss.hasPermi('wechat:category:add')")
@Log(title = "添加类目", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation("添加类目")
......@@ -61,7 +61,7 @@ public class WeCategoryController extends BaseController {
/**
* 更新目录
*/
@PreAuthorize("@ss.hasPermi('wechat:category:edit')")
// @PreAuthorize("@ss.hasPermi('wechat:category:edit')")
@Log(title = "更新目录", businessType = BusinessType.UPDATE)
@PutMapping
@ApiOperation("更新目录")
......@@ -73,7 +73,7 @@ public class WeCategoryController extends BaseController {
/**
* 删除类目
*/
@PreAuthorize("@ss.hasPermi('wechat:category:remove')")
// @PreAuthorize("@ss.hasPermi('wechat:category:remove')")
@Log(title = "删除类目", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
@ApiOperation("删除类目")
......
......@@ -39,7 +39,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 查询聊天关系映射列表
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:list')")
// @PreAuthorize("@ss.hasPermi('chat:mapping:list')")
@GetMapping("/list")
public TableDataInfo list(WeChatContactMapping weChatContactMapping)
{
......@@ -51,7 +51,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 按客户查询关系映射列表
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:listByCustomer')")
// @PreAuthorize("@ss.hasPermi('chat:mapping:listByCustomer')")
@GetMapping("/listByCustomer")
public TableDataInfo listByCustomer()
{
......@@ -63,7 +63,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 导出聊天关系映射列表
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:export')")
// @PreAuthorize("@ss.hasPermi('chat:mapping:export')")
@Log(title = "聊天关系映射", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeChatContactMapping weChatContactMapping)
......@@ -76,7 +76,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 获取聊天关系映射详细信息
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:query')")
// @PreAuthorize("@ss.hasPermi('chat:mapping:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
......@@ -86,7 +86,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 新增聊天关系映射
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:add')")
// @PreAuthorize("@ss.hasPermi('chat:mapping:add')")
@Log(title = "聊天关系映射", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeChatContactMapping weChatContactMapping)
......@@ -97,7 +97,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 修改聊天关系映射
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:edit')")
// @PreAuthorize("@ss.hasPermi('chat:mapping:edit')")
@Log(title = "聊天关系映射", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeChatContactMapping weChatContactMapping)
......@@ -108,7 +108,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 删除聊天关系映射
*/
@PreAuthorize("@ss.hasPermi('chat:mapping:remove')")
// @PreAuthorize("@ss.hasPermi('chat:mapping:remove')")
@Log(title = "聊天关系映射", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
......
......@@ -3,7 +3,9 @@ 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.WeTagGroup;
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.*;
......@@ -21,6 +23,10 @@ public class WeCustomerPortraitController extends BaseController {
private IWeCustomerService iWeCustomerService;
@Autowired
private IWeTagGroupService weTagGroupService;
/**
* 根据客户id和当前企业员工id获取员工详细信息
* @param externalUserid
......@@ -55,4 +61,22 @@ public class WeCustomerPortraitController extends BaseController {
/**
* 获取当前系统所有可用标签
* @return
*/
@GetMapping(value = "/findAllTags")
public AjaxResult findAllTags(){
return AjaxResult.success(
weTagGroupService.selectWeTagGroupList(
WeTagGroup.builder()
.build()
)
);
}
}
......@@ -16,6 +16,8 @@ public class WeCustomerPortrait {
private String externalUserid;
//企业员工id
private String operUserid;
//客户与企业员工关系id
private String flowerCustomerRelId;
//客户昵称
private String name;
//客户备注
......
package com.linkwechat.wecom.domain;
import lombok.Data;
/**
* @description: 客户画像标签
* @author: HaoN
* @create: 2021-03-04 12:31
**/
@Data
public class WeCustomerPortraitTag {
}
......@@ -62,4 +62,16 @@ public interface WeTagGroupMapper extends BaseMapper<WeTagGroup>
* @return
*/
public int batchInsetWeTagGroup(@Param("weTagGroups") List<WeTagGroup> weTagGroups);
/**
* 根据企业员工与添加客户关系id给客户打标签
* @param flowerCustomerRelId
* @return
*/
public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(@Param("flowerCustomerRelId") String flowerCustomerRelId);
}
......@@ -7,8 +7,6 @@ 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;
......@@ -120,7 +118,7 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param operUserid
* @return
*/
WeCustomerPortrait findCustomerByOperUseridAndCustomerId(@Param("externalUserid") String externalUserid, @Param("operUserid") String operUserid);
WeCustomerPortrait findCustomerByOperUseridAndCustomerId(String externalUserid,String operUserid);
/**
......
package com.linkwechat.wecom.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeTagGroup;
import com.linkwechat.wecom.domain.dto.tag.WeCropGroupTagDto;
import java.util.List;
/**
* 标签组Service接口
*
......@@ -69,4 +69,13 @@ public interface IWeTagGroupService extends IService<WeTagGroup>
void deleteTagGroup(String id);
void updateTagGroup(String id);
/**
* 根据企业员工与添加客户关系id给客户打标签
* @param flowerCustomerRelId
* @return
*/
public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(String flowerCustomerRelId);
}
......@@ -629,7 +629,20 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
@Override
public WeCustomerPortrait findCustomerByOperUseridAndCustomerId(String externalUserid, String operUserid) {
return weCustomerMapper.findCustomerByOperUseridAndCustomerId(externalUserid,operUserid);
WeCustomerPortrait weCustomerPortrait
= weCustomerMapper.findCustomerByOperUseridAndCustomerId(externalUserid, operUserid);
if(null != weCustomerPortrait){
//获取当前客户拥有得标签
weCustomerPortrait.setWeTagGroupList(
iWeTagGroupService.findCustomerTagByFlowerCustomerRelId(
weCustomerPortrait.getFlowerCustomerRelId()
)
);
}
return weCustomerPortrait;
}
@Override
......
......@@ -337,5 +337,10 @@ public class WeTagGroupServiceImpl extends ServiceImpl<WeTagGroupMapper, WeTagGr
}
}
@Override
public List<WeTagGroup> findCustomerTagByFlowerCustomerRelId(String flowerCustomerRelId) {
return this.baseMapper.findCustomerTagByFlowerCustomerRelId(flowerCustomerRelId);
}
}
......@@ -315,7 +315,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wfcr.qq,
wc.position,
wfcr.remark_corp_name,
wfcr.description
wfcr.description,
wfcr.id as flowerCustomerRelId
FROM
we_customer wc
LEFT JOIN we_flower_customer_rel wfcr on wc.external_userid=wfcr.external_userid
......
......@@ -101,5 +101,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<select id="findCustomerTagByFlowerCustomerRelId" resultMap="WeTagGroupResult">
SELECT
wt.tag_id,
wt.`name`,
wtg.gourp_name,
wtg.group_id
FROM
we_flower_customer_tag_rel wfctr
INNER JOIN we_tag wt ON wfctr.tag_id = wt.tag_id
INNER JOIN we_tag_group wtg ON wt.group_id = wtg.group_id
WHERE wt.`status`=0 and wtg.`status`=0 and wfctr.flower_customer_rel_id=#{flowerCustomerRelId}
</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.
先完成此消息的编辑!
想要评论请 注册