|
@@ -269,7 +269,7 @@ public class SynSapServiceImpl implements SynSapService {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- //if(!number.contains("AD20220999")) continue; ////用于测试
|
|
|
+ if(!number.contains("AD20220999")) continue; ////用于测试
|
|
|
|
|
|
String proleader = item.getString("USR03");
|
|
|
String department = item.getString("DEPARTMENT");
|
|
@@ -299,73 +299,72 @@ public class SynSapServiceImpl implements SynSapService {
|
|
|
QFilter qf2 = new QFilter("number", QCP.equals, "SAP");
|
|
|
DynamicObject srcSysDyn = BusinessDataServiceHelper.loadSingle("bos_devportal_bizcloud", new QFilter[]{qf2});
|
|
|
|
|
|
- DynamicObject dyn = projectMap.get(number);
|
|
|
- if (dyn == null) {
|
|
|
- /*
|
|
|
- * 处理一级项目,来自于项目编码前段编码 BD20200303.2010.07 ,BD20200303为一级项目编码
|
|
|
- * */
|
|
|
- DynamicObject parentDyn = null;
|
|
|
- String parent = SyncSapUtils.getProjectNumberForParent(number);
|
|
|
-
|
|
|
- if (StringUtils.isNotEmpty(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;
|
|
|
+ /*
|
|
|
+ * 处理一级项目,来自于项目编码前段编码 BD20200303.2010.07 ,BD20200303为一级项目编码
|
|
|
+ * */
|
|
|
+ DynamicObject parentDyn = null;
|
|
|
+ String parent = SyncSapUtils.getProjectNumberForParent(number);
|
|
|
+ if (StringUtils.isNotEmpty(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");
|
|
|
+ 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); ///项目分类
|
|
|
}
|
|
|
- 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);
|
|
|
- }else{
|
|
|
- if (EmptyUtils.isNotEmpty(typeDyn)) {
|
|
|
- parentDyn.set("group", typeDyn); ///项目分类
|
|
|
- }
|
|
|
- if (EmptyUtils.isNotEmpty(proleaderDyn)) {
|
|
|
- parentDyn.set("proleader", proleaderDyn);
|
|
|
- }
|
|
|
- if (EmptyUtils.isNotEmpty(departmentDyn)) {
|
|
|
- parentDyn.set("department", departmentDyn);
|
|
|
- }
|
|
|
- if (EmptyUtils.isNotEmpty(projectStatusDyn)) {
|
|
|
- parentDyn.set("prostatus", projectStatusDyn);
|
|
|
- }
|
|
|
- parentMap.put(parent, parentDyn);
|
|
|
- //projectList.add(parentDyn);
|
|
|
+ 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);
|
|
|
+ }else{
|
|
|
+ if (EmptyUtils.isNotEmpty(typeDyn)) {
|
|
|
+ parentDyn.set("group", typeDyn); ///项目分类
|
|
|
+ }
|
|
|
+ if (EmptyUtils.isNotEmpty(proleaderDyn)) {
|
|
|
+ parentDyn.set("proleader", proleaderDyn);
|
|
|
+ }
|
|
|
+ if (EmptyUtils.isNotEmpty(departmentDyn)) {
|
|
|
+ parentDyn.set("department", departmentDyn);
|
|
|
+ }
|
|
|
+ if (EmptyUtils.isNotEmpty(projectStatusDyn)) {
|
|
|
+ parentDyn.set("prostatus", projectStatusDyn);
|
|
|
+ }
|
|
|
+ parentMap.put(parent, parentDyn);
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ DynamicObject dyn = projectMap.get(number);
|
|
|
+ if (dyn == null) {
|
|
|
+
|
|
|
/***
|
|
|
* 处理二级项目,如果项目编码中包含点,则需要处理上级项目
|
|
|
*/
|