处理多次新建角色图问题
This commit is contained in:
parent
13e4e6cce1
commit
7f70305592
Binary file not shown.
@ -4225,8 +4225,15 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
CoePropertyUtil.createProperty(newUUID + "_attr", property);
|
||||
}
|
||||
|
||||
//创建角色关联关系
|
||||
CreateRelevanceRoleModel(isLargeIteration,oldUUID,PALRepositoryCache.getCache().get(newUUID),mapNewUUID,tempVer);
|
||||
|
||||
|
||||
//1.创建角色模型
|
||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
||||
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(oldUUID);
|
||||
if (oldModelList.size()>0 && oldModelList.get(0).getAttrId().equals("role")) {
|
||||
CreateRelevanceRoleModel(isLargeIteration,oldUUID,PALRepositoryCache.getCache().get(newUUID),mapNewUUID,tempVer);
|
||||
}
|
||||
|
||||
//创建绩效关联关系
|
||||
CreateRelevancePerformanceModel(isLargeIteration,oldUUID,PALRepositoryCache.getCache().get(newUUID),mapNewUUID,tempVer);
|
||||
|
||||
@ -4259,91 +4266,84 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
||||
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(olduuid);
|
||||
|
||||
|
||||
//1.创建角色模型
|
||||
String relationFileId = oldModelList.get(0).getRelationFileId();
|
||||
String srcPath = "";// 源文件路径
|
||||
String targetPath = "";// 目标文件路径
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
PALRepositoryModelImpl lastplModel = (PALRepositoryModelImpl) coeProcessLevel.getInstance(relationFileId);
|
||||
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(relationFileId, 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, relationFileId, targetPath, lastplModel.getId());
|
||||
|
||||
if (oldModelList.size()>0) {
|
||||
|
||||
if(oldModelList.get(0).getAttrId().equals("role")) {
|
||||
String relationFileId = oldModelList.get(0).getRelationFileId();
|
||||
String srcPath = "";// 源文件路径
|
||||
String targetPath = "";// 目标文件路径
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
PALRepositoryModelImpl lastplModel = (PALRepositoryModelImpl) coeProcessLevel.getInstance(relationFileId);
|
||||
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(relationFileId, lastplModel.getId());
|
||||
// 获取新旧节点关联关系
|
||||
final Map<String, String> mapNewUUID1 = createShapeIdRelation(PALRepositoryCache.getCache().get(relationFileId), true);
|
||||
// 处理流程属性
|
||||
String property = CoePropertyUtil.getPropertyValue(relationFileId + "_attr");
|
||||
if (!UtilString.isEmpty(property)) {
|
||||
CoePropertyUtil.createProperty(newUUID + "_attr", property);
|
||||
}
|
||||
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, relationFileId, targetPath, lastplModel.getId());
|
||||
|
||||
// 获取新旧节点关联关系
|
||||
final Map<String, String> mapNewUUID1 = createShapeIdRelation(PALRepositoryCache.getCache().get(relationFileId), true);
|
||||
// 处理流程属性
|
||||
String property = CoePropertyUtil.getPropertyValue(relationFileId + "_attr");
|
||||
if (!UtilString.isEmpty(property)) {
|
||||
CoePropertyUtil.createProperty(newUUID + "_attr", property);
|
||||
for (DesignerShapeRelationModel oldModel : oldModelList) {
|
||||
if (oldModel.getAttrId().equals("role")) {
|
||||
String methodIds = "org.role";
|
||||
if (mapNewUUID.containsKey(oldModel.getShapeId())) {
|
||||
//重新设置修订关联关系
|
||||
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);
|
||||
}
|
||||
|
||||
for (DesignerShapeRelationModel oldModel : oldModelList) {
|
||||
if (oldModel.getAttrId().equals("role")) {
|
||||
String methodIds = "org.role";
|
||||
if (mapNewUUID.containsKey(oldModel.getShapeId())) {
|
||||
//重新设置修订关联关系
|
||||
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(relationFileId), 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());
|
||||
}
|
||||
|
||||
|
||||
CoeProcessLevelUtil.copyRepositoryProperty(PALRepositoryCache.getCache().get(relationFileId), 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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user