子流程相关代码提交

This commit is contained in:
yujh 2024-08-22 14:29:20 +08:00
parent b3a2b9b8f7
commit c17fab4e84
5 changed files with 846 additions and 562 deletions

View File

@ -4,13 +4,7 @@ import static com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil.special
import java.io.File;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
@ -39,6 +33,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
import com.actionsoft.bpms.bpmn.engine.model.def.ProcessNode;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.DispatcherRequest;
@ -286,6 +281,7 @@ public class Report1Gener {
JSONArray repositoryShapeTable = new JSONArray();//流程步骤Table
JSONArray roleMappingPostTable = new JSONArray();//角色对应岗位Table
JSONArray criticalControlPointTable = new JSONArray();//关键控制点Table
JSONArray procedureTable = new JSONArray();//上下游流程Table
@ -384,9 +380,25 @@ public class Report1Gener {
int dangerIndex = 1;// 风险序号
int regulateIndex = 1;// 控制序号
int roleMappingPostIndex =1;//控制序号
//先排序将子流程的几点放到最后
// 将type为"sub_process_node"的Map移动到列表末尾
List<Map<String, Object>> toRemove = new ArrayList<>();
for (Iterator<Map<String, Object>> iterator = repositoryFileElements.iterator(); iterator.hasNext();) {
Map<String, Object> map = iterator.next();
if ("sub_process_node".equals(map.get("type"))) {
toRemove.add(map); // 先收集起来
iterator.remove(); // 然后从原列表中移除
}
}
// 将收集到的Map添加到列表末尾
repositoryFileElements.addAll(toRemove);
// 输出结果
for (Map<String, Object> shape : repositoryFileElements) {
//过滤导出的图形类型
if ("method_approval_node,method_service_node,method_approval_node3,method_service_node4,decision".indexOf((String)shape.get("type")) == -1) {
if ("method_approval_node,method_service_node,method_approval_node3,method_service_node4,decision,sub_process_node".indexOf((String)shape.get("type")) == -1) {
continue;
}
JSONObject _tr = new JSONObject();
@ -639,7 +651,23 @@ public class Report1Gener {
} catch (Exception e) {
// TODO: handle exception
}*/
//上下游流程
List<PALRepositoryPropertyModel> repositoryPropertyList = PALRepositoryPropertyCache.getPropertyByPlId(repositoryModel.getId());
if (repositoryPropertyList != null && repositoryPropertyList.size() > 0) {
for (PALRepositoryPropertyModel palRepositoryPropertyModel : repositoryPropertyList) {
JSONObject _process_tr = new JSONObject();
if(palRepositoryPropertyModel.getPropertyId().equals("lead_process")){//上游流程
_process_tr.put("name",JSONObject.parseObject(palRepositoryPropertyModel.getPropertyValue()).getString("relationShapeText"));
_process_tr.put("type","上游流程");
}else if(palRepositoryPropertyModel.getPropertyId().equals("rear_process")){//下游流程
_process_tr.put("name",JSONObject.parseObject(palRepositoryPropertyModel.getPropertyValue()).getString("relationShapeText"));
_process_tr.put("type","下游流程");
}
if(!_process_tr.isEmpty()){
procedureTable.add(_process_tr);
}
}
}
//相关/支持文件
@ -802,6 +830,10 @@ public class Report1Gener {
dataMap.put("criticalControlPointTable", criticalControlPointTable);
dataMap.put("criticalControlPointTableCount", criticalControlPointTable.size());
//上下游表格
dataMap.put("procedureTable", procedureTable);
dataMap.put("procedureTableCount", procedureTable.size());
boolean contains = isNumberAscArray.contains("false");
if(contains) {
fileTable.sort(Comparator.comparing(obj -> ((JSONObject) obj).getString("file_name")));

View File

@ -7,9 +7,9 @@
<attribute key="Drafted_and_revised_by" title="拟制/修订人" type="string" value="" desc="拟制/修订人" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="Process_Architecture_L1" title="流程架构L1" type="string" value="" desc="流程架构L1" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%,*" isValid="true"/>
<attribute key="Process_Architecture_L2" title="流程架构L2" type="string" value="" desc="流程架构L2" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%,*" isValid="true"/>
<attribute key="Process_Architecture_L3" title="流程架构L3" type="string" value="" desc="流程架构L3" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%,*" isValid="true"/>
<attribute key="Process_Architecture_L4" title="流程架构L4" type="string" value="" desc="流程架构L4" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%,*" isValid="true"/>
<attribute key="auditor" title="审核人" type="string" value="" desc="审核人" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="Process_Architecture_L3" title="流程架构L3" type="string" value="" desc="流程架构L3" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%,*" isValid="true"/>
<attribute key="Process_Architecture_L4" title="流程架构L4" type="string" value="" desc="流程架构L4" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%,*" isValid="true"/>
<attribute key="auditor" title="审核人" type="string" value="" desc="审核人" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="reviewer" title="复核人" type="string" value="" desc="复核人" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="approver" title="审批人" type="string" value="" desc="审批人" isRequired="true" ref="" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="related_files" title="相关文件" type="relation" value="" desc="相关文件" isRequired="false" ref="{&quot;method&quot;:&quot;process&quot;,&quot;type&quot;:&quot;file&quot;,&quot;multiple&quot;:true}" readonly="true" groupPath="baseAttribute" scope="%" isValid="true"/>
@ -29,5 +29,7 @@
<attribute key="T_supplementary_articles" title="附则" type="textarea" value="" desc="附则" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="activity_number" title="活动序号" type="string" value="" desc="活动序号" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
<attribute key="Out_related_files" title="外部相关文件" type="textarea" value="" desc="填写外部相关文件名称,多个用逗号隔开" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="JYGLGY" title="相关经营管理纲要" type="select_m" value="" desc="请选择" isRequired="false" ref="【集团】全面价值经营,【集团】全面创新驱动,【奶粉】以消费者为中心,提供极致满意的消费体验,【奶粉】以高目标为引领,快速发展,只争第一,【奶粉】以共赢为指引,与合作伙伴建立长期利益共同体,【奶粉】以结果为导向,付出不亚于任何人的努力,【奶粉】以赢得市场竞争为驱动,成为一支有理想、有信念的强大团队,【酸奶】始终以消费者为中心,提供最优品质产品与最佳消费体验,【酸奶】视品牌为核心资产,让我们的品牌成为消费者的挚爱与首选,【酸奶】打造厂商命运共同体,构建稳固可持续发展的厂商生态圈,【酸奶】坚持高目标引领,直面竞争,只争第一,【酸奶】人人都是企业的经营者,不达目标誓不罢休,【酸奶】成为心中有理想、胸中有目标、敢打硬仗、能打胜仗、追求卓越的高绩效团队" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="JYGLGY" title="相关经营管理纲要" type="select_m" value="" desc="请选择" isRequired="false" ref="【集团】全面价值经营,【集团】全面创新驱动,【奶粉】以消费者为中心,提供极致满意的消费体验,【奶粉】以高目标为引领,快速发展,只争第一,【奶粉】以共赢为指引,与合作伙伴建立长期利益共同体,【奶粉】以结果为导向,付出不亚于任何人的努力,【奶粉】以赢得市场竞争为驱动,成为一支有理想、有信念的强大团队,【酸奶】始终以消费者为中心,提供最优品质产品与最佳消费体验,【酸奶】视品牌为核心资产,让我们的品牌成为消费者的挚爱与首选,【酸奶】打造厂商命运共同体,构建稳固可持续发展的厂商生态圈,【酸奶】坚持高目标引领,直面竞争,只争第一,【酸奶】人人都是企业的经营者,不达目标誓不罢休,【酸奶】成为心中有理想、胸中有目标、敢打硬仗、能打胜仗、追求卓越的高绩效团队" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="riskMatrixInfo" title="风险矩阵信息" type="table" value="" desc="风险矩阵信息" isRequired="false" ref="{&quot;firstColumn&quot;:&quot;关键控制点&quot;,&quot;secondColumn&quot;:&quot;控制描述&quot;,&quot;threeColumn&quot;:&quot;对应风险描述&quot;,&quot;fourColumn&quot;:&quot;角色/岗位&quot;}" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
<attribute key="111aaa" title="测试的" type="table" value="" desc="aaaa" isRequired="false" ref="{&quot;firstColumn&quot;:&quot;列名1&quot;,&quot;secondColumn&quot;:&quot;列名2&quot;,&quot;threeColumn&quot;:&quot;&quot;,&quot;fourColumn&quot;:&quot;&quot;}" readonly="false" groupPath="baseAttribute" scope="%" isValid="true"/>
</attributes>

View File

@ -174,6 +174,7 @@ public class PalManageUtil {
icons.add("&#xe835;|#88147F");//紫旗帜(xe835-88147F.png)
icons.add("&#xe835;|#7DABB1");//浅蓝旗帜(xe835-7DABB1.png)
icons.add("&#xe835;|#707070");//灰旗帜(xe835-707070.png)
icons.add("&#xe63d;|#D81E06");//关键点(xe835-707070.png)
return icons;
}
@ -305,6 +306,9 @@ public class PalManageUtil {
case "&#xe835;|#707070"://灰旗帜(-.png)
dataUrl = "xe835-707070.png";
break;
case "&#xe63d;|#D81E06"://关键点(-.png)
dataUrl = "xe63d-D81E06.png";
break;
}
return dataUrl;
}

View File

@ -1628,6 +1628,32 @@ function getRelevanceShapes(objId, attributeValue) {
saveRelevanceShapesTODB(relationShapes, shape.id, shape.text, $("title").text(), shapeGroupId, objId, shape, attributeValue);
}
// 得到关联形状
function getRelevanceShapes_new(objId, attributeValue,linkObject) {
$("#attr_dialog_normal_relevance_shapes_div").dialog('close');
selectShape = Utils.getSelected()[0];
var shape = selectShape;
if (!shape) {
return;
}
var relationShapes = attr_content_iframe_relevance_shapes.getRelationShapeInfos();
var shapeGroupId = "";
for (var i = 0; i < shape.dataAttributes.length; i++) {
var attr = shape.dataAttributes[i];
if (attr.shapeGroupId != undefined && attr.shapeGroupId != "") {
shapeGroupId = attr.shapeGroupId;
break;
}
}
shape = getAttributeByAttrId(shape, objId, relationShapes);
var linksArray = [];
linksArray.push(linkObject);
shape.dataAttributes[13].linksArray =linksArray;
shape.link = linkObject.name;
saveRelevanceShapesTODB(relationShapes, shape.id, shape.text, $("title").text(), shapeGroupId, objId, shape, attributeValue);
}
Array.prototype.unique = function () {
var res = [];
var json = {};
@ -2266,8 +2292,16 @@ function updateAttributeById(objId, va, shapeId) {
];
shape.dataAttributes[13]["dataShowConfig"].config = dataArray;
}else{
//删除右下角图表
shape.dataAttributes[13]["dataShowConfig"].config = [];
var dataArray = [
{
"horizontal": "right",
"verity": "bottom",
"showType": "icon",
"iconContent": ""
}
];
shape.dataAttributes[13]["dataShowConfig"].config = dataArray;
}
Model.update(shape);
}
@ -3763,9 +3797,23 @@ function openRelationDig(obj, value) {
cls: "blue",
handler: function () {
var tmpObjId = $(obj).attr("objid");
getRelevanceShapes(tmpObjId, value);
var tmpShape = Utils.getSelected()[0];
var tmpTitle = tmpShape.title;
if(tmpTitle === "子流程"){
var relationShapes = attr_content_iframe_relevance_shapes.getRelationShapeInfos();
//增加默认的链接,打开该文件模型
var linkObject = {
"name":relationShapes[0].relationShapeText,
"value":relationShapes[0].relationShapeText,
"target": "newTab",
"type": "file",
"uuid": relationShapes[0].relationFileId,
"url":"./w?sid="+sid+"&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid="+relationShapes[0].relationFileId+"&openType=0&perms=&filePerms="
};
getRelevanceShapes_new(tmpObjId, value,linkObject);
}else{
getRelevanceShapes(tmpObjId, value);
}
if (tmpShape.name == "linker") {
return;
}