CN112115695A - Template dynamic generation method, system, computer equipment and storage medium - Google Patents

Template dynamic generation method, system, computer equipment and storage medium Download PDF

Info

Publication number
CN112115695A
CN112115695A CN202010970747.5A CN202010970747A CN112115695A CN 112115695 A CN112115695 A CN 112115695A CN 202010970747 A CN202010970747 A CN 202010970747A CN 112115695 A CN112115695 A CN 112115695A
Authority
CN
China
Prior art keywords
template
data
filling
bookmark
dynamic adjustment
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
CN202010970747.5A
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.)
Ping An Trust Co Ltd
Original Assignee
Ping An Trust 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 Ping An Trust Co Ltd filed Critical Ping An Trust Co Ltd
Priority to CN202010970747.5A priority Critical patent/CN112115695A/en
Publication of CN112115695A publication Critical patent/CN112115695A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The invention relates to the technical field of computers, and discloses a template dynamic generation method, a template dynamic generation system, computer equipment and a storage medium, wherein the method comprises the following steps: configuring bookmarks for a dynamic adjustment area in a preset document template; acquiring corresponding template filling data from a database according to the bookmark; filling template filling data obtained after traversing the dynamic adjustment area in the preset document template into the corresponding dynamic adjustment area to generate a report template; and the dynamic adjustment area is used for displaying the obtained template filling data as the template content of the report template. According to the invention, by configuring the bookmarks in the preset document template, when the existing service scene is changed, the dynamic generation of the report template can be rapidly realized, the manufacturing speed of the report template is increased, the complexity of template manufacturing and development is reduced, and the convenience of later-stage report template maintenance can be improved.

Description

