Unified approval method for multiple service types

By using business type identifier-driven entity set routing and reflection attribute access, combined with action type and role permission verification, the problem of inconsistent approval execution between heterogeneous business entities is solved, and unified approval and audit records for multiple business types are realized, improving the stability and traceability of the system.

CN123180937APending Publication Date: 2026-11-27GUIZHOU ELECTRIC POWER DESIGN INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611446894.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-17
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies make it difficult to achieve consistency in approval execution and auditing mechanisms among heterogeneous business entities in enterprise management systems with multiple business types. This results in inconsistent status processing, a lack of unified verification of permission configurations, and difficulty in reconstructing the complete trajectory of approval records using a unified data association method.

Method used

The system drives entity set routing by business type identifiers, uses general query and reflection attribute access to achieve status reading and writing, and combines action type and role permission verification to uniformly record approval operations and generate a consistent approval trajectory.

Benefits of technology

It enables the reuse of approval processing logic for different business types, reduces redundant modifications when adding new business types, reduces illegal status transitions and self-approval anomalies, and improves the traceability of the approval process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180937A_ABST
    Figure CN123180937A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer data processing and workflow control, and discloses a multi-service type unified approval method for solving the problems of inconsistent state rules and difficult unified association of approval tracks caused by setting approval logic respectively by heterogeneous service entities. The method routes and queries the target service entity which is not deleted according to the service type, reads the current state by reflection, and according to the actions of passing the audit, final approval or withdrawal, filters the records according to the service type, service identifier and previous action, selects the latest previous record according to the operation time, and compares the operator identifier. After the verification is passed, the target state is updated and written into the unified approval record. The present application is applicable to the hierarchical approval of enterprise multi-service documents, can reuse the state processing chain and realize self-prevention and approval traceability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer data processing and workflow control technology, specifically to a unified approval method for multiple business types in an enterprise management system. Background Technology

[0002] Enterprise management systems typically require tiered approval processes for various business documents, including contracts, projects, output value, invoices, receipts, payments, settlements, changes, and claims. Although different business documents are stored in their respective business entity sets, the approval process usually involves document submission, tiered review, final approval or rejection, status updates, and retention of operation records.

[0003] Chinese patent application CN112990850A, entitled "A Method and System for Process Implementation Based on a Rule Engine," discloses a technical approach that collaboratively implements process creation and flow through a business process interface module, a rule engine module, and a workflow engine module. In this approach, the business process interface module acquires business data and sends it to the rule engine module. The rule engine module then generates a decision based on the business data, and the business process interface module finally sends the decision to the workflow engine module to complete process creation and flow. This technical approach effectively coordinates business decisions with process execution.

[0004] However, when multiple business types use different data entities, status fields, and business number fields, the existing process implementation still requires handling entity location, status reading, and status writing separately in each business implementation. This easily leads to duplicate business adaptation code and may cause inconsistencies in the meaning of status and action constraints between different businesses. Meanwhile, when there is a lack of unified association verification between the permission configuration of the reviewer or final approver and the identity of the preceding operator, the system struggles to reliably prevent adjacent approval steps from being completed by the same operator. Furthermore, when each business retains its own approval records, it is also difficult to reconstruct the complete approval trajectory using a unified data association method. Therefore, how to establish a consistent approval execution and audit processing mechanism among multiple heterogeneous business entities, and implement unified role, status, and operator constraints during status transitions, is a technical problem that needs to be solved in this field. Summary of the Invention

[0005] This invention addresses the technical problems existing in the prior art by proposing a unified approval method for multiple business types, in order to establish a consistent approval execution chain and audit record mechanism for heterogeneous business entities.

