diff --git a/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar b/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar index 6813c237..c71b7854 100644 Binary files a/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar and b/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar differ diff --git a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ImportShapeExcel1.java b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ImportShapeExcel1.java index 92417751..0c416f96 100644 --- a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ImportShapeExcel1.java +++ b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ImportShapeExcel1.java @@ -168,6 +168,27 @@ public class ImportShapeExcel1 { LogUtil.appendLog(BatchConst.LOG_END + "[执行阶段][保存模型阶段]", simpleLogFile, fullLogFile); this.saveDefine(repositoryId,nodeMap,rightMaxLine,maxLevel); + + //关联属性处理 + DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao(); + if (relationList.size() == 0) { + LogUtil.appendLog(BatchConst.LOG_WARNING + "新增形状属性关联属性内容忽略", simpleLogFile, fullLogFile); + } else { + LogUtil.appendLog(BatchConst.LOG_START + "新增形状属性关联属性内容", simpleLogFile, fullLogFile); + boolean insertProps = relationDao.barchInsert(relationList); + if (insertProps) { + for (int i = 0; i < relationList.size(); i++) { + String name = relationList.get(i).getAttrId(); + String value = relationList.get(i).getRelationShapeText(); + + LogUtil.appendLog(BatchConst.LOG_DESC + "形状属性关联属性内容[" + name + "],属性内容值为[" + value + "]", simpleLogFile, fullLogFile); + } + LogUtil.appendLog(BatchConst.LOG_END + "新增形状属性关联属性内容,总共新增[" + relationList.size() + "]条", simpleLogFile, fullLogFile); + } else { + LogUtil.appendLog(BatchConst.LOG_WARNING + "新增形状属性关联属性内容失败,详情查看BPM平台运行日志", simpleLogFile, fullLogFile); + } + } + // 更新其他自定义属性 LogUtil.appendLog(BatchConst.LOG_START + "完善模型内形状自定义属性配置", simpleLogFile, fullLogFile); PALRepositoryAPIManager.getInstance().updateRepositoryProperty(repositoryId); @@ -175,6 +196,9 @@ public class ImportShapeExcel1 { } LogUtil.appendLog(BatchConst.LOG_END + "[执行结束][Excel导入完成]", simpleLogFile, fullLogFile); + + // 关联属性缓存重新刷新 + DesignerShapeRelationCache.getCache().reload(); } private JSONObject drawBranchShape(String repositoryId,Map>>> branchData,double originOffsetX,Map> nodeMap, diff --git a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ValidShapeExcel.java b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ValidShapeExcel.java index daeb7e31..ccf0bf8d 100644 --- a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ValidShapeExcel.java +++ b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ValidShapeExcel.java @@ -884,6 +884,10 @@ public class ValidShapeExcel { String palId = repositoryMap.get(key); PALRepositoryModel plModel = PALRepositoryCache.getCache().get(palId); BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(plModel.getId(), 0); + if (defineModel == null) { + defineModel = CoeDesignerUtil.createModel(palId, 0); + defineModel.setCreateHistory(false); + } String define = defineModel.getDefinition(); JSONObject definition = JSON.parseObject(define); JSONObject elements = definition.getJSONObject("elements");