CN-121980023-A - Templated purchase file generation method and system
Abstract
The invention provides a templated purchasing file generating method and a templated purchasing file generating system in the technical field of computer information, wherein the templated purchasing file generating method comprises the steps of S1, creating purchasing file templates, S2, storing the purchasing file templates into a database, S3, verifying and analyzing an input purchasing file generating request to obtain purchasing scenes, business data, target formats and watermark contents, matching the target purchasing file templates from the database based on the purchasing scenes and displaying the purchasing scenes through a graphical interface, S4, dynamically injecting business data into a template information layer based on an input operation instruction, binding the labels and the business data through a directory configuration layer, and then rendering the target purchasing file templates to generate intermediate contents, and S5, converting the intermediate contents into purchasing files based on the target formats. The invention has the advantage of greatly improving the intelligent level and the operation efficiency of purchase management.
Inventors
- LI JUNJIE
- YE YONGXI
- SHI SHUAI
- GAO GUOSHENG
- YANG FENG
- ZHENG XINGANG
Assignees
- 数采小博科技发展有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251211
Claims (10)
- 1. A templatized purchase file generation method is characterized by comprising the following steps: Step S1, creating a corresponding purchasing file template based on a preset purchasing scene, wherein the purchasing file template adopts a layered structure and is provided with a template information layer, a template label layer and a catalog configuration layer, and the template label layer is used for abstracting service contents into reusable label components; step S2, storing each purchasing file template and label configuration and catalog configuration associated with each purchasing file template into a database supporting tenant isolation management; S3, acquiring a purchase file generation request input by a user terminal, checking and analyzing the purchase file generation request to obtain a purchase scene, service data, a target format and watermark content, matching a corresponding target purchase file template from a database based on the purchase scene, and displaying the target purchase file template through a graphical interface; Step S4, the graphical interface carries out label replacement in a template label layer in the target purchase file template based on the input operation instruction, the service data is dynamically injected into a template information layer, after the label and the service data are bound through the catalog configuration layer, the target purchase file template is rendered through a THYMELEAF template engine, and the intermediate content in an HTML format is generated; And S5, converting the intermediate content into a purchase file based on the target format, adding a digital watermark to the purchase file, integrating the CA electronic signature, and transmitting the purchase file to a user terminal.
- 2. The method for generating a templated purchase document according to claim 1, wherein in step S1, the purchase scene includes at least a purchase notice, a purchase invitation, a review report, and a transaction notice; The label component classifies based on purchasing business rules, comprises purchasing modes, item types and clause types, and manages the purchasing modes, the item types and the clause types through a label type field; In the step S2, the database supports copying and version control of the purchase file template and allows a new template to be created based on the history purchase file template; the purchase file templates of each tenant are isolated through tenant IDs, so that data security and independence are ensured.
- 3. The method for generating a templated purchase file according to claim 1, wherein said step S3 is specifically: Acquiring a purchase file generation request which is input by a user terminal and carries request content ciphertext, request time and hash value, wherein the request content ciphertext is obtained by encrypting purchase scene, service data, target format and watermark content through an SM4 algorithm; Analyzing the purchase file generation request to obtain a request content ciphertext, request time and a hash value, performing integrity verification on the request content ciphertext and the request time through the hash value, performing aging verification on the request time, and decrypting the request content ciphertext through an SM4 algorithm to obtain a purchase scene, service data, a target format and watermark content; and matching the corresponding target purchase file template from the database based on the purchase scene, and displaying the target purchase file template in real time through a graphical interface.
- 4. The method for generating a templated procurement file according to claim 1, wherein in step S4, the label replacement supports a recursive process of nested labels; in the rendering process of the target purchase file template, supporting real-time preview through the graphical interface; the step of dynamically injecting the service data into the template information layer specifically comprises the following steps: the business data is mapped to template variables of a template information layer through a context object.
- 5. The method for generating a templated purchase file according to claim 1, wherein said step S5 is specifically: calling a corresponding file generation engine based on the target format, and converting the intermediate content into a purchase file; embedding watermark content in the purchase file by combining the embedding modes of the visible watermark and the invisible watermark so as to finish the addition of the digital watermark; The SHA-256 algorithm calculates a digital abstract of the purchase file added with the digital watermark, encrypts the digital abstract through a private key corresponding to a digital certificate issued by a CA server to obtain a CA electronic signature, integrates the CA electronic signature into the purchase file, and sends the purchase file to a user terminal through an HTTPS protocol.
- 6. The templated purchase file generation system is characterized by comprising the following modules: the purchasing file template creating module is used for creating a corresponding purchasing file template based on a preset purchasing scene, wherein the purchasing file template adopts a layered structure and is provided with a template information layer, a template label layer and a catalog configuration layer, and the template label layer is used for abstracting service contents into reusable label components; the purchasing file template storage module is used for storing each purchasing file template and the label configuration and the directory configuration associated with the purchasing file template into a database supporting tenant isolation management; The purchasing file generation request analysis module is used for acquiring a purchasing file generation request input by a user terminal, verifying and analyzing the purchasing file generation request to obtain purchasing scenes, business data, target formats and watermark contents, matching corresponding target purchasing file templates from a database based on the purchasing scenes, and displaying the target purchasing file templates through a graphical interface; The purchase file template rendering module is used for performing label replacement in a template label layer in the target purchase file template based on an input operation instruction by the graphical interface, dynamically injecting the service data into a template information layer, binding the label and the service data through the catalog configuration layer, and rendering the target purchase file template through a THYMELEAF template engine to generate intermediate content in an HTML format; And the purchase file generation module is used for converting the intermediate content into a purchase file based on the target format, adding a digital watermark to the purchase file, integrating the CA electronic signature, and transmitting the purchase file to the user terminal.
- 7. The system of claim 6, wherein the purchase scenario comprises at least a purchase announcement, a purchase invitation, a review report, and a transaction notification; The label component classifies based on purchasing business rules, comprises purchasing modes, item types and clause types, and manages the purchasing modes, the item types and the clause types through a label type field; in the purchase file template storage module, the database supports copy and version control of the purchase file template and allows a new template to be created based on the historical purchase file template; the purchase file templates of each tenant are isolated through tenant IDs, so that data security and independence are ensured.
- 8. The system for generating a templated purchase file according to claim 6, wherein said purchase file generating request parsing module is specifically configured to: Acquiring a purchase file generation request which is input by a user terminal and carries request content ciphertext, request time and hash value, wherein the request content ciphertext is obtained by encrypting purchase scene, service data, target format and watermark content through an SM4 algorithm; Analyzing the purchase file generation request to obtain a request content ciphertext, request time and a hash value, performing integrity verification on the request content ciphertext and the request time through the hash value, performing aging verification on the request time, and decrypting the request content ciphertext through an SM4 algorithm to obtain a purchase scene, service data, a target format and watermark content; and matching the corresponding target purchase file template from the database based on the purchase scene, and displaying the target purchase file template in real time through a graphical interface.
- 9. The templated procurement file generation system of claim 6 characterized by the procurement file template rendering module, the label substitution supports recursive processing of nested labels; in the rendering process of the target purchase file template, supporting real-time preview through the graphical interface; the step of dynamically injecting the service data into the template information layer specifically comprises the following steps: the business data is mapped to template variables of a template information layer through a context object.
- 10. The templated procurement file generation system of claim 6 characterized by the procurement file generation module is specifically configured to: calling a corresponding file generation engine based on the target format, and converting the intermediate content into a purchase file; embedding watermark content in the purchase file by combining the embedding modes of the visible watermark and the invisible watermark so as to finish the addition of the digital watermark; The SHA-256 algorithm calculates a digital abstract of the purchase file added with the digital watermark, encrypts the digital abstract through a private key corresponding to a digital certificate issued by a CA server to obtain a CA electronic signature, integrates the CA electronic signature into the purchase file, and sends the purchase file to a user terminal through an HTTPS protocol.
Description
Templated purchase file generation method and system Technical Field The invention relates to the technical field of computer information, in particular to a templatized purchasing file generation method and system. Background In the field of purchasing management, especially in the operation of large enterprises or clustered companies, standardization and standardization of purchasing flows are key to improving efficiency, controlling risks and guaranteeing compliance. Purchase files, such as purchase announcements, purchase invitations, review reports, transaction notices, and the like, are the core carriers and legal basis for the purchase activity. These documents are of a wide variety and their content, format and terms often need to be strictly customized according to different purchasing means (e.g., public bidding, competitive negotiations, etc.), project types, and management regulations within the enterprise. At present, in the traditional or informatization-less purchasing management mode, the following modes mainly exist in the compiling of the files: (1) Manually compiling, namely, the business personnel completely rely on manual operation to write each purchase file from scratch in word processing software. This approach is extremely inefficient and highly dependent on the personal experience and expertise of the sponsor, and is highly prone to errors, omissions or contradictions in document content due to negligence or deviation from policy understanding. Meanwhile, consistency of the same type of files compiled by different personnel and different departments in format and content is difficult to ensure, and professional images and management specifications of enterprises are damaged. (2) Static template multiplexing, namely, the enterprise pre-makes standardized Word or PDF template files. The business personnel manually searches and modifies the key information (such as project name, date, amount, etc.) in the template through copy-paste when required. This approach, while improving efficiency to some extent, is extremely inflexible. When the purchasing scene changes or the regulation system of the enterprise is updated, a great deal of manpower is required to be input to check and modify the stock templates one by one, and the maintenance cost is high. More importantly, the static templates cannot realize dynamic assembly and logic control of the content, and cannot meet the requirement of sections or clauses needing flexible adjustment in complex purchase projects. (3) Primary informatization systems some purchase management systems provide file generation functionality, but are generally simpler to implement. For example, the system may only support populating simple business data (e.g., vendor names, project numbers) in fixed document paragraphs, lacking fine management of the overall structure of the document and complex business logic. Such systems have the following drawbacks in general: The flexibility is insufficient, the template structure is stiff, and the templates are difficult to be rapidly customized and adjusted for different scenes in an intuitive mode (such as dragging). The lack of reusability, namely the inability to abstract the common reusable business terms (such as payment, acceptance criteria, default liabilities, etc.) in the procurement file into independent "building block" units, results in a template library that is bulky and redundant, and difficult to manage and reuse. The legal effectiveness guarantee is weak, the generated electronic document is difficult to integrate electronic signature (CA authentication) conveniently so as to generate a final document with legal effectiveness, and often, off-line processes such as printing, signing, scanning and the like are still needed, so that the full-process electronization cannot be realized. Therefore, how to provide a templatized purchase file generation method and system, so as to achieve the improvement of the intelligent level and the operation efficiency of purchase management, becomes a technical problem to be solved urgently. Disclosure of Invention The invention aims to solve the technical problem of providing a templatized purchasing file generation method and a templatized purchasing file generation system, so as to improve the intelligent level and the operation efficiency of purchasing management. In a first aspect, the present invention provides a templated purchase file generating method, including the steps of: Step S1, creating a corresponding purchasing file template based on a preset purchasing scene, wherein the purchasing file template adopts a layered structure and is provided with a template information layer, a template label layer and a catalog configuration layer, and the template label layer is used for abstracting service contents into reusable label components; step S2, storing each purchasing file template and label configuration and catalog configuration associated with each purchas