Commit f1869650 by 徐高华

删除wx_user_id

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