|
@@ -308,7 +308,14 @@ public class SynSapServiceImpl implements SynSapService {
|
|
|
String parent = SyncSapUtils.getProjectNumberForParent(number);
|
|
|
|
|
|
if (StringUtils.isNotEmpty(parent) ) {
|
|
|
- parentDyn = parentMap.get(parent); //会有多个相同的父项目,需要去重
|
|
|
+ QFilter qf1 = new QFilter("number", QCP.equals, parent);
|
|
|
+ DynamicObject parentDyn1 = BusinessDataServiceHelper.loadSingle("bd_project", new QFilter[]{qf1});
|
|
|
+ DynamicObject parentDyn2 = parentMap.get(parent); //会有多个相同的父项目,需要去重
|
|
|
+ if(parentDyn1 != null){
|
|
|
+ parentDyn = parentDyn1;
|
|
|
+ }else{
|
|
|
+ parentDyn = parentDyn2;
|
|
|
+ }
|
|
|
if (parentDyn == null) {
|
|
|
parentDyn = BusinessDataServiceHelper.newDynamicObject("bd_project");
|
|
|
long Id = DB.genLongId("t_bd_project");
|
|
@@ -355,6 +362,7 @@ public class SynSapServiceImpl implements SynSapService {
|
|
|
if (EmptyUtils.isNotEmpty(projectStatusDyn)) {
|
|
|
parentDyn.set("prostatus", projectStatusDyn);
|
|
|
}
|
|
|
+ parentMap.put(parent, parentDyn);
|
|
|
projectList.add(parentDyn);
|
|
|
}
|
|
|
}
|