Commit cbca0956 by 墨竹

feat:添加好友日志修改

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