客户相关bug修复

1 parent bc6f20d9
package com.linkwechat.common.core.page;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
......@@ -26,6 +28,7 @@ public class TableDataInfo<T> implements Serializable
private String msg;
/**最后同步时间*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lastSyncTime;
/**去重复客户数*/
......
......@@ -47,6 +47,9 @@ public class WeCustomerDetail {
private String otherDescr;
//0-未知 1-男性 2-女性
private Integer gender;
private List<CompanyOrPersonTag> companyTags;
......@@ -86,6 +89,9 @@ public class WeCustomerDetail {
//加入时间
private Date joinTime;
//群主
private String leaderName;
}
......
......@@ -30,7 +30,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @param userId
* @return
*/
WeCustomerDetail.Groups findWecustomerGroups(@Param("userId") String userId);
List<WeCustomerDetail.Groups> findWecustomerGroups(@Param("userId") String userId);
......
......@@ -646,15 +646,18 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
public WeCustomerDetail findWeCustomerDetail(String externalUserid,String userId) {
WeCustomerDetail weCustomerDetail=new WeCustomerDetail();
List<WeCustomerList> weCustomerList = this.findWeCustomerList(
WeCustomerList.builder()
.externalUserid(externalUserid)
.firstUserId(userId)
.build()
);
if(CollectionUtil.isNotEmpty(weCustomerList)){
BeanUtils.copyBeanProp(
weCustomerDetail,
weCustomerList.stream().findFirst().get()
,weCustomerDetail);
);
List<WeCustomerDetail.TrackUser> trackUsers=new ArrayList<>();
weCustomerList.stream().forEach(k->{
trackUsers.add(WeCustomerDetail.TrackUser.builder()
......@@ -669,7 +672,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
);
weCustomerDetail.setGroups(
(List<WeCustomerDetail.Groups>) this.baseMapper.findWecustomerGroups(externalUserid)
this.baseMapper.findWecustomerGroups(externalUserid)
);
......
......@@ -36,6 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND wc.external_userid=#{weCustomerList.externalUserid}
</if>
<if test="weCustomerList.firstUserId !=null">
AND wc.first_user_id=#{weCustomerList.firstUserId}
</if>
<if test="weCustomerList.departmentIds != null and weCustomerList.departmentIds !=''">
<if test="weCustomerList.departmentIds.indexOf(',') != -1">
OR wu.department in
......@@ -78,11 +82,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wg.chat_id,
wg.group_name,
wgm.join_time,
wgm.join_scene
wgm.join_scene,
(SELECT wu.user_name FROM we_user wu WHERE wu.user_id=wg.owner) as leaderName
FROM
we_group_member wgm
LEFT JOIN we_group wg ON wg.chat_id = wgm.chat_id
WHERE wgm.del_flag=0 and wg.del_flag=0. AND wgm.user_id=#{userId}
LEFT JOIN we_group wg ON wg.chat_id = wgm.chat_id
WHERE wgm.del_flag=0 and wg.del_flag=0 AND wgm.user_id=#{userId}
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!