CN109829141B - Project table generation method and device - Google Patents
Project table generation method and device Download PDFInfo
- Publication number
- CN109829141B CN109829141B CN201811624649.5A CN201811624649A CN109829141B CN 109829141 B CN109829141 B CN 109829141B CN 201811624649 A CN201811624649 A CN 201811624649A CN 109829141 B CN109829141 B CN 109829141B
- Authority
- CN
- China
- Prior art keywords
- template
- item
- data
- cell
- value
- 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.)
- Active
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method and a device for generating a project table, wherein the method comprises the following steps: displaying a template table list on an operation interface, copying the target template table after detecting the target template table selected by a user in the template table list to obtain template data, and generating a project table by using the obtained template data; the OID number of the item table is the same as the OID number of the target template table; after obtaining item data entered by a user in the generated item table, combining the template data and the item data existing in the item table by adopting a preset combining rule to obtain an item table formed by combining results: the method comprises the steps that a merging rule is preset, if the template data has a value in a cell, the value of the template data in the cell is used as the value of the cell; if the template data has no value in the cell, the value of the item data in the cell is taken as the value of the cell. By applying the embodiment of the invention, the standardization of the project table is improved.
Description
Technical Field
The present invention relates to the field of online forms, and in particular, to a method and apparatus for generating an item form.
Background
With the development of business items, completing an item may consist of a large number of online forms, e.g., an item has more than 100 sub-items, each sub-item may contain 300 workbooks, each workbook contains 3 online forms, and then a total of 9 ten thousand online forms need to be made to complete the item. Workers are often required to process large amounts of forms and data.
In order to improve the working efficiency and the normalization of the table, the conventional table generating method is generally as follows: a new form is generated by editing a template form set in advance. However, the inventors have found that in implementing the present invention, the prior art has at least the following problems: because all data in the item table can be modified, the item table in the same item is difficult to unify templates, and the standardization of the item table is not high.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a project form generation method and a project form generation device, which are used for ensuring that project forms in the same project can be unified as templates so as to improve the standardization of the project forms.
The invention is realized in the following way:
in a first aspect, the present invention provides a method for generating an item table, the method comprising:
displaying a template table list on an operation interface, copying a target template table selected by a user in the template table list after the target template table is detected, obtaining template data, and generating a project table by using the obtained template data; the OID number of the item table is the same as the OID number of the target template table;
after obtaining item data entered by a user in the generated item table, merging the template data existing in the item table with the item data by adopting a preset merging rule to obtain an item table formed by merging results: the preset merging rule is that for the same cell, if the template data has a value in the cell, the value of the template data in the cell is used as the value of the cell; if the template data has no value in the cell, the value of the item data in the cell is taken as the value of the cell.
Optionally, a preset merging rule is adopted to merge the template data existing in the item table with the item data to obtain an item table formed by merging results, including:
respectively taking the template data and the item data existing in the item table as a first JSON object and a second JSON object;
for each cell in the item table, if the first JSON object has a value in the cell, taking the value of the first JSON object as the value of the cell; and if the first JSON object has no value in the cell, taking the value of the second JSON object in the cell as the value of the cell.
Optionally, after obtaining the project data, the method further comprises:
and saving the obtained project data in a JSON format.
Optionally, the method further comprises:
and caching each template table in the template table list to the local.
Optionally, the method further comprises:
upon detection of a load instruction, a different online form than the local cache is loaded from the server, and the local cache online form is updated with the loaded online form, including the template form and the item form.
Optionally, loading a presence form other than the local cache from the server, updating the local cache presence form with the loaded presence form, including:
for each locally cached template table, obtaining a local version number and an ID number of the template table; obtaining a source version number of a template table having the ID number from a server; judging whether the local version number is the same as the source version number; if not, pulling the template form with the ID number from the server, and updating the template form by using the pulled template form; if the template tables are the same, the template tables are not pulled from the server;
for each locally cached item table, obtaining a local version number, an ID number and an OID number of the item table; determining a corresponding template table with the OID number and obtaining a source version number of the item table with the ID number from the server; judging whether the local version number and the source version number of the item table are the same; if the item tables are not the same, the item table with the ID number is pulled from the server, the item table which is locally cached is updated by the pulled item table, and the updated item table is used as the item table to be combined; if the item tables are the same, taking the locally cached item table as an item table to be combined; and merging the item table to be merged with the determined corresponding template table, and updating the item table to be merged by using a merging result.
Optionally, the method further comprises:
after detecting the modification instruction, modifying the template table acted by the modification instruction.
In a second aspect, the present invention provides an item table generating apparatus, the apparatus comprising:
the acquisition module is used for displaying a template table list on an operation interface, copying the target template table after detecting the target template table selected by a user in the template table list to obtain template data, and generating a project table by using the obtained template data; the OID number of the item table is the same as the OID number of the target template table;
the merging module is used for merging the template data existing in the item table with the item data by adopting a preset merging rule after obtaining the item data typed in by the user in the generated item table, so as to obtain an item table formed by merging results: the preset merging rule is that for the same cell, if the template data has a value in the cell, the value of the template data in the cell is used as the value of the cell; if the template data has no value in the cell, the value of the item data in the cell is taken as the value of the cell.
Optionally, the merging module merges the template data existing in the item table with the item data by adopting a preset merging rule to obtain an item table formed by merging results, which specifically includes:
respectively taking the template data and the item data existing in the item table as a first JSON object and a second JSON object;
for each cell in the item table, if the first JSON object has a value in the cell, taking the value of the first JSON object as the value of the cell; and if the first JSON object has no value in the cell, taking the value of the second JSON object in the cell as the value of the cell.
Optionally, the device further comprises a storage module for:
after obtaining the item data, the obtained item data is saved as JSON format.
Optionally, the apparatus further includes:
and the caching module is used for caching the item table formed by the combination result and each template table in the template table list to the local.
Optionally, the apparatus further includes:
and the loading module is used for loading the online form which is different from the local cache from the server after the loading instruction is detected, and updating the online form which is locally cached by using the loaded online form, wherein the online form comprises a template form and an item form.
Optionally, the loading module loads an online form different from the local cache from the server, and updates the local cache online form with the loaded online form, specifically:
for each locally cached template table, obtaining a local version number and an ID number of the template table; obtaining a source version number of a template table having the ID number from a server; judging whether the local version number is the same as the source version number; if not, pulling the template form with the ID number from the server, and updating the template form by using the pulled template form; if the template tables are the same, the template tables are not pulled from the server;
for each locally cached item table, obtaining a local version number, an ID number and an OID number of the item table; determining a corresponding template table with the OID number and obtaining a source version number of the item table with the ID number from the server; judging whether the local version number and the source version number of the item table are the same; if the item tables are not the same, the item table with the ID number is pulled from the server, the item table which is locally cached is updated by the pulled item table, and the updated item table is used as the item table to be combined; if the item tables are the same, taking the locally cached item table as an item table to be combined; and merging the item table to be merged with the determined corresponding template table, and updating the item table to be merged by using a merging result.
Optionally, the apparatus further comprises a modification module for:
after detecting the modification instruction, modifying the template table acted by the modification instruction.
The invention has the following beneficial effects: by applying the embodiment of the invention, each item table in the item can be newly built by copying the template table, the efficiency of generating the item table is improved, each item table in the item is combined by template data and item data, and if the item data and the template data have values in a certain cell, the value of the template data in the cell is taken as the final value of the cell; the uniformity of template data in each item table generated based on the same template table is ensured, the consistency and normalization of each item table in the same item are ensured, and the purpose of normalizing the item table according to the template table is achieved; and because the OID number of the item table is the same as the OID number of the target template table, the cross-table reference relation in the template table can be directly copied into the item table, the item table can directly obtain and use the cross-table reference relation, and the cross-table reference relation does not need to be reestablished in the item table, thereby realizing the new construction process of simplifying the item table and being convenient for quickly generating the required item table.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method for generating an item table according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an item table generating device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, the method for generating the project table provided by the present invention may be applied to an electronic device, where in a specific application, the electronic device may be a computer, a personal computer, a tablet, a mobile phone, etc., which is all reasonable. In addition, the functional software for implementing the project table generation method provided by the embodiment of the invention can be special project table generation software or a plug-in software with the project table generation function. The invention is not limited to the running system in the electronic device, and for example, the running system can be a LINUX operating system, a Windows operating system, a UNIX operating system, or the like.
Referring to fig. 1, an embodiment of the present invention provides a method for generating an item table, including the following steps:
s101, displaying a template table list on an operation interface, copying a target template table selected by a user in the template table list after the target template table is detected, obtaining template data, and generating a project table by using the obtained template data; the OID number of the item table is the same as the OID number of the target template table;
the template table list may have a plurality of template table options, each template table option corresponds to a template table, the template table may be a pre-constructed basic table, the user may be any person having ordinary skill in the art who can operate the man-machine interaction interface, the template table selected by the user in the template table options may be referred to as a target template table, one or more target template tables selected by the user may be provided, and for each target template table, template data of the target template table may be used to generate an item table.
It should be noted that, the template table and the item table of the present invention may include an OID (Object Identifier ) number and an ID (identification) number, where the OID number and the ID number of each template table are the same, the OID number of the item table is the same as the OID number of the template table used to generate the item table, the OID number and the ID number of each item table are different, the ID number of the template table is used to uniquely identify the template table, and the ID number of the item table is used to uniquely identify the item table. The relation between the item table and the template table can be quickly determined through the OID number, so that the item tables generated by the same template table can be quickly determined. The specific form of the ID number and the OID number is not limited in the present invention, and may be, for example, a character string formed by one or a combination of characters such as numerals, letters, and underlines.
The template data of the target template table may include fields in the table, field values for each field, patterns of cells, formulas in cells, and so forth. The form may be an online form, in the format of Excel, csv (Comma-Separated Values), xml (eXtensible Markup Language ), or the like. The method for generating the item table by using the template data is not limited, and for example, a method for generating the table can be written in advance by adopting programming languages such as C#, ASP NET and the like or an Excel library can be directly referenced to generate the Excel table.
A user can pre-construct a template table through a SpreadJS online editor, and can type a cross-table function in the template table, through the cross-table function, the cross-table reference relation between the template table and other template tables can be pre-established, and the cross-table reference relation can be copied into an item table generated based on the template table. The parameter format of the cross-table function is as follows: "[ OID ] shaetindex ] shaetname", cell, wherein OID represents the OID number of the target form to be referenced, shaetindex represents the index number of the target form in which the data to be referenced is located, shaetname represents the name of the target form in which the data to be referenced is located, and cell represents the cell region in which the data to be referenced is located.
The project table and the template table can be regarded as a database for storing two data tables, if the cross-table reference function is preset in the template table, each project table generated based on copying the template table also comprises the cross-table reference function, and the cross-table reference function takes the OID number as one of parameters, and the OID number of the project table is the same as the OID number of the template table used for generating the project table, so that the cross-table reference relation in the template table can be directly copied into the project table, the project table can directly obtain and use the cross-table reference relation, the cross-table reference relation does not need to be re-established in the project table, thereby realizing the new construction process of simplifying the project table, and being convenient for quickly generating the required project table.
S102, after obtaining item data input by a user in the generated item table, merging the template data existing in the item table with the item data by adopting a preset merging rule to obtain an item table formed by merging results: the preset merging rule is that for the same cell, if the template data has a value in the cell, the value of the template data in the cell is used as the value of the cell; if the template data has no value in the cell, the value of the item data in the cell is taken as the value of the cell.
The user can type the item data in the item table, if the template data exists in a certain cell, the value of the cell cannot change along with the change of the value of the newly-typed item data, and the normalization of the item table is ensured.
Specifically, a preset merging rule is adopted to merge the template data existing in the item table with the item data to obtain an item table formed by merging results, which may include: converting the existing template data and the project data in the project table into a first JSON object and a second JSON object respectively; for each cell in the item table, if the first JSON object has a value in the cell, taking the value of the first JSON object as the value of the cell; and if the first JSON object has no value in the cell, taking the value of the second JSON object in the cell as the value of the cell.
The JSON (JavaScript Object Notation, JS object numbered musical notation) is a lightweight data exchange format, and both template data and project data can be in the form of JSON character strings and converted into JSON objects, so that data merging can be realized rapidly. The invention does not limit the mutual conversion between the JSON object and the JSON character string, and can adopt the existing conversion mode for conversion.
Or in other embodiments, the preset merge rule may be designed in other manners, which is not limited in the present invention. For example, JQuery may also be employed to merge two JSON objects.
By applying the embodiment of the invention, each item table in the item can be newly built by copying the target template table, the efficiency of generating the item table is improved, each item table in the item is combined by template data and item data, and if the item data and the template data have values in a certain cell, the value of the template data in the cell is taken as the final value of the cell; the uniformity of template data in each item table generated based on the same template table is ensured, the consistency and normalization of each item table in the same item are ensured, and the purpose of normalizing the item table according to the template table is achieved.
In one embodiment, the method further comprises:
after detecting the modification instruction, modifying the template table acted by the modification instruction.
After the template table and the project table are built, the data in the tables can be modified. The invention does not limit the specific modification mode, for example, the specific contents of the tables such as the cross-table function, the field name, the field value and the like in the template table or the project table can be modified through the SpreadJS online table editor. For example, the project table may be adaptively modified according to project related content, e.g., modifying a specific value of a certain field of the project table, modifying a cross-table referencing relationship of a certain cell, etc., and the field name of the template table, style related content, e.g., font, line height, etc., of the cell may be modified.
The template table can generally meet the requirements of most of the projects, but in the process of actually creating the projects, the template of the projects may need to be modified according to the conditions of the projects, and since the OID number of the project table is the same as the OID number of the template table used for generating the project table, after the template table is modified, the contents in the project table with the OID number can be uniformly modified, so that all project tables of the whole project are uniformly modified without singly modifying each project table.
By applying the embodiment of the invention, the project table is obtained by copying the template table, and the template table is not directly used as the project table, so that the project table and the template table are mutually independent, and any party is modified without affecting the other party. When a few item tables required by the item and the existing template tables exist, the user can still select to use the template table to create the item, then independently modify the template data in the item table, and for each item table uniformly generated by the template table, the OID numbers of the item tables are the same as the OID numbers of the template table, so that the template data in each item table can be uniformly modified along with modification of the template data in a certain item table, the template data of each item table is uniformly modified by modifying the template data of one item table, the modification process is simplified, and the uniformity of the templates of each item table is facilitated.
In addition, when the project table needed by the project is larger in access with the existing template table, a user can establish a set of template table according to the project requirement so as to generate the project table, and the flexibility and usability of the template table are ensured.
In order to facilitate the user to create a template form, a template management button may be displayed on the operation interface, after detecting that the user clicks the template management button, a dialog box may be popped up, a template name input by the user through the dialog box may be obtained, after obtaining the template name, a template editing operation interface may be displayed, and the template editing operation interface may provide an editing operation button, for example, a button for creating, modifying, deleting a folder or a file, creating a sub-level file for the folder by selecting the folder and clicking the new button.
The file tree directory for storing the template table can be an infinite tree data structure constructed based on a database, the file can be moved in a mode of dragging the file to change the file sequence or the hierarchical structure for convenience of a user, in addition, the user can edit template data for each file (namely the template table) through a SpreadJS online table editor, and after clicking a save button, the electronic equipment can store the template data into the database. After the template table is constructed, a user can select a newly added template in the template editing operation interface and adjust the newly added template to be in an enabling mode, and then the template table can be displayed on a template table list displayed on the operation interface for selection by the user.
By applying the embodiment of the invention, the user can conveniently and quickly construct the required template form, and the user experience is improved.
To facilitate subsequent quick reading of the item table, after obtaining the item data, the method further comprises:
and saving the obtained project data in a JSON format.
After the user types the project data, the user can click a data storage button, and the electronic device can store the project data, or directly store the project data after obtaining the project data typed by the user, and the specific storage mode can be as follows: and converting the data into a JSON format through an online electronic form, and integrally storing the data. Therefore, when the item table is opened again next time, the combination of the template data and the item data can be quickly carried out through JSON coverage logic, so that the rate of reading the item table is improved.
To improve the efficiency of the subsequent table acquisition, the method further comprises:
and caching each template table in the template table list to the local.
By caching the item table and the template table locally, the influence on the efficiency caused by continuously pulling the item table and the template table from the server can be avoided, and the efficiency of subsequently acquiring the table is improved.
Each online form may also include a version number (version), which may be referred to as a source version number when stored on the server; when cached locally, its version number may be referred to as a local version number. In order to ensure the integrity and version accuracy of the data, if the data (data) in the online form changes, the version number of the online form may change accordingly. version can be MD5 (Message-Digest Algorithm) value generated by the character string of the data field, MD5 is a widely used cryptographic hash function, a 128-bit (16-byte) hash value can be generated, and MD5 values generated by different character strings are different, so that version difference after data change can be ensured, and the integrity and consistency of data are ensured.
The MD5 value of the cached online form may be calculated by using an MD5 calculator, or a program for calculating the MD5 value may be written in advance using a programming language such as Python, PHP, or the like, and the MD5 value of the cached online form is calculated by executing the program. In addition, in other implementations, the SHA (Secure Hash Algorithm ) 1 value, SHA256 value, or SHA512 value of the cached online form may be calculated, and the calculated SHA1 value, SHA256 value, or SHA512 value may be used as the local version number of the cached online form. Two cache data structures can be adopted to respectively cache the template table and the item table, and the cache data structure for storing the template table can comprise ID, data { }, version and OID which respectively represent the ID number, data, local version number and OID number of the template table; the cache data structure for storing the item table may include ID, data { }, excel_id, project_id, version, and OID, representing the ID number, data, form number, item number, local version number, and OID number of the item table, respectively. In other embodiments, other data structures may be used to buffer the template table and the item table, and the present invention is not limited to the specific data structure form.
In one implementation, the method further comprises: upon detection of a load instruction, a different online form than the local cache is loaded from the server, and the local cache online form is updated with the loaded online form, including the template form and the item form.
The present invention is not limited to a specific manner of detecting a load instruction, and may be, for example: after the application program opening instruction is obtained, loading a template table and a project table which are different from the local cache from a server; or, after detecting that a refresh button or a reload button on the displayed interface is clicked, loading a template form and an item form different from the local cache from the server; alternatively, template tables and item tables other than the local cache are loaded from the server every preset fixed time period or every preset time point is reached.
The electronic device may display an icon of an application program for implementing the function of the present invention, and the user may click or double click on the icon, so that the electronic device may obtain an application program opening instruction, and further may load a template table and an item table different from the local cache from the server. Alternatively, the electronic device may display an interface operable by the user, which may include a refresh button or a reload button, and upon detecting that the user clicks the refresh button or reload button, an online form other than the local cache may be loaded from the server. Loading a table from the server that is different from the locally cached table refers to loading a table from the server that is different from the locally cached table. The preset fixed time length and the preset time point can be preset according to requirements, for example, the preset time length is 1 hour, 2 hours and the like, and the preset time point can be 9:00, 14:00, 18:00 and the like.
Specifically, loading a presence form other than the local cache from the server, updating the local cache presence form with the loaded presence form may include:
for each locally cached template table, obtaining a local version number and an ID number of the template table; obtaining a source version number of a template table having the ID number from a server; judging whether the local version number is the same as the source version number; if not, pulling the template form with the ID number from the server, and updating the template form by using the pulled template form; if the template tables are the same, the template tables are not pulled from the server;
for each locally cached item table, obtaining a local version number, an ID number and an OID number of the item table; determining a corresponding template table with the OID number and obtaining a source version number of the item table with the ID number from the server; judging whether the local version number and the source version number of the item table are the same; if the item tables are not the same, the item table with the ID number is pulled from the server, the item table which is locally cached is updated by the pulled item table, and the updated item table is used as the item table to be combined; if the item tables are the same, taking the locally cached item table as an item table to be combined; and merging the item table to be merged with the determined corresponding template table, and updating the item table to be merged by using a merging result.
In the first loading, since the local cache does not contain the table from the server, all template tables and item tables can be pulled from the server, and then only the tables different from the local cache need to be pulled from the server for each loading.
Specifically, the following merging principle may be adopted to merge the determined corresponding template table and the item table to be merged: if the item table to be combined and the corresponding template table have values in a certain cell, taking the value of the corresponding template table as the final value of the cell; this ensures normalization of the item tables to be merged. Assuming that the data content of the corresponding template table is A= { a:1, B: { B1:2, B2:3}, c:2}, and the data content of the item table to be combined is B= { a:2, d:3}, the result obtained by combining the corresponding template table and the item to be combined is { a:1, B: { B1:2, B2:3}, c:2, d:3}.
In one implementation, determining the corresponding template table with the OID number may include:
obtaining a source version number of a template table with the OID number from a server; judging whether the local version number of the template table with the OID number is the same as the source version number; if the template tables are not the same, the template table with the OID number is pulled from the server, the template table with the OID number which is locally cached is updated by the pulled template table, and the updated template table is determined to be the corresponding template table with the OID number; if the template tables are the same, the locally cached template table with the OID number is determined to be the corresponding template table with the OID number.
By adopting the embodiment of the invention, the online form is cached locally, so that the online form does not need to be acquired at each time by the server, the influence on the efficiency caused by continuously pulling the item form and the template form from the server is avoided, and the efficiency of acquiring the online form subsequently is improved. And by comparing the version numbers, the consistency of the locally cached template form and the content of the template form in the server and the consistency of the locally cached item form and the content of the item form in the server are ensured, so that the timely update of the locally cached online form is realized, and the accuracy and the reliability of the locally cached online form are improved.
In addition, in order to improve the data transmission efficiency, the server may compress the table requested to be loaded by the electronic device, and further transmit the compressed table to improve the transmission efficiency, for example, the server may compress the table by adopting GZIP and/or LZ-string, so that before the electronic device displays the loaded table, the method further includes decompressing the loaded table; displaying the loaded form includes displaying the decompressed form.
Corresponding to the method embodiment, the embodiment of the invention also provides a device for generating the project table.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an apparatus for generating an item table according to an embodiment of the present invention, where the apparatus includes:
the obtaining module 201 is configured to display a template table list on an operation interface, copy a target template table selected by a user in the template table list after detecting the target template table, obtain template data, and generate an item table using the obtained template data; the OID number of the item table is the same as the OID number of the target template table;
the merging module 202 is configured to, after obtaining item data entered by a user in the generated item table, merge, using a preset merge rule, existing template data in the item table and the item data, to obtain an item table formed by a merging result: the preset merging rule is that for the same cell, if the template data has a value in the cell, the value of the template data in the cell is used as the value of the cell; if the template data has no value in the cell, the value of the item data in the cell is taken as the value of the cell.
By applying the embodiment of the invention, each item table in the item can be newly built by copying the target template table, the efficiency of generating the item table is improved, each item table in the item is combined by template data and item data, and if the item data and the template data have values in a certain cell, the value of the template data in the cell is taken as the final value of the cell; the uniformity of template data in each item table generated based on the same template table is ensured, the consistency and normalization of each item table in the same item are ensured, and the purpose of normalizing the item table according to the template table is achieved; and because the OID number of the item table is the same as the OID number of the target template table, the cross-table reference relation in the template table can be directly copied into the item table, so that the item table can directly obtain and use the cross-table reference relation without reestablishing the cross-table reference relation in the item table, thereby realizing the new construction process of simplifying the item table and being convenient for quickly generating the required item table.
Optionally, the merging module merges the template data existing in the item table with the item data by adopting a preset merging rule to obtain an item table formed by merging results, which specifically includes:
respectively taking the template data and the item data existing in the item table as a first JSON object and a second JSON object;
for each cell in the item table, if the first JSON object has a value in the cell, taking the value of the first JSON object as the value of the cell; and if the first JSON object has no value in the cell, taking the value of the second JSON object in the cell as the value of the cell.
Optionally, the device further comprises a storage module for:
after obtaining the item data, the obtained item data is saved as JSON format.
Optionally, the apparatus further includes:
and the caching module is used for caching the item table formed by the combination result and each template table in the template table list to the local.
Optionally, the apparatus further includes:
and the loading module is used for loading the online form which is different from the local cache from the server after the loading instruction is detected, and updating the online form which is locally cached by using the loaded online form, wherein the online form comprises a template form and an item form.
Optionally, the loading module loads an online form different from the local cache from the server, and updates the local cache online form with the loaded online form, specifically:
for each locally cached template table, obtaining a local version number and an ID number of the template table; obtaining a source version number of a template table having the ID number from a server; judging whether the local version number is the same as the source version number; if not, pulling the template form with the ID number from the server, and updating the template form by using the pulled template form; if the template tables are the same, the template tables are not pulled from the server;
for each locally cached item table, obtaining a local version number, an ID number and an OID number of the item table; determining a corresponding template table with the OID number and obtaining a source version number of the item table with the ID number from the server; judging whether the local version number and the source version number of the item table are the same; if the item tables are not the same, the item table with the ID number is pulled from the server, the item table which is locally cached is updated by the pulled item table, and the updated item table is used as the item table to be combined; if the item tables are the same, taking the locally cached item table as an item table to be combined; and merging the item table to be merged with the determined corresponding template table, and updating the item table to be merged by using a merging result.
Optionally, the apparatus further comprises a modification module for:
after detecting the modification instruction, modifying the template table acted by the modification instruction.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.
Claims (6)
1. A method of generating a project table, the method comprising:
displaying a template table list on an operation interface, copying a target template table selected by a user in the template table list after the target template table is detected, obtaining template data, and generating a project table by using the obtained template data; the OID number of the item table is the same as the OID number of the target template table;
after obtaining item data entered by a user in the generated item table, merging the template data existing in the item table with the item data by adopting a preset merging rule to obtain an item table formed by merging results: the preset merging rule is that for the same cell, if the template data has a value in the cell, the value of the template data in the cell is used as the value of the cell; if the template data has no value in the cell, taking the value of the item data in the cell as the value of the cell;
caching each template table in the template table list to the local;
after detecting the loading instruction, loading an online form different from the local cache from the server, and updating the local cache online form with the loaded online form, wherein the online form comprises a template form and an item form;
loading a presence form other than the local cache from the server, updating the local cache presence form with the loaded presence form, comprising:
for each locally cached template table, obtaining a local version number and an ID number of the template table; obtaining a source version number of a template table having the ID number from a server; judging whether the local version number is the same as the source version number; if not, pulling the template form with the ID number from the server, and updating the template form by using the pulled template form; if the template tables are the same, the template tables are not pulled from the server;
for each locally cached item table, obtaining a local version number, an ID number and an OID number of the item table; determining a corresponding template table with the OID number and obtaining a source version number of the item table with the ID number from the server; judging whether the local version number and the source version number of the item table are the same; if the item tables are not the same, the item table with the ID number is pulled from the server, the item table which is locally cached is updated by the pulled item table, and the updated item table is used as the item table to be combined; if the item tables are the same, taking the locally cached item table as an item table to be combined; combining the item table to be combined with the determined corresponding template table, and updating the item table to be combined by using a combination result;
after detecting the modification instruction, modifying the template table acted by the modification instruction.
2. The method of claim 1, wherein combining the template data existing in the item table and the item data using a preset combining rule to obtain an item table formed by combining results, comprises:
respectively taking the template data and the item data existing in the item table as a first JSON object and a second JSON object;
for each cell in the item table, if the first JSON object has a value in the cell, taking the value of the first JSON object as the value of the cell; and if the first JSON object has no value in the cell, taking the value of the second JSON object in the cell as the value of the cell.
3. The method according to claim 1 or 2, wherein after obtaining project data, the method further comprises:
and saving the obtained project data in a JSON format.
4. An item table generating apparatus, comprising:
the acquisition module is used for displaying a template table list on an operation interface, copying the target template table after detecting the target template table selected by a user in the template table list to obtain template data, and generating a project table by using the obtained template data; the OID number of the item table is the same as the OID number of the target template table;
the merging module is used for merging the template data existing in the item table with the item data by adopting a preset merging rule after obtaining the item data typed in by the user in the generated item table, so as to obtain an item table formed by merging results: the preset merging rule is that for the same cell, if the template data has a value in the cell, the value of the template data in the cell is used as the value of the cell; if the template data has no value in the cell, taking the value of the item data in the cell as the value of the cell; caching each template table in the template table list to the local; after detecting the loading instruction, loading an online form different from the local cache from the server, and updating the local cache online form with the loaded online form, wherein the online form comprises a template form and an item form; loading a presence form other than the local cache from the server, updating the local cache presence form with the loaded presence form, comprising: for each locally cached template table, obtaining a local version number and an ID number of the template table; obtaining a source version number of a template table having the ID number from a server; judging whether the local version number is the same as the source version number; if not, pulling the template form with the ID number from the server, and updating the template form by using the pulled template form; if the template tables are the same, the template tables are not pulled from the server; for each locally cached item table, obtaining a local version number, an ID number and an OID number of the item table; determining a corresponding template table with the OID number and obtaining a source version number of the item table with the ID number from the server; judging whether the local version number and the source version number of the item table are the same; if the item tables are not the same, the item table with the ID number is pulled from the server, the item table which is locally cached is updated by the pulled item table, and the updated item table is used as the item table to be combined; if the item tables are the same, taking the locally cached item table as an item table to be combined; combining the item table to be combined with the determined corresponding template table, and updating the item table to be combined by using a combination result; after detecting the modification instruction, modifying the template table acted by the modification instruction.
5. The apparatus of claim 4, wherein the merging module merges the template data existing in the item table with the item data by using a preset merging rule to obtain an item table formed by merging results, specifically:
respectively taking the template data and the item data existing in the item table as a first JSON object and a second JSON object;
for each cell in the item table, if the first JSON object has a value in the cell, taking the value of the first JSON object as the value of the cell; and if the first JSON object has no value in the cell, taking the value of the second JSON object in the cell as the value of the cell.
6. The apparatus of claim 4 or 5, further comprising a storage module for:
after obtaining the item data, the obtained item data is saved as JSON format.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811624649.5A CN109829141B (en) | 2018-12-28 | 2018-12-28 | Project table generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811624649.5A CN109829141B (en) | 2018-12-28 | 2018-12-28 | Project table generation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109829141A CN109829141A (en) | 2019-05-31 |
CN109829141B true CN109829141B (en) | 2023-06-09 |
Family
ID=66860567
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811624649.5A Active CN109829141B (en) | 2018-12-28 | 2018-12-28 | Project table generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109829141B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112949266B (en) * | 2019-12-11 | 2024-06-25 | 珠海金山办公软件有限公司 | Electronic form processing method, electronic form processing device, electronic equipment and storage medium |
CN111767704B (en) * | 2020-06-30 | 2024-01-26 | 浪潮通用软件有限公司 | Excel form template generation method and device |
CN113220752A (en) | 2021-05-06 | 2021-08-06 | 北京字跳网络技术有限公司 | Display method and device and electronic equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104978215A (en) * | 2014-10-08 | 2015-10-14 | 腾讯科技(深圳)有限公司 | File updating method, relevant equipment and system |
CN107943777A (en) * | 2017-12-14 | 2018-04-20 | 北京久蓉科技有限公司 | A kind of collaborative editing, cooperative processing method, device, equipment and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7554689B2 (en) * | 2003-10-15 | 2009-06-30 | Canon Kabushiki Kaisha | Document layout method |
US7469262B2 (en) * | 2003-12-29 | 2008-12-23 | Oracle International Corporation | Customizable metadata merging framework |
GB0623912D0 (en) * | 2006-11-30 | 2007-01-10 | Bayne Duncan J | Improved electronic form software and brower programming methods |
CN101650712A (en) * | 2009-08-18 | 2010-02-17 | 深圳市科陆电子科技股份有限公司 | Generating management method and system of self-defined report |
CN102708336B (en) * | 2012-05-02 | 2015-04-22 | 四川建设网有限责任公司 | Method and system for electronic document processing based on separation of key data from customized template |
-
2018
- 2018-12-28 CN CN201811624649.5A patent/CN109829141B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104978215A (en) * | 2014-10-08 | 2015-10-14 | 腾讯科技(深圳)有限公司 | File updating method, relevant equipment and system |
CN107943777A (en) * | 2017-12-14 | 2018-04-20 | 北京久蓉科技有限公司 | A kind of collaborative editing, cooperative processing method, device, equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
REDLetr: Workflow and tools to support the migration of legacy clinical data capture systems to REDCap;William D. Dunn Jr.等;International Journal of Medical Informatics;第93卷;103-110 * |
基于C#的OLEDB和COM组件对Excel文件操作;陈洪磊等;大众科技;第16卷(第6期);6-9 * |
Also Published As
Publication number | Publication date |
---|---|
CN109829141A (en) | 2019-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109829144B (en) | Method and device for cross-table referencing of online table | |
US20110307856A1 (en) | Workflow visualization | |
US11093242B2 (en) | Automatically mapping data while designing process flows | |
US11689609B2 (en) | Mechanism for webpage composition | |
US11016650B1 (en) | Building data metric objects through user interactions with data marks of displayed visual representations of data sources | |
US11755293B2 (en) | Code execution and data processing pipeline | |
US7899846B2 (en) | Declarative model editor generation | |
US20110083120A1 (en) | Modeling and linking documents for packaged software application configuration | |
CN109829141B (en) | Project table generation method and device | |
US11556702B2 (en) | Orchestration of crud operations for a hierarchical web service data model in a spreadsheet | |
US20200104121A1 (en) | Efficient storage and analysis of source code modification history data | |
CN109815428B (en) | Online table caching method and device | |
CN110309239B (en) | Visual map editing method and device | |
US20130346845A1 (en) | Interactive multi device in memory form generation | |
US20140337284A1 (en) | Synchronizing folders using a shadow folder hierarchy | |
US20180157686A1 (en) | System and method for datastore management framework | |
US20240037325A1 (en) | Ability to add non-direct ancestor columns in child spreadsheets | |
US20200257507A1 (en) | Integration of workflow and logical data objects using visual programming | |
US10460015B1 (en) | Assimilation in multi model webpage composition | |
Dujlovic et al. | An approach to web-based visualization of automatically generated data models | |
US11074231B1 (en) | Validating modifications to mapping statements for processing hierarchical data structures | |
CN109829143B (en) | Online form summarizing method and device | |
US10515330B2 (en) | Real time visibility of process lifecycle | |
US20240054170A1 (en) | Methods and systems for web-based data presentation | |
Milovanovic et al. | Python Data Visualization Cookbook |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230830 Address after: DB Area, Liye Commune Store, No. 289 Guanshan Avenue, Hongshan District, Wuhan City, Hubei Province, 430070 Patentee after: Wuhan Mango Technology Co.,Ltd. Address before: 430056 room 1603, building 36, Golden Harbor Phase IV, 68 Dongfeng Avenue, Hanyang District, Wuhan City, Hubei Province Patentee before: Chen Deqin |
|
TR01 | Transfer of patent right |