Template dynamic generation method, system, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a template dynamic generation method, system, computer device, and storage medium.
Background
In the daily work process of a company enterprise, corresponding report templates are often required to be made according to actual business. When the company has a wide business volume, the number of the corresponding report templates is also huge. The existing report template is generally customized and developed by research and development personnel according to the requirements of actual services, and after the report template of a certain service is put into use, if the service direction or the service details are changed, the research and development personnel need to reevaluate the complete service flow to remake the template. When the actual service is changed frequently, the frequent re-formulation of the report template will occupy a lot of service preparation time, and the service development rate is seriously affected. Moreover, the frequent development of the report template also occupies a great amount of development time of research personnel, wastes time and labor, and is easy to cause the sudden increase of business maintenance cost.
Disclosure of Invention
The invention mainly aims to provide a template dynamic generation method, a template dynamic generation system, computer equipment and a storage medium, and aims to solve the problem of low manufacturing efficiency of report templates.
In order to achieve the above object, the present invention provides a template dynamic generation method, which comprises the following steps:
configuring bookmarks for a dynamic adjustment area in a preset document template;
acquiring corresponding template filling data from a database according to the bookmark;
filling template filling data obtained after traversing the dynamic adjustment area in the preset document template into the corresponding dynamic adjustment area to generate a report template; and the dynamic adjustment area is used for displaying the obtained template filling data as the template content of the report template.
Optionally, before the step of configuring the bookmark to the dynamic adjustment area in the preset document template, the method further includes:
acquiring a correlation template of the preset document template, performing matching analysis on template contents in the correlation template, and determining the change frequency of filling data of each area in the template contents;
and dividing each area in the template content into a fixed area and a dynamic adjustment area according to a preset frequency change threshold.
Optionally, the step of configuring a bookmark for the dynamic adjustment area in the preset document template includes:
and determining a dynamic adjustment area selected by a user and bookmark contents input by the user according to a configuration instruction triggered by the user, and configuring the bookmark according to the bookmark contents.
Optionally, the step of obtaining corresponding template filling data from a database according to the bookmark includes:
acquiring a template value expression corresponding to the bookmark from a database;
and reading corresponding fields from the database as template filling data according to the template value expression, and replacing corresponding template placeholders with the template filling data.
Optionally, after the step of filling template filling data obtained after traversing the dynamic adjustment region in the preset document template into the corresponding dynamic adjustment region to generate a report template, the method further includes:
determining a data filling position in the report template according to a data filling instruction triggered by a user;
configuring a rule element for the data filling position, wherein the rule element comprises a data value expression and a data format of the data filling position;
and acquiring filling data conforming to the data format from the database according to the data value expression corresponding to the data filling position, and filling the filling data to the data filling position to generate a data filling report.
Optionally, the step of obtaining, from the database, filling data conforming to the data format according to the data value expression corresponding to the data filling position, and filling the filling data to the data filling position includes:
traversing the data filling positions in the report template, and replacing each data filling position with an editable bookmark corresponding to the data filling position;
and acquiring filling data conforming to the data format from a database according to the data value expression corresponding to each bookmark, and replacing each bookmark with the corresponding filling data.
Optionally, the step of obtaining the filling data conforming to the data format from the database according to the data value expression corresponding to each bookmark includes:
updating the database according to the data to be disclosed pushed by the data management terminal;
and acquiring filling data conforming to the data format from the updated database according to the data value expression corresponding to each bookmark.
In order to achieve the above object, the present invention further provides a template dynamic generation system, including:
the configuration module is used for configuring bookmarks for the dynamic adjustment area in the preset document template;
the data acquisition module is used for acquiring corresponding template filling data from a database according to the bookmark;
and the filling module is used for filling template filling data obtained after traversing the dynamic adjustment area in the preset document template into the corresponding dynamic adjustment area so as to generate a report template.
To achieve the above object, the present invention further provides a computer device, which includes a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the template dynamic generation method as described above.
To achieve the above object, the present invention further provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the template dynamic generation method as described above.
According to the template dynamic generation method, the system, the computer equipment and the storage medium, the bookmark or the bookmark content modification is configured in the dynamic adjustment area in the preset document template in the application interface, the preset document template can be edited and modified according to the requirements of actual business, the modified preset document template traverses all the dynamic adjustment area in the preset document template after being normally started, corresponding template filling data is obtained from a database according to the modified bookmark content, and the dynamic adjustment area is dynamically loaded and filled, so that the dynamically loaded template content is displayed for a user. According to the change of the actual business, the bookmark content can be modified in the dynamic adjustment area needing to be modified in the preset document template, so that the template meeting the actual business requirement is obtained, a new template does not need to be manufactured again, the template manufacturing efficiency can be greatly improved, the complexity of template manufacturing and development is reduced, and the maintenance of the report template in the later period is greatly facilitated.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for dynamically generating templates according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for dynamically generating templates according to the present invention;
FIG. 4 is a flowchart illustrating a method for dynamically generating templates according to a third embodiment of the present invention;
FIG. 5 is a flowchart illustrating a template dynamic generation method according to a fourth embodiment of the present invention;
FIG. 6 is a flowchart illustrating a fifth embodiment of a template dynamic generation method according to the present invention;
FIG. 7 is a flowchart illustrating a sixth embodiment of a method for dynamically generating templates according to the present application;
FIG. 8 is a functional block diagram of the template dynamic generation system according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a hardware structure of a computer device provided in each embodiment of the present invention. The computer device comprises a communication module 01, a memory 02, a processor 03 and the like. Those skilled in the art will appreciate that the computer device illustrated in FIG. 1 may also include more or fewer components than shown, or combine certain components, or a different arrangement of components. The processor 03 is connected to the memory 02 and the communication module 01, respectively, and the memory 02 stores a computer program, which is executed by the processor 03 at the same time.
The communication module 01 may be connected to an external device through a network. The communication module 01 may receive data sent by an external device, and may also send data, instructions, and information to the external device, where the external device may be an electronic device such as a data management terminal, a mobile phone, a tablet computer, a notebook computer, and a desktop computer.
The memory 02 may be used to store software programs and various data. The memory 02 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, an application program required by at least one function (a target sub-process, a first monitoring sub-process and a shared file corresponding to the instruction are created based on a parent process), and the like; the storage data area may store data or information created according to the use of the computer device, or the like. Further, the memory 02 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 03, which is a control center of the computer device, connects various parts of the entire computer device by using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 02 and calling data stored in the memory 02, thereby integrally monitoring the computer device. Processor 03 may include one or more processing units; preferably, the processor 03 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 03.
Although not shown in fig. 1, the computer device may further include a circuit control module, where the circuit control module is used for being connected to a mains supply to implement power control and ensure normal operation of other components.
Those skilled in the art will appreciate that the computer device architecture depicted in FIG. 1 is not intended to be limiting of computer devices and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
Various embodiments of the method of the present invention are presented in terms of the above-described hardware architecture.
Referring to fig. 2, in a first embodiment of the template dynamic generation method of the present invention, the template dynamic generation method includes the steps of:
step S10, configuring bookmarks for the dynamic adjustment area in the preset document template;
in the scheme, a preset document template is stored in the computer device in advance, and the preset document template can be in a word document format. The preset document template consists of a fixed area and a dynamic adjustment area, the template content in the fixed area is fixed, and the template content in the dynamic adjustment area dynamically loads corresponding data and displays the data to a user when the preset document template is opened. The fixed area and the dynamic adjustment area of the preset document template can be converted by a user through area configuration. That is, the user can convert the dynamic adjustment area into the fixed area by area configuration, so that the area displays fixed template contents, for example, main template contents such as company name, code number, and the like, which are not easily changed even if the business is changed, can be configured as the fixed area. That is, even when the traffic is largely changed, the template content in the fixed area does not need to be adjusted. The user may also manually perform area configuration to convert the fixed area into the dynamic adjustment area, for example, after a service of a certain item of content in the template changes, the certain item of content needs to be frequently modified or needs to have a dynamic data loading requirement, and then the user may convert the area corresponding to the item of content from the fixed area into the dynamic adjustment area, so that the configured preset document template meets the changed service requirement.
The method includes the steps that fixed template content is preset in a fixed area in a document template, and content displayed in the fixed area when a user opens the template is the template content. And the dynamic adjustment area needs to perform bookmark configuration, and when the template is subjected to bookmark configuration, the content displayed in the dynamic adjustment area is the bookmark content, so that a user can configure and modify the bookmark content. And when the user normally opens the template, the dynamic adjustment area displays the actual template content acquired according to the bookmark content and loads and displays the actual template content. That is, by adding a corresponding bookmark to the dynamic adjustment area or modifying the bookmark content, dynamic loading of the template content can be achieved when the user opens the template.
It should be noted that each bookmark in the preset document template can be configured or modified independently, and when a certain position in the preset document template needs to be adjusted according to the change of the actual service, the position area only needs to be a dynamic adjustment area, and the bookmark content in the dynamic adjustment area is modified, so that the modification can be completed.
Step S20, acquiring corresponding template filling data from a database according to the bookmark;
a plurality of dynamic adjustment areas can exist in a preset document template, the position of a bookmark in each dynamic adjustment area is the position of dynamically loading data in the template, and the bookmark can be used as a template placeholder. Each bookmark corresponds to an access logic, when a user opens the template, a corresponding data field can be determined from the database according to the access logic corresponding to the bookmark, and the field is template filling data filled to the bookmark position.
Step S30, filling template filling data obtained after traversing the dynamic adjustment area in the preset document template into the corresponding dynamic adjustment area to generate a report template; and the dynamic adjustment area is used for displaying the obtained template filling data as the template content of the report template.
The method comprises the steps of presetting template filling data in a database corresponding to each bookmark in a document template, obtaining template filling data corresponding to each bookmark after traversing bookmarks corresponding to all dynamic adjustment areas in the preset document template, filling the template filling data obtained from the database to corresponding bookmark positions one by one, and replacing the bookmarks serving as template placeholders to generate a report template after dynamically loading data. When the user opens the report template, the dynamic adjustment area may display the obtained template filling data as the template content.
In this embodiment, by configuring a bookmark or modifying bookmark content in a dynamic adjustment area in a preset document template in an application interface, the preset document template can be edited and modified according to the requirements of actual services, the modified preset document template will traverse all dynamic adjustment areas in the preset document template after being normally started, and corresponding template filling data is acquired from a database according to the modified bookmark content to dynamically load and fill the dynamic adjustment area, so as to display the dynamically loaded template content to a user. According to the change of the actual business, the bookmark content can be modified in the dynamic adjustment area needing to be modified in the preset document template, so that the template meeting the actual business requirement is obtained, a new template does not need to be manufactured again, the template manufacturing efficiency can be greatly improved, the complexity of template manufacturing and development is reduced, and the maintenance of the report template in the later period is greatly facilitated.
It can be understood that, the original template re-production needs the research and development personnel who know the style sheet well to carry out the customized development of the template through the programming language, while the existing template dynamic generation mode only needs the relevant personnel who know the actual business to modify the bookmark content in the preset document template according to the actual business scene, so that the bookmark can point to the template filling data, the dynamic adjustment of the preset document template is realized, the relevant personnel is not required to have the experience related to the program, and in the production and generation process of the template, the staff in each link can obtain the report template matching the business scene after correspondingly modifying the bookmark content in the preset document template according to the part responsible for the staff. After the report template in the word document format is generated, the report template can be converted into the PDF format so as to obtain the PDF template corresponding to the service scene.
Further, referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of the method for dynamically generating a template according to the present application, based on the embodiment shown in fig. 2, in this embodiment, before the step of configuring the bookmark to the dynamic adjustment area in the preset document template in step S10, the method further includes:
step S40, acquiring a correlation template of the preset document template, performing matching analysis on the template content in the correlation template, and determining the change frequency of filling data of each area in the template content;
and step S41, dividing each area in the template content into a fixed area and a dynamic adjustment area according to a preset frequency change threshold.
In this embodiment, the fixed area and the dynamic adjustment area in the preset document template may also be automatically configured. After a user modifies bookmark contents in a preset document template to generate a report template capable of being dynamically loaded, the report template can be used as an associated template of the preset document template. By acquiring a plurality of related templates generated in the past and performing matching analysis on the template contents, it is possible to specify the change frequency of the template fill data corresponding to each region in the template and determine whether the template fill data is fill data that frequently fluctuates. For example, after performing matching analysis on a plurality of associated templates, it may be determined that template filling data obtained by each dynamic loading in a certain dynamic adjustment area in the associated templates has not changed or has an extremely low change frequency, and then the corresponding dynamic adjustment area in the preset document template may be reconfigured to be a fixed area. That is, data obtained by dynamically loading a certain template content in different report templates has less change, the template content can be used as a fixed area in a preset document template, and dynamic loading is not required when the report template is started. When the dynamic adjustment area is configured as the fixed area, an automatic configuration request can be made for the user, the matching analysis result of the associated template is displayed for the user, and the dynamic adjustment area can be configured as the fixed area after the user passes the request.
It can be understood that, a preset frequency change threshold may be stored in the computer device in advance, and after performing matching analysis on the associated template, if the frequency of a change of a certain bookmark content in the preset document template is lower than the change threshold, the bookmark content may be configured as fixed template filling data. Similarly, after the matching analysis is performed on the association templates, if it is found that the fixed content in a certain fixed area changes frequently in different association templates, the fixed area may be configured as a dynamic adjustment area, and the user is prompted to perform bookmark configuration for the dynamic adjustment area, so as to avoid that the user manually modifies the content in the fixed area each time. All areas in the preset document template can be divided into fixed areas and dynamic adjustment areas through the relation between the change frequency and the change threshold, and if the area attribute of a certain area is changed before and after the area is divided, the area can be converted into the divided area attribute.
Further, referring to fig. 4, fig. 4 is a flowchart illustrating a third embodiment of the template dynamic generation method of the present application, based on the embodiment shown in fig. 3, in this embodiment, in step S10, the step of configuring a bookmark for a dynamic adjustment area in a preset document template includes:
step S11, according to the configuration instruction triggered by the user, determining the dynamic adjustment area selected by the user and the bookmark content input by the user, and configuring the bookmark according to the bookmark content.
In this embodiment, after entering a configuration interface of a preset document template through an application interface, a user may select a dynamic adjustment area by triggering a configuration instruction, and the user may also input corresponding bookmark content through an editing instruction, and after obtaining the bookmark content input by the user, the computer device may configure or modify the bookmark in the selected dynamic adjustment area according to the bookmark content. It can be understood that different regions of the preset document template can be correspondingly set with different adjustment permissions, so that people with insufficient permissions can be prevented from modifying important regions in the preset document template. For example, the authority requirements for implementing switching between the fixed region and the dynamic adjustment region in different regions in the preset document template are different, that is, the region switching can be performed by a user with primary authority in the region a, while the region switching adjustment can be performed by a user with higher authority in the region B. Similarly, the bookmark content configuration authority and modification authority in each dynamic adjustment area can be different, a user with higher authority can modify bookmark contents in more dynamic adjustment areas compared with a user with primary authority, after a configuration instruction triggered by the user is received, the configuration authority and modification authority of the user can be verified, whether the user has the authority for configuring the bookmark or not is judged, and the bookmark is configured according to the bookmark content input by the user after the user passes the verification, so that the preset document template is effectively protected, and the problem that a business person without the authority mistakenly configures the bookmark is avoided.
Further, referring to fig. 5, fig. 5 is a flowchart illustrating a fourth embodiment of a template dynamic generation method according to the present application, based on the embodiment shown in fig. 4, in this embodiment, the bookmark is a template placeholder of the dynamic adjustment area selected by the user, and step S20, the step of obtaining corresponding template filling data from a database according to the bookmark includes:
step S21, obtaining a template value expression corresponding to the bookmark from a database;
and step S22, reading corresponding fields from the database as template filling data according to the template value-taking expression, and replacing corresponding template placeholders with the template filling data.
In this embodiment, a configuration mapping table is stored in advance in the database, a corresponding template value-taking expression can be determined from the configuration mapping table according to bookmark contents in a preset document template, and when a user opens a report template, a corresponding data field can be queried from the database through the template value-taking expression to serve as template filling data. The bookmark content occupies a preset document template, namely, the bookmark is a filling position of template filling data obtained by dynamic loading, namely, the bookmark is a template placeholder corresponding to the template filling data, and after the template filling data is obtained from a database, the bookmark content at the bookmark position is replaced by the template filling data, so that the dynamic loading of the report template can be realized. It can be understood that, when the report template is generated, the bookmark in the report template is replaced by the corresponding template value expression, and when the report template is opened by the user, the template value expression is replaced by the template filling data obtained by query, so that the user can browse the dynamically loaded report template.
It should be noted that the preset document template may be a document in a docx suffix format in the word document, after the suffix format is modified into zip and opened, the word/document.xml document is the original word document content, the bookmark content may be dynamically replaced in the xml document by using the template filling data read from the database, the original word/document.xml document is covered by the replaced xml document, and after the suffix format is modified into docx again, the word document dynamically filled by the template may be obtained. The template value-taking expression corresponding to the bookmark in the XML document can be obtained through analysis of an open source XML analysis package dom4j, and template filling data in a database is obtained through an el expression in a template engine freemarker to replace the bookmark.
It can be understood that the pageoffice plug-in can open a word document of a server on line in a browser, and when the plug-in is clicked and stored, a background can obtain specific data corresponding to a bookmark in the word document, namely a template value-taking expression, and then the template value-taking expression is stored in a corresponding field of a corresponding table in a database according to a mapping configuration table of the bookmark, so that bookmark configuration can be realized.
Further, referring to fig. 6, fig. 6 is a flowchart illustrating a fifth embodiment of the template dynamic generation method of the present application, based on the embodiments illustrated in fig. 2 to fig. 5, in this embodiment, after the step of step S30, filling template filling data obtained after traversing the dynamic adjustment area in the preset document template into the corresponding dynamic adjustment area to generate the report template, the method further includes:
step S50, determining a data filling position in the report template according to a data filling instruction triggered by a user;
step S60, configuring rule elements for the data filling positions, wherein the rule elements comprise data value expressions and data formats of the data filling positions;
and step S70, acquiring filling data conforming to the data format from the database according to the data value expression corresponding to the data filling position, and filling the filling data to the data filling position to generate a data filling report.
In this embodiment, after the report template is generated, the data in the template may also be intelligently filled. After the user opens the report template, the report template only displays the template contents, and the corresponding data contents are not filled in. The user may trigger a data-fill instruction through the application interface to traverse all data-fill locations in the report template to determine all locations that need to be data-filled. The user may configure the rule elements for each data fill location. The rule elements may include a data value expression corresponding to the data filling position and a data format of the value data. It is understood that the rule element may further include a unique identification code of the data filling position, and the data filling position can be determined through the unique identification code, so that a user can determine the data filling position through a query of the unique identification code to modify the rule element. When a user configures a rule element of a data filling position, a data format of the data filling position can be established, for example, when the position needs to be filled with date data, the data format is a date format, and when percentage data needs to be filled, the data format is a percentage format. After the filling data are obtained from the database according to the data value expression corresponding to the data filling position, the data format of the filling data can be verified, when the data format of the filling data meets the data format configured by the rule elements, the obtained filling data can be determined to meet the configuration requirement, and at the moment, the data filling position corresponding to the filling value of the filling data can be obtained. And traversing all data filling positions in the report template, and filling all the acquired filling data to the data filling positions corresponding to one another, so as to generate the data filling report. The filling data stored in the system can be quickly and correspondingly filled into the report template through data intelligent filling, the report issuing speed is improved, and a large amount of human resource cost is saved.
It is understood that various attributes of the padding data, such as an editable attribute, a writeback attribute, a formatting attribute, and the like, can also be set through the rule element configuration. For example, if an editable attribute is set to 1 in a rule element of a certain data filling position, the filling data at the data filling position can be modified by the user when the user opens the report after data filling. If the editable attribute is 0, the user cannot modify the filling data at the data filling position after opening the report.
Further, referring to fig. 7, fig. 7 is a flowchart illustrating a sixth embodiment of the template dynamic generation method of the present application, based on the embodiment shown in fig. 6, in this embodiment, step S70 is to obtain filling data conforming to the data format from the database according to a data value expression corresponding to the data filling position, and fill the filling data into the data filling position to generate a data filling report, where the step includes:
step S71, traversing the data filling positions in the report template, and replacing each data filling position with an editable bookmark corresponding to the data filling position;
and step S72, acquiring filling data conforming to the data format from a database according to the data value expression corresponding to each bookmark, and replacing each bookmark with the corresponding filling data to generate a data filling report.
In this embodiment, a plurality of data filling positions correspond to the report template, and each data filling position can be replaced by a corresponding editable bookmark by traversing all the data filling positions, where the bookmark includes a data value expression of the current data filling position, and after filling data is correspondingly acquired from the database according to each data value expression, the bookmark can be replaced by the filling data, so as to ensure that the correct position in the report template is filled with the filling data.
Further, in a seventh embodiment of the template dynamic generation method of the present application, based on the embodiment shown in fig. 7, in this embodiment, in step S72, the step of obtaining, according to the data value expression corresponding to each bookmark, filling data conforming to the data format from a database, and replacing each bookmark with corresponding filling data to generate a data filling report includes:
step S721, updating the database according to the data to be disclosed pushed by the data management terminal;
step S722, obtaining filling data conforming to the data format from the updated database according to the data value expression corresponding to each bookmark, and replacing each bookmark with corresponding filling data to generate a data filling report.
In this embodiment, the data that needs to be filled in the report template may be already stored in the database system, or may be the data to be disclosed that needs to be reported is integrated and pushed to the database by the data management terminal, and the data management terminal may be an enterprise resource planning, ERP, management terminal. The traditional data filling mode needs cooperation of multiple persons, relevant data are searched from a large amount of data in a database, and the data are arranged and verified and then filled into a report template. And by setting the bookmark as a data placeholder in the report template, after the database is updated by the enterprise resource management ERP terminal, filling data which accords with a data format can be directly obtained from the updated database according to the data value expression corresponding to the bookmark, and the bookmark can be directly replaced by using the filling data, so that the filling data is filled to the correct position in the report template, the data filling of the report template is quickly and accurately realized, and the consumption of manpower and material resources can be effectively reduced. The technical scheme of this application can use in wisdom medical science and technology technical field, is applied to and fills electronic case in batches, perhaps generates patient's treatment list etc. in batches, makes medical management more intelligent.
It should be noted that, during data filling, a word document of the report template may be modified into a zip file by modifying a suffix format, and a word/document. After a word document is converted into an xml document, rule elements are converted into bookmarks, the xml document is converted into an ftl file, after filling data are obtained through the bookmarks, all the bookmarks in ftl can be replaced by the correspondingly obtained filling data through a template loading method of a template engine freemaker, a ftl file after replacement is output again as the xml document, the newly output xml document is replaced by a word/document.xml file in an original zip file, and the suffix format of the zip file is modified into docx, so that a product report in the word document format after data filling can be obtained.
Referring to fig. 8, the present invention further provides a template dynamic generation system, including:
the configuration module 10 is configured to configure bookmarks for a dynamic adjustment area in a preset document template;
the data acquisition module 20 is configured to acquire corresponding template filling data from a database according to the bookmark;
and the template filling module 30 is configured to fill template filling data obtained after traversing the dynamic adjustment area in the preset document template into the corresponding dynamic adjustment area, so as to generate a report template.
Further, the template dynamic generation system further includes:
the matching module 40 is configured to obtain an association template of the preset document template, perform matching analysis on template contents in the association template, and determine a change frequency of filling data in each area in the template contents;
a dividing module 50, configured to divide each region in the template content into a fixed region and a dynamic adjustment region according to a preset frequency change threshold.
Further, the configuration module 10 includes:
the selection module 11 determines the dynamic adjustment area selected by the user and the bookmark content input by the user according to the configuration instruction triggered by the user, and configures the bookmark according to the bookmark content.
Further, the data obtaining module 20 includes:
the first value taking module 21 is configured to obtain a template value taking expression corresponding to the bookmark from a database;
and a second value taking module 22, configured to read a corresponding field from the database according to the template value taking expression as template filling data, and replace the corresponding template placeholder with the template filling data.
Further, the template dynamic generation system further includes:
a positioning module 60, configured to determine a data filling position in the report template according to a data filling instruction triggered by a user;
a rule element module 70, configured to perform rule element configuration on the data filling position, where the rule element includes a data value expression and a data format of the data filling position;
and the data filling module 80 is configured to obtain filling data conforming to the data format from the database according to the data value expression corresponding to the data filling position, and fill the filling data into the data filling position to generate a data filling report.
Further, the data padding module 80 includes:
a first replacement module 81, configured to traverse the data filling positions in the report template, and replace each data filling position with an editable bookmark corresponding to the data filling position;
and the second replacing module 82 is configured to obtain filling data conforming to the data format from a database according to the data value expression corresponding to each bookmark, and replace each bookmark with corresponding filling data.
Further, the second replacement module 82 includes:
the updating module 83 is configured to update the database according to the data to be disclosed pushed by the data management terminal;
and the sorting module 84 is configured to obtain filling data conforming to the data format from the updated database according to the data value expression corresponding to each bookmark.
The invention also proposes a computer-readable storage medium on which a computer program is stored. The computer-readable storage medium may be the Memory 02 in the terminal of fig. 1, and may also be at least one of a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, and an optical disk, and the computer-readable storage medium includes several pieces of information for enabling the terminal to perform the method according to the embodiments of the present invention.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A template dynamic generation method is characterized by comprising the following steps:
configuring bookmarks for a dynamic adjustment area in a preset document template;
acquiring corresponding template filling data from a database according to the bookmark;
filling template filling data obtained after traversing the dynamic adjustment area in the preset document template into the corresponding dynamic adjustment area to generate a report template; and the dynamic adjustment area is used for displaying the obtained template filling data as the template content of the report template.
2. The method for dynamically generating templates according to claim 1, wherein before the step of configuring bookmarks for dynamically adjusting regions in the preset document template, the method further comprises:
acquiring a correlation template of the preset document template, performing matching analysis on template contents in the correlation template, and determining the change frequency of filling data of each area in the template contents;
and dividing each area in the template content into a fixed area and a dynamic adjustment area according to a preset frequency change threshold.
3. The method for dynamically generating templates according to claim 2, wherein the step of configuring the bookmarks for the dynamically adjusted area in the preset document template comprises:
and determining a dynamic adjustment area selected by a user and bookmark contents input by the user according to a configuration instruction triggered by the user, and configuring the bookmark according to the bookmark contents.
4. The method for dynamically generating templates according to claim 3, wherein the bookmark is a template placeholder of the dynamically adjusted area selected by the user, and the step of obtaining corresponding template filling data from a database according to the bookmark comprises:
acquiring a template value expression corresponding to the bookmark from a database;
and reading corresponding fields from the database as template filling data according to the template value expression, and replacing corresponding template placeholders with the template filling data.
5. The method for dynamically generating templates according to any one of claims 1 to 4, wherein after the step of filling template filling data obtained after traversing the dynamically adjusted regions in the preset document template into the corresponding dynamically adjusted regions to generate the report template, the method further comprises:
determining a data filling position in the report template according to a data filling instruction triggered by a user;
configuring a rule element for the data filling position, wherein the rule element comprises a data value expression and a data format of the data filling position;
and acquiring filling data conforming to the data format from the database according to the data value expression corresponding to the data filling position, and filling the filling data to the data filling position to generate a data filling report.
6. The method for dynamically generating templates according to claim 5, wherein the step of obtaining the filling data conforming to the data format from the database according to the data value expression corresponding to the data filling position and filling the filling data into the data filling position includes:
traversing the data filling positions in the report template, and replacing each data filling position with an editable bookmark corresponding to the data filling position;
and acquiring filling data conforming to the data format from a database according to the data value expression corresponding to each bookmark, and replacing each bookmark with the corresponding filling data.
7. The method for dynamically generating templates according to claim 6, wherein the step of obtaining the filling data conforming to the data format from the database according to the data value expression corresponding to each bookmark comprises:
updating the database according to the data to be disclosed pushed by the data management terminal;
and acquiring filling data conforming to the data format from the updated database according to the data value expression corresponding to each bookmark.
8. A template dynamic generation system, the template dynamic generation system comprising:
the configuration module is used for configuring bookmarks for the dynamic adjustment area in the preset document template;
the data acquisition module is used for acquiring corresponding template filling data from a database according to the bookmark;
and the filling module is used for filling template filling data obtained after traversing the dynamic adjustment area in the preset document template into the corresponding dynamic adjustment area so as to generate a report template.
9. A computer device, characterized in that it comprises a memory, a processor and a computer program stored on said memory and executable on said processor, said computer program, when executed by said processor, implementing the steps of the template dynamic generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the template dynamic generation method according to any one of claims 1 to 7.
CN202010970747.5A 2020-09-15 2020-09-15 Template dynamic generation method, system, computer equipment and storage medium Pending CN112115695A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010970747.5A CN112115695A (en) 2020-09-15 2020-09-15 Template dynamic generation method, system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010970747.5A CN112115695A (en) 2020-09-15 2020-09-15 Template dynamic generation method, system, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112115695A true CN112115695A (en) 2020-12-22

