feat(REQ-4418) - 调整发起人主管的二级范围限定

This commit is contained in:
wangli 2025-08-26 18:19:07 +08:00
parent 7ecff1f672
commit 38f3ba685b
4 changed files with 47 additions and 30 deletions

View File

@ -121,6 +121,8 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.TEMPLATE_NOTICE_MES
import static cn.axzo.workflow.common.constant.BpmnConstants.TEMPLATE_PENDING_MESSAGE_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.TEMPLATE_SIGN_PENDING_MESSAGE_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.TEMPLATE_SMS_MESSAGE_ID;
import static cn.axzo.workflow.common.enums.ApproverSpecifyRangeUnitEnum.in_ent;
import static cn.axzo.workflow.common.enums.ApproverSpecifyRangeUnitEnum.in_project;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_CONDITION;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_EMPTY;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_EXCLUSIVE_GATEWAY;
@ -828,6 +830,8 @@ public final class BpmnJsonConverterUtil {
// "/resources/配置台模型.json";
// String fileName = "/Users/wangli/work/company/yizhi/workflow-engine/workflow-engine-server/src/main" +
// "/resources/权限点模型.json";
boolean present = Optional.of(in_ent).filter(unit -> unit != in_project).isPresent();
String fileName = "/Users/wangli/work/company/yizhi/workflow-engine/workflow-engine-server/src/main" +
"/resources/request.json";
byte[] bytes = Files.readAllBytes(Paths.get(fileName));

View File

@ -86,6 +86,7 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_META;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTION;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_PERMISSION;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_INITIATOR_LEADER_RANGE_UNIT;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_INITIATOR_SPECIFIED_EXCLUDE_COOPERATE_TYPES;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_INITIATOR_SPECIFIED_EXCLUDE_IDENTITY_TYPES;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_INITIATOR_SPECIFIED_FILTER;
@ -548,6 +549,18 @@ public final class BpmnMetaParserHelper {
return Optional.empty();
}
public static Optional<ApproverSpecifyRangeUnitEnum> getInitiatorLeaderRangeUnit(FlowElement flowElement) {
Optional<ApproverSpecifyEnum> approverSpecify = getApproverSpecify(flowElement);
if (approverSpecify.isPresent()) {
return defaultValid(flowElement, CONFIG_APPROVER_SPECIFY).flatMap(element -> element.getChildElements()
.getOrDefault(CONFIG_INITIATOR_LEADER_RANGE_UNIT, Collections.emptyList())
.stream()
.findFirst()
.map(e -> ApproverSpecifyRangeUnitEnum.valueOf(e.getAttributeValue(null, ELEMENT_ATTRIBUTE_VALUE))));
}
return Optional.empty();
}
public static Optional<Boolean> getInitiatorSpecifiedFilter(FlowElement flowElement) {
Optional<ApproverSpecifyEnum> approverSpecify = getApproverSpecify(flowElement);
if (approverSpecify.isPresent() && Objects.equals(approverSpecify.get(), ApproverSpecifyEnum.initiatorSpecified_v2)) {

View File

@ -26,8 +26,8 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.enums.ApproverEmptyHandleTypeEnum.transferToAdmin;
import static cn.axzo.workflow.common.enums.ApproverSpecifyRangeUnitEnum.in_project;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getApproverEmptyHandleType;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getApproverSpecifyRangeUnit;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getAreaFilterEnable;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getInitiatorLeaderRangeUnit;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getSpecialtyFilterEnable;
/**
@ -64,7 +64,7 @@ public class BasedInitiatorLeaderV2TaskAssigneeSelector extends AbstractBpmnTask
.scope(FlowTaskAssignerScopeDTO.builder()
.nodeId(initiator.parseNodeId())
.upLevel(SignApproverOrgLimitEnum.LV_0.getCode())
.crossDomain(getApproverSpecifyRangeUnit(flowElement).filter(unit -> unit != in_project).isPresent())
.crossDomain(getInitiatorLeaderRangeUnit(flowElement).filter(unit -> unit != in_project).isPresent())
.build())
.initiatorPersonId(initiator.parsePersonId())
.areaCodes(getAreaFilterEnable(flowElement) ? Sets.newHashSet(ListUtils.emptyIfNull(orgDTO.getIncludeAreaCodes())) : Sets.newHashSet())

View File

@ -89,7 +89,7 @@
<jsonValue><![CDATA[{"id":"NODE_STARTER","type":"NODE_STARTER","name":"发起人","property":{"isMultiTask":true,"isSequential":false,"groupsType":"or","fieldPermission":[]}}]]></jsonValue>
</extensionElements>
</userTask>
<sequenceFlow id="SequenceFlowId_26bf7f7a4d624658964562d4c5b1f17d" name="发起人" sourceRef="startEventNode"
<sequenceFlow id="SequenceFlowId_aab3b45080a443a6ad19f83d1ea700aa" name="发起人" sourceRef="startEventNode"
targetRef="NODE_STARTER"></sequenceFlow>
<userTask id="node_864990574287_ylc5" name="审批节点" flowable:assignee="${assigneeName}"
flowable:formKey="test-form">
@ -181,7 +181,7 @@
<completionCondition>${nrOfInstances != nrOfActiveInstances}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="SequenceFlowId_a0fb39e606584def84e4e186a4803d6a" name="审批节点" sourceRef="NODE_STARTER"
<sequenceFlow id="SequenceFlowId_7b271edd67394f9ab032d343f449556e" name="审批节点" sourceRef="NODE_STARTER"
targetRef="node_864990574287_ylc5"></sequenceFlow>
<serviceTask id="node_865038288523_ff8k" name="抄送节点"
flowable:delegateExpression="${engineCarbonCopyV2EventListener}">
@ -200,7 +200,7 @@
<![CDATA[{"id":"node_865038288523_ff8k","parentId":"node_864990574287_ylc5","type":"NODE_CARBON_COPY","name":"抄送节点","property":{"approverSpecify":"role_v2","approverSpecifyRange":"within_the_project_construction_units","cooperateShipType":"PROJ_PRIMARY_CONTRACTING_UNIT","approverSpecifyRangeUnit":"in_ent","initiatorSpecifiedFilter":false,"excludeIdentityTypes":[],"excludeCooperateShipTypes":[],"specifyValue":"[{\"name\":\"其他\",\"value\":101357,\"type\":7},{\"name\":\"首页-待删除\",\"value\":101289,\"type\":7},{\"name\":\"班组管理(劳资)\",\"value\":101290,\"type\":7},{\"name\":\"人员管理-T\",\"value\":101291,\"type\":7},{\"name\":\"查看企业通讯录\",\"value\":101292,\"type\":7},{\"name\":\"部门管理-T\",\"value\":101293,\"type\":7},{\"name\":\"班组管理\",\"value\":101294,\"type\":7},{\"name\":\"岗位权限管理-T\",\"value\":101295,\"type\":7},{\"name\":\"编辑工程-待删除\",\"value\":101296,\"type\":7},{\"name\":\"查看工程\",\"value\":101297,\"type\":7},{\"name\":\"申请工程完结-待删除\",\"value\":101356,\"type\":7},{\"name\":\"发薪账户管理\",\"value\":101298,\"type\":7},{\"name\":\"查看发薪报表-T\",\"value\":101299,\"type\":7},{\"name\":\"招工\",\"value\":101300,\"type\":7}]","isMultiTask":true,"isSequential":false,"groupsType":"or","carbonCopyConf":[],"fieldPermission":[]}}]]></jsonValue>
</extensionElements>
</serviceTask>
<sequenceFlow id="SequenceFlowId_39fe8ba883b34f5a89fbe71774c099d7" name="抄送节点"
<sequenceFlow id="SequenceFlowId_ffeca9aa09224d94b6402af900ec6901" name="抄送节点"
sourceRef="node_864990574287_ylc5" targetRef="node_865038288523_ff8k"></sequenceFlow>
<userTask id="node_865016003134_707l" name="业务节点" flowable:assignee="${assigneeName}"
flowable:formKey="test-form">
@ -293,9 +293,9 @@
<completionCondition>${nrOfInstances != nrOfActiveInstances}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="SequenceFlowId_75cf225cb6104b5caa27f11ae1479822" name="业务节点"
<sequenceFlow id="SequenceFlowId_6748340cbe304aef91c937e29ab0ada2" name="业务节点"
sourceRef="node_865038288523_ff8k" targetRef="node_865016003134_707l"></sequenceFlow>
<sequenceFlow id="SequenceFlowId_dd624c7933bc40a2ae852088c52d8f4e" sourceRef="node_865016003134_707l"
<sequenceFlow id="SequenceFlowId_ca7bdfc7d17542d18b42bebd2dd1750d" sourceRef="node_865016003134_707l"
targetRef="endEventNode"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_id">
@ -318,41 +318,41 @@
<bpmndi:BPMNShape bpmnElement="NODE_STARTER" id="BPMNShape_NODE_STARTER">
<omgdc:Bounds height="60.0" width="100.0" x="80.0" y="0.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_dd624c7933bc40a2ae852088c52d8f4e"
id="BPMNEdge_SequenceFlowId_dd624c7933bc40a2ae852088c52d8f4e">
<omgdi:waypoint x="630.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="642.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="642.0" y="30.000000000000004"></omgdi:waypoint>
<omgdi:waypoint x="680.0" y="30.000000000000004"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_75cf225cb6104b5caa27f11ae1479822"
id="BPMNEdge_SequenceFlowId_75cf225cb6104b5caa27f11ae1479822">
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_6748340cbe304aef91c937e29ab0ada2"
id="BPMNEdge_SequenceFlowId_6748340cbe304aef91c937e29ab0ada2">
<omgdi:waypoint x="480.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="492.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="492.0" y="30.000000000000007"></omgdi:waypoint>
<omgdi:waypoint x="530.0" y="30.000000000000007"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_26bf7f7a4d624658964562d4c5b1f17d"
id="BPMNEdge_SequenceFlowId_26bf7f7a4d624658964562d4c5b1f17d">
<omgdi:waypoint x="30.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="42.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="42.0" y="30.000000000000007"></omgdi:waypoint>
<omgdi:waypoint x="80.0" y="30.000000000000007"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_ca7bdfc7d17542d18b42bebd2dd1750d"
id="BPMNEdge_SequenceFlowId_ca7bdfc7d17542d18b42bebd2dd1750d">
<omgdi:waypoint x="630.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="642.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="642.0" y="30.000000000000004"></omgdi:waypoint>
<omgdi:waypoint x="680.0" y="30.000000000000004"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_39fe8ba883b34f5a89fbe71774c099d7"
id="BPMNEdge_SequenceFlowId_39fe8ba883b34f5a89fbe71774c099d7">
<omgdi:waypoint x="330.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="342.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="342.0" y="30.000000000000007"></omgdi:waypoint>
<omgdi:waypoint x="380.0" y="30.000000000000007"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_a0fb39e606584def84e4e186a4803d6a"
id="BPMNEdge_SequenceFlowId_a0fb39e606584def84e4e186a4803d6a">
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_7b271edd67394f9ab032d343f449556e"
id="BPMNEdge_SequenceFlowId_7b271edd67394f9ab032d343f449556e">
<omgdi:waypoint x="180.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="192.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="192.0" y="30.000000000000007"></omgdi:waypoint>
<omgdi:waypoint x="230.0" y="30.000000000000007"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_ffeca9aa09224d94b6402af900ec6901"
id="BPMNEdge_SequenceFlowId_ffeca9aa09224d94b6402af900ec6901">
<omgdi:waypoint x="330.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="342.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="342.0" y="30.000000000000007"></omgdi:waypoint>
<omgdi:waypoint x="380.0" y="30.000000000000007"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlowId_aab3b45080a443a6ad19f83d1ea700aa"
id="BPMNEdge_SequenceFlowId_aab3b45080a443a6ad19f83d1ea700aa">
<omgdi:waypoint x="30.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="42.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="42.0" y="30.000000000000007"></omgdi:waypoint>
<omgdi:waypoint x="80.0" y="30.000000000000007"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>