Commit 2a118786 by 王祖波

通过消息队列批量保存跟进记录

parent 4224ccb5
......@@ -9,7 +9,7 @@ public class ContactFollowBatchQDTO implements Serializable {
/**
* 会员id
*/
private List<String> memberIdList;
private List<MemberFollow> memberList;
/**
* 导购id
*/
......@@ -18,17 +18,13 @@ public class ContactFollowBatchQDTO implements Serializable {
* 跟进记录
*/
private String followRemark;
/**
* 跟进时间
*/
private Date followTime;
public List<String> getMemberIdList() {
return memberIdList;
public List<MemberFollow> getMemberList() {
return memberList;
}
public void setMemberIdList(List<String> memberIdList) {
this.memberIdList = memberIdList;
public void setMemberList(List<MemberFollow> memberList) {
this.memberList = memberList;
}
public String getClerkId() {
......@@ -47,11 +43,40 @@ public class ContactFollowBatchQDTO implements Serializable {
this.followRemark = followRemark;
}
public Date getFollowTime() {
return followTime;
}
public static class MemberFollow implements Serializable{
/**
* 会员id
*/
private String memberId;
/**
* 跟进时间
*/
private Date followTime;
public MemberFollow() {
}
public MemberFollow(String memberId, Date followTime) {
this.memberId = memberId;
this.followTime = followTime;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public Date getFollowTime() {
return followTime;
}
public void setFollowTime(Date followTime) {
this.followTime = followTime;
public void setFollowTime(Date followTime) {
this.followTime = followTime;
}
}
}
\ No newline at end of file
......@@ -53,8 +53,8 @@ public class ContactFollowApiServiceImpl implements ContactFollowApiService {
return ServiceResponse.success();
}
ContactFollowBatchQDTO qdto = JSONObject.parseObject(message, ContactFollowBatchQDTO.class);
List<String> memberIdList = qdto.getMemberIdList();
if (CollectionUtils.isEmpty(memberIdList)) {
List<ContactFollowBatchQDTO.MemberFollow> memberList = qdto.getMemberList();
if (CollectionUtils.isEmpty(memberList)) {
return ServiceResponse.success();
}
String clerkId = qdto.getClerkId();
......@@ -65,13 +65,13 @@ public class ContactFollowApiServiceImpl implements ContactFollowApiService {
if (clerkDTO == null) {
return ServiceResponse.success();
}
List<ContactFollowQDTO> list = memberIdList.stream().map(x -> {
List<ContactFollowQDTO> list = memberList.stream().map(x -> {
ContactFollowQDTO followQDTO = new ContactFollowQDTO();
followQDTO.setMemberId(x);
followQDTO.setMemberId(x.getMemberId());
followQDTO.setClerkId(clerkId);
followQDTO.setClerkCode(clerkDTO.getClerkCode());
followQDTO.setFollowRemark(clerkDTO.getClerkName() + qdto.getFollowRemark());
followQDTO.setFollowTime(qdto.getFollowTime());
followQDTO.setFollowTime(x.getFollowTime());
followQDTO.setEnterpriseId(clerkDTO.getEnterpriseId());
return followQDTO;
}).collect(Collectors.toList());
......
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