Family

ID=73803416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010970747.5A Pending CN112115695A (en) 2020-09-15 2020-09-15 Template dynamic generation method, system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112115695A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992765A (en) * 2021-12-28 2022-01-28 北京南天信息工程有限公司 Financial message conversion method and system based on Freemarker template engine
CN114935996A (en) * 2022-07-20 2022-08-23 灵智信息服务(深圳)有限公司 Method, computer device and storage medium for online processing of documents
CN115952525A (en) * 2023-02-23 2023-04-11 天津联想协同科技有限公司 Online document region authority setting method and device, server and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103279454A (en) * 2013-06-09 2013-09-04 广东电网公司电力科学研究院 Document automatic generation method, device and system
CN108595398A (en) * 2018-04-16 2018-09-28 北京航空航天大学 The method that artificial intelligence program substitutes person writing's simulation report
CN109299446A (en) * 2018-08-03 2019-02-01 新华三大数据技术有限公司 Report-generating method and device
CN109359284A (en) * 2018-09-25 2019-02-19 深圳市稳大网络技术有限公司 A kind of reporting and processing method, device and terminal device
US20200097535A1 (en) * 2018-09-24 2020-03-26 The Toronto-Dominion Bank Systems and methods for automatic report generation and retaining of annotations in reporting documents after regeneration
CN111145051A (en) * 2019-11-26 2020-05-12 方正璞华软件(武汉)股份有限公司 Method and device for generating arbitration electronic document

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103279454A (en) * 2013-06-09 2013-09-04 广东电网公司电力科学研究院 Document automatic generation method, device and system
CN108595398A (en) * 2018-04-16 2018-09-28 北京航空航天大学 The method that artificial intelligence program substitutes person writing's simulation report
CN109299446A (en) * 2018-08-03 2019-02-01 新华三大数据技术有限公司 Report-generating method and device
US20200097535A1 (en) * 2018-09-24 2020-03-26 The Toronto-Dominion Bank Systems and methods for automatic report generation and retaining of annotations in reporting documents after regeneration
CN109359284A (en) * 2018-09-25 2019-02-19 深圳市稳大网络技术有限公司 A kind of reporting and processing method, device and terminal device
CN111145051A (en) * 2019-11-26 2020-05-12 方正璞华软件(武汉)股份有限公司 Method and device for generating arbitration electronic document

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992765A (en) * 2021-12-28 2022-01-28 北京南天信息工程有限公司 Financial message conversion method and system based on Freemarker template engine
CN114935996A (en) * 2022-07-20 2022-08-23 灵智信息服务(深圳)有限公司 Method, computer device and storage medium for online processing of documents
CN115952525A (en) * 2023-02-23 2023-04-11 天津联想协同科技有限公司 Online document region authority setting method and device, server and storage medium
CN115952525B (en) * 2023-02-23 2023-08-11 天津联想协同科技有限公司 Online document region authority setting method, device, server and storage medium

