diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index ec923dc7..30ade141 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ 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 eae9028e..c90df639 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 @@ -966,7 +966,7 @@ public class DesignerRelationShapeWeb extends ActionWeb { } String tmpStr = StringUtils.join(versionIds, ","); List list = dao.getModelListByShapeIdAndRelationShapeId(ruuid, shapeId, null, tmpStr); - list.sort(Comparator.comparing(DesignerShapeRelationModel::getRelationShapeText)); + list.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText)); for (DesignerShapeRelationModel model : list) { if (ids.contains(model.getRelationFileId())) { continue; @@ -987,7 +987,7 @@ public class DesignerRelationShapeWeb extends ActionWeb { } else {// 关联形状 Set ids = new HashSet<>(); List list = dao.getModelListByShapeIdAndRelationShapeId(ruuid, shapeId, relationShapeIds, null); - + list.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText)); for (DesignerShapeRelationModel model : list) { if (ids.contains(model.getRelationShapeId()) && !"shapeAndFile".equals(type)) { continue; 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 cbfd0290..351a964e 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 @@ -4377,6 +4377,9 @@ public class CoeDesignerWeb extends ActionWeb { if(UtilString.isNotEmpty(relationFileId)){ + if(relationFileId.contains(",")){ + relationFileId=relationFileId.split(",")[0]; + } String srcPath = "";// 源文件路径 String targetPath = "";// 目标文件路径 PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel(); 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 8e535a96..84392714 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 @@ -736,7 +736,7 @@ public class CoeProcessLevelUtil { newModel.setId(UUIDGener.getUUID()); newModel.setFileId(uuId); newModel.setShapeId(""); - newModel.setShapeText(""); + newModel.setShapeText(oldModel.getShapeText()); newModel.setAttrId(oldModel.getAttrId()); newModel.setRelationFileId(oldModel.getRelationFileId()); newModel.setRelationShapeId(oldModel.getRelationShapeId()); 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 58918655..a026c0ed 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 @@ -2534,7 +2534,7 @@ public class CoeProcessLevelWeb extends ActionWeb { if ("relation".equals(attributeModel.getType())) { List list = DesignerShapeRelationCache.getListByAttrId(uuid, "", attributeModel.getKey()); - list.sort(Comparator.comparing(DesignerShapeRelationModel::getRelationShapeText)); + list.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText)); if (list != null && list.size() > 0) { // 判断是否有重复数据,进行重复过滤 @@ -3177,13 +3177,13 @@ public class CoeProcessLevelWeb extends ActionWeb { String relationFileId = relationFileIds[i]; DesignerShapeRelationModel relationModel = new DesignerShapeRelationModel(); relationModel.setFileId(relationObj.getString("fileId")); + long l = System.currentTimeMillis(); relationModel.setShapeId(""); - relationModel.setShapeText(""); + relationModel.setShapeText(l+""); relationModel.setAttrId(relationObj.getString("attrId")); relationModel.setRelationFileId(relationFileId); relationModel.setRelationShapeId(""); - long l = System.currentTimeMillis(); - relationModel.setRelationShapeText(l+""); + relationModel.setRelationShapeText(""); // 获取文件 JSONObject refObj = JSONObject.parseObject(attrModelMap.get(attrId).getRef()); String relationType = refObj.containsKey("type") ? refObj.getString("type") : "shape"; @@ -10767,8 +10767,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(); } - copyPalProcessLevelRoleCorrelationModelRepository(wsId,teamId,sourceIds,result); - copyPalProcessLevelPerformanceCorrelationModelRepository(wsId,teamId,sourceIds); + copyPalProcessLevelRoleCorrelationModelRepository(wsId,teamId,sourceId,result); + copyPalProcessLevelPerformanceCorrelationModelRepository(wsId,teamId,sourceId,result); } // 操作行为日志记录 if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { @@ -10789,7 +10789,7 @@ public String deleteReply(String replyid, String messageid) { * @param targetId * @return */ - public String copyPalProcessLevelRoleCorrelationModelRepository(String wsId, String teamId, String sourceIds,String resultmsg) { + public String copyPalProcessLevelRoleCorrelationModelRepository(String wsId, String teamId, String sourceId,String resultmsg) { ResponseObject ro = ResponseObject.newOkResponse(); CoeDesignerWeb coe=new CoeDesignerWeb(_uc); @@ -10797,9 +10797,6 @@ public String deleteReply(String replyid, String messageid) { String useId = null; String roleuseId = null; //获取数据属性同步创建角色模型 - JSONArray sourceIdArr = JSONArray.parseArray(sourceIds); - for (int i = 0; i < sourceIdArr.size(); i++) { - String sourceId = sourceIdArr.getString(i); DesignerShapeRelationDao dao = new DesignerShapeRelationDao(); PALRepositoryCache.getCache().get(sourceId); @@ -10865,7 +10862,6 @@ public String deleteReply(String replyid, String messageid) { newModel1.setRelationShapeText(oldModel.getRelationShapeText()); dao.insert(newModel1); } - } return ro.toString(); } @@ -10881,11 +10877,13 @@ public String deleteReply(String replyid, String messageid) { * @param targetId * @return */ - public String copyPalProcessLevelPerformanceCorrelationModelRepository(String wsId, String teamId, String sourceIds) { + public String copyPalProcessLevelPerformanceCorrelationModelRepository(String wsId, String teamId, String sourceId,String resultmodel) { + + + + ResponseObject ro = ResponseObject.newOkResponse(); - JSONArray sourceIdArr = JSONArray.parseArray(sourceIds); - for (int i = 0; i < sourceIdArr.size(); i++) { - String sourceId = sourceIdArr.getString(i); + String perforId=perforId=JSONObject.parseObject(resultmodel).getJSONObject("data").getJSONObject("msg").getJSONObject("data").get("useId").toString(); PALRepositoryPropertyDao repositoryPropertyDao = new PALRepositoryPropertyDao(); List oldPropertyList = repositoryPropertyDao.getPropertysByPlid(sourceId, ""); List newPropertyList = new ArrayList(); @@ -10897,33 +10895,75 @@ public String deleteReply(String replyid, String messageid) { String relationFileId=JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId"); String[] splitRelationFileId; PALRepositoryModel model; + if(UtilString.isNotEmpty(relationFileId)){ - if(relationFileId.contains(",")){ + if(relationFileId.contains(",")) { splitRelationFileId=relationFileId.split(","); - model= PALRepositoryCache.getCache().get(splitRelationFileId[0]); + relationFileId=splitRelationFileId[0]; + }else { + relationFileId=relationFileId; + } - 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(); - } - - }else{ model= PALRepositoryCache.getCache().get(relationFileId); String result = copyFile(wsId, teamId, relationFileId, "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(); } - } + CoeDesignerWeb coe=new CoeDesignerWeb(_uc); + // 处理流程属性 + String property = CoePropertyUtil.getPropertyValue(relationFileId + "_attr"); + if (!UtilString.isEmpty(property)) { + CoePropertyUtil.createProperty(moveRo.getString("result") + "_attr", property); + } + + Map mapNewUUID= (Map) JSONObject.parseObject(result).getJSONObject("data").getJSONObject("msg").getJSONObject("data").get("mapNewUUID"); + String newuuid=JSONObject.parseObject(result).getJSONObject("data").getJSONObject("msg").getJSONObject("data").get("useId").toString(); + + DesignerShapeRelationDao dao = new DesignerShapeRelationDao(); + List oldModelList = dao.getModelListByFileId(sourceId); + + oldModelList.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText)); + + for (DesignerShapeRelationModel oldModel : oldModelList) { + + if(oldModel.getAttrId().equals("Process_performance_metrics")){ + //重新设置修订关联关系 + DesignerShapeRelationModel newModel1 = new DesignerShapeRelationModel(); + newModel1.setId(UUIDGener.getUUID()); + newModel1.setFileId(perforId); + 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); + } + + } + + + if(UtilString.isNotEmpty(newuuid)){ + //插入关联模型数据 + List dataList=new ArrayList(); + dataList.add(0,"control.kpi"); + dataList.add(1,perforId); + int r = DBSql.update("update APP_ACT_COE_PAL_REPOSITORY set EXT2=? where ID=?", new Object[] { dataList.toString(),newuuid}); + + } + break; } @@ -10932,7 +10972,6 @@ public String deleteReply(String replyid, String messageid) { } } - } return ro.toString(); }