CN114996272A - Method, electronic device and readable storage medium for generating organization structure tree - Google Patents

Method, electronic device and readable storage medium for generating organization structure tree Download PDF

Info

Publication number
CN114996272A
CN114996272A CN202210617475.XA CN202210617475A CN114996272A CN 114996272 A CN114996272 A CN 114996272A CN 202210617475 A CN202210617475 A CN 202210617475A CN 114996272 A CN114996272 A CN 114996272A
Authority
CN
China
Prior art keywords
department
employee
information
dictionary
changed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210617475.XA
Other languages
Chinese (zh)
Inventor
胡广
吴泽彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Minglue Zhaohui Technology Co Ltd
Original Assignee
Beijing Minglue Zhaohui Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Minglue Zhaohui Technology Co Ltd filed Critical Beijing Minglue Zhaohui Technology Co Ltd
Priority to CN202210617475.XA priority Critical patent/CN114996272A/en
Publication of CN114996272A publication Critical patent/CN114996272A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application relates to the technical field of information retrieval, and discloses a method for generating an organization structure tree, which comprises the following steps: responding to the instruction for generating the organization structure tree, and storing a second department or a third department corresponding to a preset number in the organization relation dictionary as a root node into the alternative structure tree; and performing child node determination operation on the nodes in the alternative structure tree until no value corresponding to the serial number of the department corresponding to the node of the last hierarchy in the alternative structure tree exists in the organization relation dictionary, and obtaining the organization structure tree. Thus, when generating the organization structure tree, the numbers of departments corresponding to the nodes in the alternative structure tree can be used as keys, and the corresponding values can be matched quickly in the organization relation dictionary. And storing the matched values as child nodes of the nodes in the alternative organization structure tree to the alternative organization structure tree. Thereby enabling faster generation of the organizational structure tree. The application also discloses an electronic device and a readable storage medium.

Description