Similar Documents

Publication Publication Date Title
CN112115695A (en) Template dynamic generation method, system, computer equipment and storage medium
CN108874926B (en) Mass data query method, device, computer equipment and storage medium
CN106528129B (en) A kind of Web application interface generation system and method
CN103778107B (en) Method and platform for quickly and dynamically generating form based on EXCEL
US7716591B2 (en) System and method for dynamically generating a web page
CN110399420A (en) A kind of deriving method, electronic equipment and the medium of configurableization Excel format
CN111310427A (en) Service data configuration processing method and device, computer equipment and storage medium
US20070067714A1 (en) Modularized web page editing system and method thereof
CN106990970B (en) MVC-based dynamic page generation method and system
CN110968601A (en) Data query processing method and device
CN108762743A (en) Data table operation code generation method and device
CN111208982B (en) ERP system rapid customization platform based on visual configuration mode
CN101446971A (en) Method for building content management system and device thereof
CN113035308B (en) Quality evaluation method and system for electronic health record
CN109669693A (en) A kind of method and system generating forms pages based on dynamic page
CN102801565B (en) Method for carrying out centralized management on service configuration in network management system
CN113434133B (en) Application building method, device, equipment and computer readable storage medium
CN111552704A (en) Data report generation method and device, computer equipment and storage medium
CN102857949A (en) Method and device for planning data consistency guarantees
CN110750553A (en) Method for self-defining export of data in service management system
CN103984554A (en) Software design document generating method and device
CN117077650A (en) Document generation system, method, equipment and medium based on dynamic template configuration
CN115543428A (en) Simulated data generation method and device based on strategy template
CN100386756C (en) Schematic diagram component symbol examining apparatus and obtaining method
CN115185960A (en) Data processing method, data association system, and computer-readable 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