处理一个流程的多个版本对应了多个绩效图的问题(在创建绩效图、流程升版、版本切换调整为与角色图相同的处理方式)
This commit is contained in:
parent
940f568587
commit
603e3b18dc
Binary file not shown.
@ -4748,13 +4748,16 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
//1.创建角色模型
|
||||
String oldRoleModelId = getExistingModel(oldUUID, "org.role");// 查询与流程相关联的角色,即使流程内为关联具体的任何角色形状
|
||||
String oldRoleModelId = getExistingModel(oldUUID, "org.role");// 查询与流程相关联的角色,即使流程内未关联具体的任何角色形状
|
||||
if (oldRoleModelId != null) {
|
||||
CreateRelevanceRoleModel(isLargeIteration, oldUUID, PALRepositoryCache.getCache().get(newUUID), mapNewUUID, tempVer, teamId, oldRoleModelId);
|
||||
}
|
||||
|
||||
//创建绩效关联关系
|
||||
CreateRelevancePerformanceModel(isLargeIteration, oldUUID, PALRepositoryCache.getCache().get(newUUID), mapNewUUID, tempVer);
|
||||
String oldPerformanceModelId = getExistingModel(oldUUID, "control.kpi");// 查询与流程相关联的绩效,即使流程内未关联具体的任何绩效形状
|
||||
if (oldPerformanceModelId != null) {
|
||||
CreateRelevancePerformanceModel(isLargeIteration, oldUUID, PALRepositoryCache.getCache().get(newUUID), mapNewUUID, tempVer, teamId, oldPerformanceModelId);
|
||||
}
|
||||
|
||||
//ydq 修改
|
||||
CoeProcessLevelUtil.copyRepositoryProperty(PALRepositoryCache.getCache().get(oldUUID), PALRepositoryCache.getCache().get(newUUID), mapNewUUID, _uc,true);
|
||||
@ -4970,25 +4973,11 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
* @param targetId
|
||||
* @return
|
||||
*/
|
||||
public String CreateRelevancePerformanceModel(boolean isLargeIteration, String olduuid, PALRepositoryModel newModel, Map<String, String> mapNewUUID, Double tempVer) {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
// 校验
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(olduuid);
|
||||
if (model == null)
|
||||
throw new AWSException("没有找到文件:" + olduuid);
|
||||
PALRepositoryPropertyDao repositoryPropertyDao = new PALRepositoryPropertyDao();
|
||||
List<PALRepositoryPropertyModel> oldPropertyList = repositoryPropertyDao.getPropertysByPlid(olduuid, "");
|
||||
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 (UtilString.isNotEmpty(relationFileId)) {
|
||||
|
||||
if (relationFileId.contains(",")) {
|
||||
relationFileId = relationFileId.split(",")[0];
|
||||
}
|
||||
public String CreateRelevancePerformanceModel(boolean isLargeIteration, String olduuid, PALRepositoryModel newModel, Map<String, String> mapNewUUID, Double tempVer, String teamId, String relationFileId) {
|
||||
ResponseObject ro = null;
|
||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
||||
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(olduuid);
|
||||
// 1.创建绩效模型
|
||||
String srcPath = "";// 源文件路径
|
||||
String targetPath = "";// 目标文件路径
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
@ -5037,11 +5026,10 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
CoePropertyUtil.createProperty(newUUID + "_attr", property);
|
||||
}
|
||||
|
||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
||||
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(olduuid);
|
||||
for (DesignerShapeRelationModel oldModel : oldModelList) {
|
||||
|
||||
if (oldModel.getAttrId().equals("Process_performance_metrics")) {
|
||||
String methodIds = "control.kpi";
|
||||
if (mapNewUUID.containsKey(oldModel.getShapeId())) {
|
||||
//重新设置修订关联关系
|
||||
DesignerShapeRelationModel newModel1 = new DesignerShapeRelationModel();
|
||||
newModel1.setId(UUIDGener.getUUID());
|
||||
@ -5054,7 +5042,12 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
newModel1.setRelationShapeText(oldModel.getRelationShapeText());
|
||||
dao.insert(newModel1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 新版本文件 小组权限设置
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
CoeCooperationAPIManager.getInstance().addRepositoryToTeamAndRolePerm(_uc, teamId, lastplModel.getVersionId(), true, true);
|
||||
}
|
||||
|
||||
CoeProcessLevelUtil.copyRepositoryProperty(PALRepositoryCache.getCache().get(relationFileId), PALRepositoryCache.getCache().get(newUUID), mapNewUUID1, _uc);
|
||||
@ -5066,11 +5059,6 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
} catch (Exception e) {
|
||||
ro = ResponseObject.newWarnResponse("创建失败," + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
@ -5206,18 +5194,21 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
* @return
|
||||
*/
|
||||
public String changePalDesignerVersionUseBycorrelationPerformanceModel(String wsId, String teamId, String id) {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
||||
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(id);
|
||||
for (DesignerShapeRelationModel oldModel : oldModelList) {
|
||||
|
||||
//如果关联角色图,则同步复制角色图关联关系
|
||||
String methodIds = "";
|
||||
if (oldModel.getAttrId().equals("Process_performance_metrics")) {
|
||||
int answer = 0;
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
PALRepository repository = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
PALRepositoryModel lastPlModel = repository.getInstance(oldModel.getRelationFileId());
|
||||
answer = repository.updateStateOfVersionUuid(lastPlModel.getVersionId());// 更新所有的为0
|
||||
// 绩效图的所有版本先置为非使用中
|
||||
PALRepositoryModel processModel = PALRepositoryCache.getCache().get(id);
|
||||
if (processModel != null) {
|
||||
String versionId = getExistingModelVersionId(processModel.getVersionId(), "control.kpi");
|
||||
if (versionId != null) {
|
||||
answer = repository.updateStateOfVersionUuid(versionId);// 更新所有的为0
|
||||
}
|
||||
}
|
||||
|
||||
String performanceId = getExistingModel(id, "control.kpi");
|
||||
if (performanceId != null) {
|
||||
PALRepositoryModel lastPlModel = repository.getInstance(performanceId);
|
||||
answer = repository.updateUseStateOfVersionUuid(lastPlModel.getId());// 更新当前版本为使用状态
|
||||
CoeProcessLevelNoCache.getInstance().reloadInBackground(lastPlModel.getWsId());
|
||||
if (answer > 0) {
|
||||
@ -5226,10 +5217,8 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
} else {
|
||||
return ResponseObject.newErrResponse("使用版本更新失败").toString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ro.toString();
|
||||
return ResponseObject.newErrResponse("使用版本更新失败,绩效图尚未建立").toString();
|
||||
}
|
||||
|
||||
// 生成更多特性的json串
|
||||
|
||||
Loading…
Reference in New Issue
Block a user