修改升版绩效图/复制副本绩效图生成位置/pal打包

This commit is contained in:
zhal 2022-09-21 19:33:58 +08:00
parent 7e36bbd9a7
commit 1247191e0f
3 changed files with 168 additions and 4 deletions

View File

@ -22,6 +22,8 @@ import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.cache.*;
import com.actionsoft.apps.coe.pal.pal.ws.dao.CoeWorkSpace;
import com.actionsoft.apps.coe.pal.util.SubUtil;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.util.*;
import com.actionsoft.apps.coe.pal.pal.ws.model.CoeWorkSpaceModel;
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
@ -4191,7 +4193,10 @@ public class CoeDesignerWeb extends ActionWeb {
}
//创建关联关系
CreateincidenceRelation(isLargeIteration,oldUUID,PALRepositoryCache.getCache().get(newUUID),mapNewUUID,tempVer);
CreateRelevanceRoleModel(isLargeIteration,oldUUID,PALRepositoryCache.getCache().get(newUUID),mapNewUUID,tempVer);
//创建绩效关联关系
CreateRelevancePerformanceModel(isLargeIteration,oldUUID,PALRepositoryCache.getCache().get(newUUID),mapNewUUID,tempVer);
CoeProcessLevelUtil.copyRepositoryProperty(PALRepositoryCache.getCache().get(oldUUID), PALRepositoryCache.getCache().get(newUUID), mapNewUUID, _uc);
@ -4216,7 +4221,7 @@ public class CoeDesignerWeb extends ActionWeb {
* @param isLargeIteration
* @param olduuid
*/
public String CreateincidenceRelation(boolean isLargeIteration,String olduuid,PALRepositoryModel newModel,Map<String, String> mapNewUUID,Double tempVer){
public String CreateRelevanceRoleModel(boolean isLargeIteration,String olduuid,PALRepositoryModel newModel,Map<String, String> mapNewUUID,Double tempVer){
ResponseObject ro = null;
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(olduuid);
@ -4316,6 +4321,125 @@ public class CoeDesignerWeb extends ActionWeb {
/**
* 同步复制文件属性绩效属性数据
* @param wsId
* @param teamId
* @param sourceIds
* @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)){
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,"control.kpi");
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);
}
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(olduuid);
for (DesignerShapeRelationModel oldModel : oldModelList) {
if(oldModel.getAttrId().equals("Process_performance_metrics")){
//重新设置修订关联关系
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());
}
}
}
return ro.toString();
}
@ -4410,7 +4534,8 @@ public class CoeDesignerWeb extends ActionWeb {
ro.put("id", id);
//将关联模型(角色绩效)同步更改使用中状态
changePalDesignerVersionUseBycorrelationModel(wsId,teamId,id);
changePalDesignerVersionUseBycorrelationRoleModel(wsId,teamId,id);
changePalDesignerVersionUseBycorrelationPerformanceModel(wsId,teamId,id);
return ro.toString();
} else {
@ -4426,7 +4551,7 @@ public class CoeDesignerWeb extends ActionWeb {
* @param id
* @return
*/
public String changePalDesignerVersionUseBycorrelationModel(String wsId, String teamId, String id) {
public String changePalDesignerVersionUseBycorrelationRoleModel(String wsId, String teamId, String id) {
ResponseObject ro = ResponseObject.newOkResponse();
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(id);
@ -4455,6 +4580,41 @@ public class CoeDesignerWeb extends ActionWeb {
}
/**
* 将关联模型绩效同步更改使用中状态
* @param wsId
* @param teamId
* @param id
* @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;
PALRepository repository = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
PALRepositoryModel lastPlModel = repository.getInstance(oldModel.getRelationFileId());
answer = repository.updateStateOfVersionUuid(lastPlModel.getVersionId());// 更新所有的为0
answer = repository.updateUseStateOfVersionUuid(lastPlModel.getId());// 更新当前版本为使用状态
CoeProcessLevelNoCache.getInstance().reloadInBackground(lastPlModel.getWsId());
if (answer > 0) {
ro.put("id", id);
return ro.toString();
} else {
return ResponseObject.newErrResponse("使用版本更新失败").toString();
}
}
}
return ro.toString();
}

View File

@ -5231,6 +5231,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
newModel.setId(UUIDGener.getUUID());
newModel.setUse(false);
}
//如果为绩效图则复制文本到相应文件夹中
if(targetUUID.equals("control")){
targetUUID=sourceModel.getParentId();
}
newModel.setParentId(targetUUID);
newModel.setNo(plNo);
newModel.setMethodId(oldModel.getMethodId());