[0006] This invention provides a unified approval method for multiple business types, comprising: receiving an approval request carrying a business type identifier, a business identifier, an action type, an operator identifier, and an approval opinion; selecting a target entity set from multiple entity sets storing entities of different business types according to the business type identifier, and querying the target entity set for undeleted target business entities according to the business identifier; reading the current state of the target business entity through reflection access, determining the source state and target state according to the action type, and verifying the role permissions corresponding to the operator identifier and the matching relationship between the current state and the source state; when the action type is "approval,"... When performing an action, granting final approval, or withdrawing an action, the preceding action type is determined based on the action type. Preceding records matching the business type identifier, the business identifier, and the preceding action type are filtered from the unified approval record table. These preceding records are then sorted in descending order of operation time, and the first preceding record is selected as the latest preceding record. The preceding operator identifier in the latest preceding record is compared with the operator identifier to perform anti-self-audit verification or withdrawal permission verification. After all verifications pass, the current state of the target business entity is updated to the target state via reflection, and the approval record corresponding to this approval operation is written to the unified approval record table.

[0007] Furthermore, the current state and the target state are selected from the draft state, the pending review state, the approved pending final approval state, the approved state, and the rejected state. The action types include the submit action, the approved action, the rejected action, the final approval action, the final rejection action, and the withdraw action. Specifically, the submit action changes the draft state to the pending review state; the approved action changes the pending review state to the approved pending final approval state; the rejected action changes the pending review state to the rejected state; the final approval action changes the approved pending final approval state to the approved state; the final rejection action changes the approved pending final approval state to the rejected state; and the withdraw action changes the pending review state or the approved pending final approval state back to the draft state. The approved and rejected actions require the operator identifier to correspond to a first approval role, and the final approval and final rejection actions require the operator identifier to correspond to a second approval role.

[0008] Furthermore, the business type identifier includes at least two of the following: contract business identifier, engineering business identifier, output value business identifier, invoice business identifier, collection business identifier, payment business identifier, settlement business identifier, change business identifier, and claim business identifier.

[0009] Further, selecting the target entity set from the plurality of entity sets includes: inputting the business type identifier into a preset branch routing expression, which calls the entity query branch corresponding to the business type identifier and returns the target business entity and its current status in a unified return structure including an entity object field and a status field; the entity query branch calls a general query method with the entity type as a parameter, which reads the entity identifier attribute and deletion flag attribute shared by each business entity in the plurality of entity sets through dynamic attribute access, and filters the undeleted target business entities according to the business identifier and the deletion flag attribute.

[0010] Furthermore, updating the current state of the target business entity to the target state through reflection access includes: obtaining the state attribute and update time attribute of the target business entity through reflection, writing the target state into the state attribute, and writing the operation time of this approval operation into the update time attribute.

[0011] Furthermore, before writing the approval record, the business number attribute of the target business entity is searched sequentially according to the preset candidate business number attribute name sequence by reflection, and the found business number is written into the approval record.

[0012] Furthermore, when the action type is the approved action, the submission action is determined as the preceding action type, and the approved action is rejected if the preceding operator identifier in the latest preceding record is the same as the operator identifier; when the action type is the final approval action, the approved action is determined as the preceding action type, and the final approval action is rejected if the preceding operator identifier in the latest preceding record is the same as the operator identifier.

[0013] Furthermore, when the action type is the withdrawal action, the submission action is determined as the preceding action type, the preceding operator in the latest preceding record is determined as the submitter of the most recent submission action, and the withdrawal action is rejected when the preceding operator identifier is different from the operator identifier.

[0014] Furthermore, the approval record includes a business type identifier, a business identifier, a business number, an approval step, an action type, an operator identifier, an operator name, an approval opinion, and an operation time. The approval records corresponding to the same business type identifier and the business identifier are queried in ascending order of operation time to generate the approval trajectory of the target business entity.

[0015] Furthermore, when a new business type is added, the correspondence between the business type identifier of the new business type and the entity query branch is added to the branch routing expression, and the status verification, anti-self-review verification, permission withdrawal verification, reflection status update and approval record writing processing performed for the approval request are reused.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0017] To address the issues of duplicate adaptation code and inconsistent status handling caused by implementing approval processes separately for various business entities, this invention uses business type identifiers to drive entity set routing and uses general query and reflection attribute access to complete the query, status reading, and status writing of target entities. This limits the differences between entities of different business types to the entity query branch and attribute mapping stage. Subsequent status verification, permission verification, and record writing can reuse the same processing chain, which helps to reduce the operational differences caused by repeatedly modifying the core approval logic when adding new business types.

