Commit f1869650 by 徐高华

删除wx_user_id

parent b2685140
......@@ -14,7 +14,6 @@ public class WxUserAddLogQDTO implements Serializable{
private Long hmId;
private boolean delFlag;
private String externalUserid;
private String wxUserId;
private String staffId;
private String staffName;
private String clerkId;
......@@ -51,10 +50,6 @@ public class WxUserAddLogQDTO implements Serializable{
return externalUserid;
}
public String getWxUserId() {
return wxUserId;
}
public String getStaffId() {
return staffId;
}
......@@ -95,10 +90,6 @@ public class WxUserAddLogQDTO implements Serializable{
this.externalUserid = externalUserid;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
......
......@@ -50,7 +50,7 @@ public interface WxUserAddLogMapper {
* @throws
*/
public TabWxUserAddLog selectNewLog(@Param("externalUserid") String externalUserid,
@Param("wxUserId") String wxUserId);
@Param("staffId") String staffId);
/**
*
......
......@@ -23,8 +23,6 @@ public class TabWxUserAddLog implements Serializable {
/**成员信息*/
private String staffId;
private String staffName;
/**企微ID*/
private String wxUserId;
/**1添加 2删除*/
private Integer statusFlag;
/**0其他场景1引流链接2活码*/
......@@ -109,14 +107,6 @@ public class TabWxUserAddLog implements Serializable {
return staffName;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getWxUserId() {
return wxUserId;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
......
......@@ -55,7 +55,6 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
try {
log.info("保存用户信息-add={}", JSON.toJSON(qdto));
String externalUserid = qdto.getExternalUserid();
String wxUserId = qdto.getWxUserId();
TabWxUserAddLog entity = new TabWxUserAddLog();
entity.setLogId(UniqueIdUtils.uniqueLong());
entity.setWxEnterpriseId(qdto.getWxEnterpriseId());
......@@ -63,12 +62,11 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
entity.setExternalUserid(externalUserid);
entity.setAddChannel(0);
entity.setStatusFlag(1);
entity.setWxUserId(qdto.getWxUserId());
entity.setStaffId(qdto.getStaffId());
entity.setStaffName(qdto.getStaffName());
entity.setAllDelFlag(0);
if (qdto.isDelFlag()) {
TabWxUserAddLog logUser = this.wxUserAddLogMapper.selectNewLog(externalUserid, wxUserId);
TabWxUserAddLog logUser = this.wxUserAddLogMapper.selectNewLog(externalUserid, qdto.getStaffId());
if(null == logUser) {
log.info("删除好友") ;
return ;
......@@ -179,26 +177,26 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
private int isAllDel(String externalUserid) {
List<TabWxUserAddLog> list = this.wxUserAddLogMapper.listAllForDel(externalUserid);
Map<String, List<TabWxUserAddLog>> map = list.stream()
.collect(Collectors.groupingBy(TabWxUserAddLog::getWxUserId));
.collect(Collectors.groupingBy(TabWxUserAddLog::getStaffId));
Set<String> set = map.keySet();
Iterator<String> it = set.iterator();
boolean exist = false;
while (it.hasNext()) {
String wxUserId = it.next();
List<TabWxUserAddLog> itemList = map.get(wxUserId);
String staffId = it.next();
List<TabWxUserAddLog> itemList = map.get(staffId);
if (itemList.size() == 1 && itemList.get(0).getStatusFlag() == 2) {
log.info("成员={}只有1条删除的记录", wxUserId);
log.info("成员={}只有1条删除的记录", staffId);
} else {
TabWxUserAddLog addLog = itemList.get(0);
if (addLog.getStatusFlag() == 1) {
log.info("成员={}最新是添加记录", wxUserId);
if (addLog.getWxUserId().equals(wxUserId)) {
log.info("成员={}本次删除", wxUserId);
log.info("成员={}最新是添加记录", staffId);
if (addLog.getStaffId().equals(staffId)) {
log.info("成员={}本次删除", staffId);
} else {
exist = true;
}
} else {
log.info("成员={}最新是删除记录", wxUserId);
log.info("成员={}最新是删除记录", staffId);
}
}
}
......
......@@ -126,7 +126,6 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
wxUserAddLogQDTO.setUnionid(related.getUnionid());
wxUserAddLogQDTO.setDelFlag(true);
wxUserAddLogQDTO.setExternalUserid(related.getExternalUserId());
wxUserAddLogQDTO.setWxUserId(related.getWxUserId());
wxUserAddLogQDTO.setStaffId(related.getStaffId());
wxUserAddLogQDTO.setClerkId(related.getClerkId());
wxUserAddLogService.save(wxUserAddLogQDTO);
......
......@@ -464,7 +464,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
wxUserAddLogQDTO.setUnionid(unionid);
wxUserAddLogQDTO.setDelFlag(false);
wxUserAddLogQDTO.setExternalUserid(externalUserId);
wxUserAddLogQDTO.setWxUserId(wxUserId);
wxUserAddLogQDTO.setStaffId(staffId);
wxUserAddLogQDTO.setStaffName(staffName);
wxUserAddLogQDTO.setClerkId(staffClerkRelationDTO.getClerkId());
......
......@@ -9,7 +9,6 @@
<result column="external_userid" property="externalUserid"/>
<result column="staff_id" property="staffId"/>
<result column="staff_name" property="staffName"/>
<result column="wx_user_id" property="wxUserId"/>
<result column="status_flag" property="statusFlag"/>
<result column="add_channel" property="addChannel"/>
<result column="hm_id" property="hmId"/>
......@@ -37,14 +36,12 @@
<result column="all_del_flag" property="allDelFlag"/>
</resultMap>
<sql id="Base_Column_List">
log_id
,
log_id ,
wx_enterprise_id,
enterprise_id,
external_userid,
staff_id,
staff_name,
wx_user_id,
status_flag,
add_channel,
hm_id,
......@@ -81,7 +78,6 @@
external_userid,
staff_id,
staff_name,
wx_user_id,
status_flag,
add_channel,
hm_id,
......@@ -114,7 +110,6 @@
#{externalUserid,jdbcType=VARCHAR},
#{staffId,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR},
#{wxUserId,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER},
#{addChannel,jdbcType=INTEGER},
#{hmId,jdbcType=BIGINT},
......@@ -177,7 +172,7 @@
select
<include refid="Base_Column_List"/>
from tab_haoban_wx_user_add_log where
external_userid=#{externalUserid} and wx_user_id =#{wxUserId} and
external_userid=#{externalUserid} and staff_id =#{staffId} and
status_flag != 0 order by create_time desc limit 1
</select>
......
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