| 
					
				 | 
			
			
				@@ -256,6 +256,7 @@ public class SynSapServiceImpl implements SynSapService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         )); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<DynamicObject> projectList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String, DynamicObject> parentMap = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Object[]> useorgList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         StringBuilder err = new StringBuilder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -305,40 +306,43 @@ public class SynSapServiceImpl implements SynSapService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  * */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 DynamicObject parentDyn = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 String parent = SyncSapUtils.getProjectNumberForParent(number); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (StringUtils.isNotEmpty(parent)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn = BusinessDataServiceHelper.newDynamicObject("bd_project"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    long Id = DB.genLongId("t_bd_project"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("id", Id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("masterid", Id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("number", parent); // 编号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("org", DEFAULT_ORG_ID);  //一级项目放在顶层组织下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("createorg", DEFAULT_ORG_ID);  //一级项目放在顶层组织下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (EmptyUtils.isNotEmpty(typeDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        parentDyn.set("group", typeDyn);  ///项目分类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("level", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("isleaf", 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("status", "C");        ///单据状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("ctrlstrategy", "5");  //控制策略  自由分配 2 全局共享 5  私有 7 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("enable", "1");        //使用状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    // parentDyn.set("prostatus", "PASS_S"); //项目状态 PASS通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("name", parent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    parentDyn.set("fullname", parent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (EmptyUtils.isNotEmpty(proleaderDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        parentDyn.set("proleader", proleaderDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (EmptyUtils.isNotEmpty(departmentDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        parentDyn.set("department", departmentDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (EmptyUtils.isNotEmpty(projectStatusDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        parentDyn.set("prostatus", projectStatusDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (EmptyUtils.isNotEmpty(srcSysDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        parentDyn.set("systemtypebase", srcSysDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    projectList.add(parentDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (StringUtils.isNotEmpty(parent) ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    parentDyn = parentMap.get(parent);  //会有多个相同的父项目,需要去重 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (parentDyn == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn = BusinessDataServiceHelper.newDynamicObject("bd_project"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long Id = DB.genLongId("t_bd_project"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("id", Id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("masterid", Id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("number", parent); // 编号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("org", DEFAULT_ORG_ID);  //一级项目放在顶层组织下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("createorg", DEFAULT_ORG_ID);  //一级项目放在顶层组织下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (EmptyUtils.isNotEmpty(typeDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            parentDyn.set("group", typeDyn);  ///项目分类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("level", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("isleaf", 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("status", "C");        ///单据状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("ctrlstrategy", "5");  //控制策略  自由分配 2 全局共享 5  私有 7 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("enable", "1");        //使用状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // parentDyn.set("prostatus", "PASS_S"); //项目状态 PASS通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("name", parent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentDyn.set("fullname", parent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (EmptyUtils.isNotEmpty(proleaderDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            parentDyn.set("proleader", proleaderDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (EmptyUtils.isNotEmpty(departmentDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            parentDyn.set("department", departmentDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (EmptyUtils.isNotEmpty(projectStatusDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            parentDyn.set("prostatus", projectStatusDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (EmptyUtils.isNotEmpty(srcSysDyn)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            parentDyn.set("systemtypebase", srcSysDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        parentMap.put(parent, parentDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        projectList.add(parentDyn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 /*** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  * 处理二级项目,如果项目编码中包含点,则需要处理上级项目 
			 |