[0018] This invention combines the legitimate source and target states corresponding to action types with role permission verification. In the approval, final approval and withdrawal operations, it queries the latest preceding records and compares the preceding operator's identifier with the current operator's identifier. This allows for a unified determination of whether the state transition is legitimate and whether the adjacent approval steps are executed by a restricted operator before the state is written back. This helps to reduce approval chain anomalies caused by illegal state transitions and self-approval.

[0019] This invention also uses business type identifiers and business identifiers to unify approval records, storing data such as approval steps, action types, operators, and operation times within these records. This allows approval operations for different business types to be stored using a consistent data structure and queried in chronological order, facilitating the reconstruction of the complete approval trajectory of the target business entity and improving the traceability of the approval process. All of these effects are achieved through the collaborative processing of entity routing, status handling, preceding record verification, and unified record writing, without relying on unverified quantitative performance indicators. Attached Figure Description

[0020] Figure 1 To standardize the approval status transition diagram;

[0021] Figure 2 A unified approval architecture diagram for multiple business types;

[0022] Figure 3 To prevent self-audit verification flowchart. Detailed Implementation

[0023] The present invention will be further described below with reference to the accompanying drawings and embodiments. It should be noted that the following embodiments are used to illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention. Without departing from the technical concept of the present invention, those skilled in the art can make equivalent substitutions for the specific names of business entities, interface names, and field names.

[0024] In this implementation, the business type identifier is denoted as `bizType`, and the business identifier is denoted as `bizId`. The unified approval service can be implemented by `SysApproveService`, and can receive requests through the approval interface provided by `SysApproveController`. The approval request must at least carry `bizType`, `bizId`, action type `action`, operator identifier `operatorId`, and approval comment `remark`. The first approval role `ROLE_VP` represents the role that performs the approval or rejection action, and the second approval role `ROLE_BOSS` represents the role that performs the final approval or final rejection action. Figure 1 This illustrates the transition relationships between unified states and actions. Figure 2 The diagram illustrates the data flow between the request receiving module 100, the service routing module 200, the status processing module 300, the record verification module 400, the record writing module 500, the multi-service entity set 600, and the unified approval record table 700. Figure 3 This shows the process of querying previous records and comparing operators.

[0025] Example 1: Unified Approval Method for Multiple Business Types

[0026] This embodiment presents a complete workflow for a unified approval method that can be implemented independently. This method executes the same approval main chain for multiple types of business entities stored in different entity sets, and includes the following steps.

[0027] S101, Receive approval request. The unified approval service obtains the business type identifier (bizType), business identifier (bizId), action type (action), current operator identifier (operatorId), and approval comment (remark) from the request. It uses bizType and bizId to jointly determine the business object targeted by this operation, and uses action to determine the approval branch in which this operation is performed. The system obtains the role information corresponding to the current operator based on the operatorId and uses this role information for role permission comparison in S105.

[0028] S102, select the entity query branch based on bizType. Business routing uses branch routing expressions to map contract, engineering, output, invoice, collection, payment, settlement, change, and claim to entity sets of contract, engineering, output, invoice, collection, payment, settlement, change, and claim, respectively. The FindBizEntityWithStatus method receives bizType and bizId, calls the entity query method in the corresponding branch, and returns the query results in a unified return structure including the entity object field and the status field. Therefore, subsequent approval processing does not need to depend on the specific type of each business entity. Any two or more of the nine business types can be connected to this unified approval main chain.

[0029] S103, query target business entities that have not been deleted. Each entity query branch calls the general query method WrapAsync, which takes entity type T as a parameter. <t>This method retrieves data from the entity set corresponding to entity type T, and reads the common entity identifier attribute Id and deletion flag attribute IsDeleted using dynamic attribute access. It filters entities whose Id is equal to bizId and whose IsDeleted indicates they have not been deleted. Entity type T accessing the route must have readable Id and IsDeleted attributes. If there is no branch corresponding to bizType in the route, no matching entity is found, or the aforementioned common attributes are missing, the approval process stops, and no status update or successful approval record is written.

