Commit aa46a112 by 徐高华

Merge branch 'feature/xgh/bug/1210' into 'master'

Feature/xgh/bug/1210

See merge request !2347
parents e2210c8e 5d1be566
......@@ -24,6 +24,8 @@ public interface StaffService {
int delByStaffId(String staffId);
void delStaff(String wxEnterpriseId ,String staffId) ;
/**
* 选择用户id和企业标识
*
......
package com.gic.haoban.manage.service.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
......@@ -7,9 +8,13 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.UniqueIdUtils;
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.manage.api.dto.StaffClerkRelationDTO;
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.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
......@@ -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.fee.TabHaobanQywxFeeAccountStaff;
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.chat.GroupChatService;
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.wechat.api.dto.qywx.fee.AccountListDTO;
import com.gic.wechat.api.dto.qywx.fee.AccountListResponseDTO;
......@@ -58,6 +66,18 @@ public class StaffServiceImpl implements StaffService {
private TabHaobanStaffClerkRelationMapper staffClerkRelationMapper ;
@Autowired
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
public TabHaobanStaff selectById(String id) {
......@@ -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);
}
}
}
}
......@@ -561,7 +561,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
}
List<TabHaobanPreDealLog> dealLogList=new ArrayList<>();
String rootPid="0";
if (ids.size()>1) {
if (ids.size()>=1) {
rootPid="-999";
syncId=Integer.valueOf(rootPid);
TabHaobanPreDealLog dealLog = getRootDept(wxEnterpriseId,rootPid,taskId);
......@@ -645,9 +645,12 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
if (CollectionUtils.isEmpty(delStaffIds)) {
logger.info("没有要删除的用户:{}--{}", wxEnterpriseId, taskId);
} else {
staffClerkRelationService.cleanStaffClerk(wxEnterpriseId, delStaffIds);
staffService.cleanStaff(wxEnterpriseId, delStaffIds);
staffDepartmentRelatedService.cleanStaffDepartment(wxEnterpriseId, delStaffIds);
//staffClerkRelationService.cleanStaffClerk(wxEnterpriseId, delStaffIds);
//staffService.cleanStaff(wxEnterpriseId, delStaffIds);
// staffDepartmentRelatedService.cleanStaffDepartment(wxEnterpriseId, delStaffIds);
for(String staffId : delStaffIds) {
this.staffService.delStaff(wxEnterpriseId,staffId);
}
}
}
}
......
......@@ -399,30 +399,7 @@ public class MessageApiServiceImpl implements MessageApiService {
return;
}
String staffId = oldStaff.getStaffId();
// 销毁卡券
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);
}
}
this.staffService.delStaff(wxEnterpriseId,staffId);
}
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