修复点击下拉显示错误数据问题

This commit is contained in:
zhal 2022-07-23 15:18:41 +08:00
parent 3d7431ccd1
commit 0a4f49e0ca
6 changed files with 204 additions and 41 deletions

View File

@ -1452,9 +1452,9 @@ public class CoEPALController {
// @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_TREE_NODE") // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_TREE_NODE")
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_node") @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_node")
public String COEPALRepositoryDesignerRelevanceShapesTreeDate(UserContext me, String wsId, String pid) { public String COEPALRepositoryDesignerRelevanceShapesTreeDate(UserContext me, String wsId, String pid,String attrId,String ruuid) {
DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me);
return web.getTreeJson(wsId, pid); return web.getTreeJson(wsId, pid,attrId,ruuid);
} }
// @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PROCESS_MODELS_TREE_NODE") // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PROCESS_MODELS_TREE_NODE")

View File

@ -32,6 +32,7 @@ import com.actionsoft.bpms.bpmn.modeler.constant.BPMNFileConstant;
import com.actionsoft.bpms.bpmn.modeler.io.BPMNIO; import com.actionsoft.bpms.bpmn.modeler.io.BPMNIO;
import com.actionsoft.bpms.bpmn.modeler.util.BPMNFileUtil; import com.actionsoft.bpms.bpmn.modeler.util.BPMNFileUtil;
import com.actionsoft.bpms.commons.cache.Cache; import com.actionsoft.bpms.commons.cache.Cache;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.htmlframework.AlertWindow; import com.actionsoft.bpms.commons.htmlframework.AlertWindow;
import com.actionsoft.bpms.commons.login.constant.LoginConst; import com.actionsoft.bpms.commons.login.constant.LoginConst;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject; import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
@ -46,10 +47,7 @@ import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.fs.DCContext; import com.actionsoft.bpms.server.fs.DCContext;
import com.actionsoft.bpms.server.fs.dc.DCProfileManager; import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
import com.actionsoft.bpms.server.fs.dc.DCUtil; import com.actionsoft.bpms.server.fs.dc.DCUtil;
import com.actionsoft.bpms.util.Base64; import com.actionsoft.bpms.util.*;
import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilFile;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.apps.coe.pal.constant.CoEConstant; import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishFrequencyDao; import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishFrequencyDao;
import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishListHistory; import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishListHistory;
@ -1253,6 +1251,7 @@ public class PALRepositoryQueryAPIManager {
jsonObject.put("open", i == 1); jsonObject.put("open", i == 1);
jsonObject.put("plCategory", method); jsonObject.put("plCategory", method);
result.add(jsonObject); result.add(jsonObject);
if ("isUsed".equals(type)) { if ("isUsed".equals(type)) {
result.addAll(getUsedPalRepositoryTreeDataByPid(context, wsId, method)); result.addAll(getUsedPalRepositoryTreeDataByPid(context, wsId, method));
@ -1343,6 +1342,23 @@ public class PALRepositoryQueryAPIManager {
} }
/**
*
* @param context
* @param wsId
* @param pid
* @param uuid
* @return
*/
public JSONArray getUsedPalRepositoryTreeDataByPidAnduuid(UserContext context, String wsId, String pid,String attrId,String uuid) {
List<PALRepositoryModel> list = getUsedPalRepositoryModelsByPid(wsId, pid); // 根据父节点Id获取使用中的子节点
Collections.sort(list, new Comparator1()); // 按级别排序
JSONArray result = list2JsonByuuid(context, list, true, false,attrId,uuid);
return result;
}
/**************************************************** 获取流程树 **********************************************************/ /**************************************************** 获取流程树 **********************************************************/
/** /**
@ -1426,7 +1442,7 @@ public class PALRepositoryQueryAPIManager {
* @param type * @param type
* @return * @return
*/ */
public JSONArray getPermPalRepositoryTreeDataByUser(UserContext context, String wsId, String teamId, String type) { public JSONArray getPermPalRepositoryTreeDataByUser(UserContext context, String wsId, String teamId, String type,String uuid) {
JSONArray result = new JSONArray(); JSONArray result = new JSONArray();
List<PALRepositoryModel> list = null; List<PALRepositoryModel> list = null;
@ -1678,6 +1694,7 @@ public class PALRepositoryQueryAPIManager {
private JSONArray list2Json(UserContext context, List<PALRepositoryModel> list, boolean isUsed, boolean isPublished, String removeIds, String param) { private JSONArray list2Json(UserContext context, List<PALRepositoryModel> list, boolean isUsed, boolean isPublished, String removeIds, String param) {
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
for (PALRepositoryModel model : list) { for (PALRepositoryModel model : list) {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("id", model.getId().trim()); object.put("id", model.getId().trim());
object.put("pid", model.getNewParentId().trim()); object.put("pid", model.getNewParentId().trim());
@ -1769,6 +1786,130 @@ public class PALRepositoryQueryAPIManager {
return jsonArray; return jsonArray;
} }
/*********************************************************************重写通过流程model列表获取流程树的json数组***by zhaolei*****************************************************/
/**
* 通过流程model列表获取流程树的json数组
*
* @param context
* @param list
* @return
*/
public JSONArray list2JsonByuuid(UserContext context, List<PALRepositoryModel> list, boolean isUsed, boolean isPublished,String attrId,String uuid) {
return list2JsonByuuid(context, list, isUsed, isPublished, null, null,attrId,uuid);
}
private JSONArray list2JsonByuuid(UserContext context, List<PALRepositoryModel> list, boolean isUsed, boolean isPublished, String removeIds, String param,String attrId,String uuid) {
JSONArray jsonArray = new JSONArray();
for (PALRepositoryModel model : list) {
if(model.getMethodId().equals("control.kpi") || model.getMethodId().equals("org.role") ){
List data=new ArrayList();
data.add(0,model.getMethodId());
data.add(1,uuid);
RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?",model.getId(),data.toString());
if (rowMap != null) {
JSONObject object = new JSONObject();
object.put("id", model.getId().trim());
object.put("pid", model.getNewParentId().trim());
if (removeIds != null && removeIds.contains(model.getId().trim())) {
object.put("nocheck", true);
} else {
object.put("nocheck", false);
}
object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim());
object.put("name", I18nRes.findValue(CoEConstant.APP_ID, context.getLanguage(), model.getName()).trim());
object.put("wsId", model.getWsId());
PALMethodModel methodModel = PALMethodCache.getPALMethodModelById(model.getMethodId());
if (methodModel == null || methodModel.isFolder()) {// 没有该建模方法或者是文件夹类
object.put("title", object.get("name"));
} else {
object.put("title", object.get("name") + " " + VersionUtil.getVersionStrV(model.getVersion()).trim());
}
//三员管理文件密级校验
if (HighSecurityUtil.isON() && HighSecurityUtil.fileSecuritySwitch()){
ResponseObject responseObject = new CoeProcessLevelWeb(DispatcherRequest.getUserContext()).checkFilePemission(model.getId());
if (responseObject.isErr() && (methodModel != null && !methodModel.isFolder())){
object.put("nocheck", true);
}
}
object.put("drop", false);
object.put("isSystemFile", model.isSystemFile());
object.put("plMethodId", model.getMethodId().trim());
if (methodModel == null || methodModel.isFolder()) {// 没有该建模方法或者是文件夹类
object.put("iconFont", "&#58930;");
} else {
object.put("iconFont", "&#59101;");
}
List<PALRepositoryModel> children = null;
if (isUsed) {
children = getUsedPalRepositoryModelsByPid(model.getWsId(), model.getId());
if (param != null && "designer".equals(param) && children != null && children.size() > 0) {// 过滤掉发布版本
List<PALRepositoryModel> tempChildren = new ArrayList<>();
for (PALRepositoryModel model2 : children) {
if (!model2.isPublish()) {
tempChildren.add(model2);
}
}
children = tempChildren;
}
} else if (isPublished) {
children = getPublishedPalRepositoryModelsByPid(model.getWsId(), model.getId());
}
if (children == null || children.size() == 0) {
object.put("isParent", false);
//String icon = object.getString("icon");
object.put("leaf", true);// 叶子节点
// object.put("icon", icon.replace("16.png", "16.leaf.png"));
} else {
object.put("isParent", true);
object.put("open", false);
}
object.put("plLevel", model.getLevel());
object.put("plOrdexIndex", model.getOrderIndex());
object.put("plDiagramUrl", model.getDiagramUrl());
object.put("isDrops", model.isSystemFile());
object.put("isPublish", model.isPublish());
object.put("isStop", model.isStop());
object.put("isApproval", model.isApproval());
object.put("ext1", model.getExt1());
object.put("ext2", model.getExt2());
object.put("ext3", model.getExt3());
object.put("ext4", model.getExt4());
object.put("isUse", model.isUse());
object.put("url", "./w?sid=" + context.getSessionId() + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_portal_page&ruuid=" + model.getId() + "&type=1&wsid=" + model.getWsId());
object.put("plCategory", model.getMethodCategory());
object.put("versionId", model.getVersionId());
object.put("orderIndex", model.getOrderIndex());
object.put("isBottomLevel", model.isBottomLevel());
String dutyDeptId = model.getDutyDept();
object.put("dutyDeptId", dutyDeptId == null ? "" : dutyDeptId);
String plDutyDeptName = dutyDeptId;
if (!UtilString.isEmpty(dutyDeptId)) {
if (SDK.getORGAPI().getDepartmentById(dutyDeptId) != null) {
plDutyDeptName = SDK.getORGAPI().getDepartmentById(dutyDeptId).getName();
}
}
object.put("dutyDeptName", UtilString.isEmpty(dutyDeptId) ? "" : plDutyDeptName);
String plDutyPerson = model.getDutyUser();
object.put("dutyPersonId", model.getDutyUser() == null ? "" : model.getDutyUser());
object.put("dutyPersionName", UtilString.isEmpty(plDutyPerson) ? "" : SDK.getORGAPI().getUserAliasNames(plDutyPerson));
jsonArray.add(object);
}
}
}
return jsonArray;
}
/*******************************************************************************************************************************************/
/** /**
* 对于不完整的流程树有权限限制等重新设置父节点Id * 对于不完整的流程树有权限限制等重新设置父节点Id
* *
@ -1998,7 +2139,7 @@ public class PALRepositoryQueryAPIManager {
* @param pid * @param pid
* @return * @return
*/ */
public String getPublishProcessIsVisibleModelList(UserContext context, String wsId, String pid) { public String getPublishProcessIsVisibleModelList(UserContext context, String wsId, String pid,String uuid) {
List<PALRepositoryModel> subPublishList = getPublishedPalRepositoryModelsByPid(wsId, pid);// 发布的子流程 List<PALRepositoryModel> subPublishList = getPublishedPalRepositoryModelsByPid(wsId, pid);// 发布的子流程
List<PALRepositoryModel> subUseList = getUsedPalRepositoryModelsByPid(wsId, pid);// 使用中的子流程 List<PALRepositoryModel> subUseList = getUsedPalRepositoryModelsByPid(wsId, pid);// 使用中的子流程
List<PALRepositoryModel> list = new ArrayList<PALRepositoryModel>(); // 获取所有子流程 List<PALRepositoryModel> list = new ArrayList<PALRepositoryModel>(); // 获取所有子流程

View File

@ -767,8 +767,12 @@ public class DesignerRelationShapeWeb extends ActionWeb {
JSONObject jsonObject = objects.getJSONObject(i); JSONObject jsonObject = objects.getJSONObject(i);
String url = jsonObject.getString("url"); String url = jsonObject.getString("url");
String id = jsonObject.getString("id"); String id = jsonObject.getString("id");
if (UtilString.isNotEmpty(url)) { if (UtilString.isNotEmpty(url)) {
RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", id, ruuid); List data=new ArrayList();
data.add(0,jsonObject.getString("plMethodId"));
data.add(1,ruuid);
RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", id, data.toString());
if (rowMap != null) { if (rowMap != null) {
jsonArr_new.add(objects.getJSONObject(i)); jsonArr_new.add(objects.getJSONObject(i));
} }
@ -1070,8 +1074,14 @@ public class DesignerRelationShapeWeb extends ActionWeb {
* @param pid * @param pid
* @return * @return
*/ */
public String getTreeJson(String wsId, String pid) { public String getTreeJson(String wsId, String pid,String attrId,String uuid) {
JSONArray list = PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPid(_uc, wsId, pid); JSONArray list;
if(attrId.equals("Process_performance_metrics")){
list= PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPidAnduuid(_uc, wsId,pid,attrId,uuid);
}else{
list= PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPid(_uc, wsId, pid);
}
JSONArray result = new JSONArray(); JSONArray result = new JSONArray();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
JSONObject node = list.getJSONObject(i); JSONObject node = list.getJSONObject(i);

View File

@ -8178,8 +8178,6 @@ public class CoeProcessLevelWeb extends ActionWeb {
// } // }
} }
System.out.println("modelId====================="+model.getId());
// 保存文件属性 // 保存文件属性
PALRepositoryAPIManager.getInstance().updateRepositoryProperty(model.getId()); PALRepositoryAPIManager.getInstance().updateRepositoryProperty(model.getId());
@ -8384,12 +8382,15 @@ public class CoeProcessLevelWeb extends ActionWeb {
String plRid = UUIDGener.getUUID(); String plRid = UUIDGener.getUUID();
String id = UUIDGener.getUUID(); String id = UUIDGener.getUUID();
List data=new ArrayList();
data.add(0,methodId);
data.add(1,uuid);
Timestamp nowTime = new Timestamp(System.currentTimeMillis()); Timestamp nowTime = new Timestamp(System.currentTimeMillis());
PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, wsId, plname + titleName, PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, wsId, plname + titleName,
"", 1, parentId, category, true, 1, "", 1, parentId, category, true, 1,
id, false, methodId, "0", 1, null, id, false, methodId, "0", 1, null,
null, "admin", "admin", nowTime, null, uuid, null, "admin", "admin", nowTime, null, data.toString(),
null, null, null, null, null, null, null, 1); null, null, null, null, null, null, null, 1);
coeProcessLevel.insert(model); coeProcessLevel.insert(model);

View File

@ -621,12 +621,7 @@
} }
} }
} }
/* var output = initOutputFileLink();
if (output != 0) {
output = 40;
} else {
output = 0;
}*/
$(window).trigger('resize'); $(window).trigger('resize');
var newHeight = $(window).height() - $('#toolbarName').height() - $('#newadd_tools').height() - 41 - 0; var newHeight = $(window).height() - $('#toolbarName').height() - $('#newadd_tools').height() - 41 - 0;
// $('.newadd_portalAttr').height(newHeight-100); // $('.newadd_portalAttr').height(newHeight-100);
@ -716,20 +711,16 @@
</script> </script>
<style> <style>
body{height:100%!important;} body{height:100%!important;}
.newadd_body{ margin: 0;color: #333333; text-align: left;background-color: #f1f5f7;}
.newadd_title{font-size: 18px;font-weight: bold; margin-bottom:20px;display: block } .newadd_title{font-size: 18px;font-weight: bold; margin-bottom:20px;display: block }
.newadd_card { .newadd_card {
/* float: left;*/ width: 100%;
width:100%;
height:100%;
background-color: #fff; background-color: #fff;
background-clip: border-box; background-clip: border-box;
border-radius: 4px; border-radius: 4px;
box-shadow: 0 2px 4px rgb(0, 0, 0, 0.2); box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
margin-bottom: 20px; margin-bottom: 20px;
position:relative; height: 90%!important;
min-height:100%; position: relative;
padding: 0 2%;
} }
.page .footer{position:absolute; left:0; bottom:0; height:200px; width:100%;} .page .footer{position:absolute; left:0; bottom:0; height:200px; width:100%;}
.newadd_card .title{font-size: 16px; margin: 20px;} .newadd_card .title{font-size: 16px; margin: 20px;}
@ -786,16 +777,34 @@
padding-top: 20px; padding-top: 20px;
} }
#pinglun{clear: both;overflow: hidden;height: auto;} #pinglun{clear: both;overflow: hidden;height: auto;}
.suofang{height:40px;background-color:white;border-top:1px solid #efefef;vertical-align:middle;position: relative;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;} .suofang {
height: 40px;
background-color: white;
border-top: 1px solid #efefef;
vertical-align: middle;
position: absolute;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
bottom: 0;
width: 100%;
}
.processfiledown li{line-height: 20px;} .processfiledown li{line-height: 20px;}
.awsui-table td{border:0!important; padding: 2px 0!important;} .awsui-table td{border:0!important; padding: 2px 0!important;}
.iconTabClass{ .iconTabClass{
float: left;display: block; width: 18px; height: 18px; background:url("iconnew.png") no-repeat; background-size: 100%;} float: left;display: block; width: 18px; height: 18px; background:url("iconnew.png") no-repeat; background-size: 100%;}
.newadd_body {
margin: 0;
color: #333333;
text-align: left;
background-color: #f1f5f7;
/* overflow: hidden; */
padding: 20px;
}
</style> </style>
</head> </head>
<body class="newadd_body"> <body class="newadd_body">
<div style="padding:20px"> <div>
<!--<canvas id="support_canvas" style="display: none;"></canvas>--> <!--<canvas id="support_canvas" style="display: none;"></canvas>-->
<div> <div>
@ -902,7 +911,7 @@
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<!-- 弹框表格 --> <!-- &lt;!&ndash; 弹框表格 &ndash;&gt;
<div id="attribute-table-window2" style="width:500px;height:325px;display:none;"> <div id="attribute-table-window2" style="width:500px;height:325px;display:none;">
<div style='margin:0px;height:235px;width:500px;'> <div style='margin:0px;height:235px;width:500px;'>
<div style="height: 225px;width: 493px;overflow:auto;"> <div style="height: 225px;width: 493px;overflow:auto;">
@ -914,36 +923,36 @@
<div style="margin-top: 5px" id="attribute-add-content2"></div> <div style="margin-top: 5px" id="attribute-add-content2"></div>
</div> </div>
</div> </div>
</div> </div>-->
<!-- <button name="dock_btn_enlarge" type="button" class="awsui-btn" onclick="canvasresizeMax();">放大</button>--> <!-- <button name="dock_btn_enlarge" type="button" class="awsui-btn" onclick="canvasresizeMax();">放大</button>-->
<!-- <button name="dock_btn_narrow" type="button" class="awsui-btn" onclick="canvasresizeMin();">缩小</button>--> <!-- <button name="dock_btn_narrow" type="button" class="awsui-btn" onclick="canvasresizeMin();">缩小</button>-->
<div id="designer"> <!--<div id="designer">
<div id="designer_viewport" class="readonly"> <div id="designer_viewport" class="readonly">
<!-- Graphic Dock Window --> &lt;!&ndash; Graphic Dock Window &ndash;&gt;
</div> </div>
</div> </div>-->
</div> </div>
<div style="width:510px;display:none;" id="shapes_dialog"> <!--<div style="width:510px;display:none;" id="shapes_dialog">
<div id="content" class="dlg-content awsui-ux"> <div id="content" class="dlg-content awsui-ux">
<ul id="shape_manage_list"> <ul id="shape_manage_list">
<#liStr> <#liStr>
</ul> </ul>
</div> </div>
</div> </div>-->
<div id="designer-version-manager" style="width:600px; display:none;"> <!--<div id="designer-version-manager" style="width:600px; display:none;">
<div id='contentDiv' style='margin-top:1px;height:220px;' class="dlg-content"> <div id='contentDiv' style='margin-top:1px;height:220px;' class="dlg-content">
<iframe width="100%" id="designerManager" name="coeCreateUser" frameBorder="0" style="width: 100%; height: 220px;"></iframe> <iframe width="100%" id="designerManager" name="coeCreateUser" frameBorder="0" style="width: 100%; height: 220px;"></iframe>
</div> </div>
</div> </div>
<!-- 不支持HTML5的页面显示图片 --> &lt;!&ndash; 不支持HTML5的页面显示图片 &ndash;&gt;
<div id="mainDiv" style="display: none;"> <div id="mainDiv" style="display: none;">
<div class="view_box"> <div class="view_box">
<div id="chartDivBox" style="background: none;"> <div id="chartDivBox" style="background: none;">
@ -958,7 +967,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>-->
<div title="" style="width:550px;display:none;" id="upfile-dialog"> <div title="" style="width:550px;display:none;" id="upfile-dialog">
<div id='upfile-content' style='height:330px;'> <div id='upfile-content' style='height:330px;'>

View File

@ -884,6 +884,8 @@
<cmd-bean name="com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_node"> <cmd-bean name="com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_node">
<param name="wsId" /> <param name="wsId" />
<param name="pid" /> <param name="pid" />
<param name="attrId" />
<param name="ruuid" />
</cmd-bean> </cmd-bean>
<cmd-bean name="com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_query"> <cmd-bean name="com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_query">
<param name="autoContent"/> <param name="autoContent"/>