[0030] S104, Read the current status. For the entity object obtained in S103, the unified approval service uses reflection to obtain the status attribute named Status and read its value, using the result as the current status. Business entities accessing the unified approval service must have a readable and writable Status attribute and a writable UpdateTime attribute; if reflection cannot find the corresponding attribute or the attribute is not readable or writable, the current approval process stops. Business entities retain their respective entity types and enter the same status processing chain through the agreed attribute interface. In this way, entities such as contracts and projects do not need to have a separate approval service.

[0031] S105, determine the source state, target state, and required roles based on the action, and verify the current state and role permissions. For example... Figure 1 As shown, the unified status includes draft, pending (awaiting VP review), VP_approved (VP reviewed and awaiting final approval), approved, and rejected. The six standard actions and their conversion relationships are as follows: The submit action `ACTION_SUBMIT` changes draft to pending, executed by the initiator; the approve action `ACTION_APPROVE` changes pending to VP_approved, requiring the operator to have the ROLE_VP role; the reject action `ACTION_REJECT` changes pending to rejected, requiring the operator to have the ROLE_VP role; the final approve action `ACTION_FINAL_APPROVE` changes VP_approved to approved, requiring the operator to have the ROLE_BOSS role; the final reject action `ACTION_FINAL_REJECT` changes VP_approved to rejected, requiring the operator to have the ROLE_BOSS role; and the withdraw action `ACTION_WITHDRAW` changes pending or VP_approved back to draft, executed by the original submitter. The process will proceed only if the current state matches the source state of the action and the operator meets the corresponding role or identity requirements.

[0032] S106, query and compare the execution records of actions that require reference to the preceding operator. The unified approval record table sys_approve_record distinguishes different actions of different business objects using BizType, BizId, and Action. For actions that have been approved, finally approved, or withdrawn, the request's bizType and bizId are used as common filtering conditions, and the corresponding preceding action's Action is used as the action filtering condition. The resulting preceding records are sorted in descending order by CreateTime, and the first record is selected as the latest preceding record. If the required preceding record is not found, the operator's identity cannot be compared, the action is rejected, and no status update is performed.

[0033] When the action is "approved," the "submit" action is used as the preceding action to retrieve the latest submission record. Let the current operator's identifier be... The operator identifier in the latest submission record is... The conditions for approval include:

[0034]

[0035] when The review process will reject the approval action, thereby preventing the submitter from approving their own submitted business entity. The review rejection action still verifies the pending source status and ROLE_VP role according to S105 and puts the business entity into the rejected status, but the anti-self-review comparison in this section does not apply.

[0036] When the action is the final approval action, the approved action is used as the preceding action to obtain the latest approved record. Let the operator identifier in this record be... The final approval conditions include

[0037]

[0038] when The final approval action is rejected to prevent the same operator who completed the vice president's review from completing the final approval. The final rejection action still verifies the vp_approved source status and ROLE_BOSS role according to S105 and puts the business entity into the rejected status, but the anti-self-approval comparison in this section does not apply.

[0039] When the action is a retraction action, the commit action is taken as the preceding action. The latest commit record is obtained according to the aforementioned filtering and sorting rules, and the operator in that record is identified as the submitter of the most recent commit action; in this implementation, the original submitter refers to the submitter of the most recent commit action. The conditions for granting retraction permission are as follows:

[0040]

[0041] when The retraction is refused at the time, thus ensuring that retraction in the pending or vp_approved state is always initiated by the original submitter. Figure 3 The preceding record query, identifier comparison, and rejection or approval branches are used for the two-level anti-self-audit verification of the aforementioned approval and final approval actions; the withdrawal permission verification reuses the preceding record query method, but uses the same operator identifier as the approval condition.

[0042] S107, Update the target business entity. After all validations pass, the SetEntityStatus method uses reflection to obtain the Status and UpdateTime properties of the target business entity, writes the target status determined in S105 into the Status property, and writes the operation time of this approval operation into the UpdateTime property. After the reflection write is completed, the entity set selected in S102 saves the status change of the entity.

