Commit 9fa89f38 by xugaojun

【11-1迭代】: 专属协管导购精确触达优化

parent 619ef169
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
/**
* desc:员工导购id与导购wxUserId实体
*
* @author: YongEn
* @date: 2021/11/11
**/
public class ClerkStaffWxUserDTO implements Serializable {
private static final long serialVersionUID = -5124016907535027993L;
/**
* 导购员工的外部联系人id-wxUserId
*/
private String staffWxUserId;
/**
* 员工导购id
*/
private String staffClerkId;
public ClerkStaffWxUserDTO() {
}
public ClerkStaffWxUserDTO(String staffWxUserId, String staffClerkId) {
this.staffWxUserId = staffWxUserId;
this.staffClerkId = staffClerkId;
}
public String getStaffWxUserId() {
return staffWxUserId;
}
public void setStaffWxUserId(String staffWxUserId) {
this.staffWxUserId = staffWxUserId;
}
public String getStaffClerkId() {
return staffClerkId;
}
public void setStaffClerkId(String staffClerkId) {
this.staffClerkId = staffClerkId;
}
}
...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.api.service; ...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.api.service;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.ClerkStaffWxUserDTO;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO; import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedShortInfoDTO; import com.gic.haoban.manage.api.dto.ExternalClerkRelatedShortInfoDTO;
...@@ -170,6 +171,6 @@ public interface ExternalClerkRelatedApiService { ...@@ -170,6 +171,6 @@ public interface ExternalClerkRelatedApiService {
* @return map:key-会员id value-导购的wxUserId * @return map:key-会员id value-导购的wxUserId
* @author: YongEn * @author: YongEn
*/ */
Map<String, List<String>> listMemberStaffRel(List<String> memberIdList, List<String> clerkIdList, String enterpriseId); Map<String, List<ClerkStaffWxUserDTO>> listMemberStaffRel(List<String> memberIdList, List<String> clerkIdList, String enterpriseId);
} }
...@@ -18,6 +18,10 @@ public class MemberStaffRelExtDO implements Serializable { ...@@ -18,6 +18,10 @@ public class MemberStaffRelExtDO implements Serializable {
* 导购员工的外部联系人id-wxUserId * 导购员工的外部联系人id-wxUserId
*/ */
private String staffWxUserId; private String staffWxUserId;
/**
* 员工导购id
*/
private String staffClerkId;
public String getMemberId() { public String getMemberId() {
return memberId; return memberId;
...@@ -34,4 +38,21 @@ public class MemberStaffRelExtDO implements Serializable { ...@@ -34,4 +38,21 @@ public class MemberStaffRelExtDO implements Serializable {
public void setStaffWxUserId(String staffWxUserId) { public void setStaffWxUserId(String staffWxUserId) {
this.staffWxUserId = staffWxUserId; this.staffWxUserId = staffWxUserId;
} }
public String getStaffClerkId() {
return staffClerkId;
}
public void setStaffClerkId(String staffClerkId) {
this.staffClerkId = staffClerkId;
}
@Override
public String toString() {
return "MemberStaffRelExtDO{" +
"memberId='" + memberId + '\'' +
", staffWxUserId='" + staffWxUserId + '\'' +
", staffClerkId='" + staffClerkId + '\'' +
'}';
}
} }
...@@ -10,6 +10,7 @@ import com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum; ...@@ -10,6 +10,7 @@ import com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.ClerkStaffWxUserDTO;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO; import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedShortInfoDTO; import com.gic.haoban.manage.api.dto.ExternalClerkRelatedShortInfoDTO;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService; import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
...@@ -258,7 +259,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -258,7 +259,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
} }
@Override @Override
public Map<String, List<String>> listMemberStaffRel(List<String> memberIdList, List<String> clerkIdList, String enterpriseId) { public Map<String, List<ClerkStaffWxUserDTO>> listMemberStaffRel(List<String> memberIdList, List<String> clerkIdList, String enterpriseId) {
if (CollectionUtils.isEmpty(memberIdList) || CollectionUtils.isEmpty(clerkIdList)) { if (CollectionUtils.isEmpty(memberIdList) || CollectionUtils.isEmpty(clerkIdList)) {
// 2个列表都为空查不了关系 // 2个列表都为空查不了关系
return Collections.emptyMap(); return Collections.emptyMap();
...@@ -271,9 +272,9 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -271,9 +272,9 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
// key-memberId // key-memberId
MemberStaffRelExtDO::getMemberId, MemberStaffRelExtDO::getMemberId,
// value-list // value-list
e -> new ArrayList<>(Collections.singletonList(e.getStaffWxUserId())), e -> new ArrayList<>(Collections.singletonList(new ClerkStaffWxUserDTO(e.getStaffClerkId(), e.getStaffWxUserId()))),
// 重复key的value添加到集合 // 重复key的value添加到集合
(List<String> oldList, List<String> newList) -> { (List<ClerkStaffWxUserDTO> oldList, List<ClerkStaffWxUserDTO> newList) -> {
oldList.addAll(newList); oldList.addAll(newList);
return oldList; return oldList;
})); }));
......
...@@ -465,9 +465,11 @@ ...@@ -465,9 +465,11 @@
<select id="listMemberStaffRel" resultType="com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO"> <select id="listMemberStaffRel" resultType="com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO">
select ecr.member_id as memberId, select ecr.member_id as memberId,
scr.wx_user_id as staffWxUserId scr.wx_user_id as staffWxUserId,
scr.clerk_id as staffClerkId
from (select staff_id, from (select staff_id,
wx_user_id wx_user_id,
clerk_id
from tab_haoban_staff_clerk_relation from tab_haoban_staff_clerk_relation
where clerk_id in where clerk_id in
<foreach collection="clerkIdList" item="item" separator="," open="(" close=")"> <foreach collection="clerkIdList" item="item" separator="," open="(" close=")">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment