Method and system for obtaining organizational structure of application program
By utilizing the automated configuration method of the main table and subtable of the organization structure, the inefficiency problem of group companies manually configure the organizational structure of the subsidiary office system is solved, and the organizational structure of the sub-application is automatically configured, which improves work efficiency.
Patent Information
- Application Number
- CN202411061148.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2044-08-05
AI Technical Summary
In the prior art, when configuring the organizational structure of the office systems of each subsidiary, companies that develop in a group need to manually configure, which is time-consuming and labor-intensive and have low work efficiency.
Through an application organizational structure acquisition method, the organizational structure of the sub-application is automatically configured using the organizational structure main table and organizational structure sub-table. The specific steps include obtaining the node identity and organization name of the target node from the organization structure main table, saving it to the organization structure subtable, and sending the target node information in JSON format to the sub-application through the interface.
It realizes the automated configuration of the organizational structure of the sub-application, and can quickly complete the organizational structure configuration of different sub-applications, improving work efficiency.
Smart Images

Figure CN119065704B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and a system for obtaining the organizational structure of an application program. Background Art
[0002] In the environment where modern economy tends to develop intensively, groups and large-scale enterprises combine relatively independent business entities through advanced management and control, optimize the allocation of resources, complement each other's advantages, form large-scale operations, enhance the intensive competitive advantage, so as to resist market risks and greatly enhance the profitability. For companies with group development, there are both departments and subsidiaries in the organizational structure. Each subsidiary has its own relatively independent management methods and characteristics, and at the same time is under the unified management and monitoring of the head office. Each subsidiary can have its own office system, but the organizational structure in each office system needs to be expanded based on the unified organizational structure of the group. Generally, the organizational structure in the office system of each subsidiary needs to be manually configured, and the existing organizational structure of the group also needs to be manually configured separately, which is time-consuming and laborious, and the work efficiency is relatively low. Summary of the Invention
[0003] In order to solve the above problems existing in the prior art, the present invention provides a method and a system for obtaining the organizational structure of an application program. The technical problems to be solved by the present invention are realized through the following technical solutions:
[0004] In the first aspect of the embodiments of the present invention, a method for obtaining the organizational structure of an application program is provided, including the following steps:
[0005] In response to a configuration instruction for a target node of a sub-application program generated in a first organizational structure configuration area, obtain the node identifier and organizational name of the target node from the main organizational structure table, and display the organizational name and hierarchical relationship of the target node in a second organizational structure configuration area; wherein, the fields in the main organizational structure table include: node identifier and organizational name; the hierarchical relationship is generated according to the node identifier;
[0006] In response to a save operation instruction generated in the second organizational structure configuration area, generate node data, and save the node data to the sub-organizational structure table; wherein, the node data includes: the current node identifier of the target node and the identifier of the sub-application program in the configuration instruction;
[0007] In response to a call instruction for an organizational structure call interface sent by a sub-application program according to an interface address indicating the identifier of the sub-application program, obtain information about the target node from the sub-organizational structure table and the main organizational structure table according to the identifier of the sub-application program;
[0008] Convert the information of the target node into JSON format;
[0009] Send the information of the target node in JSON format to the sub-application.
[0010] In an embodiment of the present invention, the generating node data in response to the save operation instruction generated by the second organizational structure configuration area and saving the node data to the organizational structure sub-table includes:
[0011] Generate node data in response to the save operation instruction generated by the second organizational structure configuration area;
[0012] Convert the node data into node JSON data in JSON format;
[0013] Pass the node JSON data into the service module in the form of an object;
[0014] The service module obtains the string of the identifier of the sub-application of the object and the set of the current node identifier arrays of the target node;
[0015] The service module processes the string of the identifier of the sub-application and the set of the current node identifier arrays of the target node into two-dimensional structure data matching the organizational structure sub-table by means of a for loop;
[0016] The service module passes the two-dimensional structure data to the organizational structure sub-table for saving through the saveBatch method.
[0017] In an embodiment of the present invention, the obtaining the information of the target node from the organizational structure sub-table and the organizational structure main table in response to the call instruction of the organizational structure call interface sent by the sub-application according to the interface address indicating the identifier of the sub-application includes:
[0018] In response to the call instruction of the organizational structure call interface sent by the sub-application indicated by the identifier of the sub-application, obtain the current node identifier of the target node from the organizational structure sub-table;
[0019] Obtain the information of the corresponding target node from the organizational structure main table according to the current node identifier of the target node.
[0020] In an embodiment of the present invention, the method further includes:
[0021] In response to the information modification instruction of the organizational structure main table, obtain the node information of the modified node indicated by the information modification instruction from the organizational structure main table;
[0022] Determine the identifier of the corresponding modified sub-application from the organizational structure sub-table according to the node identifier in the node information of the modified node;
[0023] Convert the node information of the modified node into JSON format;
[0024] Send the node information of the JSON-format modified node to the modified sub-application according to the identifier of the modified sub-application.
[0025] The second aspect of the embodiments of the present invention provides a system for obtaining the organizational structure of an application program, including:
[0026] An acquisition display module, configured to, in response to a configuration instruction for a target node of a sub-application generated in a first organizational structure configuration area, obtain the node identifier and organizational name of the target node from the organizational structure main table, and display the organizational name and hierarchical relationship of the target node in a second organizational structure configuration area; wherein, the fields in the organizational structure main table include: node identifier and organizational name; the hierarchical relationship is generated according to the node identifier;
[0027] A saving module, configured to, in response to a saving operation instruction generated in the second organizational structure configuration area, generate node data and save the node data to the organizational structure sub-table; wherein, the node data includes: the current node identifier of the target node and the identifier of the sub-application in the configuration instruction;
[0028] An acquisition module, configured to, in response to a call instruction for an organizational structure call interface sent by a sub-application according to an interface address indicating the identifier of the sub-application, obtain the information of the target node from the organizational structure sub-table and the organizational structure main table according to the identifier of the sub-application;
[0029] A data conversion module, configured to convert the information of the target node into JSON format;
[0030] A sending module, configured to send the information of the target node in JSON format to the sub-application.
[0031] In an embodiment of the present invention, the saving module includes a generating module and a service module;
[0032] The generating module is configured to, in response to a saving operation instruction generated in the second organizational structure configuration area, generate node data; convert the node data into JSON-format node JSON data; and pass the node JSON data into the service module in the form of an object;
[0033] The service module is used to obtain the string of the identifier of the sub-application of the object and the set of current node identifiers of the target node; process the string of the identifier of the sub-application and the set of current node identifiers of the target node into two-dimensional structure data matching the organizational structure sub-table in a for loop manner; and pass the two-dimensional structure data to the organizational structure sub-table for saving through the saveBatch method.
[0034] In an embodiment of the present invention, the obtaining module is further configured to, in response to a call instruction of an organizational structure call interface sent by a sub-application indicated by the identifier of the sub-application, obtain the current node identifier of the target node from the organizational structure sub-table according to the identifier of the sub-application; and obtain information of the corresponding target node from the organizational structure main table according to the current node identifier of the target node.
[0035] In an embodiment of the present invention, it further includes an update module, which is configured to, in response to an information modification instruction of the organizational structure main table, obtain the node information of the modified node indicated by the information modification instruction from the organizational structure main table; determine the identifier of the corresponding modified sub-application from the organizational structure sub-table according to the node identifier in the node information of the modified node; convert the node information of the modified node into JSON format; and send the node information of the modified node in JSON format to the modified sub-application according to the identifier of the modified sub-application.
[0036] A third aspect of the embodiments of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements a method for obtaining the organizational structure of an application program provided in the first aspect of the embodiments of the present invention.
[0037] A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements a method for obtaining the organizational structure of an application program provided in the first aspect of the embodiments of the present invention.
[0038] The beneficial effects of the present invention:
[0039] The present invention obtains the node identifiers of the organizational structure of a sub-application from the main organizational structure table with complete organizational structure information, and saves the node identifiers and the identifier of the sub-application to the sub-organizational structure table. When the sub-application needs to configure its own organizational structure, the sub-application calls an interface to obtain the information of the target node in JSON format. After that, the sub-application parses the JSON data to obtain the node information and hierarchical relationship of the corresponding organizational structure, and completes the configuration of the organizational structure of the sub-application. The present invention realizes the automatic configuration of the organizational structure of the sub-application, can automatically and quickly complete the configuration of different organizational structures of different sub-applications, and improves work efficiency.
[0040] Other features and advantages of the present invention will be described in the following specification, and some of them will become obvious from the specification or be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained by the structures specifically pointed out in the written specification, claims, and drawings.
[0041] The technical solutions of the present invention will be further described in detail below through the drawings and embodiments. Description of the Drawings
[0042] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention, and do not constitute a limitation to the present invention. In the drawings:
[0043] Figure 1 It is a schematic flowchart of a method for obtaining the organizational structure of an application program provided by an embodiment of the present invention;
[0044] Figure 2 It is a schematic diagram of the first organizational structure configuration area and the second organizational structure configuration area provided by an embodiment of the present invention;
[0045] Figure 3 It is a block diagram of a system for obtaining the organizational structure of an application program provided by an embodiment of the present invention. Detailed Embodiments
[0046] The present invention will be further described in detail below in combination with specific embodiments, but the embodiments of the present invention are not limited thereto.
[0047] As Figure 1 shown, a first aspect of an embodiment of the present invention provides a method for obtaining the organizational structure of an application program, including the following steps:
[0048] Step 11: In response to the configuration instruction of the target node of the sub-application generated in the first organizational structure configuration area, obtain the node identifier and organizational name of the target node from the main organizational structure table, and display the organizational name and hierarchical relationship of the target node in the second organizational structure configuration area.
[0049] Among them, the fields in the main organizational structure table include: node identifier and organizational name. The hierarchical relationship is generated based on the node identifier.
[0050] Step 12: In response to the save operation instruction generated in the second organizational structure configuration area, save the node data to the sub-organizational structure table.
[0051] Among them, the node data includes: the current node identifier of the target node and the identifier of the sub-application in the configuration instruction.
[0052] Step 13: In response to the call instruction of the organizational structure call interface sent by the sub-application according to the interface address indicating the identifier of the sub-application, obtain the information of the target node from the sub-organizational structure table and the main organizational structure table according to the identifier of the sub-application.
[0053] Step 14: Convert the information of the target node into JSON format.
[0054] Step 15: Send the information of the target node in JSON format to the sub-application.
[0055] In this embodiment, by obtaining the node identifier of the organizational structure of the sub-application from the main organizational structure table with complete organizational structure information, and saving the node identifier and the identifier of the sub-application to the sub-organizational structure table, when the sub-application needs to configure its own organizational structure, the sub-application calls the interface to obtain the information of the target node in JSON format. Then, the sub-application can parse the JSON data to obtain the corresponding node information and hierarchical relationship of the organizational structure, completing the configuration of the organizational structure of the sub-application. The present invention realizes the automatic configuration of the organizational structure of the sub-application, can automatically and quickly complete the different organizational structure configurations of different sub-applications, and improves work efficiency.
[0056] The second aspect of the embodiment of the present invention provides a method for obtaining the organizational structure of an application program, including the following steps:
[0057] Step 21: When the user performs a configuration operation on the first organizational structure configuration area of the main system, the first organizational structure configuration area generates a configuration instruction.
[0058] In this embodiment, the main system may be the main management system of a group. The first organizational structure configuration area and the second organizational structure configuration area are within the main system. The configuration of the organizational structure for various systems or applications (i.e., sub-applications) used by the subsidiaries of the group is carried out in the main system. The sub-applications may be various management software of the subsidiaries, such as OA management system, attendance management system, financial management system, etc.
[0059] Specifically, the first organizational structure configuration area is an editing interface, in which the organizational names and hierarchies of all the organizational structures of the group are displayed. The detailed information of the organizational structure is managed in tabular form, and the superior-subordinate relationship is managed through the parent node identifier and the current node identifier, forming a tree structure. As shown in the main example of the organizational structure table in Table 1, the first organizational structure configuration area is associated with the main organizational structure table.
[0060]
[0061] Table 1
[0062] The user can perform configuration operations of sub-application selection and node selection in the first organizational structure configuration area. To configure the organizational structure of a certain sub-application, select the corresponding sub-application, and then select the target node and drag it to the second organizational structure configuration area for display. The main organizational structure table may also include other auxiliary information fields, such as the corresponding organizational number, organizational type, etc.
[0063] Step 22: In response to the configuration instruction of the target node of the sub-application generated in the first organizational structure configuration area, the main system obtains the node identifier of the target node from the main organizational structure table and displays the organizational name and hierarchical relationship of the target node in the second organizational structure configuration area. The hierarchical relationship is generated based on the node identifier.
[0064] Among them, the fields in the main organizational structure table include: node identifier and organizational name. The node identifier includes the current node identifier and its corresponding parent node identifier, as shown in Table 1. The configuration instruction includes the identifier of the sub-application.
[0065] Step 23: In response to the save operation instruction generated in the second organizational structure configuration area, the main system generates node data and saves the node data to the sub-organizational structure table.
[0066] Among them, the node data includes: the current node identifier of the target node and the identifier of the sub-application in the configuration instruction.
[0067] The user can select a certain node (a unit at a certain level in the organizational structure) from the first organizational structure configuration area, expand it to the second organizational structure configuration area, and can also adjust the hierarchical relationship between each node by dragging the nodes in the second organizational structure configuration area, such asFigure 2 As shown. Generate the current node identifier of the target node according to the current hierarchical relationship of the second organizational structure configuration area. This node identifier will not change, but if the hierarchical relationship is adjusted, the identifier of the parent node corresponding to this node will change. The second organizational structure configuration area is associated with the organizational structure sub-table.
[0068] Specifically, step 23 includes steps 231 - 236:
[0069] Step 231, the main system generates node data in response to the save operation instruction generated by the second organizational structure configuration area.
[0070] Before generating the save operation instruction, the hierarchical relationship of the nodes displayed in the second organizational structure configuration area can be adjusted or not. If adjusted, the identifier of the parent node of the target node is updated. When saving, use the current node identifier data and the identifier of the sub-application in the configuration instruction as the node data.
[0071] Step 232, the main system converts the node data into JSON format node JSON data.
[0072] Step 233, the main system passes the node JSON data into the service module of the main system in the form of an object.
[0073] Step 234, the service module obtains the string of the identifier of the sub-application of the object and the set of arrays of the current node identifiers of the target node.
[0074] Step 235, the service module processes the string of the identifier of the sub-application and the set of arrays of the current node identifiers of the target node into two-dimensional structure data that matches the organizational structure sub-table through a for loop.
[0075] Step 236, the service module passes the two-dimensional structure data to the organizational structure sub-table for saving through the saveBatch method.
[0076] In this embodiment, the node data is saved to the organizational structure sub-table. The fields of the organizational structure sub-table include the identifier of the sub-application (sub-application ID) and the current node identifier. The current node identifier includes the identifier of this node (this node ID) and the identifier of the current parent node (current parent node ID). An example of the organizational structure sub-table is shown in Table 2.
[0077]
[0078] For example, the code of the service module for steps 233 - 236 is as follows:
[0079] / ** Save data * The parameter params is a JSON object of node data * / @SyncAnnotation(action =ActionType. allSync ,algorithmName = "appOrgMsgAlgorithm")@RequestMapping(" / saveEdit") / ** saveEdit is node data * / @ResponseBodypublic ResultMgt saveEdit(@RequestBody JSONObject params){ResultMgt mgt=new ResultMgt("200","保存成功");try{List <apporg>appOrgs=new ArrayList<>();String appid=params.getString("appid"); / ** appid is the identifier of the sub - application * / JSONArray array=params.getJSONArray("orgs"); / ** orgs is the current identifier of the target node * / for(int i=0;i <array.size();i++){JSONObject row=array.getJSONObject(i);AppOrg appOrg=new AppOrg();appOrg.setId(String. valueOf (UUIDLong. longUUID ()));appOrg.setApp(new App(appid)); / ** Sub - application ID * / appOrg.setOrganization(new Organization(row.getString("sid"))); / ** This node ID * / appOrg.setPid(row.getString("pid")); / ** Current parent node ID * / appOrg.setSeq(i); / ** Sequence number * / / ** The sequence number of the data * / appOrgs.add(appOrg);}appOrgService.saveBatch(appid,appOrgs); / ** Batch save * / }catch(Exception ex){mgt=new ResultMgt("201","Save failed");}finally {return mgt;}}
[0080] In this embodiment, the data in the organizational structure subtable only includes the identifier of the sub-application and the current identifier of the target node. The table can quickly integrate the data of the organizational structure of each sub-application for subsequent processing. The organizational structure subtable can more concisely and clearly obtain the main core data of the organizational structure that needs to be configured for the sub-application, and can also quickly obtain the main core data of the organizational structure that needs to be configured for the sub-application during subsequent processing.
[0081] Step 24: The sub-application sends a call instruction for the organizational structure to call the interface to the main application according to the interface address. The interface address indicates the identifier of the sub-application.
[0082] Step 25: In response to the call instruction of the organizational structure call interface sent by the sub-application, the main system obtains the information of the target node from the organizational structure sub-table and the organizational structure main table according to the identifier of the sub-application.
[0083] The specific steps of Step 25 include: Steps 251 - 252:
[0084] Step 251: In response to the call instruction of the organizational structure call interface sent by the sub-application indicated by the identifier of the sub-application, obtain the current node identifier of the target node from the organizational structure sub-table. The information of the main organizational structure of the sub-application can be quickly obtained from the organizational structure sub-table.
[0085] Step 252: Obtain the information of the corresponding target node from the organizational structure main table according to the current node identifier of the target node. Obtain the corresponding current node identifier that the sub-application needs to configure from the organizational structure sub-table, and then obtain the corresponding other information of this identifier in the organizational structure main table according to this identifier.
[0086] Step 25: Convert the information of the target node into JSON format.
[0087] Exemplarily, the parameters of the information of the target node in JSON format are shown in Table 3:
[0088]
[0089] Table 3
[0090] When the organizational structure main table also includes other auxiliary information of the organization, the parameters of the information of the target node in JSON format can also include examples as shown in Table 4:
[0091]
[0092] Table 4
[0093] Step 26: Send the information of the target node in JSON format to the sub-application.
[0094] In a feasible implementation manner, it can be that the sub-application sends an access request to the interface of the main system. After the identity and permission authentication are passed, the main system sends the information of the target node in JSON format to the sub-application.
[0095] In this embodiment, the main system searches for the node data about the sub-application from the organizational structure sub-table, then searches for the complete information of this node information in the complete organizational structure main table according to this node data, converts the information found in the two tables into a JSON string and packages it, and sends it to the sub-application.
[0096] Step 27: The sub-application receives the information of the target node in JSON format, parses it accordingly, obtains the node information and the hierarchical relationship, and completes the configuration of the organizational structure locally.
[0097] The above steps in this embodiment are applicable to the initial configuration process of the organizational structure of the sub-application.
[0098] The code example for the sub-application to parse data and complete the configuration of the organizational structure is as follows:
[0099] / ** Load the application organizational structure tree of a certain application * /
[0100] @RequestMapping(" / loadAppOrgTree / {appid}")
[0101] @ResponseBody
[0102] public List <jsonobject>loadAppOrgTree(@PathVariable(name="appid")String appid){
[0103] List <jsonobject>result = new ArrayList<>();
[0104] try {
[0105] List <apporg>appOrgs=appOrgService.findAppOrgs(appid);
[0106] if(appOrgs!=null&&appOrgs.size()>0){
[0107] for(AppOrg appOrg:appOrgs){
[0108] JSONObject row=new JSONObject();
[0109] row.put("id",appOrg.getOrganization().getId());
[0110] row.put("pId",appOrg.getPid()==null?"0":appOrg.getPid());
[0111] row.put("name",appOrg.getOrganization().getName()+("0".equals(appOrg.getOrganization().getStatus())?"":"(停用)"));
[0112] result.add(row);
[0113] }
[0114] }
[0115] }catch(Exception ex){
[0116] LOGGER.info("loadAppOrgTree加载树形结构出错:"+ex.getMessage());
[0117] }finally {
[0118] return result;
[0119] }
[0120] }
[0121] The present invention obtains the node identifiers of the organizational structure of a sub-application from the main organizational structure table with complete organizational structure information, and saves the node identifiers and the identifier of the sub-application to the sub-organizational structure table. When the sub-application needs to configure its own organizational structure, the sub-application calls an interface to obtain the information of the target node in JSON format. Then, the sub-application parses the JSON data to obtain the node information and hierarchical relationship of the corresponding organizational structure, thus completing the configuration of the organizational structure of the sub-application. The present invention realizes the automatic configuration of the organizational structure of the sub-application in the main system, can automatically and quickly complete the configuration of different organizational structures of different sub-applications, and improves work efficiency.
[0122] In one embodiment, when the information of the organizational structure of the main system is updated, for example, some information of the organizational structure is modified, such as the organization name or hierarchical relationship, the node identifier is generally not allowed to be modified. The process of updating the information of the organizational structure of the main system and the sub-application after the modification includes the following steps:
[0123] Step 31, the main system responds to the information modification instruction of the main organizational structure table, and obtains the node information of the modified node indicated by the information modification instruction from the main organizational structure table.
[0124] In this step, when it is necessary to modify the organization name and hierarchical relationship of the organizational structure in the main system, the user operates and modifies on the modification page of the main organizational structure table. After the modification, an information modification instruction is generated. The main system obtains the own node identifier and / or the current parent node identifier of the modified node indicated by the information modification instruction from the main organizational structure table (when the hierarchical relationship is modified, the current parent node identifier needs to be obtained, and when the hierarchical relationship is not modified, the current parent node identifier does not need to be obtained).
[0125] Step 32, the main system determines the identifier of the corresponding modified sub-application from the sub-organizational structure table according to the node identifier in the node information of the modified node. Specifically, according to the own node identifier, the identifier of the sub-application corresponding to the modified node is found in the sub-organizational structure table. The modified node may correspond to the identifier of one or more sub-applications. By searching in the sub-organizational structure table, it can be quickly determined which sub-applications of the organizational structure node need to be modified.
[0126] Step 33, the main system converts the node information of the modified node into JSON format.
[0127] Step 34, the main system sends the node information of the modified node in JSON format to the modified sub-application according to the identifier of the modified sub-application.
[0128] Step 35: The sub-application receives the node information of the modified node in JSON format, parses it accordingly to obtain the node information and hierarchical relationship, and completes the modification of the organizational structure information locally.
[0129] In this embodiment, when the information of the organizational structure needs to be modified, there is no need to modify each sub-application with the modified node one by one. After modification in the main system, it can be sent to the corresponding sub-application.
[0130] As Figure 3 shown, the third aspect of the embodiment of the present invention provides an acquisition system for the organizational structure of an application program, including:
[0131] An acquisition and display module 41, configured to, in response to a configuration instruction for a target node of a sub-application generated in a first organizational structure configuration area, obtain the node identifier and organization name of the target node from the main organizational structure table, and display the organization name and hierarchical relationship of the target node in a second organizational structure configuration area; wherein, the fields in the main organizational structure table include: node identifier and organization name; the hierarchical relationship is generated according to the node identifier;
[0132] A saving module 42, configured to, in response to a saving operation instruction generated in a second organizational structure configuration area, generate node data, and save the node data to the sub-organizational structure table; wherein, the node data includes: the current node identifier of the target node and the identifier of the sub-application in the configuration instruction;
[0133] An acquisition module 43, configured to, in response to a call instruction for an organizational structure call interface sent by a sub-application according to an interface address indicating the identifier of the sub-application, obtain the information of the target node from the sub-organizational structure table and the main organizational structure table according to the identifier of the sub-application;
[0134] A data conversion module 44, configured to convert the information of the target node into JSON format;
[0135] A sending module 45, configured to send the information of the target node in JSON format to the sub-application.
[0136] In an embodiment of the present invention, the saving module includes a generating module and a service module;
[0137] The generating module is configured to, in response to a saving operation instruction generated in a second organizational structure configuration area, generate node data; convert the node data into JSON format node JSON data; and pass the node JSON data into the service module in the form of an object;
[0138] A service module, configured to obtain a string of the identifier of a sub-application of an object and a set of current identifier arrays of target nodes; process the string of the identifier of the sub-application and the set of current identifier arrays of the target nodes into two-dimensional structure data matching an organizational structure sub-table in a for-loop manner; and pass the two-dimensional structure data to the organizational structure sub-table for saving through the saveBatch method.
[0139] In an embodiment of the present invention, the obtaining module is further configured to, in response to a call instruction of an organizational structure call interface sent by a sub-application indicated by the identifier of the sub-application, obtain the current identifier of the target node from the organizational structure sub-table according to the identifier of the sub-application; and obtain information of the corresponding target node from the organizational structure main table according to the current identifier of the target node.
[0140] In an embodiment of the present invention, an obtaining system for the organizational structure of an application further includes an updating module, configured to, in response to an information modification instruction of the organizational structure main table, obtain node information of a modified node indicated by the information modification instruction from the organizational structure main table; determine the identifier of the corresponding modified sub-application from the organizational structure sub-table according to the node identifier in the node information of the modified node; convert the node information of the modified node into JSON format; and send the node information of the modified node in JSON format to the modified sub-application according to the identifier of the modified sub-application.
[0141] A fourth aspect of the embodiments of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the program, it implements an obtaining method for the organizational structure of an application provided in the above embodiments of the present invention.
[0142] A fifth aspect of the embodiments of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of an obtaining method for the organizational structure of an application provided in the above embodiments of the present invention.
[0143] Among them, the memory may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0144] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware systems.
[0145] The method provided by the embodiments of the present invention can be applied to an electronic device. Specifically, the electronic device may be: a desktop computer, a portable computer, a smart mobile terminal, a server, etc. There is no limitation here. Any electronic device that can implement the present invention belongs to the protection scope of the present invention.
[0146] For the device / electronic device embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, please refer to the partial description of the method embodiments.
[0147] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the processes and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0148] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions for implementing the steps specified in one process or a plurality of processes and / or boxes Figure 1 one process or a plurality of processes and / or boxes Figure 1 for implementing the functions specified in one box or a plurality of boxes.
[0150] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.< / apporg> < / jsonobject> < / jsonobject> < / apporg>
Claims
1. A method for obtaining an organizational structure of an application, characterized in that: The following steps are involved: In response to the configuration instruction of the target node of the sub-application generated in the first organizational structure configuration area, the node identifier and the organization name of the target node are obtained from the organizational structure main table, and the organization name and the hierarchical relationship of the target node are displayed in the second organizational structure configuration area; wherein the fields in the organizational structure main table include: node identifier and organization name; the hierarchical relationship is generated according to the node identifier; In response to the save operation instruction generated by the second organizational structure configuration area, node data is generated and saved into the organizational structure sub-table; wherein the node data includes: the current node identifier of the target node and the identifier of the sub-application in the configuration instruction; In response to a call instruction of an organizational structure call interface sent by a sub-application according to an interface address indicating an identifier of the sub-application, obtaining information of the target node from the organizational structure sub-table and the organizational structure main table according to the identifier of the sub-application; Convert the target node information into JSON format; Send the target node information in JSON format to the sub-application, the sub-application receives the target node information in JSON format, parses it, obtains the node information and hierarchical relationship, and completes the configuration of the organizational structure locally; The method further comprises: In response to an information modification instruction of the organizational structure master table, acquiring node information of a modification node indicated by the information modification instruction from the organizational structure master table; Determine the identifier of the corresponding modification sub-application from the organizational structure sub-table according to the node identifier in the node information of the modification node; Convert the node information of the modified node into JSON format; According to the identifier of the modification sub-application, the node information of the modification node in JSON format is sent to the modification sub-application. The sub-application receives the node information of the modification node in JSON format and performs corresponding parsing to obtain the node information and hierarchical relationship, and completes the information modification of the organizational structure locally.
2. The method according to claim 1, characterized in that The generating node data in response to the save operation instruction generated by the second organizational structure configuration area and saving the node data to the organizational structure sub-table includes: In response to the save operation instruction generated by the second organizational structure configuration area, generate node data; Convert the node data into JSON format node JSON data; Pass the node JSON data into the service module in the form of an object; The service module obtains the character string of the identification of the sub-application of the object and the node current identification array set of the target node; The service module processes the character string of the sub-application's identifier and the node current identifier array set of the target node into two-dimensional structure data matching the organizational structure sub-table by means of a for loop; The service module transfers the two-dimensional structure data to the organizational structure subtable for storage through the saveBatch method.
3. The method according to claim 1, characterized in that The step of responding to a call instruction of an organizational structure call interface sent by a sub-application according to an interface address indicating an identifier of the sub-application, acquiring information of the target node from the organizational structure sub-table and the organizational structure main table according to the identifier of the sub-application includes: In response to a call instruction of an organizational structure call interface sent by a sub-application indicated by the identifier of the sub-application, obtaining a node current identifier of the target node from the organizational structure sub-table according to the identifier of the sub-application; The information of the corresponding target node is obtained from the organizational structure main table according to the current node identifier of the target node.
4. A system for obtaining the organizational structure of an application, characterized in that: include: An acquisition and display module is used to respond to the configuration instruction of the target node of the sub-application generated in the first organizational structure configuration area, acquire the node identifier and organization name of the target node from the organizational structure main table, and display the organization name and hierarchical relationship of the target node in the second organizational structure configuration area; wherein the fields in the organizational structure main table include: node identifier and organization name; the hierarchical relationship is generated according to the node identifier; A saving module, configured to generate node data in response to a saving operation instruction generated by the second organizational structure configuration area, and save the node data to an organizational structure subtable; wherein the node data includes: a current node identifier of the target node and an identifier of the sub-application in the configuration instruction; an acquisition module, configured to respond to a call instruction of an organizational structure call interface sent by a sub-application according to an interface address indicating an identifier of the sub-application, and acquire information of the target node from the organizational structure sub-table and the organizational structure main table according to the identifier of the sub-application; A data conversion module, used to convert the information of the target node into JSON format; A sending module, used to send the target node information in JSON format to the sub-application, which receives the target node information in JSON format, parses it, obtains the node information and hierarchical relationship, and completes the configuration of the organizational structure locally; It also includes: an update module, which is used to respond to the information modification instruction of the organizational structure main table, obtain the node information of the modification node indicated by the information modification instruction from the organizational structure main table; determine the corresponding modification sub-application identifier from the organizational structure sub-table according to the node identifier in the node information of the modification node; convert the node information of the modification node into JSON format; send the node information of the modification node in JSON format to the modification sub-application according to the identifier of the modification sub-application, the sub-application receives the node information of the modification node in JSON format, and performs corresponding parsing to obtain the node information and hierarchical relationship, and completes the information modification of the organizational structure locally.
5. The system according to claim 4, characterized in that The storage module includes a generation module and a service module; The generating module is used to generate node data in response to the save operation instruction generated by the second organizational structure configuration area; Convert the node data into JSON format node JSON data; Pass the node JSON data into the service module in the form of an object; The service module is used to obtain the string of the identification of the sub-application of the object and the node current identification array set of the target node; The identification string of the sub-application and the node current identification array set of the target node are processed into two-dimensional structure data matching the organizational structure subtable through a for loop; the two-dimensional structure data is transferred to the organizational structure subtable for storage through the saveBatch method.
6. The system according to claim 4, characterized in that The acquisition module is also used to respond to a call instruction of the organizational structure call interface sent by a sub-application indicated by the identifier of the sub-application, and obtain the node current identifier of the target node from the organizational structure sub-table according to the identifier of the sub-application; and obtain the corresponding target node information from the organizational structure main table according to the node current identifier of the target node.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for obtaining the organizational structure of the application program as described in any one of claims 1 to 3 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for acquiring the organizational structure of the application program according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Organizational structure data processing method and device, computer equipment and storage medium
CN109656921A