[0043] S108, Write Approval Record. The unified approval service first checks the target business entity using the GetBizNo method according to the preset sequence of candidate business number attribute names. For example, candidate attribute names may include ContractNo, EngineeringCode, and PaymentNo. This method queries the attributes one by one in sequence, stops the query after finding the first existing and readable number attribute, and uses its attribute value as BizNo. Subsequently, the WriteRecordAsync method writes a record corresponding to this operation to sys_approve_record. This record includes BizType (business type identifier), BizId (business identifier), BizNo (business number), Step (approval step), Action (action type), OperatorId (operator identifier), Operator name, Remark (approval comments), and CreateTime (operation time).

[0044] The Step function can be represented by STEP_SUBMIT, STEP_VP_REVIEW, and STEP_BOSS_APPROVE, respectively, indicating the submission, vice president review, and general manager approval stages. The GetRecordsAsync method uses bizType and bizId as query conditions, returning all approval records for the same business entity in ascending order of CreateTime, providing a timeline for the approval history component. By separating the record table from the individual business entity tables, multiple business types share the same record structure, and each record can still be located to its corresponding business entity using BizType and BizId.

[0045] The above S101 to S108 are formed Figure 2 The data flow is as follows: The controller hands the request to the unified approval service, which inquires with the business route to obtain the entity, calls the anti-self-approval or permission revocation verification, and updates the entity and writes it to the approval record after the verification passes. Business type routing isolates entity differences, unified state constraint conversion eliminates duplicate attribute accesses, and unified records save the operation trajectory. Therefore, approval can be performed without repeatedly establishing a complete approval chain for each business type, and the possibility of state meaning shifts between different businesses is reduced.

[0046] Example 2: Complete Contract Approval Process

[0047] This example uses a contract entity of type "contract". The contract specialist creates the contract, with the contract status set to "draft". The contract specialist calls "SubmitAsync" and submits the contract, contract identifier, "ACTION_SUBMIT", operator identifier, and comments. Services are processed according to... Figure 2 The contract branch shown retrieves the contract entity, confirms that the current status is draft, updates it to pending, and writes a commit record with Action set to ACTION_SUBMIT and Step set to STEP_SUBMIT.

[0048] When the deputy general manager in charge calls ApproveAsync, the service confirms that the contract is pending and the operator has the ROLE_VP role. It then queries sys_approve_record for the latest ACTION_SUBMIT record under the contract identifier. If the current operator identifier matches the OperatorId of the commit record, then... Figure 3 The rejection branch returns "Cannot review my own submitted documents" and does not perform a success status transition; if the two are different, the contract status is updated to vp_approved and an audit record with Action as ACTION_APPROVE and Step as STEP_VP_REVIEW is written.

[0049] When the general manager calls FinalApproveAsync, the service confirms that the contract is in the vp_approved state and the operator has the ROLE_BOSS role, and then queries the latest ACTION_APPROVE record. If the current operator ID is the same as the OperatorId in the approval record, the final approval is rejected; if they are different, the contract status is updated to approved, and an approval record with Action set to ACTION_FINAL_APPROVE and Step set to STEP_BOSS_APPROVE is written, thus putting the contract into the approved state.

[0050] As an audit extension, if the aforementioned identity comparison fails, a failure action record can be written to the unified approval record table according to the failure logging method given in the briefing, and the reason for failure can be saved in Remark; this failure record does not indicate that the business entity has completed the state transition. Regardless of whether this extension is adopted, only actions that pass the verification will update the business entity status according to S107.

[0051] Example 3: Withdrawal, Modification, and Resubmission

[0052] After a contract specialist submits a contract, the contract is pending. When the specialist needs to modify the contract, they call `WithdrawAsync`. The service filters the contract's submission records by `BizType`, `BizId`, and `ACTION_SUBMIT`, selects the latest submission record in descending order of `CreateTime`, and compares the current operator ID with the `OperatorId` of the latest submission record. If they match and the current status is pending, the status is changed from pending to draft and written to the `ACTION_WITHDRAW` record; otherwise, withdrawal is rejected. After modifying the contract, the specialist can call `SubmitAsync` again, causing the contract to change from draft to pending again and creating a new submission record.

