| 
														
															@@ -6,6 +6,7 @@ import kd.bos.dataentity.entity.DynamicObject; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import kd.bos.dataentity.resource.ResManager; 
														 | 
														
														 | 
														
															 import kd.bos.dataentity.resource.ResManager; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import kd.bos.logging.Log; 
														 | 
														
														 | 
														
															 import kd.bos.logging.Log; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import kd.bos.logging.LogFactory; 
														 | 
														
														 | 
														
															 import kd.bos.logging.LogFactory; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import kd.bos.orm.query.QCP; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import kd.bos.orm.query.QFilter; 
														 | 
														
														 | 
														
															 import kd.bos.orm.query.QFilter; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import kd.bos.servicehelper.BusinessDataServiceHelper; 
														 | 
														
														 | 
														
															 import kd.bos.servicehelper.BusinessDataServiceHelper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import kd.fi.er.business.trip.model.TripSyncDataMappingModel; 
														 | 
														
														 | 
														
															 import kd.fi.er.business.trip.model.TripSyncDataMappingModel; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -22,7 +23,7 @@ import java.util.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.concurrent.atomic.AtomicReference; 
														 | 
														
														 | 
														
															 import java.util.concurrent.atomic.AtomicReference; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /** 
														 | 
														
														 | 
														
															 /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- * 滴滴-同步组织 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ * 滴滴-同步组织,全复制的7.0.8的标准源码后改造 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  * @author wanghaiwu_kd 
														 | 
														
														 | 
														
															  * @author wanghaiwu_kd 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  * @date 2025/06/16 
														 | 
														
														 | 
														
															  * @date 2025/06/16 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  */ 
														 | 
														
														 | 
														
															  */ 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -68,7 +69,7 @@ public class DiDiTripOrgCusInvoke extends AbstractOrgInvoke<Set<JSONObject>> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             String access_token = DiDiServiceUtil.getCacheToken(new Date()); 
														 | 
														
														 | 
														
															             String access_token = DiDiServiceUtil.getCacheToken(new Date()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             logger.info("Line 76 access_token{}", access_token); 
														 | 
														
														 | 
														
															             logger.info("Line 76 access_token{}", access_token); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (access_token == null) { 
														 | 
														
														 | 
														
															             if (access_token == null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                this.tripSyncLogParam.setMessage(ResManager.loadKDString("商旅集成,获取滴滴token为空,请检查配置。", "DiDiTripOrgInvoke_1", "fi-er-business", new Object[0])); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                this.tripSyncLogParam.setMessage(ResManager.loadKDString("商旅集成,获取滴滴Token为空,请检查配置。", "DiDiTripOrgInvoke_1", "fi-er-business", new Object[0])); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 this.tripSyncLogParam.setStatus("B"); 
														 | 
														
														 | 
														
															                 this.tripSyncLogParam.setStatus("B"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 return null; 
														 | 
														
														 | 
														
															                 return null; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } else { 
														 | 
														
														 | 
														
															             } else { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -86,7 +87,6 @@ public class DiDiTripOrgCusInvoke extends AbstractOrgInvoke<Set<JSONObject>> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 Arrays.stream(orgDOs).forEach((orgDO) -> { 
														 | 
														
														 | 
														
															                 Arrays.stream(orgDOs).forEach((orgDO) -> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     String name = orgDO.getString("fullname"); 
														 | 
														
														 | 
														
															                     String name = orgDO.getString("fullname"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     String out_budget_id = String.valueOf(orgDO.getLong("org.id")); 
														 | 
														
														 | 
														
															                     String out_budget_id = String.valueOf(orgDO.getLong("org.id")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    String parent_id = String.valueOf(orgDO.getLong("parent.id")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     HashMap<String, Object> signMap = new HashMap(); 
														 | 
														
														 | 
														
															                     HashMap<String, Object> signMap = new HashMap(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     signMap.put("client_id", client_id); 
														 | 
														
														 | 
														
															                     signMap.put("client_id", client_id); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -99,8 +99,9 @@ public class DiDiTripOrgCusInvoke extends AbstractOrgInvoke<Set<JSONObject>> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     signMap.put("name", name); 
														 | 
														
														 | 
														
															                     signMap.put("name", name); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     signMap.put("out_budget_id", String.valueOf(out_budget_id)); 
														 | 
														
														 | 
														
															                     signMap.put("out_budget_id", String.valueOf(out_budget_id)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    //二开,增加上级同步 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    signMap.put("parent_id", String.valueOf(parent_id)); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    //二开,增加上级同步,获取上级组织ID映射的DiDi组织ID 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    String parentId_DiDi = getDiDiOrgId(orgDO.getLong("parent.id")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    signMap.put("parent_id", String.valueOf(parentId_DiDi)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     String signKey = (String)supplierMap.get("reservedfield1"); 
														 | 
														
														 | 
														
															                     String signKey = (String)supplierMap.get("reservedfield1"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     String addDeptSign = DiDiServiceUtil.genSign(signMap, signKey); 
														 | 
														
														 | 
														
															                     String addDeptSign = DiDiServiceUtil.genSign(signMap, signKey); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -144,7 +145,7 @@ public class DiDiTripOrgCusInvoke extends AbstractOrgInvoke<Set<JSONObject>> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 String url = ""; 
														 | 
														
														 | 
														
															                 String url = ""; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 switch (syncKey) { 
														 | 
														
														 | 
														
															                 switch (syncKey) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     case "add": 
														 | 
														
														 | 
														
															                     case "add": 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        url = (String) ExternalConstants.DIDIURLMAP.get("BudgetCenterAddKey"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        url = (String)ExternalConstants.DIDIURLMAP.get("BudgetCenterAddKey"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         break; 
														 | 
														
														 | 
														
															                         break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     case "edit": 
														 | 
														
														 | 
														
															                     case "edit": 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         url = (String)ExternalConstants.DIDIURLMAP.get("BudgetCenterEditKey"); 
														 | 
														
														 | 
														
															                         url = (String)ExternalConstants.DIDIURLMAP.get("BudgetCenterEditKey"); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -177,4 +178,26 @@ public class DiDiTripOrgCusInvoke extends AbstractOrgInvoke<Set<JSONObject>> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return code; 
														 | 
														
														 | 
														
															             return code; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * 根据星瀚组织ID查询映射的DiDi组织ID 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * @param orgId 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     * @return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private String getDiDiOrgId(Long orgId){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String didiOrgId = ""; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(orgId > 0L){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            QFilter qFilter = new QFilter("server", QCP.equals, "DIDI"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            qFilter.and(new QFilter("datatype", QCP.equals, "bos_org")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            qFilter.and(new QFilter("innerdataid", QCP.equals, orgId)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            DynamicObject mappingInfo = BusinessDataServiceHelper.loadSingle("er_tripsync_datamapping", qFilter.toArray()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(mappingInfo != null){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                didiOrgId = mappingInfo.getString("outdataid"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return didiOrgId; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 |