Bill printing method and system, printing server, storage medium and electronic equipment
By querying preconfigured data mapping methods and obtaining print data, combined with technical means of selecting and filling bill templates, the problem of large workload of R&D personnel in traditional printing methods is solved, and an efficient and personalized bill printing process is achieved.
Patent Information
- Application Number
- CN202411794856.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-28
AI Technical Summary
The printing method of traditional accounting software faces the problem of heavy workload of R&D personnel, especially in terms of the flexibility and personalized needs of printing templates.
By querying the preconfigured data mapping method corresponding to the target ticket type, print data is obtained from the service interface, and the corresponding ticket template is selected, the data subset and corresponding data values are filled into the ticket template, and the bill file to be printed is generated.
An automated ticket printing process has been realized, reducing the workload of R&D personnel in printing template design and data processing, and improving printing efficiency and personalization capabilities.
Smart Images

Figure CN119718224A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a ticket printing method and system thereof, a printing server, a storage medium and an electronic device. Background Art
[0002] With the widespread application of technologies such as artificial intelligence, cloud computing, and big data, accounting software has also achieved a fusion of diversification and intelligence in printing technology. In the traditional printing process of accounting software, the printing of financial documents such as vouchers, reports, and account books has always been an important link. However, traditional printing methods face many challenges, especially in terms of the flexibility and personalized needs of printing templates.
[0003] In the related art, the design of printing templates usually relies on the front-end page drawing and back-end parameter transfer and filling by R&D personnel. Since different users have their own personalized requirements for printing formats, paper types (such as horizontal, vertical, bisection, trisection, etc.) and the content of printing columns, R&D personnel need to design and make their own printing templates for each requirement on the front-end page, which results in a large workload for R&D personnel. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a ticket printing method and system, a printing server, a storage medium and an electronic device to solve or alleviate the problem of heavy workload of R&D personnel in related technologies.
[0005] According to the first aspect of an embodiment of the present application, a ticket printing method is provided, the method comprising: querying a preconfigured data mapping method corresponding to a target ticket type, wherein the preconfigured data mapping method indicates a mode for obtaining printing data of the target ticket type; obtaining printing data required for printing the target ticket type from a service interface based on the preconfigured data mapping method; querying a storage address where a ticket template corresponding to the printing data is located, and obtaining the ticket template from the storage address; determining a data set in the printing data, and a data value corresponding to each data subset in the data set, wherein the data set is a set of data with different attributes, and each data subset in the data set corresponds to a data attribute; filling each data subset and the corresponding data value into the ticket template to obtain a ticket file to be printed.
[0006] In some embodiments of the present application, the print data required for printing the target ticket type is obtained from the service interface based on the preconfigured data mapping method, including: when the preconfigured data mapping method indicates to obtain the print data from a pre-stored data table, obtaining the print data in the data table through the service interface; when the preconfigured data mapping method indicates to filter the print data from the real-time data, filtering the print data from the real-time data based on filtering conditions through the service interface, wherein the filtering conditions include at least a filtering time and a filtering identifier.
[0007] In some embodiments of the present application, the storage address of the invoice template corresponding to the print data is queried, and the invoice template is obtained from the storage address, including: when the print data indicates to query the storage address from the custom template table, query the storage address from the custom template table; or obtain the custom invoice template corresponding to the print data from the storage address.
[0008] In some embodiments of the present application, the storage address of the bill template corresponding to the printing data is queried, and the bill template is obtained from the storage address, including: when the printing data indicates to query the storage address from the preset template table, the storage address is queried from the preset template table; and the preset bill template corresponding to the printing data is obtained from the storage address, wherein the preset bill template includes at least a voucher template, a report template and an account book template.
[0009] In some embodiments of the present application, each data subset and the corresponding data value are filled into the bill template to obtain a bill file to be printed, including: filling each data subset and the corresponding data value into the bill template to obtain a bill template to be processed; converting the bill template to be processed from a first format to a second format, and using the bill template in the second format as the bill file to be printed.
[0010] In some embodiments of the present application, the ticket printing method also includes: verifying the print data obtained from the service interface to determine whether there is unqualified print data in the print data; when unqualified print data exists in the print data, returning an error code and error information to the service interface to issue an abnormal reminder; when no unqualified print data exists in the print data, determining that the print data obtained by the service interface has passed the verification, so as to determine the data set in the print data, and the data value corresponding to each data subset in the data set.
[0011] According to a second aspect of an embodiment of the present application, a printing server is provided, wherein a query module is used to query a preconfigured data mapping and a ticket template corresponding to a target ticket type, wherein the preconfigured data mapping indicates a mode for obtaining printing data of the ticket type; a first acquisition module is used to obtain printing data required for printing the target ticket type from a service interface based on the preconfigured data mapping; a second acquisition module is used to query a storage address where a ticket template corresponding to the printing data is located, and obtain the ticket template from the storage address; a determination module is used to determine a data set in the printing data, and a data value corresponding to each data subset in the data set, wherein the data set is a collection of data with different attributes, each data subset in the data set corresponds to a data attribute, and the data value is the data value in each data subset; a filling module is used to fill each data subset and the corresponding data value into the ticket template to obtain a ticket file to be printed.
[0012] According to the third aspect of the embodiment of the present application, a ticket printing system is provided, which includes: a printing server and a printing terminal of the above embodiment, wherein the printing terminal is used to obtain the ticket file to be printed from the printing server and display the ticket file on the terminal page to facilitate printing of the ticket file.
[0013] According to the fourth aspect of the embodiments of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the ticket printing method of any of the above embodiments.
[0014] According to a fifth aspect of the embodiments of the present application, a computer storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, a ticket printing method as in any of the above embodiments is implemented.
[0015] According to the ticket printing method and its system, printing server, storage medium and electronic device provided in the embodiments of the present application, it is possible to automatically query the preconfigured data mapping method corresponding to the target ticket type, obtain the printing data required for printing the target ticket type from the service interface, select the ticket template corresponding to the printing data, and fill each data subset and the corresponding data value in the printing data into the ticket template to obtain a to-be-printed ticket file that meets user needs, thereby reducing the workload of R&D personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0017] Figure 1 A schematic diagram of a process of a bill printing method according to an embodiment of the present application;
[0018] Figure 2 A schematic diagram of a process of a bill printing method according to another embodiment of the present application;
[0019] Figure 3 is a schematic diagram of the structure of a print server according to an embodiment of the present application;
[0020] Figure 4 A schematic diagram of the structure of a ticket printing system according to an embodiment of the present application;
[0021] Figure 5 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0023] The specific implementation of the embodiments of the present application is further explained below in combination with the embodiments of the present application and the accompanying drawings.
[0024] Figure 1 The figure is a flowchart of a ticket printing method according to an embodiment of the present application.
[0025] like Figure 1 As shown, the bill printing method includes:
[0026] S11: querying a preconfigured data mapping method corresponding to a target bill type, wherein the preconfigured data mapping method indicates a mode for acquiring print data of the target bill type;
[0027] S12: Acquire the printing data required for printing the target ticket type from the service interface based on the preconfigured data mapping method.
[0028] It can be understood that when using the print server to print tickets, vouchers, reports, account books and other tickets can be printed. When the types of tickets printed are different, the print data obtained is also different. For example, when printing vouchers, the required print data can be obtained from the pre-entered original vouchers (such as invoices, receipts). When printing account books, because the account book data needs to comprehensively and systematically reflect the economic business situation of the enterprise, it is necessary to filter the required print data from the economic data in the daily economic business activities of the enterprise based on information such as ID and time. To this end, the corresponding pre-configured data mapping method is queried for the target ticket type. The pre-configured data mapping method indicates the mode of obtaining the print data of the target ticket type (such as obtaining the required print data from the pre-entered original vouchers, or filtering the required print data from the economic data in the daily economic business activities of the enterprise based on information such as ID and time), which can improve the efficiency and accuracy of data acquisition.
[0029] Exemplarily, the present application designs a printing platform and deploys the printing platform on a server to form a printing server. The printing platform is implemented based on UReport (a Java-based Chinese reporting engine) high-performance reporting engine. Any complex Chinese-style report can be implemented by iterating cells. A new web-based report designer is provided, which has interface design for complex Chinese-style reports and powerful report design functions, including but not limited to cross-tabs, grouping, sorting, summarizing, conditional formatting, etc. A web-based report designer is provided to make report design and maintenance easier.
[0030] Among them, the printing platform can be built through the following steps: (1) Design report templates: Use uReport's report designer to design report templates according to business needs; configure data sources to ensure that the report can correctly obtain data; set report styles and formats to meet printing requirements. (2) Implement report printing functions: In uReport, the report printing function can be implemented in a variety of ways, including browser-based printing and Lodop printing plug-ins. If you choose browser-based printing, you can use JavaScript to provide a printing interface and process CSS styles to ensure the printing effect. If you choose the Lodop printing plug-in, you need to install and configure the Lodop printing plug-in, and then call the plug-in's printing function in uReport. (3) Implement multi-report printing and ZIP download: uReport supports ZIP download and printing functions for multiple reports. Users can select multiple report files through parameters, and the system will merge them into a ZIP file for users to download. When implementing multi-report printing, you need to ensure that each report can correctly obtain data and generate print content.
[0031] Therefore, this application provides an entrance to the printing platform on the printing server, and the user can enter the target ticket type to be printed on the printing platform, so that the printing server can query the preconfigured data mapping method corresponding to the target ticket type to obtain the printing data through the service interface. Users can also design and maintain reports through the report designer.
[0032] Further, in some embodiments, obtaining the printing data required for printing the target ticket type from the service interface based on the preconfigured data mapping method includes:
[0033] When the preconfigured data mapping method indicates obtaining print data from a pre-stored data table, the print data in the data table is obtained through a service interface; when the preconfigured data mapping method indicates filtering print data from real-time data, the print data is filtered from the real-time data based on filtering conditions through a service interface, wherein the filtering conditions include at least a filtering time and a filtering identifier.
[0034] Exemplarily, when using a print server to print a bill file whose target bill type is a voucher, the preconfigured data mapping method corresponding to the voucher can be queried to instruct obtaining print data from a pre-stored data table (such as a data table storing order information such as invoices and receipts).
[0035] When using the print server to print a bill file whose target bill type is an account book, the pre-configured data mapping method corresponding to the voucher can be queried to indicate that when filtering print data from real-time data, the service interface can be used to filter the required print data from real-time data (the real-time data is the economic data in the daily economic business activities of the enterprise) based on information such as filtering ID and filtering time. In this way, the appropriate data acquisition method can be selected according to the target bill type, thereby improving data acquisition efficiency.
[0036] S13: Query the storage address where the bill template corresponding to the printing data is located, and obtain the bill template from the storage address.
[0037] Specifically, the ticket template is stored on a file server that is connected to the print server. The file server and the print server are connected via the https (Hypertext Transfer Protocol Secure) communication protocol. Therefore, when the print server queries the storage address of the ticket template, it needs to send a query request to the file server via the https communication protocol so that the file server can send the required storage address to it.
[0038] In some embodiments, the storage address of the bill template corresponding to the print data is queried, and the bill template is obtained from the storage address, including: when the print data indicates to query the storage address from the custom template table, query the storage address from the custom template table; obtain the custom bill template corresponding to the print data from the storage address.
[0039] Specifically, the customized bill template may be a customized template obtained by custom editing templates such as a voucher template, a report template, and an account book template, or may be other customized templates designed according to user needs.
[0040] After the print data is obtained from the service interface corresponding to the target ticket type through the print server, if the print data indicates to query the storage address from the custom template table, then the storage address of the custom template is queried from the custom template table, and the storage address is the address in the file server that is connected to the print server. The custom ticket template corresponding to the print data is further obtained from the storage address of the file server, so as to generate the ticket file to be printed based on the custom ticket template. In this way, the user's personalized printing needs in printing are met through the custom ticket template.
[0041] In other embodiments, the storage address of the bill template corresponding to the printing data is queried, and the bill template is obtained from the storage address, including: when the printing data indicates to query the storage address from the preset template table, query the storage address from the preset template table; obtain the preset bill template corresponding to the printing data from the storage address, wherein the preset bill template includes at least a voucher template, a report template and an account book template.
[0042] That is, after the print server obtains the print data from the service interface corresponding to the target ticket type, if the print data indicates to query the storage address from the preset template table, then the storage address of the custom template is queried from the preset template table, and the storage address is the address in the file server that is connected to the print server, and the preset ticket template corresponding to the print data is further obtained from the storage address of the file server, so as to generate the ticket file to be printed based on the preset ticket template. In this way, the printing of tickets can be completed quickly and conveniently through the preset ticket template, so that the operation process and user experience are improved.
[0043] S14: Determine a data set in the print data, and a data value corresponding to each data subset in the data set, wherein the data set is a set of data with different attributes, and each data subset in the data set corresponds to a data attribute.
[0044] The data set and data value are stored in a database that is connected to the printing platform, and the database is the database of the printing server itself, which can be fully utilized and avoid the design cost of creating a new database. The data set is a collection of data with different attributes, such as summary, subject (information such as the model of the product to be invoiced), quantity, amount, etc. Each data subset corresponds to a data attribute. For example, the data attribute corresponding to data subset I1 is amount, and the data values in the data subset are data values of different amounts.
[0045] S15: Fill each data subset and the corresponding data value into the bill template to obtain the bill file to be printed.
[0046] In some embodiments, each data subset and the corresponding data value are filled into the bill template to obtain a bill file to be printed, including: filling each data subset and the corresponding data value into the bill template to obtain a bill template to be processed; converting the bill template to be processed from a first format to a second format, and using the bill template in the second format as the bill file to be printed.
[0047] Specifically, after obtaining the printing data required for the target bill type, in order to correctly fill the printing data in the corresponding bill template, it is first necessary to determine the data set in the printing data and the data value corresponding to each data subset in the data set, classify the printing data, and then fill each data subset and the corresponding data value into the corresponding position in the bill template to obtain the bill template to be processed. Since the bill template stored on the file server is a template in XML (eXtensible Markup Language) format, XML allows users to create custom tags to describe the meaning and structure of the data, and can flexibly adapt to various data types and structures. Therefore, when providing the user with the bill file to be printed, it is necessary to convert the bill file in XML format to a bill file in PDF format or Excel format.
[0048] Among them, XML files can be converted to PDF files using an XSLT (Extensible Stylesheet Language Transformations) processor for format conversion, or Adobe Acrobat can be used to first convert the XML file to a supported format, such as HTML or RTF (e.g., using XSLT to convert XML to HTML), and then open the HTML file in Adobe Acrobat and select the "Create PDF" function to convert it to PDF. XML files can be converted to Excel files using Microsoft Excel's data import function or other format conversion tools for conversion, which is not limited in this application.
[0049] When printing vouchers, reports, account books and other bill documents, users of this application only need to select the target bill type and various bill templates such as horizontal, vertical, and different papers. The system will automatically obtain the data source based on the selected target bill type and bill template to generate the user's own designed bill file.
[0050] In this way, the present application can automatically query the preconfigured data mapping method corresponding to the target bill type, obtain the printing data required to print the target bill type from the service interface, select the bill template corresponding to the printing data, and fill each data subset and corresponding data value in the printing data into the bill template to obtain a bill file to be printed that meets user needs, thereby reducing the workload of R&D personnel.
[0051] In some embodiments, the ticket printing method further includes:
[0052] Verify the print data obtained from the service interface to determine whether there is unqualified print data in the print data; when unqualified print data exists in the print data, return an error code and error information to the service interface to issue an abnormal reminder; when no unqualified print data exists in the print data, determine that the print data obtained by the service interface has passed the verification, so as to determine the data set in the print data and the data value corresponding to each data subset in the data set.
[0053] Specifically, the print data can be verified by checking whether each field in the data received by the service interface is empty; verifying whether the data type of each field meets expectations, such as string, integer, floating point number, etc.; checking whether the format of the print data is correct, such as date format, time format, telephone number format, etc.
[0054] If there is unqualified print data in the print data (such as the field is controlled, the data type does not meet the expectations, the format of the print data is incorrect, etc.), the error code and error message will be returned to the service interface to remind the exception so that the print server can quickly locate the error problem. The error code can be a unique identifier to identify different types of errors. The error message should describe the cause of the error and possible solutions in detail.
[0055] If there is no unqualified print data in the print data, it can be determined that the print data obtained by the service interface has been verified, so as to determine the data set in the print data and the data value corresponding to each data subset in the data set. In this way, the interface verification is performed on the print data received by the service interface to avoid unqualified print data from being stored, and the corresponding error code and error description are returned for the non-standard information.
[0056] Figure 2 The figure is a flowchart of a ticket printing method according to another embodiment of the present application.
[0057] like Figure 2 As shown, the bill printing method includes:
[0058] S20: target bill printing;
[0059] S21: Call the printing platform to print;
[0060] S22: Query the pre-configured data mapping method corresponding to the target bill type;
[0061] S23: According to the pre-configured data mapping method corresponding to the target bill type, obtain the printing data from the relevant class;
[0062] S24: query the custom printing template table busi_ureport_file or the prefabricated template table base_ureport_preset_file, and obtain the XML file of the template from the OSS server (i.e., the file server) according to the URL (i.e., the storage path of the template file);
[0063] S25: querying the data set table base_ureport_data_set and the data source table base_ureport_data_field according to the target bill type, wherein the data set table refers to the table where the data set in the print data is located, and the data source table refers to the table where the data value corresponding to each data subset in the data set is located;
[0064] S25: Assemble the data set, data source, and data template file to generate a PDF or Excel file;
[0065] S27: Return to the page display of the printing terminal, wherein the printing terminal is in communication connection with the printing server.
[0066] In summary, compared with users using different printing papers or different document columns for display, the background system needs to be specially developed, which cannot meet the user's printing needs in real time. In addition, as the number of bill templates continues to grow, template maintenance requires a printing platform with high costs.
[0067] The printing platform of the present application is aimed at the scenario of user personalized printing. By building a printing platform and providing a web-based report designer, the design and maintenance of invoices becomes simpler. Users can generate invoice files according to preset templates or design invoice files themselves, which significantly improves printing efficiency, reduces the maintenance cost of the printing platform, and improves service stability.
[0068] The ticket printing method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.) and a PC, etc.
[0069] In addition, the technical solutions of the above-mentioned embodiments of the present application can be combined with each other and are not limited here.
[0070] Figure 3 The figure is a schematic diagram of the structure of a print server according to an embodiment of the present application.
[0071] like Figure 3 As shown, the printing server 300 includes: a query module 301, which is used to query the preconfigured data mapping and the bill template corresponding to the target bill type, wherein the preconfigured data mapping indicates a mode for obtaining the printing data of the bill type; a first acquisition module 302, which obtains the printing data required for printing the target bill type from the service interface based on the preconfigured data mapping; a second acquisition module 303, which is used to query the storage address where the bill template corresponding to the printing data is located, and obtain the bill template from the storage address; a determination module 304, which is used to determine the data set in the printing data, and the data value corresponding to each data subset in the data set, wherein the data set is a collection of data with different attributes, each data subset in the data set corresponds to a data attribute, and the data value is the data value in each data subset; a filling module 305, which is used to fill each data subset and the corresponding data value into the bill template to obtain the bill file to be printed.
[0072] In some embodiments of the present application, the first acquisition module 302 is specifically used to: when the preconfigured data mapping method indicates to obtain print data from a pre-stored data table, obtain the print data in the data table through a service interface; when the preconfigured data mapping method indicates to filter print data from real-time data, filter print data from real-time data based on filtering conditions through a service interface, wherein the filtering conditions include at least a filtering time and a filtering identifier.
[0073] In some embodiments of the present application, the second acquisition module 303 is specifically used to: when the printing data indicates to query the storage address from the custom template table, query the storage address from the custom template table; or obtain the custom bill template corresponding to the printing data from the storage address.
[0074] In some embodiments of the present application, the second acquisition module 303 is specifically used to: when the printing data indicates to query the storage address from the preset template table, query the storage address from the preset template table; obtain the preset bill template corresponding to the printing data from the storage address, wherein the preset bill template includes at least a voucher template, a report template and an account book template.
[0075] In some embodiments of the present application, the filling module 305 is specifically used to: fill each data subset and the corresponding data value into the bill template to obtain the bill template to be processed; convert the bill template to be processed from a first format to a second format, and use the bill template in the second format as the bill file to be printed.
[0076] In some embodiments of the present application, the verification module is used (not shown in the figure): to verify the print data obtained from the service interface to determine whether there is unqualified print data in the print data; when unqualified print data exists in the print data, return an error code and error information to the service interface to issue an abnormal reminder; when no unqualified print data exists in the print data, determine that the print data obtained by the service interface has passed the verification, so as to determine the data set in the print data, and the data value corresponding to each data subset in the data set.
[0077] According to the printing server of the embodiment of the present application, it is possible to automatically query the preconfigured data mapping method corresponding to the target bill type, obtain the printing data required for printing the target bill type from the service interface, select the bill template corresponding to the printing data, and fill each data subset and the corresponding data value in the printing data into the bill template to obtain a bill file to be printed that meets user needs, thereby reducing the workload of R&D personnel.
[0078] The print server 300 of this embodiment is used to implement the corresponding ticket printing methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each module in the print server 300 of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.
[0079] Figure 4 The figure is a schematic diagram of the structure of a ticket printing system according to an embodiment of the present application.
[0080] like Figure 4 As shown, the ticket printing system 400 can execute Figure 1 The ticket printing method, the ticket printing system 400 includes: the printing server 300 and the printing terminal 402 of the above embodiment, wherein the printing terminal 402 is used to obtain the ticket file to be printed from the printing server 300, and display the ticket file on the terminal page so as to print the ticket file.
[0081] In this way, the generated bill file in PDF format or Excel format is returned to the printing terminal 402 for display, and the printed data is displayed through charts, graphs and other visual elements, making data analysis more intuitive and helping to quickly understand data trends and patterns.
[0082] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0083] like Figure 5 As shown, the electronic device 500 may include: a processor 501, a memory 502, a communication interface 503 and a communication bus 504. The processor 501, the memory 502 and the communication interface 503 communicate with each other through the communication bus 504; the memory 502 is used to store at least one executable instruction, and the executable instruction enables the processor 501 to perform the operation corresponding to the ticket printing method of any of the above embodiments.
[0084] The processor 501 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0085] The memory 502 is used to store programs, and may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0086] According to the electronic device of the embodiment of the present application, it is possible to automatically query the preconfigured data mapping method corresponding to the target bill type, obtain the printing data required for printing the target bill type from the service interface, select the bill template corresponding to the printing data, and fill each data subset and the corresponding data value in the printing data into the bill template to obtain a bill file to be printed that meets user needs, thereby reducing the workload of R&D personnel.
[0087] The embodiment of the present application also provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the ticket printing method of any of the above embodiments is implemented.
[0088] According to the computer storage medium of the embodiment of the present application, it is possible to automatically query the preconfigured data mapping method corresponding to the target bill type, obtain the printing data required for printing the target bill type from the service interface, select the bill template corresponding to the printing data, and fill each data subset and the corresponding data value in the printing data into the bill template to obtain a bill file to be printed that meets user needs, thereby reducing the workload of R&D personnel.
[0089] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0090] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the ticket printing method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the ticket printing method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the ticket printing method shown herein.
[0091] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0092] The above implementation methods are only used to illustrate the embodiments of the present application, and are not intended to limit the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application, and the scope of patent protection of the embodiments of the present application should be defined by the claims. The systems, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions.
Claims
1. A bill printing method, characterized in that: The method comprises: Querying a preconfigured data mapping method corresponding to a target ticket type, wherein the preconfigured data mapping method indicates a mode for acquiring print data of the target ticket type; Acquire the printing data required for printing the target ticket type from the service interface based on the preconfigured data mapping method; Querying the storage address of the bill template corresponding to the printing data, and obtaining the bill template from the storage address; Determine a data set in the print data, and a data value corresponding to each data subset in the data set, wherein the data set is a set of data with different attributes, and each data subset in the data set corresponds to a data attribute; Each data subset and the corresponding data value are filled into the bill template to obtain the bill file to be printed.
2. The ticket printing method according to claim 1, characterized in that: Acquiring the printing data required for printing the target ticket type from the service interface based on the preconfigured data mapping method includes: When the preconfigured data mapping method indicates obtaining the print data from a pre-stored data table, obtaining the print data in the data table through the service interface; When the preconfigured data mapping method indicates to filter the print data from the real-time data, the print data is filtered from the real-time data based on the filtering condition through the service interface, wherein the filtering condition at least includes a filtering time and a filtering identifier.
3. The ticket printing method according to claim 1, characterized in that: Querying the storage address of the bill template corresponding to the printing data, and obtaining the bill template from the storage address, including: When the printing data indicates to query the storage address from the custom template table, query the storage address from the custom template table; The custom bill template corresponding to the custom bill type is obtained from the storage address.
4. The ticket printing method according to claim 3, characterized in that: Querying the storage address of the bill template corresponding to the printing data, and obtaining the bill template from the storage address, including: When the printing data indicates to query the storage address from the preset template table, query the storage address from the preset template table; A preset bill template corresponding to the printing data is obtained from the storage address, wherein the preset bill template at least includes a voucher template, a report template and an account book template.
5. The ticket printing method according to claim 1, characterized in that: Fill each data subset and the corresponding data value into the bill template to obtain the bill file to be printed, including: Fill each data subset and the corresponding data value into the bill template to obtain the bill template to be processed; The to-be-processed bill template is converted from a first format to a second format, and the bill template in the second format is used as a bill file to be printed.
6. The ticket printing method according to claim 1, characterized in that: The method further comprises: Verifying the print data obtained from the service interface to determine whether there is unqualified print data in the print data; When unqualified printing data exists in the printing data, an error code and error information are returned to the service interface to provide an abnormal reminder; When there is no unqualified printing data in the printing data, it is determined that the printing data obtained by the service interface is verified to be passed, so as to determine the data set in the printing data and the data value corresponding to each data subset in the data set.
7. A print server, characterized in that: include: A query module, used to query a preconfigured data mapping corresponding to a target bill type, wherein the preconfigured data mapping indicates a mode for obtaining print data of the bill type; A first acquisition module, which acquires the printing data required for printing the target ticket type from a service interface based on the preconfigured data mapping; A second acquisition module, used for querying the storage address of the bill template corresponding to the printing data, and acquiring the bill template from the storage address; a determination module, configured to determine a data set in the print data, and a data value corresponding to each data subset in the data set, wherein the data set is a set of data with different attributes, each data subset in the data set corresponds to a data attribute, and the data value is a data value in each data subset; The filling module is used to fill each data subset and the corresponding data value into the bill template to obtain the bill file to be printed.
8. A ticket printing system, characterized in that: The system comprises: The print server and print terminal according to claim 7, wherein the print terminal is used to obtain the ticket file to be printed from the print server, and display the ticket file on the terminal page so as to print the ticket file.
9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the ticket printing method according to any one of claims 1 to 6.
10. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the bill printing method according to any one of claims 1 to 6 is implemented.