From 56c39716d5dc29ce332f62b337759f6358755f30 Mon Sep 17 00:00:00 2001 From: yujh Date: Fri, 9 Aug 2024 11:13:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E6=89=8B=E5=86=8C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=AF=BC=E5=87=BA=EF=BC=8C=E4=BB=A5=E5=8F=8A=E4=B8=89?= =?UTF-8?q?=E4=B8=AA=E5=B1=9E=E6=80=A7=E5=BF=85=E5=A1=AB=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pal/output/pr/report1/Report1Gener.java | 41 +- .../步骤横表-流程手册4.xml | 893 ++++++++++++------ .../extend/js/designer.extend.link.js | 35 +- 3 files changed, 693 insertions(+), 276 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java index 50e31b9a..d9ff2013 100644 --- a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java +++ b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/report1/Report1Gener.java @@ -11,6 +11,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; import com.actionsoft.apps.coe.pal.constant.CoEConstant; import com.actionsoft.apps.coe.pal.output.pr.util.PrReportComment; @@ -38,6 +39,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.commons.database.RowMap; import com.actionsoft.bpms.commons.mvc.view.ResponseObject; import com.actionsoft.bpms.server.DispatcherRequest; import com.actionsoft.bpms.server.UserContext; @@ -282,7 +284,9 @@ public class Report1Gener { } prReportComment.getCommentContent2(dataMap, repositoryModel);//获取一些公共的数据(手册首页的手册岗位名称、部门、时间等) JSONArray repositoryShapeTable = new JSONArray();//流程步骤Table - JSONArray roleMappingPostTable = new JSONArray(); + JSONArray roleMappingPostTable = new JSONArray();//角色对应岗位Table + JSONArray criticalControlPointTable = new JSONArray();//关键控制点Table + @@ -387,6 +391,7 @@ public class Report1Gener { } JSONObject _tr = new JSONObject(); JSONObject _roleMappingPostTr = new JSONObject(); + JSONObject _criticalControlPointTr = new JSONObject(); OutputWordUtil.setShapeDefaultValue2(repositoryId, _tr); //设置默认值 @@ -510,8 +515,12 @@ public class Report1Gener { String querySqlRole = " SELECT RELATIONSHAPEID FROM APP_ACT_COE_PAL_SHAPE_RLAT WHERE SHAPEID = ? AND ATTRID = ?"; String relationShapeId = DBSql.getString(querySqlRole, new Object[]{shapeId, "role"}); String querySql = " SELECT RELATIONSHAPETEXT FROM APP_ACT_COE_PAL_SHAPE_RLAT WHERE SHAPEID = ? AND ATTRID = ?"; - String postInfo = DBSql.getString(querySql, new Object[]{relationShapeId, "post"}); - if(UtilString.isNotEmpty(postInfo)){ + //可能存在一个角色对应多个岗位的关系 + List maps = DBSql.getMaps(querySql, new Object[]{relationShapeId, "post"}); + if(!maps.isEmpty()){ + String postInfo = maps.stream() + .map(rowMap -> (String) rowMap.get("RELATIONSHAPETEXT")) // 提取每个Map中的RELATIONSHAPETEXT字段 + .collect(Collectors.joining(",")); // 使用逗号拼接字符串 _roleMappingPostTr.put("shape_number",roleMappingPostIndex); _roleMappingPostTr.put("roleMapping_role",attrValue); _roleMappingPostTr.put("roleMapping_post",postInfo); @@ -520,12 +529,35 @@ public class Report1Gener { roleMappingPostIndex++; } } + + //增加关键控制点table + if("isCriticalControlPoint".equals(attrId) && "是".equals(attrValue)){ + //遍历 + _criticalControlPointTr.put("shapeName",shape.get("name")); + for (int j = 0; j < dataAttributes.size(); j++) { + JSONObject json = dataAttributes.getJSONObject(j); + String jsonAttrId = json.getString("key"); + String jsonAttrValue = json.getString("value"); + if("controlDesc".equals(jsonAttrId)){ + _criticalControlPointTr.put("controlDesc",jsonAttrValue); + } + if("mappingRiskDescription".equals(jsonAttrId)){ + _criticalControlPointTr.put("mappingRiskDescription",jsonAttrValue); + } + if("role".equals(jsonAttrId)){ + _criticalControlPointTr.put("role",jsonAttrValue); + } + } + } } } repositoryShapeTable.add(_tr); if(!_roleMappingPostTr.isEmpty()){ roleMappingPostTable.add(_roleMappingPostTr); } + if(!_criticalControlPointTr.isEmpty()){ + criticalControlPointTable.add(_criticalControlPointTr); + } index++; } } @@ -802,6 +834,9 @@ public class Report1Gener { dataMap.put("roleMappingPostTable", roleMappingPostTable); dataMap.put("roleMappingPostTableCount", roleMappingPostTable.size()); + + dataMap.put("criticalControlPointTable", criticalControlPointTable); + dataMap.put("criticalControlPointTableCount", criticalControlPointTable.size()); boolean contains = isNumberAscArray.contains("false"); if(contains) { fileTable.sort(Comparator.comparing(obj -> ((JSONObject) obj).getString("file_name"))); diff --git a/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册4.xml b/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册4.xml index cf3445ed..99d2a091 100644 --- a/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册4.xml +++ b/com.actionsoft.apps.coe.pal.output.pr/步骤横表-流程手册4.xml @@ -4942,278 +4942,278 @@ y7fdOgAAAABJRU5ErkJggk== - - - <#if (roleMappingPostTableCount ==0 )> - <#else> - - - - - - - - - - - 角色岗位对应表 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 序号 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 角色 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 岗位 - - - - - <#list roleMappingPostTable as table3> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${table3.shape_number} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${table3.roleMapping_role} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${table3.roleMapping_post} - - - - - - - - + + +<#if (roleMappingPostTableCount ==0 )> +<#else> + + + + + + + + + + + 角色岗位对应表 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 序号 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 角色 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 岗位 + + + + +<#list roleMappingPostTable as table3> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${table3.shape_number} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${table3.roleMapping_role} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${table3.roleMapping_post} + + + + + + + + @@ -6215,6 +6215,7 @@ y7fdOgAAAABJRU5ErkJggk== + @@ -6450,8 +6451,356 @@ y7fdOgAAAABJRU5ErkJggk== + +<#if (criticalControlPointTableCount ==0 )> +<#else> + + + + + + + + + + + 关键控制点风险矩阵 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 关键控制点 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 控制描述 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 对应风险描述 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 角色/岗位 + + + + +<#list criticalControlPointTable as table4> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${table4.shapeName} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${table4.controlDesc} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${table4.mappingRiskDescription} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${table4.role} + + + + + + + + <#if (supports_table_count >0 )> + + diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js index b2711049..59e83ae8 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js @@ -1446,6 +1446,8 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { mouseout = ""; } $("#" + tbodyId).empty(); + //判断是否涉及关键控制点,修改属性必填项 + updateArrayByControlPoint(attributesJsonArray); for (var index = 0; index < attributesJsonArray.length; index++) { var obj = attributesJsonArray[index]; if (obj != null && obj != undefined && obj.value != undefined) { @@ -1464,7 +1466,6 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { if (obj.isRequired !== null && obj.isRequired) { requiredSpan = '*' } - var isdesc = obj.desc == undefined ? "" : obj.desc; var constr = '' + ' ' + objName + requiredSpan + '' @@ -2250,6 +2251,34 @@ function updateAttributeById(objId, va, shapeId) { } } +function updateArrayByControlPoint(attributesJsonArray){ + //如果关键控制位是,则更新更新为必填 + var isCriticalControlPoint="否"; + attributesJsonArray.forEach(obj => { + // 检查id是否匹配 + if (obj.id === 'isCriticalControlPoint') { + isCriticalControlPoint = obj.value; + } + }); + attributesJsonArray.forEach(obj => { + if(isCriticalControlPoint === "是"){ + if(obj.id ==="controlDesc"){ + obj.isRequired = true; + } + if(obj.id ==="mappingRiskDescription"){ + obj.isRequired = true; + } + }else{ + if(obj.id ==="controlDesc"){ + obj.isRequired = false; + } + if(obj.id ==="mappingRiskDescription"){ + obj.isRequired = false; + } + } + }); +} + // 删除行上的属性 function removeTrAttribute(obj) { var options = { @@ -4009,6 +4038,9 @@ function getBooleanSelectOptions(booleanValues, shapeId) { if (selectedData != null && selectedData != '') { $("#attribute_name_input_" + objId).val(selectedData[0]).trigger("change"); } + $obj.on("select2:select", function (e) { + alert(1); + }); $obj.off("select2:close").on("select2:close", function (e) { // var type = this.id.substring(this.id.lastIndexOf('_')+1); var type = this.id.substr('attribute_name_input_'.length); @@ -4020,6 +4052,7 @@ function getBooleanSelectOptions(booleanValues, shapeId) { booleanComboboxs[type] = selectValue.join(','); saveSelectContent(type, booleanComboboxs[type], shapeId); }); + $("#attribute_name_input_" + objId + "_Tip").css({"float": "left", "border": "0"}); } }