[0053] When a business entity is in the `vp_approved` state, the withdrawal verification is still performed according to the submitter's identity of the most recent commit. If successful, it is converted from `vp_approved` to `draft`. When the general manager disapproves a `vp_approved` business entity, `ACTION_FINAL_REJECT` is executed, converting it to `rejected`, instead of executing `ACTION_WITHDRAW` as the general manager. This distinction ensures that withdrawal permissions always match the submitter of the most recent commit, while preserving... Figure 1 The final rejection branch is shown.

[0054] Example 4: Accessing New Service Types

[0055] When adding purchase order functionality, you can add `purchase_order` to the BizType allowed value set of the approval record, add the mapping between `purchase_order` and the purchase order entity query branch in the branch routing expression of `FindBizEntityWithStatus`, and have this branch call `WrapAsync`. <purpurchaseorder>Query the purchase order entity. The purchase order entity has common attributes such as Id, IsDeleted, Status, and UpdateTime, and the purchase order number is obtained by the sequence of candidate business number attribute names.

[0056] After completing the above route registration, the controller continues to reuse the unified approval service's submission, review, final approval, rejection, and withdrawal interfaces. State matching, role verification, two-level anti-self-approval, permission withdrawal, reflection-based state updates, and unified record writing all follow the processing described in Example 1, eliminating the need to create a separate state machine for `purchase_order`. This extension method maintains... Figure 2 The unified service and record structure remain unchanged, and the changes are limited to the correspondence between business types and entity query branches.

[0057] Example 5: Unified Approval System for Multiple Business Types

[0058] This embodiment provides a unified approval system for multiple business types, including a request receiving module, a business routing module, a status processing module, a record verification module, and a record writing module.

[0059] like Figure 2 As shown, the request receiving module 100 obtains the bizType, bizId, action, operatorId, and remark, and passes these request parameters to subsequent modules. The business routing module 200 maintains the correspondence between business types and entity query branches, and calls a general query method to dynamically access the Id and IsDeleted in the multi-business entity set 600 to return the target business entities that have not been deleted and their current status.

[0060] The status processing module 300 reads the Status via reflection, retrieves the source status, target status, and required role based on the action, and completes status matching and role permission verification. After successful verification, this module writes the Status and UpdateTime via reflection. The record verification module 400 selects the Submit or Approval action as the preceding action only when the action is an Approval, Final Approval, or Withdrawal action. It filters the corresponding Action within the same BizType and BizId range in the unified approval record table 700, retrieves the latest preceding record in descending order of CreateTime, and then... Figure 3 The method shown compares OperatorId to perform two levels of anti-self-audit or permission revocation verification.

[0061] The record writing module 500 calls GetBizNo to retrieve the business number and writes the approval record, including BizType, BizId, BizNo, Step, Action, OperatorId, Operator, Remark, and CreateTime, to the unified approval record table 700. These modules can be uniformly scheduled by SysApproveService; the request receiving module 100 can be set in SysApproveController; the business routing module 200 and the status processing module 300 are connected to the multi-business entity set 600; and the record verification module 400 and the record writing module 500 are connected to the unified approval record table 700. All modules work collaboratively in the order of S101 to S108 of Embodiment 1.

[0062] Example 6: Electronic Equipment

[0063] This embodiment provides an electronic device, including a processor and a memory. The memory stores a computer program. When the processor reads and executes the computer program, it receives an approval request, performs entity routing and non-deleted entity query based on business type, performs status reading, action and permission verification, previous record query and operator comparison, and completes reflection status update and approval record writing after the verification is passed, thereby executing the unified approval method for multiple business types described in Embodiments 1 to 4.

[0064] Example 7: Computer-readable storage medium

[0065] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the processor performs steps S101 to S108, and is able to perform corresponding processing in contract approval, resubmission after withdrawal, and access to new business types, thereby realizing the unified approval method for multiple business types of the present invention.< / purpurchaseorder> < / t>

Claims

