Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -11,6 +11,9 @@ import com.cool.store.dto.dept.DepartmentEventDTO;
|
||||
*/
|
||||
public interface EnterpriseSyncService {
|
||||
|
||||
/**
|
||||
* 全量同步
|
||||
*/
|
||||
void syncAll();
|
||||
|
||||
/**
|
||||
|
||||
@@ -85,7 +85,10 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同步组织架构
|
||||
* @return
|
||||
*/
|
||||
private Pair<List<RegionDO>, Multimap<String, String>> syncRegion(){
|
||||
//同步部门
|
||||
List<SysDepartmentDTO> departments = isvHttpRequest.getSubDepartments(CommonConstants.ROOT_DEPT_ID_STR, true);
|
||||
@@ -239,13 +242,23 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
dealUserLeaderDept(updateLeaderDeptMap);
|
||||
break;
|
||||
case DEPARTMENT_DELETED:
|
||||
syncAll();
|
||||
boolean leafNode = regionDAO.isLeafNode(departmentDetail.getId());
|
||||
if(leafNode){
|
||||
//叶子节点的时候会删除部门
|
||||
regionDAO.deleteRegionByRegionId(departmentDetail.getId());
|
||||
}else{
|
||||
syncAll();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理用户负责部门信息
|
||||
* @param leaderDeptMap
|
||||
*/
|
||||
public void dealUserLeaderDept(Multimap<String, String> leaderDeptMap){
|
||||
if(leaderDeptMap.isEmpty()){
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user