Search

CN-115409014-B - Document template generation method, device, computer equipment and storage medium

CN115409014BCN 115409014 BCN115409014 BCN 115409014BCN-115409014-B

Abstract

The application relates to a document template generation method, a document template generation device, computer equipment and a storage medium. The method comprises the steps of traversing each control in a bill template of a source bill, analyzing control information of each traversed control, keeping the control information unchanged if unbound field information in the control information is analyzed, updating the control information according to metadata preset for a target bill if the field information is analyzed to be bound in the control information, and generating the bill template of the target bill according to the control information kept unchanged in the bill template of the source bill and the updated control information. The method can improve the generation efficiency of the bill template.

Inventors

  • LIU GUANGHUA
  • LI WEI

Assignees

  • 金蝶蝶金云计算有限公司

Dates

Publication Date
20260512
Application Date
20220922

Claims (9)

  1. 1. A document template generation method, the method comprising: traversing each control in the bill template of the source bill, and analyzing the control information of each traversed control; If the unbound field information in the control information is analyzed, keeping the control information unchanged; If the field information is bound in the control information, updating the control information according to metadata preset for a target bill, wherein the metadata comprises the steps of clearing all the information in the control information if the field information is bound in the control information, the target field information matched with the field information bound in the control information does not exist in the metadata, the field information bound in the control information is the field information in an entry form in the source bill, clearing the data source information corresponding to the field information bound in the control information, and if the field information is bound in the control information, the target field information matched with the field information bound in the control information does not exist in the metadata, and the field information bound in the control information is the field information in a main form in the source bill, wherein the main form contains the field information of each field in the target bill and refers to the position outside the data form in the entry form; And generating the bill template of the target bill according to the control information which is kept unchanged in the bill template of the source bill and the updated control information.
  2. 2. The method of claim 1, wherein the metadata includes field information of each field in the target document and corresponding data source information, and the updating the control information according to metadata preset for the target document if the field information is bound in the control information is analyzed, comprises: if the field information is bound in the control information, modifying the data source information corresponding to the field information bound in the control information according to the target data source information corresponding to the target field information matched with the field information bound in the control information in the metadata.
  3. 3. The method of claim 1, further comprising pre-recording field information of each field in the target document and corresponding data source information into metadata.
  4. 4. The method of claim 1, further comprising pre-establishing respective metadata for each document.
  5. 5. The method according to any one of claims 1 to 4, further comprising: If the control type of the control is analyzed to be the control type which does not relate to the data source, the control information of the control is kept unchanged; if the control type of the control is analyzed to be the control type related to the data source, identifying whether field information is bound in the control information; if not, executing the step of keeping the control information unchanged if the unbound field information in the control information is analyzed; and if the binding exists, executing the step of updating the control information according to metadata preset for the target bill if the field information is bound in the control information.
  6. 6. A document template generation apparatus, the apparatus comprising: the control analysis module is used for traversing each control in the bill template of the source bill, analyzing the control information of each traversed control, and if the unbound field information in the control information is analyzed, keeping the control information unchanged; The control information updating module is used for updating the control information according to metadata preset for a target bill if the field information is bound in the control information, and comprises the steps of clearing all the field information in a main table in the source bill if the field information is bound in the control information, the field information matched with the field information is not present in the metadata, the field information bound in the control information is the field information in an entry table in the source bill, clearing the data source information corresponding to the field information bound in the control information, and clearing all the field information in the main table, except the position of the data in the entry table, of the data in the entry table if the field information is bound in the control information, the field information matched with the field information bound in the control information is not present in the metadata, and the field information bound in the control information is the field information in the main table in the source bill; and the bill template generating module is used for generating the bill template of the target bill according to the control information which is kept unchanged in the bill template of the source bill and the updated control information.
  7. 7. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
  8. 8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
  9. 9. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 5.

Description

Document template generation method, device, computer equipment and storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to a document template generating method, apparatus, computer device, and storage medium. Background With the development of computer technology, various enterprise business systems, such as ERP (ENTERPRISE RESOURCE PLANNING ) systems, are layered, and the business systems greatly improve the operation and management efficiency of enterprises. Many business systems have the function of making and generating document templates, and users can make the document templates through the business systems so as to conveniently print and use documents. In the conventional method, when each document template is manufactured, a user is required to accurately set and adjust attribute information such as the position, the size and the like of each control in the document template, and even for a plurality of document templates with high information overlap ratio, each document template is manufactured respectively, a great deal of time is required to be spent for manufacturing and adjusting so as to obtain one document template, and therefore, the efficiency is low. Disclosure of Invention In view of the foregoing, it is desirable to provide a document template generation method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the generation efficiency of document templates. In a first aspect, the present application provides a document template generation method. The method comprises the following steps: traversing each control in the bill template of the source bill, and analyzing the control information of each traversed control; If the unbound field information in the control information is analyzed, keeping the control information unchanged; If the field information is bound in the control information, updating the control information according to metadata preset for a target bill; And generating the bill template of the target bill according to the control information which is kept unchanged in the bill template of the source bill and the updated control information. In a second aspect, the application further provides a document template generating device. The device comprises: the control analysis module is used for traversing each control in the bill template of the source bill, analyzing the control information of each traversed control, and if the unbound field information in the control information is analyzed, keeping the control information unchanged; The control information updating module is used for updating the control information according to metadata preset for a target bill if the field information is bound in the control information; and the bill template generating module is used for generating the bill template of the target bill according to the control information which is kept unchanged in the bill template of the source bill and the updated control information. In one embodiment, the metadata includes field information of each field in the target document and corresponding data source information, and the control information updating module is further configured to modify, if the field information is resolved to be bound in the control information, the data source information corresponding to the field information bound in the control information according to the target data source information corresponding to the target field information in the metadata, which is matched with the field information bound in the control information. In one embodiment, the metadata includes field information of each field in the target document, and the control information updating module is further configured to clear the control information if the field information is bound in the control information and the target field information matched with the field information bound in the control information does not exist in the metadata. In one embodiment, the control information updating module is further configured to empty data source information corresponding to the field information bound in the control information if the field information bound in the control information is analyzed, the target field information matched with the field information bound in the control information does not exist in the metadata, and the field information bound in the control information is the field information in the entry table in the source document. In one embodiment, the control information updating module is further configured to empty all information in the control information if it is analyzed that field information is bound in the control information, target field information matched with the field information bound in the control information does not exist in the metadata, and the field information bound in the control information is the field information in the main table in