1. A unified approval method for multiple business types, characterized in that, include: Receive approval requests that include a business type identifier, business identifier, action type, operator identifier, and approval comments; Based on the business type identifier, a target entity set is selected from multiple entity sets storing entities of different business types. The target business entities that have not been deleted are then queried from the target entity set based on the business identifier. The current state of the target business entity is read via reflection. The source and target states are determined based on the action type. The role permissions corresponding to the operator identifier and the matching relationship between the current state and the source state are verified. When the action type is an approval action, final approval action, or withdrawal action, the preceding action type is determined based on the action type. Preceding records matching the business type identifier, the business identifier, and the preceding action type are filtered from the unified approval record table. The preceding records are sorted in descending order of operation time, and the first preceding record is selected as the latest preceding record. The preceding operator identifier in the latest preceding record is compared with the operator identifier to perform anti-self-audit verification or withdrawal permission verification. After all verifications pass, the current state of the target business entity is updated to the target state via reflection, and the approval record corresponding to this approval operation is written to the unified approval record table.

2. The unified approval method for multiple business types according to claim 1, characterized in that, The current state and the target state are selected from the draft state, pending review state, approved and awaiting final approval state, approved state, and rejected state. The action types include submit action, approved action, rejected action, final approval action, final rejection action, and withdraw action. The submit action changes the draft state to the pending review state; the approved action changes the pending review state to the approved and awaiting final approval state; the rejected action changes the pending review state to the rejected state; the final approval action changes the approved and awaiting final approval state to the approved state; the final rejection action changes the approved and awaiting final approval state to the rejected state; and the withdraw action changes the pending review state or the approved and awaiting final approval state back to the draft state. The approved and rejected actions require the operator identifier to correspond to a first approval role, and the final approval and final rejection actions require the operator identifier to correspond to a second approval role.

3. The unified approval method for multiple business types according to claim 1, characterized in that, The business type identifier includes at least two of the following: contract business identifier, engineering business identifier, output value business identifier, invoice business identifier, collection business identifier, payment business identifier, settlement business identifier, change business identifier, and claim business identifier.

4. The unified approval method for multiple business types according to claim 1, characterized in that, Selecting the target entity set from the plurality of entity sets includes: inputting the business type identifier into a preset branch routing expression, which calls the entity query branch corresponding to the business type identifier and returns the target business entity and its current status in a unified return structure including an entity object field and a status field; the entity query branch calls a general query method with the entity type as a parameter, which reads the entity identifier attribute and deletion flag attribute shared by each business entity in the plurality of entity sets through dynamic attribute access, and filters the undeleted target business entities according to the business identifier and the deletion flag attribute.

5. The unified approval method for multiple business types according to claim 1, characterized in that, Updating the current state of the target business entity to the target state via reflection includes: obtaining the state attribute and update time attribute of the target business entity via reflection, writing the target state into the state attribute, and writing the operation time of this approval operation into the update time attribute.

6. The unified approval method for multiple business types according to claim 1, characterized in that, Before writing the approval record, the business number attribute of the target business entity is searched sequentially according to the preset candidate business number attribute name sequence by reflection, and the found business number is written into the approval record.

7. The unified approval method for multiple business types according to claim 1, characterized in that, When the action type is the approved action, the submission action is determined as the preceding action type, and the approved action is rejected if the preceding operator identifier in the latest preceding record is the same as the operator identifier; when the action type is the final approval action, the approved action is determined as the preceding action type, and the final approval action is rejected if the preceding operator identifier in the latest preceding record is the same as the operator identifier.

8. The unified approval method for multiple business types according to claim 1, characterized in that, When the action type is the withdrawal action, the submission action is determined as the preceding action type, the preceding operator in the latest preceding record is determined as the submitter of the most recent submission action, and the withdrawal action is rejected if the preceding operator identifier is different from the operator identifier.

9. The unified approval method for multiple business types according to claim 1, characterized in that, The approval records include business type identifier, business identifier, business number, approval steps, action type, operator identifier, operator name, approval opinion, and operation time. The approval records corresponding to the same business type identifier and business identifier are queried in ascending order of operation time to generate the approval trajectory of the target business entity.

10. The unified approval method for multiple business types according to claim 4, characterized in that, When a new business type is added, the correspondence between the business type identifier of the new business type and the entity query branch is added to the branch routing expression, and the status verification, anti-self-review verification, permission withdrawal verification, reflection status update and approval record writing processing performed for the approval request are reused.

Citation Information

Patent Citations

  • Flow implementation method and system based on rule engine

    CN112990850A