Method, electronic device and readable storage medium for generating organization structure tree
Technical Field
The present application relates to the field of information retrieval technologies, and for example, to a method, an electronic device, and a readable storage medium for generating an organization structure tree.
Background
In order to enable employees to know an enterprise organization structure more intuitively, an organization structure tree of an enterprise needs to be acquired, and the existing method for generating the organization structure tree is to store information of department information departments corresponding to preset department numbers in a database as root nodes into an alternative organization structure tree. And traversing all department information in the database by utilizing the number of the department corresponding to the node in the alternative organization structure tree, and storing the department information of which the number is the number of the department corresponding to the node as a child node of the node in the alternative organization structure tree under the condition that the number of the department to which the department information exists in the database is the same as the number of the department corresponding to the node. Meanwhile, by using the numbers of the departments corresponding to the nodes in the alternative organization structure tree, all the employee information in the database needs to be traversed, and under the condition that the number of the department to which the employee belongs, in which the employee information exists, in the database is the same as the number of the department corresponding to the node, the employee information, in which the number of the department to which the employee belongs is the number of the department corresponding to the node, is stored in the alternative organization structure tree as the child node of the node in the alternative organization structure tree. And until all department information and employee information in the database are stored in the alternative structure tree, obtaining the organization structure tree of the enterprise.
In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art:
thus, each time a child node under a node is determined, the corresponding department information and/or employee information needs to be acquired by traversing the database. Thus, when the amount of data stored in the database is large, the longer the time required for recursive traversal is, the lower the efficiency of data acquisition is, and thus the organization structure tree cannot be generated quickly.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview nor is intended to identify key/critical elements or to delineate the scope of such embodiments but rather as a prelude to the more detailed description that is presented later.
The embodiment of the disclosure provides a method, an electronic device and a readable storage medium for generating an organization structure tree, so that the organization structure tree can be generated rapidly.
In some embodiments, the method for generating an organizational structure tree comprises: acquiring department information and employee information of an enterprise from a preset database; constructing an organization relation dictionary by utilizing the department information and the employee information of the enterprise; the organization relation dictionary comprises a first department relation dictionary and a first department employee relation dictionary; the first department relation dictionary comprises data stored by taking the number of a second department as a key and taking the set of department information of a first department corresponding to the second department as a value, and the first department employee relation dictionary comprises data stored by taking the number of a third department as a key and taking the set of employee information of employees corresponding to the third department as a value; responding to an instruction for generating an organization structure tree, and storing a second department or a third department corresponding to a preset number in the organization relation dictionary as a root node into an alternative structure tree; and performing child node determination operation on the nodes in the alternative structure tree until a value corresponding to the serial number of the department corresponding to the node of the last hierarchy in the alternative structure tree does not exist in the first department relation dictionary and the first department employee relation dictionary, and obtaining the organization structure tree.
In some embodiments, the electronic device comprises a processor and a memory storing program instructions, the processor being configured to perform the above-described method for generating an organizational structure tree when executing the program instructions.
In some embodiments, the readable storage medium stores executable instructions that, when executed, perform the above-described method for generating an organizational structure tree.
The method and the device for generating the organization structure tree, the electronic device and the readable storage medium provided by the embodiment of the disclosure can realize the following technical effects: the organization structure tree is constructed by utilizing a pre-constructed organization relation dictionary, and the organization relation dictionary comprises data which takes the number of the second department as a key, takes the set of the department information of the first department corresponding to the second department as a value and stores the data which takes the number of the third department as a key and takes the set of the employee information of the employee corresponding to the third department as a value. Thus, when generating the organization structure tree, the numbers of departments corresponding to the nodes in the alternative structure tree can be used as keys, and the corresponding values can be matched quickly in the organization relation dictionary. And storing the matched values as child nodes of the nodes in the alternative organization structure tree. Furthermore, department information and/or employee information corresponding to child nodes of the nodes in the alternative structure tree can be determined without traversing the database, so that the organization structure tree can be generated more quickly.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the accompanying drawings and not in limitation thereof, in which elements having the same reference numeral designations are shown as like elements and not in limitation thereof, and wherein:
FIG. 1 is a schematic diagram of a method for generating an organizational structure tree according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of another method for generating an organizational structure tree provided by an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of another method for generating an organizational structure tree provided by an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of another method for generating an organizational structure tree provided by an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of another method for generating an organizational structure tree provided by an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of another method for generating an organizational structure tree provided by an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of another method for generating an organizational structure tree provided by an embodiment of the present disclosure;
fig. 8 is a schematic diagram of an electronic device provided by an embodiment of the disclosure.
Detailed Description
So that the manner in which the features and elements of the disclosed embodiments can be understood in detail, a more particular description of the disclosed embodiments, briefly summarized above, may be had by reference to the embodiments, some of which are illustrated in the appended drawings. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown in simplified form in order to simplify the drawing.
The terms "first," "second," and the like in the description and claims of the embodiments of the disclosure and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the present disclosure described herein may be made. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion.
In the embodiment of the present disclosure, the character "/" indicates that the preceding and following objects are in an or relationship. For example, A/B represents: a or B.
The term "and/or" is an associative relationship that describes objects, meaning that three relationships may exist. For example, a and/or B, represents: a or B, or A and B.
The term "correspond" may refer to an association or binding relationship, and a corresponding to B refers to an association or binding relationship between a and B.
In order to enable employees to know an enterprise organization structure more intuitively, an organization structure tree of an enterprise needs to be acquired, and the existing method for generating the organization structure tree is to store information of department information departments corresponding to preset department numbers in a database as root nodes into an alternative organization structure tree. And traversing all department information in the database by utilizing the number of the department corresponding to the node in the alternative organization structure tree, and storing the department information of which the number is the number of the department corresponding to the node as a child node of the node in the alternative organization structure tree under the condition that the number of the department to which the department information exists in the database is the same as the number of the department corresponding to the node. Meanwhile, by using the numbers of the departments corresponding to the nodes in the alternative organization structure tree, all the employee information in the database needs to be traversed, and under the condition that the number of the department to which the employee belongs, in which the employee information exists, in the database is the same as the number of the department corresponding to the node, the employee information, in which the number of the department to which the employee belongs is the number of the department corresponding to the node, is stored in the alternative organization structure tree as the child node of the node in the alternative organization structure tree. Thus, each time a child node under a node is determined, the corresponding department information and/or employee information needs to be acquired by traversing the database. Thus, when the amount of data stored in the database is large, the longer the time required for recursive traversal is, the lower the efficiency of data acquisition is, and thus the organization structure tree cannot be generated quickly. According to the method, the organization relation structure tree is constructed by utilizing the first department relation dictionary and the first department employee relation dictionary in the organization relation dictionary, and the corresponding value is quickly matched in the organization relation dictionary by taking the number of the department corresponding to the node in the alternative structure tree as a key. And storing the matched values as child nodes of the nodes in the alternative organization structure tree. That is, all the department information and all the employee information belonging to the department can be quickly obtained, and all the department information and all the employee information belonging to the department can be stored in the alternative organization structure tree as child nodes of the corresponding node of the department. Therefore, the child nodes of the nodes in the alternative structure tree can be determined without traversing the database, so that the data acquisition efficiency is improved, and the organization structure tree can be generated more quickly.
In the embodiment of the present disclosure, the electronic device is a computer, a mobile phone, or a tablet computer. The organization relation dictionary comprises a first department relation dictionary and a first department employee relation dictionary; the first department relation dictionary comprises data stored by taking the number of a second department as a key and taking the set of department information of a first department corresponding to the second department as a value, and the first department employee relation dictionary comprises data stored by taking the number of a third department as a key and taking the set of employee information of employees corresponding to the third department as a value; the first department corresponding to the second department is a department affiliated to the second department; and the staff corresponding to the third department is the staff belonging to the third department.
As shown in fig. 1, an embodiment of the present disclosure provides a method for generating an organization structure tree, including:
and S101, the electronic equipment acquires department information and employee information of the enterprise from a preset database.
And S102, the electronic equipment utilizes the department information and the employee information of the enterprise to construct an organization relation dictionary.
In step S103, in response to the instruction for generating the organization structure tree, the electronic device stores the second department or the third department corresponding to the preset number in the organization relation dictionary as a root node in the alternative structure tree.
And step S104, the electronic equipment performs child node determination operation on the nodes in the alternative structure tree until no value corresponding to the department number corresponding to the node of the last hierarchy in the alternative structure tree exists in the first department relation dictionary and the first department employee relation dictionary, and an organization structure tree is obtained. Wherein the child node determining operation comprises: and determining a value corresponding to the serial number of the department corresponding to the node in the alternative structure tree as a target child node in the first department relation dictionary and the first department employee relation dictionary. And storing the target child node as a child node of the node in the alternative structure tree to the alternative structure tree.
By adopting the method for generating the organization structure tree provided by the embodiment of the disclosure, the organization structure tree is constructed by utilizing the pre-constructed organization relation dictionary, and the organization relation dictionary comprises data which is stored by taking the number of the second department as a key, taking the set of the department information of the first department corresponding to the second department as a value, and data which is stored by taking the number of the third department as a key and taking the set of the employee information of the employee corresponding to the third department as a value. Thus, when generating the organization structure tree, the numbers of departments corresponding to the nodes in the alternative structure tree can be used as keys, and the corresponding values can be matched quickly in the organization relation dictionary. And storing the matched values as child nodes of the nodes in the alternative organization structure tree. That is, all the department information and all the employee information belonging to the department can be quickly obtained, and all the department information and all the employee information belonging to the department can be stored in the alternative organization structure tree as child nodes of the corresponding node of the department. Therefore, department information and/or employee information corresponding to the child nodes of the nodes in the alternative structure tree can be determined without traversing the database, so that the data acquisition efficiency is improved, and the organization structure tree can be generated more quickly.
Further, after the organization relation dictionary is constructed by using the department information and the employee information of the enterprise, the method further comprises the following steps: and caching the organization relation dictionary.
Optionally, in response to the instruction to generate the organization structure tree, storing the second department or the third department corresponding to the preset number in the organization relation dictionary as a root node in the alternative structure tree, including: and responding to the instruction for generating the organization structure tree, acquiring a second department or a third department corresponding to the preset number from the cached organization relation dictionary, and storing the second department or the third department corresponding to the preset number as a root node in the alternative structure tree. In this way, when the organization structure tree is generated, the department information and the employee information are acquired by directly using the cached organization relation dictionary. The department information and the employee information are acquired from the database without calling an interface of the electronic equipment, and query optimization is realized. The time for calling the interface of the electronic equipment is reduced, and then the organization structure tree can be generated more quickly.
Further, after the organization relation dictionary is constructed by using the department information and the employee information of the enterprise, the method further comprises the following steps: and re-acquiring department information and employee information of the enterprise from a preset database at intervals of a preset time period, constructing an alternative organization relation dictionary by using the re-acquired department information and employee information of the enterprise, and covering the cached organization relation dictionary by using the alternative organization relation dictionary. Because the cached organization relation dictionary is updated by directly utilizing the data in the database, a large amount of time is needed to reconstruct the organization relation dictionary, and the data in the cached organization relation dictionary is incomplete before the reconstruction of the organization relation dictionary is completed. In order to reduce the time of data incomplete in the process of updating the cached organization relation dictionary, the embodiment of the disclosure constructs the alternative organization relation dictionary by using the data in the database, and then covers the organization relation dictionary in the cache by using the alternative organization relation dictionary. The time spent for covering the organization relation dictionary in the cache by using the alternative organization relation dictionary is less than the time for reconstructing the organization relation dictionary by using the data in the database. Therefore, the time of data incomplete in the process of updating the organizational relation dictionary in the cache can be shortened.
Optionally, the organization relation dictionary further includes a second department relation dictionary and a second department employee relation dictionary. The second department relation dictionary includes data stored with the number of the first department as a key and the number of the second department corresponding to the first department as a value. The second department employee relationship dictionary comprises data stored by taking the number of the employee as a key and taking the number of a third department corresponding to the employee as a value. Therefore, under the condition of department information change and/or employee information change, whether the department and/or the employee belonging to the department is changed or not can be quickly judged through the second department relation dictionary and the second department employee relation dictionary. Therefore, the first department relation dictionary can be quickly updated by the changed department information, and/or the first department staff relation dictionary can be quickly updated by the changed staff information.
Optionally, after the organization relation dictionary is constructed by using the department information and the employee information of the enterprise, the method further includes: and acquiring the department information of the newly added department under the condition of receiving the newly added department information sent by the database. The department information of the newly added department comprises the number of the newly added department, the name of the newly added department and the number of the department to which the newly added department belongs. And determining the number of the department to which the newly added department belongs as a first target number. And taking the number of the newly added department as a key, and storing the first target number as a value corresponding to the number of the newly added department in a second department relation dictionary. It is determined whether a key in the first department relation dictionary includes a first target number. If so, adding the department information of the newly added department into a value corresponding to the first target number of the first department relation dictionary; and otherwise, taking the first target number as a key, and taking the department information of the newly-added department as a value corresponding to the first target number to be stored in the first department relation dictionary. Therefore, under the condition that the newly added department information sent by the database is received, the department information of the newly added department is stored in the first department relation dictionary and the second department relation dictionary, and the data stored in the organization relation dictionary can be ensured to be the same as the data stored in the database.
As shown in fig. 2, an embodiment of the present disclosure provides a method for generating an organization structure tree, including:
step S201, the electronic equipment utilizes department information and employee information of the enterprise to construct an organization relation dictionary.
Step S202, the electronic equipment acquires department information of the newly added department under the condition of receiving the newly added department information sent by the database. The department information of the newly added department comprises the number of the newly added department, the name of the newly added department and the number of the department to which the newly added department belongs, and the number of the department to which the newly added department belongs is determined as the first target number.
In step S203, the electronic device stores the number of the newly added department as a key and the first target number as a value corresponding to the number of the newly added department in the second department relation dictionary.
Step S204, the electronic equipment judges whether the keys in the first department relation dictionary comprise first target numbers or not; if yes, go to step S205; otherwise, step S206 is executed.
In step S205, the electronic device adds the department information of the newly added department to the value corresponding to the first target number of the first department relation dictionary. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
In step S206, the electronic device stores the first target number as a key and the department information of the newly added department as a value corresponding to the first target number in the first department relation dictionary. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
In step S207, in response to the instruction for generating the organization structure tree, the electronic device stores the second department or the third department corresponding to the preset number in the updated organization relation dictionary as a root node in the alternative structure tree.
And S208, the electronic equipment performs child node determination operation on the nodes in the alternative structure tree until the updated first department relation dictionary and the updated first department employee relation dictionary do not have a value corresponding to the serial number of the department corresponding to the node of the last level in the alternative structure tree, and an organization structure tree is obtained.
By adopting the method for generating the organization structure tree provided by the embodiment of the disclosure, under the condition that the newly added department information sent by the database is received, the department information of the newly added department is stored in the first department relation dictionary and the second department relation dictionary, so that the data stored in the organization relation dictionary can be updated. And then generating an organization structure tree by using the updated organization relation dictionary, so that the organization structure tree can truly show the organization architecture of the enterprise.
Optionally, after the organization relation dictionary is built by using the department information and the employee information of the enterprise, the method further includes: and under the condition of receiving a first notification message sent by the database, acquiring the changed department information from the first notification message. The first notification message is used for representing the name of the change department and/or the affiliated department of the change department. The changed department information includes a number of the department after the change of the department information, a name of the department after the change of the department information, and a number of a department to which the department after the change of the department information belongs. And acquiring a value corresponding to the department number after the department information is changed from the second department relation dictionary, and determining the value as a second target number. And judging whether the second target number is the same as the number of the department to which the department information is changed. And deleting the department information of the first department corresponding to the department number after the department information is changed from the value corresponding to the second target number of the first department relation dictionary under the condition that the second target number is different from the number of the department to which the department after the department information is changed. And determining the number of the department to which the department after the department information change belongs as a third target number, taking the number of the department after the department information change as a key, and taking the third target number as a value corresponding to the number of the department after the department information change and storing the value in a second department relation dictionary. It is judged whether or not the third object number is included in the keys of the first department relation dictionary. And if so, adding the changed department information into a value corresponding to the third target number of the first department relation dictionary. And otherwise, taking the third target number as a key, and taking the department information after the department information is changed as a value corresponding to the third target number to be stored in the first department relation dictionary. In this way, by determining whether or not the second target number is the same as the number of the department to which the department information has been changed, it is possible to quickly determine whether or not the department to which the department belongs has changed, and in the case where the department to which the department belongs has changed, delete the department information of the first department corresponding to the department number after the department information has been changed from the set of the department information of the first department corresponding to the second target number in the first department relation dictionary. That is, the key-value relationship between the changed section information and the number of the section to which the section before the section information change belongs is deleted in the first section relationship dictionary. And simultaneously, adding a key-value relationship between the number of the department after the department information is changed and the number of the department to which the department after the department information is changed in a second department relation dictionary. In addition, in a case where the third target number is not included in the keys of the first department relation dictionary, a key-value relationship between the number of the department to which the department whose department information is changed belongs and the number of the department whose department information is changed is added to the first department relation dictionary. Therefore, the data stored in the organization relation dictionary can be ensured to be the same as the data stored in the database.
Optionally, after determining whether the second target number is the same as the number of the department to which the department belongs after the change of the department information, the method further includes: and under the condition that the second target number is the same as the number of the department to which the department information changed belongs, covering first target information in the value corresponding to the second target number of the first department relation dictionary by using the changed department information, wherein the first target information is the department information corresponding to the department number after the department information is changed in the value corresponding to the second target number of the first department relation dictionary. In this way, in the case where the second target number is the same as the number of the section to which the section information is changed, it can be quickly determined that the section to which the section belongs has not changed, and at the same time, since the first notification message is used to represent the name of the changed section and/or the section to which the changed section belongs, it can be determined that the name of the section has changed. Therefore, the first department information stored in the first department relationship is updated by the changed department information, and the data stored in the organization relationship dictionary can be ensured to be the same as the data stored in the database.
As shown in fig. 3, an embodiment of the present disclosure provides a method for generating an organization structure tree, including:
step S301, the electronic equipment utilizes department information and employee information of the enterprise to construct an organization relation dictionary.
Step S302, the electronic equipment acquires the changed department information from the first notification message under the condition of receiving the first notification message sent by the database; the first notification message is used for representing the name of the change department and/or the affiliated department of the change department; the changed department information includes a number of the department after the change of the department information, a name of the department after the change of the department information, and a number of a department to which the department after the change of the department information belongs.
In step S303, the electronic device obtains a value corresponding to the department number after the department information is changed from the second department relation dictionary, and determines the value as the second target number.
Step S304, the electronic equipment judges whether the second target number is the same as the number of the department to which the department information is changed; if yes, go to step 310; otherwise, step S305 is executed.
In step S305, the electronic device deletes the department information of the first department corresponding to the department number after the change of the department information, from the value corresponding to the second target number of the first department relation dictionary. Then step S306 is performed.
In step S306, the electronic device determines the number of the department to which the department after the department information change belongs as a third target number, and stores the third target number in the second department relation dictionary as a value corresponding to the number of the department after the department information change with the number of the department after the department information change as a key. Then, step S307 is executed.
Step S307, the electronic equipment judges whether the keys of the first department relation dictionary comprise third target numbers or not; if yes, go to step S308; otherwise, step S309 is performed.
Step S308, the electronic equipment adds the changed department information into a value corresponding to the third target number of the first department relation dictionary. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
In step S309, the electronic device stores the third object number as a key and the department information after the department information change as a value corresponding to the third object number in the first department relation dictionary. An updated first department relationship dictionary and an updated organization relationship dictionary are obtained.
In step S310, the electronic device uses the changed department information to overwrite the first target information in the value corresponding to the second target number of the first department relation dictionary. The first target information is department information corresponding to the department number after the department information is changed in the value corresponding to the second target number of the first department relation dictionary. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
In step S311, in response to the instruction for generating the organization structure tree, the electronic device stores the updated second department or third department corresponding to the preset number in the organization relation dictionary as a root node in the candidate structure tree.
In step S312, the electronic device performs child node determination operations on the nodes in the alternative structure tree until there is no value corresponding to the department number corresponding to the node of the last level in the updated first department relation dictionary and first department employee relation dictionary, and obtains an organization structure tree.
By adopting the method for generating the organization structure tree provided by the embodiment of the disclosure, whether the name of the department and/or the affiliated department of the department are changed can be quickly judged through the second department relation dictionary. And updating the first department relation dictionary and the second department relation dictionary by using the changed department information under the condition that the affiliated department of the department is changed. And updating the first department relation dictionary by using the changed department information under the condition that the name of the department is changed. So that the data stored in the organizational relationship dictionary can be updated. And then generating an organization structure tree by using the updated organization relation dictionary, so that the organization structure tree can truly show the organization architecture of the enterprise.
Optionally, after the organization relation dictionary is constructed by using the department information and the employee information of the enterprise, the method further includes: and under the condition of receiving the deleting department information sent by the database, acquiring the department number of the deleted department. A value corresponding to the department number of the deleted department is acquired in the second department relation dictionary and determined as a fourth target number. In the value corresponding to the fourth target number of the first-department relational dictionary, the department information of the first department corresponding to the department number of the deleted department is deleted. In this way, the first department information corresponding to the department number of the deleted department can be deleted in the first department relationship. Thereby ensuring that the data stored in the organization relation dictionary is the same as the data stored in the database.
As shown in fig. 4, an embodiment of the present disclosure provides a method for generating an organization structure tree, including:
step S401, the electronic equipment utilizes department information and employee information of the enterprise to construct an organization relation dictionary.
In step S402, the electronic device acquires the department number of the deleted department when receiving the deletion department information sent by the database.
In step S403, the electronic device acquires a value corresponding to the department number of the deleted department in the second department relation dictionary, and determines it as the fourth target number.
In step S404, the electronic device deletes the department information of the first department corresponding to the department number of the deleted department from the value corresponding to the fourth target number of the first department relation dictionary. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
Step S405, in response to the instruction for generating the organization structure tree, the electronic device stores the updated second department or third department corresponding to the preset number in the organization relation dictionary as a root node in the alternative structure tree.
Step S406, the electronic device performs child node determination operation on the nodes in the alternative structure tree until the updated first department relation dictionary and the updated first department employee relation dictionary do not have a value corresponding to the department number corresponding to the node of the last level in the alternative structure tree, and an organization structure tree is obtained.
By adopting the data updating method provided by the embodiment of the disclosure, the first department information corresponding to the department number of the deleted department can be deleted in the first department relation dictionary under the condition that the deleted department information sent by the database is received. So that the data stored in the organization relation dictionary can be updated. And then generating an organization structure tree by using the updated organization relation dictionary, so that the organization structure tree can truly show the organization architecture of the enterprise.
Optionally, after the organization relation dictionary is built by using the department information and the employee information of the enterprise, the method further includes: and acquiring the information of the newly added staff under the condition of receiving the information of the newly added staff sent by the database. The newly added employee information comprises the number of the newly added employee, the name of the newly added employee and the number of the department to which the newly added employee belongs, and the number of the department to which the newly added employee belongs is determined as the fifth target number. And taking the number of the newly added employee as a key, and storing the fifth target number as a value corresponding to the number of the newly added employee in the second department employee relationship dictionary. And judging whether the key in the first department employee relationship dictionary comprises a fifth target number. And if so, adding the newly-added employee information into a value corresponding to the fifth target number of the first department employee relationship dictionary. And otherwise, taking the fifth target number as a key, and taking the newly-added employee information as a value corresponding to the fifth target number to be stored in the first department employee relationship dictionary. Therefore, under the condition that the newly added employee information sent by the database is received, the employee information of the newly added employee can be stored in the first department employee relationship dictionary and the second department employee relationship dictionary, and therefore the data stored in the organization relationship dictionary is the same as the data stored in the database.
As shown in fig. 5, an embodiment of the present disclosure provides a method for generating an organization structure tree, including:
step S501, the electronic equipment utilizes department information and employee information of an enterprise to construct an organization relation dictionary.
Step S502, the electronic device obtains the information of the newly added staff when receiving the information of the newly added staff sent by the database. The newly added employee information comprises the number of the newly added employee, the name of the newly added employee and the number of the department to which the newly added employee belongs, and the number of the department to which the newly added employee belongs is determined as the fifth target number.
And S503, the electronic equipment takes the number of the newly added employee as a key, and stores the fifth target number into a second department employee relationship dictionary as a value corresponding to the number of the newly added employee.
In step S504, the electronic device determines whether the key in the first department employee relationship dictionary includes the fifth target number. If so, go to step S505. Otherwise, step S506 is executed.
And step S505, adding the newly added employee information to a value corresponding to the fifth target number of the first department employee relationship dictionary by the electronic equipment. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
Step S506, the electronic device uses the fifth target number as a key, and uses the newly added employee information as a value corresponding to the fifth target number to store in the first department employee relationship dictionary. An updated first department relationship dictionary and an updated organization relationship dictionary are obtained.
In step S507, in response to the instruction for generating the organization structure tree, the electronic device stores the second department or the third department corresponding to the preset number in the updated organization relation dictionary as a root node in the alternative structure tree.
Step S508, the electronic device performs child node determination operation on the nodes in the alternative structure tree until there is no value corresponding to the department number corresponding to the node of the last level in the updated first department relation dictionary and first department employee relation dictionary, and obtains an organization structure tree.
By adopting the method for generating the organization structure tree provided by the embodiment of the disclosure, the employee information of the newly added employee is stored in the first department employee relationship dictionary and the second department employee relationship dictionary under the condition that the newly added employee information sent by the database is received, so that the data stored in the organization relationship dictionary can be updated. And then generating an organization structure tree by using the updated organization relation dictionary, so that the organization structure tree can truly show the organization architecture of the enterprise.
Optionally, after the organization relation dictionary is built by using the department information and the employee information of the enterprise, the method further includes: and under the condition of receiving a second notification message sent by the database, acquiring the changed employee information from the second notification message. The second notification message is used for representing the name of the change staff and/or the department to which the change staff belongs. The changed employee information comprises the employee number after the employee information is changed, the employee name after the employee information is changed and the number of the department to which the employee belongs after the employee information is changed. And acquiring a value corresponding to the employee number after the employee information is changed from the employee relationship dictionary of the second department, and determining the value as a sixth target number. And judging whether the sixth target number is the same as the number of the department to which the employee belongs after the employee information is changed. And under the condition that the sixth target number is different from the number of the department to which the employee belongs after the employee information is changed, deleting the employee information corresponding to the employee number after the employee information is changed from the value corresponding to the sixth target number of the employee relationship dictionary of the first department. And determining the number of the department to which the employee belongs after the employee information is changed as a seventh target number. And taking the employee number after the employee information is changed as a key, and taking the seventh target number as a value corresponding to the employee number after the employee information is changed and storing the value into the second department employee relationship dictionary. And judging whether the key in the first department employee relationship dictionary comprises a seventh target number. And if so, adding the changed employee information into a value corresponding to the seventh target number of the first department employee relationship dictionary. And otherwise, taking the seventh target number as a key, and taking the employee number after the employee information is changed as a value corresponding to the seventh target number to be stored in the first department employee relationship dictionary. In this way, whether the number of the sixth target number is the same as the number of the department to which the employee belongs after the employee department information is changed or not can be quickly judged. And under the condition that the department to which the employee belongs changes, deleting the employee information corresponding to the employee number after the change of the employee information from the set of the employee information corresponding to the sixth target number in the first department employee relationship dictionary. Namely, the key-value relationship between the changed employee information and the number of the department to which the employee belongs before the change of the employee information is deleted in the first department employee relationship dictionary. And simultaneously, adding a key-value relationship between the employee number after the employee information is changed and the number of the department to which the employee belongs after the employee information is changed in the second department employee relationship dictionary. In addition, the seventh target number is not included in the key of the first department employee relationship dictionary, and the key-value relationship between the number of the department to which the employee belongs after the employee information is changed and the employee number after the employee information is changed is added in the first department employee relationship dictionary. Therefore, the data stored in the organization relation dictionary can be ensured to be the same as the data stored in the database.
Optionally, after determining whether the sixth target number is the same as the number of the department to which the employee belongs after the employee information is changed, the method further includes: under the condition that the sixth target number is the same as the number of the department to which the employee belongs after the employee information is changed, covering second target information in a value corresponding to the seventh target number of the employee relationship dictionary of the first department by using the changed employee information; the second target information is the employee information corresponding to the employee number after the change of the employee information in the value corresponding to the seventh target number of the first department employee relationship dictionary. Therefore, under the condition that the sixth target number is the same as the number of the department to which the employee belongs after the employee information is changed, the fact that the department to which the employee belongs is not changed can be quickly determined, and meanwhile, the second notification message is used for representing that the name of the employee is changed and/or the department to which the employee belongs is changed, and therefore the fact that the name of the employee is changed can be determined. Therefore, the employee information stored in the first department employee relationship dictionary is updated by the changed employee information, and the data stored in the organization relationship dictionary can be ensured to be the same as the data stored in the database.
As shown in fig. 6, an embodiment of the present disclosure provides a method for generating an organization structure tree, including:
step S601, the electronic equipment utilizes department information and employee information of the enterprise to construct an organization relation dictionary.
Step S602, when receiving the second notification message sent by the database, the electronic device acquires the changed employee information from the second notification message. The second notification message is used for representing the name of the change staff and/or the affiliated department of the change staff; the changed employee information comprises the employee number after the employee information is changed, the employee name after the employee information is changed and the number of the department to which the employee belongs after the employee information is changed.
Step S603, the electronic device obtains a value corresponding to the employee number after the change of the employee information in the second department employee relationship dictionary, and determines the value as the sixth target number.
In step S604, the electronic device determines whether the sixth target number is the same as the number of the department to which the employee belongs after the employee information is changed. If so, go to step S610. Otherwise, step S605 is executed.
In step S605, the electronic device deletes the employee information corresponding to the employee number after the change of the employee information from the value corresponding to the sixth target number of the first department employee relationship dictionary. Then, step S606 is performed.
And step S606, the electronic equipment determines the number of the department to which the employee belongs after the employee information is changed as a seventh target number, the employee number after the employee information is changed is used as a key, and the seventh target number is used as a value corresponding to the employee number after the employee information is changed and is stored in the employee relationship dictionary of the second department. Step S607 is then executed.
Step S607, the electronic equipment judges whether the key in the first department employee relationship dictionary comprises a seventh target number; if so, go to step S608. Otherwise, step S609 is executed.
Step S608, the electronic device adds the changed employee information to a value corresponding to the seventh target number of the first department employee relationship dictionary. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
And step S609, the electronic equipment takes the seventh target number as a key, and takes the employee number after the employee information is changed as a value corresponding to the seventh target number and stores the value in the first department employee relationship dictionary. An updated first department relationship dictionary and an updated organization relationship dictionary are obtained.
Step S610, the electronic equipment covers second target information in a value corresponding to a seventh target number of the first department employee relationship dictionary by using the changed employee information; the second target information is the employee information corresponding to the employee number after the change of the employee information in the value corresponding to the seventh target number of the first department employee relationship dictionary. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
In step S611, in response to the instruction for generating the organization structure tree, the electronic device stores the updated second department or third department corresponding to the preset number in the organization relationship dictionary as a root node in the alternative structure tree.
Step S612, the electronic device performs child node determination operation on the nodes in the alternative structure tree until there is no value corresponding to the department number corresponding to the node of the last hierarchy in the updated first department relation dictionary and first department employee relation dictionary, and obtains an organization structure tree.
By adopting the method for generating the organization structure tree provided by the embodiment of the disclosure, because the employee number cannot be changed, whether the name of the employee and/or the department to which the employee belongs is changed can be quickly judged in the second department relation dictionary by utilizing the employee number after the change of the employee information. And under the condition that the department to which the employee belongs changes, updating the employee relationship dictionary of the first department and the employee relationship dictionary of the second department by using the changed employee information. And under the condition that the name of the employee is changed, updating the first department employee relationship dictionary by using the changed employee information. So that the data stored in the organization relation dictionary can be updated. And then generating an organization structure tree by using the updated organization relation dictionary, so that the organization structure tree can truly show the organization architecture of the enterprise.
Optionally, after the organization relation dictionary is built by using the department information and the employee information of the enterprise, the method further includes: and under the condition of receiving the employee attendance information sent by the database, acquiring the employee number of the employee who leaves the employee from the employee attendance information. And acquiring a value corresponding to the employee number of the out-of-office employee from the second department employee relationship dictionary, and determining the value as an eighth target number. And deleting the employee information corresponding to the employee number of the out-of-work employee in the value corresponding to the eighth target number of the first department employee relationship dictionary. In this way, when the employee leave information transmitted from the database is received, the employee information corresponding to the employee number of the leave employee can be deleted in the first department relationship. Thereby ensuring that the data stored in the organization relation dictionary is the same as the data stored in the database.
As shown in fig. 7, an embodiment of the present disclosure provides a method for generating an organization structure tree, including:
and step S701, the electronic equipment utilizes department information and employee information of the enterprise to construct an organization relation dictionary.
Step S702, the electronic device obtains the employee number of the employee who leaves the job from the employee leave information when receiving the employee leave information sent by the database.
In step S703, the electronic device obtains a value corresponding to the employee number of the employee who leaves the office from the second department employee relationship dictionary, and determines the value as the eighth target number.
In step S704, the electronic device deletes the employee information corresponding to the employee number of the employee who leaves the office from the value corresponding to the eighth target number of the first department employee relationship dictionary. And obtaining the updated first department relation dictionary and the updated organization relation dictionary.
Step S705, in response to the instruction for generating the organization structure tree, the electronic device stores the second department or the third department corresponding to the preset number in the updated organization relation dictionary as a root node in the alternative structure tree.
Step S706, the electronic device performs child node determination operation on the nodes in the alternative structure tree until the updated first department relation dictionary and first department employee relation dictionary do not have a value corresponding to the serial number of the department corresponding to the node of the last level in the alternative structure tree, and an organization structure tree is obtained.
By adopting the method for generating the organization structure tree provided by the embodiment of the disclosure, the employee information corresponding to the employee number of the employee who leaves can be deleted in the first department relation under the condition that the employee leaving information sent by the database is received. So that the data stored in the organizational relationship dictionary can be updated. And then generating an organization structure tree by using the updated organization relation dictionary, so that the organization structure tree can truly show the organization architecture of the enterprise.
As shown in fig. 8, an embodiment of the present disclosure provides an electronic device including a processor (processor)800 and a memory (memory) 801. Optionally, the apparatus may also include a Communication Interface 802 and a bus 803. The processor 800, the communication interface 802, and the memory 801 may communicate with each other via a bus 803. Communication interface 802 may be used for the transfer of information. The processor 800 may call logic instructions in the memory 801 to perform the method of generating an organizational structure tree of the above-described embodiments.
By adopting the electronic device provided by the embodiment of the disclosure, the organization relation structure tree is constructed by utilizing the first department relation dictionary and the first department employee relation dictionary in the organization relation dictionary, and the corresponding value is quickly matched in the organization relation dictionary by taking the number of the department corresponding to the node in the alternative structure tree as a key. And storing the matched values as child nodes of the nodes in the alternative organization structure tree. That is, all the department information and all the employee information belonging to the department can be quickly obtained, and all the department information and all the employee information belonging to the department can be stored in the alternative organization structure tree as child nodes of the corresponding node of the department. Therefore, the child nodes of the nodes in the alternative structure tree can be determined without traversing the database, so that the data acquisition efficiency is improved, and the organization structure tree can be generated more quickly.
In addition, the logic instructions in the memory 801 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as a stand-alone product.
The memory 801 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 800 executes functional applications and data processing, i.e. implements the method for generating an organizational structure tree in the above-described embodiments, by executing program instructions/modules stored in the memory 801.
The memory 801 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. Further, memory 801 may include high speed random access memory and may also include non-volatile memory.
The embodiment of the disclosure provides a readable storage medium, which stores executable instructions, and the executable instructions execute the method for generating the organization structure tree when running.
Embodiments of the present disclosure provide a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the above-described method for generating an organizational structure tree.
The computer-readable storage medium described above may be a transitory computer-readable storage medium or a non-transitory computer-readable storage medium.
The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, where the computer software product is stored in a storage medium and includes one or more instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present disclosure. And the aforementioned storage medium may be a non-transitory storage medium comprising: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes, and may also be a transient storage medium.
The above description and drawings sufficiently illustrate embodiments of the disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, and other changes. The examples merely typify possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in or substituted for those of others. Furthermore, the words used in the specification are words of description only and are not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, the terms "comprises" and/or "comprising," when used in this application, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Without further limitation, an element defined by the phrase "comprising an …" does not exclude the presence of other like elements in a process, method or apparatus that comprises the element. In this document, each embodiment may be described with emphasis on differences from other embodiments, and the same and similar parts between the respective embodiments may be referred to each other. For methods, products, etc. of the embodiment disclosures, reference may be made to the description of the method section for relevance if it corresponds to the method section of the embodiment disclosure.
Those of skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software may depend upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments. It can be clearly understood by the skilled person that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, apparatuses, etc.) may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units may be merely a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to implement the present embodiment. In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than disclosed in the description, and sometimes there is no specific order between the different operations or steps. For example, two sequential operations or steps may in fact be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (12)

