Commit 90da0e15 by qwmqiuwenmin

Merge branch 'developer' of http://115.159.76.241/haoban3.0/haoban-manage3.0.git into developer

parents 6dc57905 aaf96b7b
...@@ -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);
}
} }
} }
......
...@@ -328,10 +328,11 @@ ...@@ -328,10 +328,11 @@
<update id="cleanStaffDepartment" > <update id="cleanStaffDepartment" >
update tab_haoban_staff_department_related update tab_haoban_staff_department_related
set set
status_flag = 0 status_flag = 0,
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 not 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>
...@@ -367,7 +367,7 @@ ...@@ -367,7 +367,7 @@
<select id="listUserStaffId" resultType="string"> <select id="listUserStaffId" resultType="string">
select staff_id FROM tab_haoban_staff select staff_id FROM tab_haoban_staff
WHERE WHERE
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1 and super_manager_flag is not null wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1 and super_manager_flag is null
and staff_id not in and staff_id not in
<foreach collection="staffIds" item="item" open="(" separator="," close=")"> <foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item} #{item}
......
...@@ -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