CN114169306A - Method, device and equipment for generating electronic receipt and readable storage medium - Google Patents

Method, device and equipment for generating electronic receipt and readable storage medium Download PDF

Info

Publication number
CN114169306A
CN114169306A CN202111521341.XA CN202111521341A CN114169306A CN 114169306 A CN114169306 A CN 114169306A CN 202111521341 A CN202111521341 A CN 202111521341A CN 114169306 A CN114169306 A CN 114169306A
Authority
CN
China
Prior art keywords
information
electronic receipt
target
template
service
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
CN202111521341.XA
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 Pension Insurance Corp
Original Assignee
Ping An Pension Insurance Corp
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 Pension Insurance Corp filed Critical Ping An Pension Insurance Corp
Priority to CN202111521341.XA priority Critical patent/CN114169306A/en
Publication of CN114169306A publication Critical patent/CN114169306A/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
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Tourism & Hospitality (AREA)
  • Health & Medical Sciences (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method, a device, equipment and a readable storage medium for generating an electronic receipt, wherein the method comprises the following steps: in the process of handling the target service, when an electronic receipt generating instruction is received, analyzing service type information from the service information of the target service; acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of pieces of row information, and each piece of row information comprises a plurality of elements; sequentially traversing all the line information in the electronic receipt template, and acquiring all the elements from the currently traversed target line information; determining element values of all elements in the target line information according to the service information, and splicing the element values of all elements in the target line information into character string information; forming an electronic receipt in a PDF format according to the character string information combination corresponding to each line of information; the invention can generate the electronic receipt more efficiently.

Description

Method, device and equipment for generating electronic receipt and readable storage medium
Technical Field
The present invention relates to the field of data display technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for generating an electronic receipt.
Background
With the development of electronic office systems, electronic receipt sheets are a common form that customers want to call service information for viewing. In the prior art, when an electronic receipt is required to be generated for a client in a business processing process, business information needs to be manually filled in according to an electronic receipt format, the electronic receipt generated in this way wastes human resources and consumes a long time, and meanwhile, batch processing cannot be performed on electronic receipts of the same type.
Therefore, how to efficiently generate the electronic receipt is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a method, a device and equipment for generating an electronic receipt and a readable storage medium, which solve the technical problems in the prior art and achieve a more efficient electronic receipt generation effect.
According to one aspect of the present invention, there is provided a method of generating an electronic receipt, the method comprising the steps of:
in the process of handling the target service, when an electronic receipt generating instruction is received, analyzing service type information from the service information of the target service;
acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of pieces of row information, and each piece of row information comprises a plurality of elements;
sequentially traversing all the line information in the electronic receipt template, and acquiring all the elements from the currently traversed target line information;
determining element values of all elements in the target line information according to the service information, and splicing the element values of all elements in the target line information into character string information;
and combining to form an electronic receipt in PDF format according to the character string information corresponding to each line information.
Optionally, before the obtaining the electronic receipt template corresponding to the service type information from the preset template library, the method further includes:
acquiring an electronic receipt sample corresponding to the service type information from a preset sample database; wherein the electronic receipt sample is in a text format;
generating an electronic receipt template according to the electronic receipt sample; wherein, the electronic receipt template is in a character string format;
setting a corresponding line number for each line information in the electronic receipt template, and setting a corresponding element serial number for each element in each line information;
and adding the electronic receipt single template into the template library, and adding a label corresponding to the service type information for the electronic receipt single template.
Optionally, before the sequentially traversing the information of each line in the electronic receipt template and acquiring each element from the currently traversed target information of each line, the method further includes:
acquiring the line number of each line information in the electronic receipt template, and adding all the line numbers into a preset first list set according to an ascending order;
respectively establishing a corresponding second list set for each row of information, and adding a corresponding row number for each second list set;
and adding each element in each row of information into the corresponding second list set according to the sequence of the element sequence.
Optionally, the sequentially traversing the information of each line in the electronic receipt template, and acquiring each element from the currently traversed target information of each line specifically includes:
sequentially traversing each line number in the first list set, and searching a target second list set corresponding to the currently traversed target line number;
all elements contained in the target second list set are parsed out.
Optionally, the determining the element value of each element in the target line information according to the service information specifically includes:
sequentially traversing each element in the target second list set, and judging the element type of the currently traversed target element;
and if the element type of the target element is a static element, taking the target element as an element value, and if the element type of the target element is a dynamic element, acquiring the element value of the target element from the service information.
Optionally, if the element type of the target element is a dynamic element, acquiring an element value of the target element from the service information specifically includes:
acquiring a generation rule base associated with the electronic receipt template;
and acquiring a generation rule corresponding to the target element from the generation rule base, and calculating an element value of the target element according to the service information by using the generation rule.
Optionally, the forming of the electronic receipt in the PDF format according to the combination of the character string information corresponding to each piece of line information specifically includes:
and storing the character string information corresponding to each second list set into a preset third list set according to the line number sequence, and generating the electronic receipt in the PDF format based on the third list set.
In order to achieve the above object, the present invention further provides an apparatus for generating an electronic receipt, which specifically includes the following components:
the analysis module is used for analyzing the service type information from the service information of the target service when an electronic receipt generating instruction is received in the process of handling the target service;
the acquisition module is used for acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of pieces of row information, and each piece of row information comprises a plurality of elements;
the traversal module is used for sequentially traversing all the line information in the electronic receipt template and acquiring all the elements from the currently traversed target line information;
the determining module is used for determining the element values of all the elements in the target line information according to the service information and splicing the element values of all the elements in the target line information into character string information;
and the generating module is used for combining and forming the electronic receipt in the PDF format according to the character string information corresponding to each line of information.
In order to achieve the above object, the present invention further provides a computer device, which specifically includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above-described method of generating an electronic response piece when executing the computer program.
In order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, realizes the above-mentioned steps of the method of generating an electronic receipt.
According to the method, the device, the equipment and the readable storage medium for generating the electronic receipt, provided by the invention, all elements in each line of information in the electronic receipt template can be traversed by acquiring the electronic receipt template related to the service type, and the element value of each element is determined according to the generation rule, so that the process that the operation is manually carried out according to the service information in the prior art is omitted; meanwhile, the formats of the electronic receipt single templates corresponding to each service type are fixed and can be reused, and the generation process only needs to modify the element values corresponding to the dynamic elements in the electronic receipt single templates according to different service information and generate the electronic receipt, so that the electronic receipt single of the same type can be generated in batches, and a more efficient electronic receipt single generation effect is achieved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is an alternative flow chart of a method for generating an electronic receipt according to an embodiment;
FIG. 2 is a schematic diagram of an alternative program module of the apparatus for generating an electronic receipt according to the second embodiment;
fig. 3 is a schematic diagram of an alternative hardware architecture of the computer device according to the third embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
The embodiment of the invention provides a method for generating an electronic receipt, which specifically comprises the following steps as shown in fig. 1:
step S101: in the process of handling the target service, when an electronic receipt generating instruction is received, the service type information is analyzed from the service information of the target service.
In the process of transacting business for a user, when an electronic receipt is required to be generated for the user, an electronic receipt generation instruction is triggered; the electronic receipt is used for displaying various service information in the service handling process according to a preset electronic receipt format, and includes service information related to a target service and service handling result information, and different types of services have electronic receipt with different styles, for example: the electronic receipt for handling the banking business comprises client information, business handling information and money; the electronic receipt handling the commodity business comprises commodity detail information, commodity amount, purchase time and the like.
Step S102: acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of line information, and each line information comprises a plurality of elements.
In the present embodiment, information is created for different service types in advanceEstablishing corresponding electronic receipt template, wherein each electronic receipt template comprises a plurality of lines of information, and each line of information comprises a plurality of elements; it should be noted that, the elements in a row of information are divided in advance in the process of forming the electronic receipt template, for example, in the row of information "applicant:name (I)And the dangerous species number is:number ofAnd the service life is as follows:Time"in, the elements are: "applicant: "," is a little bit "Name (I)", seed number: "," is a little bit "Number of", the year of insuring: "," is a little bit "Time", and each element has corresponding element attribute information.
In this embodiment, the content and format of the electronic receipt for the same service type are basically the same, and each line of information in the electronic receipt is relatively fixed, so that corresponding electronic receipt templates are set for different service type information, so as to generate the electronic receipt based on the electronic receipt templates in the following.
Specifically, before step S102, the method further includes:
step A1: acquiring an electronic receipt sample corresponding to the service type information from a preset sample database; wherein the electronic receipt sample is in a text format;
step A2: generating an electronic receipt template according to the electronic receipt sample; wherein, the electronic receipt template is in a character string format;
in this embodiment, the content in the electronic receipt sample is in text form, the content in the electronic receipt template is in character string form, and the process of generating the electronic receipt template from the electronic receipt sample is to convert the text information of each line in the electronic receipt sample line by line into the character string information of each line in the electronic receipt template.
Step A3: setting a corresponding line number for each line information in the electronic receipt template, and setting a corresponding element serial number for each element in each line information;
step A4: and adding the electronic receipt single template into the template library, and adding a label corresponding to the service type information for the electronic receipt single template.
In this embodiment, the corresponding electronic receipt template is set for different service types, so that the electronic receipt can be generated by flexibly using the electronic receipt template in different services, and the content in the electronic receipt template is modified.
Step S103: and sequentially traversing all the line information in the electronic receipt template, and acquiring all the elements from the currently traversed target line information.
Specifically, before step S103, the method further includes:
step B1: acquiring the line number of each line information in the electronic receipt template, and adding all the line numbers into a preset first list set according to an ascending order;
the List set is a set capable of arranging input elements in an input order, and each element in the List set has an element number, and can be indexed according to the element number. In this embodiment, by means of the ordering of the list set, the line number and the element number in the list can be used in a one-to-one correspondence manner in the storage process.
In this embodiment, the query of the line numbers is performed line by line in the electronic receipt template by using a traversal manner, that is, starting from a first line of the electronic receipt template, the line number corresponding to the first line is stored in a first element position of a first list set, then the line number corresponding to a second line is stored in a second element position of the first list set, and so on, the line numbers of all the line information in the electronic receipt template are stored in the first list set one by one. The first list set is used for storing the line numbers of all lines of information in the electronic receipt form template so as to process each line of information in the following process, and the condition of information omission in the process of generating the electronic receipt form is avoided.
Step B2: respectively establishing a corresponding second list set for each row of information, and adding a corresponding row number for each second list set;
step B3: and adding each element in each row of information into the corresponding second list set according to the sequence of the element sequence.
In this embodiment, a corresponding second list set is set for each piece of line information in the electronic receipt template, and the second list set is used to store all elements in one piece of line information in the electronic receipt template.
In this embodiment, a target line number is obtained from the first list set in a traversal manner, then each element in the target line information is found out from the electronic receipt template according to the target line number, finally each element is sequentially stored in the target second list set according to a preset element number, that is, an element with an element number of 1 in the target line information is stored in a first element position of the target second list set, and then an element with an element number of 2 in the target line information is stored in a second element position of the target second list set, and so on until all elements in the target line information in the electronic receipt template are stored in the target second list set. For example, a certain line of information in an electronic response piece template is "applicant:name (I)And (3) purchasing:accident of certain rideAnd (3) premium:money amountElement ", wherein, in the process of creating the electronic receipt template, corresponding element serial numbers have been added to each element in the row of information in advance, that is," applicant: "-1,".Name (I)"-2," purchase: "-3,".Accident of certain ride"-4," premium: "-5,".Money amount"-6," element "-7, and storing the elements in the row information in a second list set one by one according to the ascending order of the element sequence numbers from 1 to 7. And storing each element in each line of information in the electronic receipt single template by using the second list set, and sequencing according to the element sequence number so as to generate character string information more orderly in the subsequent element splicing process.
Further, step S103 specifically includes:
step C1: sequentially traversing each line number in the first list set, and searching a target second list set corresponding to the currently traversed target line number;
step C2: all elements contained in the target second list set are parsed out.
In this embodiment, the order of the list sets is utilized to sequentially store the line sequence numbers in the first list set in an ascending order so as to index the corresponding line sequence numbers, and then a second list set is respectively set for each line of information and the elements in each line of information are stored in an ascending order of the element sequence numbers so as to index the corresponding elements according to the element sequence numbers.
Step S104: and determining element values of all elements in the target line information according to the service information, and splicing the element values of all elements in the target line information into character string information.
Specifically, the determining the element value of each element in the target line information according to the service information specifically includes:
step D1: sequentially traversing each element in the target second list set, and judging the element type of the currently traversed target element;
step D2: and if the element type of the target element is a static element, taking the target element as an element value, and if the element type of the target element is a dynamic element, acquiring the element value of the target element from the service information.
In this embodiment, since each element has corresponding element attribute information, whether an element is a static element or a dynamic element can be determined by the element attribute information; the static elements are elements which do not need to change values, namely, the elements in the electronic receipt template can be used in different instantiated electronic receipts; for example, the in-line information "applicant:name (I)And the dangerous species number is:number ofAnd the service life is as follows:Time"in, static elements are" applicant: ", seed number: and, the service life: ", the static elements in the electronic receipt template can be used directly in each instantiated electronic receipt without change; to moveThe state element is an element needing to change the value, namely the values used in different instantiation electronic receipt sheets are different; for example, the in-line information "applicant:name (I)And the dangerous species number is:number ofAnd the service life is as follows:Time"middle, dynamic element is"Name (I)”、“Number of"and"Time of flight Workshop", the values of these elements are different in different services. It should be noted that, in the present embodiment, a unique dynamic element name is set in advance for each dynamic element, and the dynamic element name is added as a dynamic element to the electronic receipt template.
The static elements in the electronic receipt form template are fixed, the element values of the corresponding static elements are the static elements which already exist in the electronic receipt form template, modification is not needed according to the service information, the dynamic elements need modification according to the service information, and then the dynamic element names are used as dynamic elements to be added into the electronic receipt form template.
In this embodiment, according to the element types of the template elements, the static element part can be applied mechanically by only changing the values corresponding to the dynamic elements in the electronic receipt single templates of the same type, so as to achieve the effect of batch processing.
Further, if the element type of the target element is a dynamic element, acquiring an element value of the target element from the service information specifically includes:
step E1: acquiring a generation rule base associated with the electronic receipt template;
step E2: and acquiring a generation rule corresponding to the target element from the generation rule base, and calculating an element value of the target element according to the service information by using the generation rule.
The generation rules are calculation formulas used for calculating element values of the target elements, and the generation rules of all the elements in the electronic receipt template are integrated to form a generation rule base.
Further, before step S104, the method further includes:
step F1: acquiring a generation rule base associated with the electronic receipt template; wherein the generating a rule base comprises: generating rules which are respectively set for each dynamic element in the electronic receipt single template and are used for calculating element values of the dynamic elements;
step F2: aiming at a target dynamic element, calculating an element value of the target dynamic element according to the service information by using a corresponding generation rule;
step F3: and storing each dynamic element and the corresponding element value into a preset dynamic element map set in an associated manner.
The Map set is used to store data having a mapping relationship, and in this embodiment, a dynamic element Map set having a mapping relationship between dynamic elements and element values is set.
In this embodiment, a generation rule base attached to an electronic receipt template is used, according to a target generation rule of a target dynamic element, original business information required by the target generation rule is acquired from the business information, an element value of the target dynamic element is calculated from the original business information according to the target generation rule, and each calculated dynamic element and the element value are stored in a dynamic element map set in a pair.
Further, if the element type of the target element is a dynamic element, acquiring an element value of the target element from the service information specifically includes:
and finding out an element value corresponding to the target element from the dynamic element map set, and replacing the target element by using the element value.
In this embodiment, since the element values of the static elements do not change, the static elements in the second list set do not need to be modified; the dynamic elements in the second list set are characterized by the dynamic element names, and are not real element values, so that corresponding element values need to be acquired from the dynamic element map set according to the dynamic element names, and the acquired element values are added to the second list set to replace the dynamic element names.
In this embodiment, the dynamic element names of all dynamic elements in the electronic receipt template are replaced with the element values by using the dynamic element map set, so that the efficiency of generating the electronic receipt from the electronic receipt template can be improved, and the time consumption for generating the electronic receipt is reduced.
In this embodiment, two alternative ways of determining the element values corresponding to the dynamic elements are provided, the first way is to determine the element values corresponding to the dynamic elements in the template by using the element values of the target elements calculated by the generation rules; the second method is that the element value of each dynamic element in the template is calculated by using a generation rule, then each dynamic element and the corresponding element value are stored in a dynamic element map set in a correlation mode, and the element value corresponding to the target element is searched in the map set to replace the target element.
Step S105: and combining to form an electronic receipt in PDF format according to the character string information corresponding to each line information.
Specifically, step S105 includes:
and storing the character string information corresponding to each second list set into a preset third list set according to the line number sequence, and generating the electronic receipt in the PDF format based on the third list set.
In this embodiment, it is necessary to sequentially store the string information sequence formed by each second list set into the third list set in ascending order by using the line number of each second list set. In addition, traversing the third list set, converting the character string information of all rows in the third list set into a PDF file by using an itext class library, and finally sending the PDF file to a user side or directly displaying the PDF file on line.
In this embodiment, by using the ordering of the list sets, the line numbers of the electronic receipt template are stored in the first list set in an ascending order, then the line numbers in the first list set are traversed, corresponding second list sets are set for the line information corresponding to each line number, all elements in each second list set are ordered according to the element numbers, and the mapping relationship between the names of the dynamic variables in the map set and the element values is matched, so that the element values of the corresponding target dynamic elements can be replaced more quickly, the time consumed for generation is reduced, and a more efficient electronic receipt generation effect is achieved.
Example two
The embodiment of the invention provides a device for generating an electronic receipt, which specifically comprises the following components as shown in fig. 2:
the analysis module 201 is used for analyzing service type information from the service information of the target service when an electronic receipt generating instruction is received in the process of handling the target service;
an obtaining module 202, configured to obtain an electronic receipt form template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of pieces of row information, and each piece of row information comprises a plurality of elements;
the traversal module 203 is configured to sequentially traverse each piece of line information in the electronic receipt template, and obtain each element from currently traversed target line information;
a determining module 204, configured to determine element values of each element in the target line information according to the service information, and splice the element values of all elements in the target line information into character string information;
the generating module 205 is configured to combine to form an electronic receipt in PDF format according to the character string information corresponding to each piece of line information.
Specifically, the apparatus further comprises:
the adding module is used for acquiring an electronic receipt sample corresponding to the service type information from a preset sample database before acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt sample is in a text format; generating an electronic receipt template according to the electronic receipt sample; wherein, the electronic receipt template is in a character string format; setting a corresponding line number for each line information in the electronic receipt template, and setting a corresponding element serial number for each element in each line information; and adding the electronic receipt single template into the template library, and adding a label corresponding to the service type information for the electronic receipt single template.
Further, the apparatus further comprises:
the filling module is used for acquiring the line number of each line information in the electronic receipt template before traversing each line information in the electronic receipt template in sequence and acquiring each element from the currently traversed target line information, and adding all the line numbers into a preset first list set according to an ascending order; respectively establishing a corresponding second list set for each row of information, and adding a corresponding row number for each second list set; and adding each element in each row of information into the corresponding second list set according to the sequence of the element sequence.
Specifically, the traversing module 203 is configured to:
sequentially traversing each line number in the first list set, and searching a target second list set corresponding to the currently traversed target line number;
all elements contained in the target second list set are parsed out.
Specifically, the determining module 204 includes:
the judging unit is used for sequentially traversing each element in the target second list set and judging the element type of the currently traversed target element;
and the replacing unit is used for taking the target element as an element value if the element type of the target element is a static element, and acquiring the element value of the target element from the service information if the element type of the target element is a dynamic element.
Further, the replacing unit is specifically configured to:
acquiring a generation rule base associated with the electronic receipt template;
and acquiring a generation rule corresponding to the target element from the generation rule base, and calculating an element value of the target element according to the service information by using the generation rule.
Further, the apparatus further comprises:
the storage module is used for acquiring a generation rule base associated with the electronic receipt single template before determining the element values of all the elements in the target line information according to the service information and splicing the element values of all the elements in the target line information into character string information; wherein the generating a rule base comprises: generating rules which are respectively set for each dynamic element in the electronic receipt single template and are used for calculating element values of the dynamic elements; aiming at a target dynamic element, calculating an element value of the target dynamic element according to the service information by using a corresponding generation rule; and storing each dynamic element and the corresponding element value into a preset dynamic element map set in an associated manner.
Further, the replacement unit is further configured to:
and finding out an element value corresponding to the target element from the dynamic element map set, and replacing the target element by using the element value.
Specifically, the generating module 205 is configured to:
and storing the character string information corresponding to each second list set into a preset third list set according to the line number sequence, and generating the electronic receipt in the PDF format based on the third list set.
EXAMPLE III
The embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) capable of executing programs, and the like. As shown in fig. 3, the computer device 30 of the present embodiment includes at least but is not limited to: a memory 301, a processor 302 communicatively coupled to each other via a system bus. It is noted that FIG. 3 only shows the computer device 30 having components 301 and 302, but it is understood that not all of the shown components are required and that more or fewer components may be implemented instead.
In this embodiment, the memory 301 (i.e., the readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 301 may be an internal storage unit of the computer device 30, such as a hard disk or a memory of the computer device 30. In other embodiments, the memory 301 may also be an external storage device of the computer device 30, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 30. Of course, the memory 301 may also include both internal and external storage devices for the computer device 30. In the present embodiment, the memory 301 is generally used for storing an operating system and various types of application software installed in the computer device 30. In addition, the memory 301 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 302 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 302 generally serves to control the overall operation of the computer device 30.
Specifically, in this embodiment, the processor 302 is configured to execute the program of the method for generating an electronic receipt stored in the memory 301, and when the program of the method for generating an electronic receipt is executed, the following steps are implemented:
in the process of handling the target service, when an electronic receipt generating instruction is received, analyzing service type information from the service information of the target service;
acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of pieces of row information, and each piece of row information comprises a plurality of elements;
sequentially traversing all the line information in the electronic receipt template, and acquiring all the elements from the currently traversed target line information;
determining element values of all elements in the target line information according to the service information, and splicing the element values of all elements in the target line information into character string information;
and combining to form an electronic receipt in PDF format according to the character string information corresponding to each line information.
The specific embodiment process of the above method steps can be referred to in the first embodiment, and the detailed description of this embodiment is not repeated here.
Example four
The present embodiments also provide a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., having stored thereon a computer program that when executed by a processor implements the method steps of:
in the process of handling the target service, when an electronic receipt generating instruction is received, analyzing service type information from the service information of the target service;
acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of pieces of row information, and each piece of row information comprises a plurality of elements;
sequentially traversing all the line information in the electronic receipt template, and acquiring all the elements from the currently traversed target line information;
determining element values of all elements in the target line information according to the service information, and splicing the element values of all elements in the target line information into character string information;
and combining to form an electronic receipt in PDF format according to the character string information corresponding to each line information.
The specific embodiment process of the above method steps can be referred to in the first embodiment, and the detailed description of this embodiment is not repeated here.
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 apparatus 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 apparatus. 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 apparatus 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 method of generating an electronic response piece, the method comprising:
in the process of handling the target service, when an electronic receipt generating instruction is received, analyzing service type information from the service information of the target service;
acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of pieces of row information, and each piece of row information comprises a plurality of elements;
sequentially traversing all the line information in the electronic receipt template, and acquiring all the elements from the currently traversed target line information;
determining element values of all elements in the target line information according to the service information, and splicing the element values of all elements in the target line information into character string information;
and combining to form an electronic receipt in PDF format according to the character string information corresponding to each line information.
2. The method for generating an electronic receipt according to claim 1, wherein before the obtaining the electronic receipt template corresponding to the service type information from the preset template library, the method further comprises:
acquiring an electronic receipt sample corresponding to the service type information from a preset sample database; wherein the electronic receipt sample is in a text format;
generating an electronic receipt template according to the electronic receipt sample; wherein, the electronic receipt template is in a character string format;
setting a corresponding line number for each line information in the electronic receipt template, and setting a corresponding element serial number for each element in each line information;
and adding the electronic receipt single template into the template library, and adding a label corresponding to the service type information for the electronic receipt single template.
3. The method of generating an electronic receipt according to claim 2, wherein before the sequentially traversing the respective pieces of line information in the electronic receipt template and obtaining the respective elements from the currently traversed target piece of line information, the method further comprises:
acquiring the line number of each line information in the electronic receipt template, and adding all the line numbers into a preset first list set according to an ascending order;
respectively establishing a corresponding second list set for each row of information, and adding a corresponding row number for each second list set;
and adding each element in each row of information into the corresponding second list set according to the sequence of the element sequence.
4. The method for generating an electronic receipt according to claim 3, wherein traversing the line information in the electronic receipt template in sequence and obtaining elements from the currently traversed target line information specifically comprises:
sequentially traversing each line number in the first list set, and searching a target second list set corresponding to the currently traversed target line number;
all elements contained in the target second list set are parsed out.
5. The method for generating an electronic receipt according to claim 3, wherein the determining the element values of the elements in the target line information according to the service information specifically includes:
sequentially traversing each element in the target second list set, and judging the element type of the currently traversed target element;
and if the element type of the target element is a static element, taking the target element as an element value, and if the element type of the target element is a dynamic element, acquiring the element value of the target element from the service information.
6. The method for generating an electronic receipt according to claim 5, wherein if the element type of the target element is a dynamic element, acquiring the element value of the target element from the service information specifically includes:
acquiring a generation rule base associated with the electronic receipt template;
and acquiring a generation rule corresponding to the target element from the generation rule base, and calculating an element value of the target element according to the service information by using the generation rule.
7. The method for generating an electronic receipt according to claim 6, wherein the forming of the electronic receipt in the PDF format according to the combination of the character string information corresponding to each line information specifically includes:
and storing the character string information corresponding to each second list set into a preset third list set according to the line number sequence, and generating the electronic receipt in the PDF format based on the third list set.
8. An apparatus for generating an electronic response piece, the apparatus comprising:
the analysis module is used for analyzing the service type information from the service information of the target service when an electronic receipt generating instruction is received in the process of handling the target service;
the acquisition module is used for acquiring an electronic receipt template corresponding to the service type information from a preset template library; wherein the electronic receipt single-mode board comprises a plurality of pieces of row information, and each piece of row information comprises a plurality of elements;
the traversal module is used for sequentially traversing all the line information in the electronic receipt template and acquiring all the elements from the currently traversed target line information;
the determining module is used for determining the element values of all the elements in the target line information according to the service information and splicing the element values of all the elements in the target line information into character string information;
and the generating module is used for combining and forming the electronic receipt in the PDF format according to the character string information corresponding to each line of information.
9. A computer device, the computer device comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111521341.XA 2021-12-13 2021-12-13 Method, device and equipment for generating electronic receipt and readable storage medium Pending CN114169306A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111521341.XA CN114169306A (en) 2021-12-13 2021-12-13 Method, device and equipment for generating electronic receipt and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111521341.XA CN114169306A (en) 2021-12-13 2021-12-13 Method, device and equipment for generating electronic receipt and readable storage medium

Publications (1)

Publication Number Publication Date
CN114169306A true CN114169306A (en) 2022-03-11

Family

ID=80486144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111521341.XA Pending CN114169306A (en) 2021-12-13 2021-12-13 Method, device and equipment for generating electronic receipt and readable storage medium

Country Status (1)

Country Link
CN (1) CN114169306A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116091015A (en) * 2023-04-07 2023-05-09 中瑞方胜人力资源科技(北京)有限公司 Payroll system, payroll method, electronic device, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815464A (en) * 2018-12-15 2019-05-28 中国平安人寿保险股份有限公司 PDF document generation method, device, electronic equipment and storage medium
CN110147541A (en) * 2019-05-23 2019-08-20 北京神州泰岳软件股份有限公司 A kind of generation method and device of economic report
WO2021042521A1 (en) * 2019-09-04 2021-03-11 平安科技(深圳)有限公司 Contract automatic generation method, computer device and computer non-volatile storage medium
CN113627145A (en) * 2021-08-02 2021-11-09 上海浦东发展银行股份有限公司 Method, device, equipment and medium for generating file of parameterized configuration

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815464A (en) * 2018-12-15 2019-05-28 中国平安人寿保险股份有限公司 PDF document generation method, device, electronic equipment and storage medium
CN110147541A (en) * 2019-05-23 2019-08-20 北京神州泰岳软件股份有限公司 A kind of generation method and device of economic report
WO2021042521A1 (en) * 2019-09-04 2021-03-11 平安科技(深圳)有限公司 Contract automatic generation method, computer device and computer non-volatile storage medium
CN113627145A (en) * 2021-08-02 2021-11-09 上海浦东发展银行股份有限公司 Method, device, equipment and medium for generating file of parameterized configuration

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116091015A (en) * 2023-04-07 2023-05-09 中瑞方胜人力资源科技(北京)有限公司 Payroll system, payroll method, electronic device, and storage medium

Similar Documents

Publication Publication Date Title
CN112016273B (en) Document catalog generation method, device, electronic equipment and readable storage medium
CN111274782A (en) Text auditing method and device, computer equipment and readable storage medium
CN111159982B (en) Document editing method, device, electronic equipment and computer readable storage medium
CN107679208A (en) A kind of searching method of picture, terminal device and storage medium
CN110990403A (en) Business data storage method, system, computer equipment and storage medium
CN110837366A (en) Form generation method, electronic device and computer readable storage medium
CN111026753A (en) Label storage method and device based on tree structure
CN110765101A (en) Label generation method and device, computer readable storage medium and server
CN111258799A (en) Error reporting information processing method, electronic device and computer readable storage medium
CN111159183B (en) Report generation method, electronic device and computer readable storage medium
CN111752565A (en) Interface generation method and device, computer equipment and readable storage medium
CN112528616A (en) Business form generation method and device, electronic equipment and computer storage medium
CN111625567A (en) Data model matching method, device, computer system and readable storage medium
CN112115107A (en) Contract text automatic generation method and device
CN111444368B (en) Method and device for constructing user portrait, computer equipment and storage medium
CN114169306A (en) Method, device and equipment for generating electronic receipt and readable storage medium
US10445695B2 (en) Method and system for providing continuous reference architecture and bill of material modeling
CN111598707B (en) Page generation method and electronic equipment
CN111984674A (en) Method and system for generating structured query language
CN111723210A (en) Method and device for storing data table, computer equipment and readable storage medium
CN109949090A (en) Lead referral method, apparatus, electronic equipment and medium
CN111610908B (en) Method for generating frame diagram, computer equipment and readable storage medium
CN113741953A (en) Form processing method and device, electronic equipment and computer storage medium
CN109344386B (en) Text content identification method, apparatus, device and computer readable storage medium
CN112685078A (en) Interface document generation and query method, device 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