Commit aaf96b7b by fudahua

插入绑定日志

parent 3d3dc1ef
...@@ -161,12 +161,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -161,12 +161,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
return uuid; return uuid;
} }
@Override @Override
public int cleanStaffClerk(String wxEnterpriseId, List<String> staffIds) { public int cleanStaffClerk(String wxEnterpriseId, List<String> delStaffIds) {
List<String> delStaffIds = staffService.listDelUserStaffId(wxEnterpriseId, staffIds);
if (CollectionUtils.isEmpty(delStaffIds)) {
logger.info("没有要删除的成员:{}",wxEnterpriseId);
return 0;
}
delStaffIds.forEach(staffId->{ delStaffIds.forEach(staffId->{
List<StaffClerkRelationDTO> relationDTOS = listBindCodeByStaffId(null, staffId); List<StaffClerkRelationDTO> relationDTOS = listBindCodeByStaffId(null, staffId);
if (CollectionUtils.isNotEmpty(relationDTOS)) { if (CollectionUtils.isNotEmpty(relationDTOS)) {
...@@ -175,8 +170,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -175,8 +170,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}); });
} }
}); });
int ret = mapper.cleanStaffDepart(wxEnterpriseId, staffIds); int ret = mapper.cleanStaffDepart(wxEnterpriseId, delStaffIds);
externalClerkRelatedService.cleanStaffRelated(wxEnterpriseId,staffIds); externalClerkRelatedService.cleanStaffRelated(wxEnterpriseId,delStaffIds);
return ret; return ret;
} }
......
...@@ -574,9 +574,14 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -574,9 +574,14 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
List<StaffDTO> retLists = staffService.listByUserIdsAndWxEnterpriseId(clerkIds, wxEnterpriseId); List<StaffDTO> retLists = staffService.listByUserIdsAndWxEnterpriseId(clerkIds, wxEnterpriseId);
List<String> staffIds = retLists.stream().map(StaffDTO::getStaffId).collect(Collectors.toList()); List<String> staffIds = retLists.stream().map(StaffDTO::getStaffId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(staffIds)) { if (CollectionUtils.isNotEmpty(staffIds)) {
staffClerkRelationService.cleanStaffClerk(wxEnterpriseId, staffIds); List<String> delStaffIds = staffService.listDelUserStaffId(wxEnterpriseId, staffIds);
staffService.cleanStaff(wxEnterpriseId, staffIds); if (CollectionUtils.isEmpty(delStaffIds)) {
staffDepartmentRelatedService.cleanStaffDepartment(wxEnterpriseId,staffIds); logger.info("没有要删除的用户:{}--{}",wxEnterpriseId,taskId);
}else {
staffClerkRelationService.cleanStaffClerk(wxEnterpriseId, delStaffIds);
staffService.cleanStaff(wxEnterpriseId, delStaffIds);
staffDepartmentRelatedService.cleanStaffDepartment(wxEnterpriseId, delStaffIds);
}
} }
} }
......
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
update_time = now() update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1 and status_flag = 1
and staff_id not in and staff_id in
<foreach collection="staffIds" item="item" open="(" separator="," close=")"> <foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
......
...@@ -347,8 +347,8 @@ ...@@ -347,8 +347,8 @@
status_flag = 0, status_flag = 0,
update_time = now() update_time = now()
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1 and super_manager_flag is null where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1
and staff_id not in and staff_id in
<foreach collection="staffIds" item="item" open="(" separator="," close=")"> <foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
......
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
status_flag = 0, status_flag = 0,
update_time = now() update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 and where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 and
staff_id not in staff_id in
<foreach collection="staffIds" item="item" open="(" separator="," close=")"> <foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
......
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