diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java index ebd2c1f3..db3181e4 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java @@ -789,29 +789,37 @@ public class DesignerRelationShapeWeb extends ActionWeb { JSONObject jsonObject = objects.getJSONObject(i); String id = jsonObject.getString("id"); String isParent = jsonObject.getString("isParent"); + if (isParent != null) { if (isParent.equals("true")) { - List coeProcessLevelModels = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getCoeProcessLevelByPid(id, wsId); - if (coeProcessLevelModels.size() > 0) { - for (int k = 0; k < coeProcessLevelModels.size(); k++) { - PALRepositoryModel coeProcessLevelModel = coeProcessLevelModels.get(k); - if (coeProcessLevelModel != null) { - List data = new ArrayList(); - data.add(0, "org.role"); - data.add(1, ruuid); - RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", coeProcessLevelModel.getId(), data.toString()); - if (rowMap != null) { - showflag = false; + String title=jsonObject.getString("title"); + if(title.equals("角色模型")){ + jsonArr_new.add(objects.getJSONObject(i)); + }else{ + List coeProcessLevelModels = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getCoeProcessLevelByPid(id, wsId); + if (coeProcessLevelModels.size() > 0) { + for (int k = 0; k < coeProcessLevelModels.size(); k++) { + PALRepositoryModel coeProcessLevelModel = coeProcessLevelModels.get(k); + if (coeProcessLevelModel != null) { + List data = new ArrayList(); + data.add(0, "org.role"); + data.add(1, ruuid); + RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", coeProcessLevelModel.getId(), data.toString()); + if (rowMap != null) { + /*showflag = false; if (showflag == false) { jsonArr_new.add(objects.getJSONObject(i)); showflag = true; + }*/ + JSONObject json = getJSon(coeProcessLevelModel); + + jsonArr_new.add(json); } - JSONObject json = getJSon(coeProcessLevelModel); - jsonArr_new.add(json); } } } } + } else { List data = new ArrayList(); data.add(0, jsonObject.getString("plMethodId")); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java index 6b113ecd..0b3ffa16 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java @@ -3753,106 +3753,108 @@ public class CoeDesignerWeb extends ActionWeb { /** * 操作升级版本/复制副本 创建对应角色/绩效关联关系 - * @param isLargeIteration + * @param isLargeIteration * @param olduuid */ -public String CreateincidenceRelation(boolean isLargeIteration,String olduuid,PALRepositoryModel newModel,Map mapNewUUID,Double tempVer){ - ResponseObject ro = ResponseObject.newOkResponse(); - DesignerShapeRelationDao dao = new DesignerShapeRelationDao(); - List oldModelList = dao.getModelListByFileId(olduuid); - if(oldModelList.size()>0){ - for (DesignerShapeRelationModel oldModel : oldModelList) { + public String CreateincidenceRelation(boolean isLargeIteration,String olduuid,PALRepositoryModel newModel,Map mapNewUUID,Double tempVer){ + ResponseObject ro = null; + DesignerShapeRelationDao dao = new DesignerShapeRelationDao(); + List oldModelList = dao.getModelListByFileId(olduuid); + if(oldModelList.size()>0){ + for (DesignerShapeRelationModel oldModel : oldModelList) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(newModel.getId()); - //如果关联角色图,则同步复制角色图关联关系 - String methodIds=""; - if(oldModel.getAttrId().equals("role")){ - methodIds="org.role"; - if (mapNewUUID.containsKey(oldModel.getShapeId())) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(newModel.getId()); + //如果关联角色图,则同步复制角色图关联关系 + String methodIds=""; + if(oldModel.getAttrId().equals("role")){ + methodIds="org.role"; + if (mapNewUUID.containsKey(oldModel.getShapeId())) { - String srcPath = "";// 源文件路径 - String targetPath = "";// 目标文件路径 - PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel(); - PALRepositoryModelImpl lastplModel = (PALRepositoryModelImpl) coeProcessLevel.getInstance(oldModel.getRelationFileId()); - final String oldUUID = lastplModel.getId(); - lastplModel.setId(UUIDGener.getUUID()); - final String newUUID = lastplModel.getId(); - //大小版本号处理 - tempVer = isLargeIteration ? coeProcessLevel.getMaxVersionNum(lastplModel.getVersionId()) : coeProcessLevel.getMaxVersionNum(lastplModel.getVersionId(),lastplModel.getVersion()); - lastplModel.setHistoryMaxVersion("0"); - lastplModel.setVersion(VersionUtil.increaseVersionNo(tempVer,isLargeIteration)); - lastplModel.setUse(false); - srcPath = lastplModel.getFilePath(); - if (!"".equals(srcPath) && srcPath != null) { - targetPath = srcPath.replace(oldModel.getId(), lastplModel.getId()); - } - lastplModel.setFilePath(targetPath); - lastplModel.setPublish(false); - lastplModel.setStop(false); - lastplModel.setApproval(false); - Timestamp nowTime = new Timestamp(System.currentTimeMillis()); - String uid = super.getContext().getUID(); - lastplModel.setCreateUser(uid); - lastplModel.setCreateDate(nowTime); - lastplModel.setModifyUser(uid); - lastplModel.setModifyDate(nowTime); - List data=new ArrayList<>(); - data.add(0,"org.role"); - data.add(1,newModel.getId()); - lastplModel.setExt2(data.toString()); - //密级 - lastplModel.setSecurityLevel(-1); - int store = 0; - try { - store = CoeProcessLevelDaoFacotory.createCoeProcessLevel().insert(lastplModel); - if (store == 1) { - // 修改设计器文件 - CoeFile fileUtil = new CoeFile(); - fileUtil.copyDefaultVersion(srcPath, oldUUID, targetPath, lastplModel.getId()); + String srcPath = "";// 源文件路径 + String targetPath = "";// 目标文件路径 + PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel(); + PALRepositoryModelImpl lastplModel = (PALRepositoryModelImpl) coeProcessLevel.getInstance(oldModel.getRelationFileId()); + final String oldUUID = lastplModel.getId(); + lastplModel.setId(UUIDGener.getUUID()); + final String newUUID = lastplModel.getId(); + //大小版本号处理 + tempVer = isLargeIteration ? coeProcessLevel.getMaxVersionNum(lastplModel.getVersionId()) : coeProcessLevel.getMaxVersionNum(lastplModel.getVersionId(),lastplModel.getVersion()); + lastplModel.setHistoryMaxVersion("0"); + lastplModel.setVersion(VersionUtil.increaseVersionNo(tempVer,isLargeIteration)); + lastplModel.setUse(false); + srcPath = lastplModel.getFilePath(); + if (!"".equals(srcPath) && srcPath != null) { + targetPath = srcPath.replace(oldModel.getId(), lastplModel.getId()); + } + lastplModel.setFilePath(targetPath); + lastplModel.setPublish(false); + lastplModel.setStop(false); + lastplModel.setApproval(false); + Timestamp nowTime = new Timestamp(System.currentTimeMillis()); + String uid = super.getContext().getUID(); + lastplModel.setCreateUser(uid); + lastplModel.setCreateDate(nowTime); + lastplModel.setModifyUser(uid); + lastplModel.setModifyDate(nowTime); + List data=new ArrayList<>(); + data.add(0,"org.role"); + data.add(1,newModel.getId()); + lastplModel.setExt2(data.toString()); + //密级 + lastplModel.setSecurityLevel(-1); + int store = 0; + try { + store = CoeProcessLevelDaoFacotory.createCoeProcessLevel().insert(lastplModel); + if (store == 1) { + // 修改设计器文件 + CoeFile fileUtil = new CoeFile(); + fileUtil.copyDefaultVersion(srcPath, oldUUID, targetPath, lastplModel.getId()); - // 获取新旧节点关联关系 - final Map mapNewUUID1 = createShapeIdRelation(PALRepositoryCache.getCache().get(oldModel.getRelationFileId()), true); - // 处理流程属性 - String property = CoePropertyUtil.getPropertyValue(oldModel.getRelationFileId() + "_attr"); - if (!UtilString.isEmpty(property)) { - CoePropertyUtil.createProperty(newUUID + "_attr", property); + // 获取新旧节点关联关系 + final Map mapNewUUID1 = createShapeIdRelation(PALRepositoryCache.getCache().get(oldModel.getRelationFileId()), true); + // 处理流程属性 + String property = CoePropertyUtil.getPropertyValue(oldModel.getRelationFileId() + "_attr"); + if (!UtilString.isEmpty(property)) { + CoePropertyUtil.createProperty(newUUID + "_attr", property); + } + + //重新设置修订关联关系 + DesignerShapeRelationModel newModel1 = new DesignerShapeRelationModel(); + newModel1.setId(UUIDGener.getUUID()); + newModel1.setFileId(newModel.getId()); + newModel1.setShapeId(mapNewUUID.get(oldModel.getShapeId())); + newModel1.setShapeText(oldModel.getShapeText()); + newModel1.setAttrId(oldModel.getAttrId()); + newModel1.setRelationFileId(newUUID); + newModel1.setRelationShapeId(oldModel.getRelationShapeId()); + newModel1.setRelationShapeText(oldModel.getRelationShapeText()); + dao.insert(newModel1); + + + CoeProcessLevelUtil.copyRepositoryProperty(PALRepositoryCache.getCache().get(oldModel.getRelationFileId()), PALRepositoryCache.getCache().get(newUUID), mapNewUUID1, _uc); + ro = ResponseObject.newOkResponse("创建成功"); + ro.put("uuid", lastplModel.getId()); + }else{ + ro = ResponseObject.newWarnResponse("创建失败"); + } + } catch (Exception e) { + ro = ResponseObject.newWarnResponse("创建失败," + e.getMessage()); } - //重新设置修订关联关系 - DesignerShapeRelationModel newModel1 = new DesignerShapeRelationModel(); - newModel1.setId(UUIDGener.getUUID()); - newModel1.setFileId(newModel.getId()); - newModel1.setShapeId(mapNewUUID.get(oldModel.getShapeId())); - newModel1.setShapeText(oldModel.getShapeText()); - newModel1.setAttrId(oldModel.getAttrId()); - newModel1.setRelationFileId(newUUID); - newModel1.setRelationShapeId(oldModel.getRelationShapeId()); - newModel1.setRelationShapeText(oldModel.getRelationShapeText()); - dao.insert(newModel1); - - CoeProcessLevelUtil.copyRepositoryProperty(PALRepositoryCache.getCache().get(oldModel.getRelationFileId()), PALRepositoryCache.getCache().get(newUUID), mapNewUUID1, _uc); - ro = ResponseObject.newOkResponse("创建成功"); - ro.put("uuid", lastplModel.getId()); - }else{ - ro = ResponseObject.newWarnResponse("创建失败"); } - } catch (Exception e) { - ro = ResponseObject.newWarnResponse("创建失败," + e.getMessage()); + ro = ResponseObject.newWarnResponse("创建失败"); + }else{ + ro = ResponseObject.newWarnResponse("创建失败"); } - - } + }else{ ro = ResponseObject.newWarnResponse("创建失败"); } return ro.toString(); - } - }else{ - ro = ResponseObject.newWarnResponse("创建失败"); - } - return ro.toString(); -} + } + diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java index 526afbea..cf6e6896 100644 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java @@ -147,14 +147,14 @@ public class SynchronousOrgJob implements IJob { RowMap orgrowMap=DBSql.getMap("SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT1=?",org.getString("ID")); if(orgrowMap==null){ - PALRepositoryModelImpl model1 = CoeProcessLevelUtil.createPALRepositoryModel(id1, plRid1, wsId, org.getString("DEPARTMENTNAME"), - "", 1, parentModelId, "org", true, 1, - id1, false, "org.normal", "0", Integer.valueOf(org.getString("ORDERINDEX")), null, - null, "admin", "admin", nowTime, org.getString("ID"), null, - null, null, null, null, null, null, null, 1); - coeProcessLevel.insert(model1); - createPostData(model1.getId(), org.getString("ID"), model1, conn); - return modelId = model1.getId(); + PALRepositoryModelImpl model1 = CoeProcessLevelUtil.createPALRepositoryModel(id1, plRid1, wsId, org.getString("DEPARTMENTNAME"), + "", 1, parentModelId, "org", true, 1, + id1, false, "org.normal", "0", Integer.valueOf(org.getString("ORDERINDEX")), null, + null, "admin", "admin", nowTime, org.getString("ID"), null, + null, null, null, null, null, null, null, 1); + coeProcessLevel.insert(model1); + createPostData(model1.getId(), org.getString("ID"), model1, conn); + return modelId = model1.getId(); }else{ String plname=orgrowMap.getString("PLNAME"); if(!plname.equals(org.getString("DEPARTMENTNAME"))){ @@ -172,15 +172,15 @@ public class SynchronousOrgJob implements IJob { if (StringUtil.isNotEmpty(parentPalOrgId)) { RowMap orgrowMap=DBSql.getMap("SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT1=?",org.getString("ID")); if(orgrowMap==null) { - PALRepositoryModelImpl model2 = CoeProcessLevelUtil.createPALRepositoryModel(id1, plRid1, wsId, org.getString("DEPARTMENTNAME"), - "", 1, getParentPalOrgId(org, conn), "org", true, 1, - id1, false, "org.normal", "0", Integer.valueOf(org.getString("ORDERINDEX")), null, - null, "admin", "admin", nowTime, org.getString("ID"), null, - null, null, null, null, null, null, null, 1); - coeProcessLevel.insert(model2); + PALRepositoryModelImpl model2 = CoeProcessLevelUtil.createPALRepositoryModel(id1, plRid1, wsId, org.getString("DEPARTMENTNAME"), + "", 1, getParentPalOrgId(org, conn), "org", true, 1, + id1, false, "org.normal", "0", Integer.valueOf(org.getString("ORDERINDEX")), null, + null, "admin", "admin", nowTime, org.getString("ID"), null, + null, null, null, null, null, null, null, 1); + coeProcessLevel.insert(model2); - createPostData(model2.getId(), org.getString("ID"), model2, conn); - return modelId = model2.getId(); + createPostData(model2.getId(), org.getString("ID"), model2, conn); + return modelId = model2.getId(); }else{ String plname=orgrowMap.getString("PLNAME"); if(!plname.equals(org.getString("DEPARTMENTNAME"))){ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/upfile/web/UpfileWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/upfile/web/UpfileWeb.java index e4f9b5f0..928c1503 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/upfile/web/UpfileWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/upfile/web/UpfileWeb.java @@ -488,20 +488,6 @@ public class UpfileWeb extends ActionWeb { return ResponseObject.newErrResponse((e.getMessage() == null) ? e.getCause().getMessage() : e.getMessage()).toString(); } - - /*DCUtil.getInstance(); - dcContext = DCUtil.createTempFileContext("com.actionsoft.apps.coe.pal", "output", uuid, "zip"); - dcContext.setFileName("xxx.zip"); - File ff = new File(dcContext.getFilePath());*/ - //UtilFile.zipCompressExcludeName(file.getPath(), ff, "log,**/config.txt"); - /*dcContext.setSession(_uc);*/ - - /*String downUrl=SDK.getConfAPI().getPortalUrl() + "/r/" + dcContext.getDownloadURL().replace("./", ""); - ro.put("url",downUrl); - return ro.toString();*/ - - //return ResponseObject.newErrResponse("下载失败").toString(); - } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java index 41cc0d94..69735909 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java @@ -691,21 +691,18 @@ public class CoeProcessLevelUtil { propertyModel.setId(UUIDGener.getUUID()); newPropertyList.add(propertyModel); - //文件属性存在流程绩效,则同步创建关联关系 - if(propertyModel.getPropertyId().equals("Process_performance_metrics")){ - PALRepositoryModel model = PALRepositoryCache.getCache().get(newUuid); - /*CoeProcessLevelWeb.createCorrelationDialogModel(newUuid,"control.kpi",model.getWsId(),"");*/ - - - - - } } } repositoryPropertyDao.batchInsert(newPropertyList); } - + + + + + + + /** * 关联属性复制 * @param olduuid @@ -724,7 +721,6 @@ public class CoeProcessLevelUtil { } //by bzp end if (mapNewUUID.containsKey(oldModel.getShapeId())) { - DesignerShapeRelationModel newModel = new DesignerShapeRelationModel(); newModel.setId(UUIDGener.getUUID()); newModel.setFileId(uuId); @@ -2375,8 +2371,8 @@ public class CoeProcessLevelUtil { * @return */ public static String getLastPublishTaskIdByModelId(String repositoryId) { - String sql = "SELECT pl.TASKID FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl WHERE pl.pid = p.id AND pl.palrepositoryid = ? ORDER BY publishdate DESC"; - //String sql="SELECT TASKID FROM BO_ACT_COE_PUBLISH_N where PUBLISHFILEID=?"; + //String sql = "SELECT pl.TASKID FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl WHERE pl.pid = p.id AND pl.palrepositoryid = ? ORDER BY publishdate DESC"; + String sql="SELECT TASKID FROM BO_ACT_COE_PUBLISH_N where PUBLISHFILEID=?"; String taskId = DBSql.getObject(sql, new RowMapper() { @Override public String mapRow(ResultSet rs, int arg1) throws SQLException { diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index b1034be8..89b990af 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -144,7 +144,6 @@ public class CoeProcessLevelWeb extends ActionWeb { } - /** * 获取未关闭的工作空间 * @@ -5308,6 +5307,7 @@ public class CoeProcessLevelWeb extends ActionWeb { // 更新流程文件中节点id等信息 updateDefineShape(newModel, mapNewUUID, ""); CoeProcessLevelUtil.copyRepositoryProperty(oldModel, newModel, mapNewUUID, _uc); + } catch (Exception e) { e.printStackTrace(); } @@ -5317,6 +5317,19 @@ public class CoeProcessLevelWeb extends ActionWeb { + /*public String updateRoleincidenceRelation(PALRepositoryModelImpl newModel){ + String newModelId = newModel.getId(); + DesignerShapeRelationDao dao = new DesignerShapeRelationDao(); + List oldModelList = dao.getModelListByFileId(newModelId); + for (DesignerShapeRelationModel oldModel : oldModelList) { + + } + + } + }*/ + + + private void updateDefineShape(PALRepositoryModelImpl newModel, Map mapNewUUID, String define) { String messageJson = null; PALRepositoryModel levelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(newModel.getId()); @@ -10236,7 +10249,8 @@ public String deleteReply(String replyid, String messageid) { SDK.getLogAPI().consoleErr("复制文件[" + model.getName() + "][" + model.getId() + "]失败," + moveRo.getString("msg")); return ResponseObject.newErrResponse(moveRo.getString("msg")).toString(); } - //copyPalProcessLevelCorrelationModelRepository(wsId,teamId,sourceIds); + copyPalProcessLevelRoleCorrelationModelRepository(wsId,teamId,sourceIds); + copyPalProcessLevelPerformanceCorrelationModelRepository(wsId,teamId,sourceIds); } // 操作行为日志记录 if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { @@ -10248,16 +10262,18 @@ public String deleteReply(String replyid, String messageid) { } + /** - * 同步复制角色、绩效模型图信息 + * 同步复制数据模型角色模型 * @param wsId * @param teamId * @param sourceIds * @param targetId * @return */ - public String copyPalProcessLevelCorrelationModelRepository(String wsId, String teamId, String sourceIds) { - + public String copyPalProcessLevelRoleCorrelationModelRepository(String wsId, String teamId, String sourceIds) { + ResponseObject ro = ResponseObject.newOkResponse(); + //获取数据属性同步创建角色模型 JSONArray sourceIdArr = JSONArray.parseArray(sourceIds); for (int i = 0; i < sourceIdArr.size(); i++) { String sourceId = sourceIdArr.getString(i); @@ -10268,10 +10284,8 @@ public String deleteReply(String replyid, String messageid) { //如果关联角色图,则同步复制角色图关联关系 String methodIds = ""; if (oldModel.getAttrId().equals("role")) { - PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel(); String targetId = checkAndCreatePalRoleFolderModel(coeProcessLevel,wsId); - PALRepositoryModel model = PALRepositoryCache.getCache().get(oldModel.getRelationFileId()); String result = copyFile(wsId, teamId, oldModel.getRelationFileId(), targetId, "all"); @@ -10282,12 +10296,60 @@ public String deleteReply(String replyid, String messageid) { } } + } } + return ro.toString(); + } - } - return ""; + + + + /** + * 同步复制文件属性绩效属性数据 + * @param wsId + * @param teamId + * @param sourceIds + * @param targetId + * @return + */ + public String copyPalProcessLevelPerformanceCorrelationModelRepository(String wsId, String teamId, String sourceIds) { + ResponseObject ro = ResponseObject.newOkResponse(); + JSONArray sourceIdArr = JSONArray.parseArray(sourceIds); + for (int i = 0; i < sourceIdArr.size(); i++) { + String sourceId = sourceIdArr.getString(i); + PALRepositoryPropertyDao repositoryPropertyDao = new PALRepositoryPropertyDao(); + List oldPropertyList = repositoryPropertyDao.getPropertysByPlid(sourceId, ""); + List newPropertyList = new ArrayList(); + if (oldPropertyList != null && oldPropertyList.size() > 0) { + for (PALRepositoryPropertyModel propertyModel : oldPropertyList) { + + //文件属性存在流程绩效,则同步创建关联关系 + if(propertyModel.getPropertyId().equals("Process_performance_metrics")){ + String relationFileId=JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId"); + String[] splitRelationFileId; + if(relationFileId!=null){ + splitRelationFileId=relationFileId.split(","); + + PALRepositoryModel model = PALRepositoryCache.getCache().get(splitRelationFileId[0]); + + String result = copyFile(wsId, teamId, splitRelationFileId[0], "control", "all"); + + JSONObject moveRo = JSONObject.parseObject(result); + if (!"ok".equals(moveRo.getString("result"))) { + SDK.getLogAPI().consoleErr("复制文件[" + model.getName() + "][" + model.getId() + "]失败," + moveRo.getString("msg")); + return ResponseObject.newErrResponse(moveRo.getString("msg")).toString(); + } + + } + } + + + } + } + } + return ro.toString(); } diff --git a/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.htm b/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.htm index 9d1db40e..4a34f115 100755 --- a/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.htm +++ b/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.htm @@ -286,6 +286,7 @@ + <#processlink_ete_js> <#batch-js>