1. A method for generating an organizational structure tree, comprising:
acquiring department information and employee information of an enterprise from a preset database;
constructing an organization relation dictionary by utilizing the department information and the employee information of the enterprise; the organization relation dictionary comprises a first department relation dictionary and a first department employee relation dictionary; the first department relation dictionary comprises data stored by taking the number of a second department as a key and taking the set of department information of a first department corresponding to the second department as a value, and the first department employee relation dictionary comprises data stored by taking the number of a third department as a key and taking the set of employee information of employees corresponding to the third department as a value;
responding to an instruction for generating an organization structure tree, and storing a second department or a third department corresponding to a preset number in the organization relation dictionary as a root node into an alternative structure tree;
and performing child node determination operation on the nodes in the alternative structure tree until a value corresponding to the serial number of the department corresponding to the node of the last hierarchy in the alternative structure tree does not exist in the first department relation dictionary and the first department employee relation dictionary, and obtaining the organization structure tree.
2. The method according to claim 1, wherein the organization relationship dictionary further comprises a second department relationship dictionary and a second department employee relationship dictionary, and the second department relationship dictionary comprises data stored with the number of the first department as a key and the number of the second department corresponding to the first department as a value; and the second department employee relationship dictionary comprises data which is stored by taking the number of the employee as a key and taking the number of a third department corresponding to the employee as a value.
3. The method of claim 2, wherein after constructing the organizational relationship dictionary using the department information and employee information of the enterprise, further comprising:
under the condition that newly added department information sent by a database is received, obtaining department information of a newly added department, wherein the department information of the newly added department comprises the number of the newly added department, the name of the newly added department and the number of a department to which the newly added department belongs, and determining the number of the department to which the newly added department belongs as a first target number;
taking the number of the newly added department as a key, and storing the first target number in the second department relation dictionary as a value corresponding to the number of the newly added department;
judging whether the keys in the first department relation dictionary comprise the first target numbers or not;
if so, adding the department information of the newly added department into a value corresponding to a first target number of the first department relation dictionary; and otherwise, the first target number is used as a key, and the department information of the newly added department is used as a value corresponding to the first target number and is stored in a first department relation dictionary.
4. The method of claim 2, wherein after constructing the organizational relationship dictionary using the department information and employee information of the enterprise, further comprising:
under the condition of receiving a first notification message sent by a database, acquiring changed department information from the first notification message; the first notification message is used for representing the name of the change department and/or the affiliated department of the change department; the changed department information comprises a number of a department of which the department information is changed, a name of the department of which the department information is changed and a number of a department to which the department of which the department information is changed belongs;
acquiring a value corresponding to the department number after the department information is changed from the second department relation dictionary, and determining the value as a second target number;
judging whether the second target number is the same as the number of the department to which the department information is changed;
deleting the department information corresponding to the department number after the department information is changed from the value corresponding to the second target number of the first department relation dictionary under the condition that the second target number is different from the number of the department to which the department information after the department information is changed belongs;
determining the number of the department to which the department after the department information change belongs as a third target number, taking the number of the department after the department information change as a key, and taking the third target number as a value corresponding to the number of the department after the department information change to be stored in a second department relation dictionary;
judging whether the keys of the first department relation dictionary comprise the third target number or not;
if so, adding the changed department information into a value corresponding to a third target number of the first department relation dictionary; and otherwise, the third target number is used as a key, and the department information after the department information is changed is used as a value corresponding to the third target number and is stored in a first department relation dictionary.
5. The method according to claim 4, wherein determining whether the second target number is the same as the number of the department to which the department information is changed, further comprises:
and under the condition that the second target number is the same as the number of the department to which the department information changed belongs, covering first target information in a value corresponding to the second target number of the first department relation dictionary by using the changed department information, wherein the first target information is the department information corresponding to the department number after the department information is changed in the value corresponding to the second target number of the first department relation dictionary.
6. The method of claim 2, wherein after constructing the organizational relationship dictionary using the department information and employee information of the enterprise, further comprising:
under the condition of receiving the information of the deleted department sent by the database, acquiring the department number of the deleted department;
acquiring a value corresponding to the department number of the deleted department from the second department relation dictionary, and determining the value as a fourth target number;
deleting the department information of the first department corresponding to the department number of the deleted department from the value corresponding to the fourth target number of the first department relation dictionary.
7. The method of claim 2, wherein after constructing the organizational relationship dictionary using the department information and employee information of the enterprise, further comprising:
acquiring newly added employee information under the condition of receiving the newly added employee information sent by the database; the newly added employee information comprises the number of the newly added employee, the name of the newly added employee and the number of the department to which the newly added employee belongs, and the number of the department to which the newly added employee belongs is determined as a fifth target number;
taking the number of the newly added employee as a key, and storing the fifth target number as a value corresponding to the number of the newly added employee into the second department employee relationship dictionary;
judging whether a key in the first department employee relationship dictionary comprises the fifth target number or not;
if so, adding the newly added employee information into a value corresponding to a fifth target number of the first department employee relationship dictionary; and otherwise, the fifth target number is used as a key, and the newly added employee information is used as a value corresponding to the fifth target number and is stored in the first department employee relationship dictionary.
8. The method of claim 2, wherein after constructing the organizational relationship dictionary using the department information and employee information of the enterprise, further comprising:
under the condition of receiving a second notification message sent by a database, acquiring changed employee information from the second notification message; the second notification message is used for representing the name of the change employee and/or the department to which the change employee belongs; the changed employee information comprises the employee number after the employee information is changed, the employee name after the employee information is changed and the number of the department to which the employee belongs after the employee information is changed;
acquiring a value corresponding to the employee number after the employee information is changed from the second department employee relationship dictionary, and determining the value as a sixth target number;
judging whether the sixth target number is the same as the number of the department to which the employee belongs after the employee information is changed;
under the condition that the sixth target number is different from the number of the department to which the employee belongs after the employee information is changed, deleting the employee information corresponding to the employee number after the employee information is changed from the value corresponding to the sixth target number of the employee relationship dictionary of the first department;
determining the number of the department to which the employee belongs after the employee information is changed as a seventh target number; the employee number after the employee information is changed is used as a key, and the seventh target number is used as a value corresponding to the employee number after the employee information is changed and is stored in a second department employee relationship dictionary;
judging whether the key in the first department employee relationship dictionary comprises the seventh target number or not;
if so, adding the changed employee information into a value corresponding to a seventh target number of the first department employee relationship dictionary; and otherwise, the seventh target number is used as a key, and the employee number after the change of the employee information is used as a value corresponding to the seventh target number and stored in a first department employee relationship dictionary.
9. The method according to claim 8, wherein after determining whether the sixth target number is the same as the number of the department to which the employee belongs after the change of the employee information, the method further comprises:
under the condition that the sixth target number is the same as the number of the department to which the employee belongs after the employee information is changed, covering second target information in a value corresponding to a seventh target number of the employee relationship dictionary of the first department by using the changed employee information; and the second target information is the employee information corresponding to the employee number after the change of the employee information in the value corresponding to the seventh target number of the first department employee relationship dictionary.
10. The method of claim 2, wherein after constructing the organizational relationship dictionary using the department information and employee information of the enterprise, further comprising:
under the condition that employee leaving information sent by a database is received, acquiring employee numbers of the leaving employees from the employee leaving information;
acquiring a value corresponding to the employee number of the out-of-office employee from the second department employee relationship dictionary, and determining the value as an eighth target number;
and deleting the employee information corresponding to the employee number of the employee who leaves the office from the value corresponding to the eighth target number of the first department employee relationship dictionary.
11. An electronic device comprising a processor and a memory storing program instructions, characterized in that the processor is configured to perform the method for generating an organizational structure tree according to any one of claims 1 to 10 when executing the program instructions.
12. A readable storage medium storing executable instructions which, when executed, perform the method for generating an organizational structure tree according to any one of claims 1 to 10.
CN202210617475.XA 2022-06-01 2022-06-01 Method, electronic device and readable storage medium for generating organization structure tree Pending CN114996272A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210617475.XA CN114996272A (en) 2022-06-01 2022-06-01 Method, electronic device and readable storage medium for generating organization structure tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210617475.XA CN114996272A (en) 2022-06-01 2022-06-01 Method, electronic device and readable storage medium for generating organization structure tree

