修改升版/副本绩效图bug/更改排序字段

This commit is contained in:
zhal 2022-11-07 19:33:03 +08:00
parent 6195a008d7
commit 5d5f3a0533
5 changed files with 73 additions and 31 deletions

View File

@ -966,7 +966,7 @@ public class DesignerRelationShapeWeb extends ActionWeb {
}
String tmpStr = StringUtils.join(versionIds, ",");
List<DesignerShapeRelationModel> 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<String> ids = new HashSet<>();
List<DesignerShapeRelationModel> 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;

View File

@ -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();

View File

@ -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());

View File

@ -2534,7 +2534,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
if ("relation".equals(attributeModel.getType())) {
List<DesignerShapeRelationModel> 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<PALRepositoryPropertyModel> oldPropertyList = repositoryPropertyDao.getPropertysByPlid(sourceId, "");
List<PALRepositoryPropertyModel> newPropertyList = new ArrayList<PALRepositoryPropertyModel>();
@ -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<String, String> mapNewUUID= (Map<String, String>) 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<DesignerShapeRelationModel> 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();
}