修复创建副本无法关联角色模型问题
This commit is contained in:
parent
a11f3f4180
commit
414c34106e
Binary file not shown.
@ -1548,7 +1548,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
* @param createNewShapeId true 返回map中key为文件节点id,value为新创建的id; false 返回map中key为文件节点id,value与key相同
|
||||
* @return map key:oldShapeId value:newShapeId/oldShapeId
|
||||
*/
|
||||
private Map<String, String> createShapeIdRelation(PALRepositoryModel oldModel, boolean createNewShapeId) {
|
||||
public Map<String, String> createShapeIdRelation(PALRepositoryModel oldModel, boolean createNewShapeId) {
|
||||
// 创建新老节点对应关系
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
// 获取原来的节点数据
|
||||
@ -3773,9 +3773,8 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(newModel.getId());
|
||||
//如果关联角色图,则同步复制角色图关联关系
|
||||
String methodIds="";
|
||||
if(oldModel.getAttrId().equals("role")){
|
||||
methodIds="org.role";
|
||||
String methodIds="org.role";
|
||||
if (mapNewUUID.containsKey(oldModel.getShapeId())) {
|
||||
|
||||
String srcPath = "";// 源文件路径
|
||||
|
||||
@ -5099,10 +5099,12 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
copyAllFile(wsId, teamId, model.getId(), newTargetUUID, index);
|
||||
}
|
||||
}
|
||||
//获取返回新的uuid,插入创建关联模型
|
||||
ro.put("msg",rostr);
|
||||
return ro.toString();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 校验复制/粘贴的文件是否存在
|
||||
* @param sourceUUID
|
||||
* @param targetUUID
|
||||
@ -5313,6 +5315,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
ro.put("mapNewUUID",mapNewUUID);
|
||||
ro.put("useId", CoeProcessLevelDaoFacotory.createCoeProcessLevel().getCoeUseProcessLevelByRid(plRid).get(0).getId());
|
||||
}
|
||||
|
||||
@ -10408,9 +10411,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
String querySql = "SELECT * FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID = '%s' and ATTRID='Process_performance_metrics'";
|
||||
/*for (int i = 1; i <=3; i++) {
|
||||
JSONObject tmp = pathArray.getJSONObject(i);
|
||||
System.out.println("tmp============"+tmp);
|
||||
String name = tmp.getString("name");
|
||||
System.out.println("name======"+name);
|
||||
if (i == 1) {
|
||||
System.out.println(tmp==null);
|
||||
L1 = UtilString.isEmpty(tmp) ? "/" : subName(name);
|
||||
@ -10513,7 +10514,7 @@ 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);
|
||||
copyPalProcessLevelRoleCorrelationModelRepository(wsId,teamId,sourceIds,result);
|
||||
copyPalProcessLevelPerformanceCorrelationModelRepository(wsId,teamId,sourceIds);
|
||||
}
|
||||
// 操作行为日志记录
|
||||
@ -10535,13 +10536,20 @@ public String deleteReply(String replyid, String messageid) {
|
||||
* @param targetId
|
||||
* @return
|
||||
*/
|
||||
public String copyPalProcessLevelRoleCorrelationModelRepository(String wsId, String teamId, String sourceIds) {
|
||||
public String copyPalProcessLevelRoleCorrelationModelRepository(String wsId, String teamId, String sourceIds,String resultmsg) {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
|
||||
CoeDesignerWeb coe=new CoeDesignerWeb(_uc);
|
||||
Map<String, String> mapNewUUID = new HashMap<String, String>();
|
||||
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);
|
||||
|
||||
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(sourceId);
|
||||
for (DesignerShapeRelationModel oldModel : oldModelList) {
|
||||
|
||||
@ -10553,6 +10561,27 @@ public String deleteReply(String replyid, String messageid) {
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(oldModel.getRelationFileId());
|
||||
String result = copyFile(wsId, teamId, oldModel.getRelationFileId(), targetId, "all");
|
||||
|
||||
if(JSONObject.parseObject(resultmsg).get("result").equals("ok")){
|
||||
|
||||
useId=JSONObject.parseObject(resultmsg).getJSONObject("data").getJSONObject("msg").getJSONObject("data").get("useId").toString();
|
||||
|
||||
if(UtilString.isNotEmpty(useId)){
|
||||
if(JSONObject.parseObject(result).get("result").equals("ok")){
|
||||
roleuseId=JSONObject.parseObject(result).getJSONObject("data").getJSONObject("msg").getJSONObject("data").get("useId").toString();
|
||||
|
||||
if(UtilString.isNotEmpty(roleuseId)){
|
||||
//插入关联模型数据
|
||||
List dataList=new ArrayList();
|
||||
dataList.add(0,"org.role");
|
||||
dataList.add(1,useId);
|
||||
int r = DBSql.update("update APP_ACT_COE_PAL_REPOSITORY set EXT2=? where ID=?", new Object[] { dataList.toString(),roleuseId});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
JSONObject moveRo = JSONObject.parseObject(result);
|
||||
if (!"ok".equals(moveRo.getString("result"))) {
|
||||
SDK.getLogAPI().consoleErr("复制文件[" + model.getName() + "][" + model.getId() + "]失败," + moveRo.getString("msg"));
|
||||
@ -10564,6 +10593,25 @@ public String deleteReply(String replyid, String messageid) {
|
||||
|
||||
}
|
||||
|
||||
List<PALRepositoryModel> models = CoeProcessLevelUtil.queryPalRepositoryModelsByPalId(sourceId);
|
||||
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(sourceId);
|
||||
// 获取新旧节点关联关系
|
||||
mapNewUUID= (Map<String, String>) JSONObject.parseObject(resultmsg).getJSONObject("data").getJSONObject("msg").getJSONObject("data").get("mapNewUUID");
|
||||
|
||||
for (DesignerShapeRelationModel oldModel : oldModelList) {
|
||||
//重新设置修订关联关系
|
||||
DesignerShapeRelationModel newModel1 = new DesignerShapeRelationModel();
|
||||
newModel1.setId(UUIDGener.getUUID());
|
||||
newModel1.setFileId(useId);
|
||||
newModel1.setShapeId(mapNewUUID.get(oldModel.getShapeId()));
|
||||
newModel1.setShapeText(oldModel.getShapeText());
|
||||
newModel1.setAttrId(oldModel.getAttrId());
|
||||
newModel1.setRelationFileId(roleuseId);
|
||||
newModel1.setRelationShapeId(oldModel.getRelationShapeId());
|
||||
newModel1.setRelationShapeText(oldModel.getRelationShapeText());
|
||||
dao.insert(newModel1);
|
||||
}
|
||||
}
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user