Publications (1)

Publication Number Publication Date
CN114996272A true CN114996272A (en) 2022-09-02

Family

ID=83030524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210617475.XA Pending CN114996272A (en) 2022-06-01 2022-06-01 Method, electronic device and readable storage medium for generating organization structure tree

Country Status (1)

Country Link
CN (1) CN114996272A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562869A (en) * 2022-10-19 2023-01-03 慧之安信息技术股份有限公司 Method and system for managing opencut client based on key value pair structure

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562869A (en) * 2022-10-19 2023-01-03 慧之安信息技术股份有限公司 Method and system for managing opencut client based on key value pair structure
CN115562869B (en) * 2022-10-19 2024-02-06 慧之安信息技术股份有限公司 Method and system for managing structure opcua clients based on key values

Similar Documents

Publication Publication Date Title
JP6456162B2 (en) Anonymization processing device, anonymization processing method and program
CN105488050B (en) A kind of more indexing means of database, apparatus and system
CN106325933A (en) Method and device for synchronizing batch data
CN106462625A (en) Real-time saved-query updates for a large graph
CN105989076A (en) Data statistical method and device
EP2317785A1 (en) Address list system and implementation method thereof
CN107451831A (en) Task method for pushing
CN109684270B (en) Database archiving method, device, system, equipment and readable storage medium
CN114996272A (en) Method, electronic device and readable storage medium for generating organization structure tree
CN110275889B (en) Feature processing method and device suitable for machine learning
CN113326363B (en) Searching method and device, prediction model training method and device and electronic equipment
CN105190601B (en) The sequence based on region on mobile device
CN112433757A (en) Method and device for determining interface calling relationship
CN108647243B (en) Industrial big data storage method based on time series
CN114661676B (en) Distributed database management system, method, electronic device and readable storage medium
CN111488117A (en) Method, electronic device, and computer-readable medium for managing metadata
CN113127490B (en) Key name generation method and device and computer readable storage medium
CN111552847B (en) Method and device for changing number of objects
CN113448980A (en) Method and device for generating SQL (structured query language) statement and electronic equipment
CN114936198A (en) Data migration method and device
CN111858158A (en) Data processing method and device and electronic equipment
CN108614838B (en) User group index processing method, device and system
CN109299067A (en) Page access method, apparatus and storage medium
CN111611258B (en) Stream data recovery method and storage device
CN113254271B (en) Data sequence recovery method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination