组织架构同步bug修复
This commit is contained in:
		
							parent
							
								
									8eb7929cdb
								
							
						
					
					
						commit
						d9e6d59145
					
				| @ -1,17 +1,5 @@ | ||||
| package com.yili.org; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.SQLException; | ||||
| import java.util.Date; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import org.dom4j.Document; | ||||
| import org.dom4j.DocumentHelper; | ||||
| import org.dom4j.Element; | ||||
| import org.quartz.JobExecutionContext; | ||||
| import org.quartz.JobExecutionException; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.database.RowMap; | ||||
| import com.actionsoft.bpms.org.cache.OrgCache; | ||||
| import com.actionsoft.bpms.org.cache.RoleCache; | ||||
| @ -28,6 +16,15 @@ import com.actionsoft.sdk.local.api.ORGAPI; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| import com.yili.util.UtilUrl; | ||||
| import org.dom4j.Document; | ||||
| import org.dom4j.DocumentHelper; | ||||
| import org.dom4j.Element; | ||||
| import org.quartz.JobExecutionContext; | ||||
| import org.quartz.JobExecutionException; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| /** | ||||
|  * 同步组织架构 | ||||
| @ -312,6 +309,17 @@ public class IntegrationJob implements IJob { | ||||
|                 		SDK.getORGAPI().closeDepartment(currentId); | ||||
|                 	} | ||||
|                 } | ||||
| 
 | ||||
|                 //新增父部门更新逻辑,add 2024/06/12 by yujh | ||||
|                 String parent_dept_id = getDeptIdByOuterId(parent_id); | ||||
|                 if(UtilString.isNotEmpty(parent_dept_id)){//不为空 | ||||
|                     String parentDepartmentId = SDK.getORGAPI().getDepartmentById(currentId).getParentDepartmentId(); | ||||
|                     if(!parentDepartmentId.equals(parent_dept_id) && !parentDepartmentId.equals("0")){//不为一级部门,且与目前部门不相符,则修改父部门 | ||||
|                         //执行修改部门 | ||||
|                         SDK.getLogAPI().consoleInfo(">>>>>>>>>>执行替换部门,"+currentId+"至"+parent_dept_id+"部门下"); | ||||
|                         SDK.getORGAPI().moveDepartmentToDepartment(currentId,parent_dept_id); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|              | ||||
|         } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 yujh
						yujh