Commit cbca0956 by 墨竹

feat:添加好友日志修改

parent 24e78e5d
......@@ -17,6 +17,7 @@ public class WxUserAddLogQDTO implements Serializable{
private String wxUserId;
private String staffId;
private String staffName;
private String clerkId;
public String getWxEnterpriseId() {
return wxEnterpriseId;
......@@ -105,4 +106,12 @@ public class WxUserAddLogQDTO implements Serializable{
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
}
package com.gic.haoban.manage.service.service.hm.impl;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BasePageInfo;
......@@ -22,10 +10,12 @@ import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO;
import com.gic.haoban.manage.service.dao.mapper.hm.WxUserAddLogMapper;
import com.gic.haoban.manage.service.entity.hm.TabWxUserAddLog;
import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.pojo.bo.hm.WxUserAddLogBO;
import com.gic.haoban.manage.service.service.MemberQueryService;
import com.gic.haoban.manage.service.service.hm.HmClerkRelationService;
import com.gic.haoban.manage.service.service.hm.HmLinkService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import com.gic.haoban.manage.service.service.hm.WxUserAddLogService;
......@@ -34,6 +24,13 @@ import com.gic.member.tag.api.dto.MemberTagDTO;
import com.gic.member.tag.api.dto.MemberTagItemDTO;
import com.gic.member.tag.api.service.MemberTagApiService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service("wxUserAddLogService")
public class WxUserAddLogServiceImpl implements WxUserAddLogService {
......@@ -50,9 +47,12 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
private MemberQueryService memberQueryService;
@Autowired
private MemberTagApiService memberTagApiService;
@Autowired
private HmClerkRelationService hmClerkRelationService;
@Override
public void save(WxUserAddLogQDTO qdto) {
log.info("保存用户信息-add={}",JSON.toJSON(qdto));
log.info("保存用户信息-add={}", JSON.toJSON(qdto));
String externalUserid = qdto.getExternalUserid();
String wxUserId = qdto.getWxUserId();
TabWxUserAddLog entity = new TabWxUserAddLog();
......@@ -82,12 +82,26 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
entity.setAddChannel(2);
entity.setHmId(qdto.getHmId());
entity.setHmName(hm.getName());
Integer hmType = hm.getHmType();
if (hmType == 1) {
entity.setClerkId(hm.getClerkId());
entity.setClerkCode(hm.getClerkCode());
entity.setClerkName(hm.getClerkName());
entity.setStoreId(hm.getStoreId());
entity.setStoreCode(hm.getStoreCode());
entity.setStoreName(hm.getStoreName());
} else if (hmType == 2) {
HmClerkRelationBO hmClerkRelationBO = hmClerkRelationService.queryByHmIdAndClerkId(qdto.getHmId(), qdto.getClerkId());
if (hmClerkRelationBO != null) {
entity.setClerkId(hmClerkRelationBO.getClerkId());
entity.setClerkCode(hmClerkRelationBO.getClerkCode());
entity.setClerkName(hmClerkRelationBO.getClerkName());
entity.setStoreId(hmClerkRelationBO.getStoreId());
entity.setStoreCode(hmClerkRelationBO.getStoreCode());
entity.setStoreName(hmClerkRelationBO.getStoreName());
}
}
memberLabelId = hm.getMemberLabelId();
}
if (null != qdto.getLinkId()) {
......@@ -103,11 +117,11 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
entity.setMemberLabelId(memberLabelId);
MemberTagItemDTO dto = this.memberTagApiService.findMemberTagItem(memberLabelId);
if (null != dto) {
String tagId = dto.getTagId() ;
MemberTagDTO tag = this.memberTagApiService.getMemberTagById(tagId) ;
String tagId = dto.getTagId();
MemberTagDTO tag = this.memberTagApiService.getMemberTagById(tagId);
entity.setMemberLabelName(tag.getTagName() + "-" + dto.getTagItemName());
}else {
log.info("会员标签查询null,memberLabelId={}",memberLabelId);
} else {
log.info("会员标签查询null,memberLabelId={}", memberLabelId);
}
}
if (null != qdto.getMemberId()) {
......@@ -116,13 +130,12 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
}
}
this.wxUserAddLogMapper.insert(entity);
}
@Override
public void updateMemberInfo(String wxEnterpriseId, String enterpriseId, String staffId, String externalUserid,
String memberId) {
log.info("保存用户信息-update={}",memberId);
log.info("保存用户信息-update={}", memberId);
if (StringUtils.isNotBlank(memberId)) {
TabWxUserAddLog entity = new TabWxUserAddLog();
entity = this.addMemberInfo(enterpriseId, memberId, entity);
......
......@@ -128,6 +128,7 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
wxUserAddLogQDTO.setExternalUserid(related.getExternalUserId());
wxUserAddLogQDTO.setWxUserId(related.getWxUserId());
wxUserAddLogQDTO.setStaffId(related.getStaffId());
wxUserAddLogQDTO.setClerkId(related.getClerkId());
wxUserAddLogService.save(wxUserAddLogQDTO);
}
......
......@@ -456,6 +456,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
wxUserAddLogQDTO.setWxUserId(wxUserId);
wxUserAddLogQDTO.setStaffId(staffId);
wxUserAddLogQDTO.setStaffName(staffName);
wxUserAddLogQDTO.setClerkId(staffClerkRelationDTO.getClerkId());
wxUserAddLogService.save(wxUserAddLogQDTO);
}
......
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