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