Commit eaa05308 by 徐高华

删除导购成员

parent 5410a7ce
...@@ -24,6 +24,8 @@ public interface StaffService { ...@@ -24,6 +24,8 @@ public interface StaffService {
int delByStaffId(String staffId); int delByStaffId(String staffId);
void delStaff(String wxEnterpriseId ,String staffId) ;
/** /**
* 选择用户id和企业标识 * 选择用户id和企业标识
* *
......
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -7,9 +8,13 @@ import com.gic.api.base.commons.ServiceResponse; ...@@ -7,9 +8,13 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.UniqueIdUtils; import com.gic.commons.util.UniqueIdUtils;
import com.gic.content.api.service.ContentProducerApiService; import com.gic.content.api.service.ContentProducerApiService;
import com.gic.haoban.app.customer.service.api.service.InnerApiService;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper; import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
...@@ -18,8 +23,11 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff; ...@@ -18,8 +23,11 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff; import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO; import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.chat.GroupChatService;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeAccountStaffService; import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeAccountStaffService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.fee.AccountListDTO; import com.gic.wechat.api.dto.qywx.fee.AccountListDTO;
import com.gic.wechat.api.dto.qywx.fee.AccountListResponseDTO; import com.gic.wechat.api.dto.qywx.fee.AccountListResponseDTO;
...@@ -58,6 +66,18 @@ public class StaffServiceImpl implements StaffService { ...@@ -58,6 +66,18 @@ public class StaffServiceImpl implements StaffService {
private TabHaobanStaffClerkRelationMapper staffClerkRelationMapper ; private TabHaobanStaffClerkRelationMapper staffClerkRelationMapper ;
@Autowired @Autowired
private ContentProducerApiService contentProducerApiService ; private ContentProducerApiService contentProducerApiService ;
@Autowired
private GroupChatService groupChatService ;
@Autowired
private HmQrcodeService hmQrcodeService ;
@Autowired
private HmQrcodeApiService hmQrcodeApiService ;
@Autowired
private InnerApiService innerApiService ;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService ;
@Autowired
private StaffDepartmentRelatedService staffDepartmentRelatedService ;
@Override @Override
public TabHaobanStaff selectById(String id) { public TabHaobanStaff selectById(String id) {
...@@ -328,4 +348,32 @@ public class StaffServiceImpl implements StaffService { ...@@ -328,4 +348,32 @@ public class StaffServiceImpl implements StaffService {
} }
} }
} }
@Override
public void delStaff(String wxEnterpriseId ,String staffId) {
// 销毁卡券
innerApiService.delCardByStaffId(staffId);
// 删除导购好友关联关系表
this.staffDepartmentRelatedService.delByStaffid(staffId);
// 员工解绑
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService
.listByStaffId(wxEnterpriseId, staffId);
if (CollectionUtils.isNotEmpty(staffClerkRelationDTOS)) {
for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) {
staffClerkRelationApiService.unbindByStaffAndClerkId("-1", staffClerkRelationDTO.getClerkId(),
ChannelCodeEnum.QW_DEL_UNBIND.getCode(), wxEnterpriseId);
}
}
// 群状态刷新
this.groupChatService.ownerDimission(staffId);
// 删除员工表-注意顺序
this.delByStaffId(staffId);
//活码删除
List<Long> hmIdList = hmQrcodeService.queryByStaffIdAndOverFlag(staffId, wxEnterpriseId, 1);
if(CollUtil.isNotEmpty(hmIdList)){
for (Long hmId : hmIdList){
hmQrcodeApiService.delById(hmId,ChannelCodeEnum.ADMIN_UNBIND.getCode(),null);
}
}
}
} }
...@@ -645,9 +645,12 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -645,9 +645,12 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
if (CollectionUtils.isEmpty(delStaffIds)) { if (CollectionUtils.isEmpty(delStaffIds)) {
logger.info("没有要删除的用户:{}--{}", wxEnterpriseId, taskId); logger.info("没有要删除的用户:{}--{}", wxEnterpriseId, taskId);
} else { } else {
staffClerkRelationService.cleanStaffClerk(wxEnterpriseId, delStaffIds); //staffClerkRelationService.cleanStaffClerk(wxEnterpriseId, delStaffIds);
staffService.cleanStaff(wxEnterpriseId, delStaffIds); //staffService.cleanStaff(wxEnterpriseId, delStaffIds);
staffDepartmentRelatedService.cleanStaffDepartment(wxEnterpriseId, delStaffIds); // staffDepartmentRelatedService.cleanStaffDepartment(wxEnterpriseId, delStaffIds);
for(String staffId : delStaffIds) {
this.staffService.delStaff(wxEnterpriseId,staffId);
}
} }
} }
} }
......
...@@ -399,30 +399,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -399,30 +399,7 @@ public class MessageApiServiceImpl implements MessageApiService {
return; return;
} }
String staffId = oldStaff.getStaffId(); String staffId = oldStaff.getStaffId();
// 销毁卡券 this.staffService.delStaff(wxEnterpriseId,staffId);
innerApiService.delCardByStaffId(staffId);
// 删除导购好友关联关系表
this.staffDepartmentRelatedService.delByStaffid(staffId);
// 员工解绑
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService
.listByStaffId(wxEnterpriseId, staffId);
if (CollectionUtils.isNotEmpty(staffClerkRelationDTOS)) {
for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) {
staffClerkRelationApiService.unbindByStaffAndClerkId("-1", staffClerkRelationDTO.getClerkId(),
ChannelCodeEnum.QW_DEL_UNBIND.getCode(), wxEnterpriseId);
}
}
// 群状态刷新
this.groupChatService.ownerDimission(staffId);
// 删除员工表-注意顺序
this.staffService.delByStaffId(staffId);
//活码删除
List<Long> hmIdList = hmQrcodeService.queryByStaffIdAndOverFlag(staffId, wxEnterpriseId, 1);
if(CollUtil.isNotEmpty(hmIdList)){
for (Long hmId : hmIdList){
hmQrcodeApiService.delById(hmId,ChannelCodeEnum.ADMIN_UNBIND.getCode(),null);
}
}
} }
log.error("成员同步结束"); log.error("成员同步结束");
} }
......
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