|
|
|
|
@ -4,20 +4,15 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import com.flossom.common.core.domain.entity.SysTag;
|
|
|
|
|
import com.flossom.common.core.domain.entity.WxUserIntegralLog;
|
|
|
|
|
import com.flossom.common.core.domain.entity.WxUserMember;
|
|
|
|
|
import com.flossom.common.core.domain.entity.WxUserTag;
|
|
|
|
|
import com.flossom.common.core.domain.entity.*;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxUserIntegralVm;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxUserMemberVm;
|
|
|
|
|
import com.flossom.common.core.enums.IntegralChangeTypeEnum;
|
|
|
|
|
import com.flossom.common.core.enums.TagTypeStatus;
|
|
|
|
|
import com.flossom.common.core.mapper.SysTagMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.WxUserIntegralLogMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.WxUserMemberMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.WxUserTagMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.*;
|
|
|
|
|
import com.flossom.common.core.utils.DateUtils;
|
|
|
|
|
import com.flossom.common.security.utils.SecurityUtils;
|
|
|
|
|
import com.flossom.system.service.ISysUserService;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@ -44,6 +39,18 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private WxUserIntegralLogMapper wxUserIntegralLogMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysUserService sysUserService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private WxNoRemindRecordMapper wxNoRemindRecordMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private WxUserRemarkMapper wxUserRemarkMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private WxUserScriptLogMapper wxUserScriptLogMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询用户
|
|
|
|
|
*
|
|
|
|
|
@ -107,8 +114,30 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
|
|
|
|
|
* @param ids 需要删除的用户主键
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Transactional
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteWxUserMemberByIds(Long[] ids) {
|
|
|
|
|
for (Long id : ids) {
|
|
|
|
|
WxUserMember wxUserMember = wxUserMemberMapper.selectWxUserMemberById(id);
|
|
|
|
|
if (wxUserMember != null) {
|
|
|
|
|
// sys_user 删除系统用户关联表
|
|
|
|
|
SysUser sysUser = sysUserService.selectUserByUserName(wxUserMember.getOpenid());
|
|
|
|
|
if (sysUser != null) {
|
|
|
|
|
sysUserService.deleteWxUserById(sysUser.getUserId());
|
|
|
|
|
}
|
|
|
|
|
// wx_user_integral_log 用户积分关联表
|
|
|
|
|
wxUserIntegralLogMapper.deleteWxUserIntegralLogByUserId(wxUserMember.getId());
|
|
|
|
|
// wx_no_remain_record 不提醒关联表
|
|
|
|
|
wxNoRemindRecordMapper.deleteWxNoRemindRecordByOpenid(wxUserMember.getOpenid());
|
|
|
|
|
// wx_user_remark 备注关联表
|
|
|
|
|
wxUserRemarkMapper.deleteWxUserRemarkByUserId(wxUserMember.getId());
|
|
|
|
|
// wx_user_script_log 话术发送记录关联表
|
|
|
|
|
wxUserScriptLogMapper.deleteWxUserScriptLogByWxUserId(wxUserMember.getId());
|
|
|
|
|
// wx_user_tag 用户标签关联表
|
|
|
|
|
wxUserTagMapper.deleteWxUserTagByUserId(wxUserMember.getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// wx_user_member 微信用户表
|
|
|
|
|
return wxUserMemberMapper.deleteWxUserMemberByIds(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|