WO2021218034A1 - 报表生成方法、装置、终端设备及存储介质 - Google Patents

报表生成方法、装置、终端设备及存储介质 Download PDF

Info

Publication number
WO2021218034A1
WO2021218034A1 PCT/CN2020/119297 CN2020119297W WO2021218034A1 WO 2021218034 A1 WO2021218034 A1 WO 2021218034A1 CN 2020119297 W CN2020119297 W CN 2020119297W WO 2021218034 A1 WO2021218034 A1 WO 2021218034A1
Authority
WO
WIPO (PCT)
Prior art keywords
report
data
preset
generation process
identification information
Prior art date
Application number
PCT/CN2020/119297
Other languages
English (en)
French (fr)
Inventor
赖云辉
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021218034A1 publication Critical patent/WO2021218034A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets

Definitions

  • This application belongs to the field of computer technology, and in particular relates to a report generation method, device, terminal device and storage medium.
  • the embodiments of the present application provide a report generation method, device, terminal device, and storage medium, aiming to solve the problem of code redundancy in the report generation method in the prior art method.
  • an embodiment of the present application provides a method for generating a report, including:
  • the target data includes report data and preset report templates
  • the report data is filled into the preset report template, and the data report corresponding to the report data is obtained.
  • an embodiment of the present application provides a report generation device, including:
  • the first obtaining module is used to obtain identification information corresponding to the report type of the report to be produced
  • the calling module is used to call the preset report generation process corresponding to the identification information
  • the second acquisition module is used to acquire target data corresponding to the identification information according to the preset report generation process, and the target data includes report data and preset report templates;
  • the generation module is used to fill the report data into the preset report template according to the preset report generation process to obtain the data report corresponding to the report data.
  • an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes all The computer program implements the report generation method as described in any one of the above-mentioned first aspects.
  • an embodiment of the present application provides a computer-readable storage medium that stores a computer program, and is characterized in that, when the computer program is executed by a processor, the implementation is as in the above-mentioned first aspect. Any one of the report generation methods.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a terminal device, causes the terminal device to execute the report generation method described in any one of the above-mentioned first aspects.
  • the embodiment of the application obtains the report generation instruction carrying the identification information and calls the preset report generation process corresponding to the identification information to realize that all reports share a common preset report generation process, reduce code redundancy, and increase the versatility of the general process And scalability.
  • the report data and the preset report template are obtained, and the report data is filled into the preset report template to generate a data report to speed up data reading.
  • FIG. 1 is a schematic flowchart of a report generation method provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a report generation method provided by another embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a report generation method provided by another embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a report generation device provided by an embodiment of the present application.
  • Fig. 5 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • the term “if” can be construed as “when” or “once” or “in response to determination” or “in response to detecting “.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • the embodiment of the present application provides a report generation method.
  • a report generation instruction carrying identification information By acquiring a report generation instruction carrying identification information, a preset report generation process corresponding to the identification information is invoked, which is compared with the existing multiple interfaces for multiple different reports.
  • This application can be implemented with only one interface, simplifying the interface call logic; compared with the existing logic of writing a set of data processing and drawing reports for each report for different report structures, all reports in this application share a common set of Preset the report generation process, complete the operation of extracting the general logic and dividing the exception logic, reducing code redundancy; and it is convenient to add general logic to the general process, without writing code for each report logic, increasing the versatility of the general process And scalability.
  • the preset report generation process obtain the report data and preset report template, according to the preset report generation process, fill the report data into the preset report template, and generate the preset report template after filling the report data into a data report, There is no need to read the report template row by row when writing code using poi (API for the Java program to read and write to Microsoft Office format files) like the traditional way.
  • poi API for the Java program to read and write to Microsoft Office format files
  • Figure 1 shows a schematic flowchart of the report generation method provided by the present application.
  • the method can be applied to terminal devices, including but not limited to mobile phones, tablets, wearable devices, and augmented reality.
  • terminal devices including but not limited to mobile phones, tablets, wearable devices, and augmented reality.
  • AR Augmented reality
  • VR virtual reality
  • UMPC ultra-mobile personal computers
  • PDA personal Digital assistant
  • server and other terminal devices the embodiments of this application do not impose any restrictions on the specific types of terminal devices.
  • the identification information may be the report ID number (tmpkey) corresponding to the report type, for example, the ID number corresponding to the expenditure report is key1, and the ID number corresponding to the income report is key2.
  • the terminal device receives a report generation instruction input by the user, and the report generation instruction carries tmpkey; the terminal device responds to the report generation instruction and transmits tmpkey to a preset interface, and is received by the map of the preset interface; The preset report generation process corresponding to tmpkey returned by the preset interface.
  • the above-mentioned preset report generation process defines the steps of generating a report, which can include a first generation process for all reports and a second generation process for some reports.
  • the first generation process includes all reports that are shared during generation.
  • the second generation process includes some steps required for the generation of the report itself.
  • this embodiment can be implemented with only one interface, which simplifies the interface calling logic.
  • all reports share a set of common templates, complete the operation of extracting common logic and split exception logic, reducing code redundancy.
  • S103 Obtain target data corresponding to the identification information according to the preset report generation process, where the target data includes report data and a preset report template;
  • the report data may be the business data of the report to be generated, such as the financial data constituting the financial report.
  • the preset report template may be a visual jxls template, which is an execl template based on the corresponding relationship between each table and code preset by the jxls engine.
  • the jxls template when the report itself is more complex, you can manually draw the jxls template, and use jxls as the generation tool; when the jxls template is expanded horizontally according to the Data Transfer Object (DTO), the jxls template can be automatically generated, including :Call the jxls tool to read the excel template as a template, so there is no need to write code like traditional poi and read excel line by line and column by line; and extract the corresponding logic between business beans and excel, customize it into an annotation configuration, and configure the annotation Defined to the corresponding business bean, so there is no need to write code for the correspondence between each business bean and excel.
  • DTO Data Transfer Object
  • S104 According to the preset report generation process, fill the report data into the preset report template to obtain a data report corresponding to the report data.
  • a DomainDtoAutoScanServiceImpl service class is defined based on jxls.
  • the service is started, the business domain package is scanned and the class, attribute information and annotation configuration are obtained through reflection, and the above information is imported into the freemarker template to generate the jxls xml of the business domain.
  • the report data is filled into the cells of the corresponding cell attributes, based on the jxls engine, according to Correspondence between code and cell attributes, assign the report data in the cell to the code statement, and generate a data report.
  • FIG. 2 shows a schematic flowchart of another report generation method provided by an embodiment of the present application. It should be noted that the steps that are the same as those in the embodiment in FIG. 1 will not be repeated here.
  • the foregoing S102 includes S201 and S202.
  • identification information is preset identification information
  • call the first generation process and the second generation process corresponding to the identification information and combine the first generation process and the second generation process into a preset report generation process.
  • tmpkey identification information
  • the first generation process is regarded as the preset report generation process. It should be understood that the first generation process may include a code function corresponding to each identification information.
  • tmpkey is the default tmpkey, that is, when the report to be generated is a special report
  • query the second generation process corresponding to tmpkey in the code library according to tmpkey find the first generation process according to the preset hook mechanism corresponding to the second generation process
  • the function position that can be added by the function of the second generation process, and the function of the second generation process is added to the function of the first generation process to obtain the preset report generation process.
  • the first generation process corresponding to the above-mentioned invoking identification information includes:
  • the data acquisition process in the first generation process is invoked, and the data filling process and the data report generation process corresponding to the identification information in the first generation process are invoked according to the identification information.
  • the first generation process is written as the first generation function as the parent class, and the fixed function, abstract function, and default function in the first generation function are defined.
  • the fixed function can be executed directly without rewriting the function
  • the abstract function can be executed after the function is rewritten
  • the default function can be executed directly without rewriting the function, or it can be executed after the function is rewritten.
  • the data acquisition process is written as a data acquisition function that executes a fixed function, and use the data acquisition function as a subclass that inherits the parent class, so that the fixed function can be executed without rewriting the fixed function;
  • the data filling process is written as an overriding abstract function
  • the data filling function is used as a subclass of inheriting the parent class, and the abstract function can be rewritten, and the function after rewriting the abstract function can be executed;
  • the data report generation process is written as a data report that can optionally rewrite the default function Generate functions and use the data report generation function as a subclass that inherits the parent class. You can rewrite the default function and execute the function after rewriting the default function, or you can execute the default function without rewriting the default function.
  • the data report generation function Based on the hook mechanism.
  • the data acquisition process can also be written as an abstract function or a default function
  • the data filling process can also be written as a fixed function or a default function
  • the data report generation process can also be written It is a fixed function or an abstract function.
  • the report generation function in the first generation process is divided into three different functional functions, so as to realize the executability and reusability of the report generation function.
  • the foregoing combination of the first generation process and the second generation process into a preset report generation process includes:
  • S2022 Add the second generation process to the preset process node in the first generation process to obtain the preset report generation process.
  • the preset process nodes that can be added by the second generation process in the first generation process are determined.
  • the first address of a certain function (process node) in the first generation process is modified in advance to the function address of the second generation process, so that when the first generation function is running, it can be determined whether the identification information is Preset identification information. If yes, according to the corresponding relationship between the identification information and the process node, the process node in the first generation process that can be added by the second generation process is queried, and according to the first address of the corresponding function of the process node, Before the function corresponding to the process node is executed, jump to the execution function corresponding to the second generation process. When the execution function of the second generation process is completed, jump back to the function corresponding to the above process node, and then realize the second generation The process is added to the first generation process.
  • FIG. 3 shows a schematic flowchart of another report generation method provided by an embodiment of the present application. It should be noted that the steps that are the same as those in the embodiment in FIG. 1 will not be repeated here.
  • the foregoing preset report generation process includes a first generation process, and the first generation process includes a data acquisition process, a data filling process, and a data report generation process;
  • the above S103 includes S301, according to the data acquisition process, the identification information is transferred to a preset data interface, and the target data corresponding to the identification information returned by the data interface is acquired;
  • the data acquisition process is a step that needs to be executed in each report generation process without differentiation. Therefore, tmpkey can be passed to the first report generation function, and the fixed function in the first report generation function can be executed to Obtain the report data and jxls template corresponding to tmpkey.
  • the above S104 includes S302 and S303.
  • the data filling process belongs to the data processing process, and the data processing process needs to be executed for each report generation process and there may be differentiated execution steps.
  • Table 1 the data "Zhang San” is filled into the cell whose cell attribute is "Student”, and in Table 2, the data "Zhang San” is filled into the cell whose cell attribute is "Teacher”. Therefore, report data can be passed into the data filling function, according to the data filling process, the report data is used as a parameter to rewrite the abstract function in the first report generation function, and the abstract function containing the report data is executed to fill the report data into jxls In the cell corresponding to the template.
  • the data report generation process is a step that needs to be executed in each report generation process, and there may or may not be a differentiated execution.
  • Table 1 can generate a horizontal table or a vertical table. Therefore, according to the data report generation process, a horizontal table can be generated by executing the default function in the first report generation function, or a vertical table can be generated by rewriting the default function in the first report generation function and executing it.
  • the preset report generation process further includes a second generation process
  • S3031 Process the report data or the preset report template according to the second generation process.
  • the process of processing the form is not a step that needs to be performed in every report generation process. For example, after the data report is generated, the name of the student with the best score needs to be marked in the student score sheet, or before the data report is generated, the average score of the student with the best score needs to be counted. For these steps that are not required for every report, distinguish these steps from the first generation process, as the second generation process, and write the execution function corresponding to each identification information in the second generation process, according to the corresponding execution function Process report data or preset report templates.
  • the report generation method further includes S104 to S106.
  • S104 Obtain template modification information, where the template modification information carries parameters to be modified;
  • the system administrator of the system has the authority to set the corresponding relationship between the data key value and the sql.
  • the mapping pool Through such a mapping pool, there is no need to modify the code in the background, but to maintain such a mapping relationship on the page. Even if the report has new data requirements in the later period, add a mapping here, and then use the key value in the jxls template to obtain the corresponding report data for display.
  • seat cost statistics For example, take seat cost statistics (SeatStatic) as an example. If you need to add a new column of seat number seatnumber later, you can add the seat number (that is, the parameter to be modified) on the report page, and the background will automatically get it through the system administrator’s authority.
  • the SQL (database) mapping table corresponding to SeatStatic.
  • the sql mapping table records the table attributes of the template (such as table coordinates). Add the seat number seatnumber to the sql mapping table to set the mapping relationship between the seatnumber and the template table attributes.
  • the system According to the mapping relationship, the seatnumber will also be put into the jxls template. In this way, you only need to modify the report page, and the jxls template will be automatically changed in the background according to the mapping relationship, without the need to update the code and redeploy.
  • all the above-mentioned data (such as the above-mentioned preset report generation process) can also be stored in a blockchain node, that is, the database in this solution can use the blockchain node On the database.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • FIG. 4 shows a structural block diagram of a report generation device provided in an embodiment of the present application. For ease of description, only parts related to the embodiment of the present application are shown.
  • the device includes:
  • the first obtaining module 401 is configured to obtain identification information corresponding to the report type of the report to be produced;
  • the calling module 402 is used to call the preset report generation process corresponding to the identification information
  • the second obtaining module 403 is configured to obtain target data corresponding to the identification information according to the preset report generation process, where the target data includes report data and a preset report template;
  • the generating module 404 is configured to fill the report data into the preset report template according to the preset report generation process to obtain a data report corresponding to the report data.
  • FIG. 5 is a schematic structural diagram of a terminal device provided by an embodiment of this application.
  • the terminal device 5 of this embodiment includes: at least one processor 50 (only one is shown in FIG.
  • the computer program 52 running on the processor 50 implements the steps in any of the foregoing method embodiments when the processor 50 executes the computer program 52.
  • the terminal device 5 may be a computing device such as a mobile phone, a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, a processor 50 and a memory 51.
  • FIG. 5 is only an example of the terminal device 5, and does not constitute a limitation on the terminal device 5. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
  • the so-called processor 50 may be a central processing unit (Central Processing Unit, CPU).
  • the processor 50 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application-specific integrated circuits (Application Specific Integrated Circuits). Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 51 may be an internal storage unit of the terminal device 5 in some embodiments, such as a hard disk or a memory of the terminal device 5. In other embodiments, the memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk equipped on the terminal device 5, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on. Further, the memory 51 may also include both an internal storage unit of the terminal device 5 and an external storage device.
  • the memory 51 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 51 can also be used to temporarily store data that has been output or will be output.
  • the embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each of the foregoing method embodiments can be realized.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the embodiments of the present application provide a computer program product.
  • the steps in the foregoing method embodiments can be realized when the mobile terminal is executed.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may at least include: any entity or device capable of carrying computer program code to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), and random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media.
  • ROM read-only memory
  • RAM random access memory
  • electrical carrier signals telecommunications signals
  • software distribution media For example, U disk, mobile hard disk, floppy disk or CD-ROM, etc.
  • computer-readable media cannot be electrical carrier signals and telecommunication signals.
  • the disclosed apparatus/network equipment and method may be implemented in other ways.
  • the device/network device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units.
  • components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

Landscapes

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

Abstract

一种适用于计算机技术领域,提供了报表生成方法、装置、终端设备及存储介质,包括:获取与待生成报表的报表类型对应的标识信息(S101);调用标识信息对应的预设报表生成流程(S102);根据预设报表生成流程,获取标识信息对应的目标数据,目标数据包括报表数据和预设报表模板(S103);根据预设报表生成流程,将报表数据填充至预设报表模板中,得到报表数据对应的数据报表(S104)。所有报表共用一套通用的预设报表生成流程,完成抽离通用逻辑和分割例外逻辑的操作,降低代码冗余;以及便于在通用流程中新增通用逻辑,而无需对每个报表逻辑编写代码,增加通用流程的通用性和可拓展性。

Description

报表生成方法、装置、终端设备及存储介质
本申请申明享有2020年04月29日递交的申请号为202010356066.X、名称为“报表生成方法、装置、终端设备及存储介质”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请属于计算机技术领域,特别是涉及一种报表生成方法、装置、终端设备及存储介质。
背景技术
随着计算机技术的高速发展,企业的业务网也在不断扩张,为了更好的运用业务数据,把业务数据以各种报表的方式展示出来。发明人意识到,对于不同的报表结构,当前需要对每个报表编写一套数据处理和绘制报表的逻辑,这样使得用户操作繁琐和代码冗余。对于更改报表结构或者数据时,当前需要更改代码逻辑和添加获取数据的代码,这样每次变更都需要后台修改和发布,增加代码的修改风险和用户的等待时长,进而降低了用户的满意度。
技术问题
有鉴于此,本申请实施例提供了一种报表生成方法、装置、终端设备及存储介质,旨在解决现有技术方法中报表生成方式存在代码冗余的问题。
技术解决方案
为解决上述技术问题,本申请实施例采用的技术方案是:
第一方面,本申请实施例提供了一种报表生成方法,包括:
获取与待生成报表的报表类型对应的标识信息;
调用标识信息对应的预设报表生成流程;
根据预设报表生成流程,获取标识信息对应的目标数据,目标数据包括报表数据和预设报表模板;
根据预设报表生成流程,将报表数据填充至预设报表模板中,得到报表数据对应的数据报表。
第二方面,本申请实施例提供了一种报表生成装置,包括:
第一获取模块,用于获取与待生产报表的报表类型对应的标识信息;
调用模块,用于调用标识信息对应的预设报表生成流程;
第二获取模块,用于根据预设报表生成流程,获取标识信息对应的目标数据,目标数据包括报表数据和预设报表模板;
生成模块,用于根据预设报表生成流程,将报表数据填充至预设报表模板中,得到报表数据对应数据报表。
第三方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如上述第一方面中任一项所述的报表生成方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如上述第一方面中任一项所述的报表生成方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的报表生成方法。
本申请实施例通过获取携带标识信息的报表生成指令,调用标识信息对应的预设报表生成流程,实现所有报表共用一套通用的预设报表生成流程,降低代码冗余,增加通用流程的通用性和可拓展性。根据预设报表生成流程,获取报表数据和预设报表模板,将报表数据填充至预设报表模板中,以生成为数据报表,以加快数据读取速度。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例提供的报表生成方法的流程示意图;
图2是本申请另一实施例提供的报表生成方法的流程示意图;
图3是本申请另一实施例提供的报表生成方法的流程示意图;
图4是本申请实施例提供的报表生成装置的结构示意图;
图5是本申请实施例提供的终端设备的结构示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
如背景技术相关记载,目前针对不同结构的报表,需要对每个报表编写一套数据处理和绘制报表的报表生成逻辑,这样需要用户耗费大量时间和精力编写代码,并且每个报表都有一套代码,使得代码冗余。对于更改报表结构或者数据时,当前需要更改代码逻辑和添加获取数据的代码,这样每次变更都需要后台修改和发布,增加代码的修改风险和用户的等待时长,进而降低了用户的满意度。
因此,本申请实施例提供一种报表生成方法,通过获取携带标识信息的报表生成指令,调用标识信息对应的预设报表生成流程,与现有针对多个不同的报表而创建多个接口相比,本申请只要一个接口即可实现,简化接口调用逻辑;与现有针对不同报表结构而对每个报表编写一套数据处理和绘制报表的逻辑相比,本申请的所有报表共用一套通用的预设报表生成流程,完成抽离通用逻辑和分割例外逻辑的操作,降低代码冗余;以及便于在通用流程中新增通用逻辑,而无需对每个报表逻辑编写代码,增加通用流程的通用性和可拓展性。根据预设报表生成流程,获取报表数据和预设报表模板,根据预设报表生成流程,将报表数据填充至预设报表模板中,并将填充报表数据后的预设报表模板生成为数据报表,从而无需像传统方式使用poi(API给Java程序对Microsoft Office格式档案读和写的功能)写代码时逐行逐列读取报表模板。
图1示出了本申请提供的报表生成方法的示意性流程图,作为示例而非限定,该方法可以应用于终端设备,该终端设备包括但不限于手机、平板电脑、可穿戴设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或个人数字助理(personal digital assistant,PDA)、服务器等终端设备,本申请实施例对终端设备的具体类型不作任何限制。
S101,获取与待生产报表的报表类型对应的标识信息;
在上述S101中,标识信息可以为报表类型对应报表ID号(tmpkey),如支出报表对应的ID号为key1,收入报表对应的ID号为key2。可选地,终端设备接收用户输入的报表生成指令,所述报表生成指令携带tmpkey;终端设备响应于报表生成指令,将tmpkey传入预设接口,并由该预设接口的map接收;获取该预设接口返回的与tmpkey对应的预设报表生成流程。
S102,调用标识信息对应的预设报表生成流程;
在上述S102中,上述预设报表生成流程定义了生成报表的步骤,其可包括针对所有报表的第一生成流程和针对部分报表的第二生成流程,第一生成流程包含所有报表生成时所共用的步骤,第二生成流程包含部分报表其自身生成时所需的步骤。
可选地,第一生成流程可定义如下:定义通用处理模式框架类JxlsCommon,里面是生成报表一般需要的步骤:获取输出文件名String ouputName = getOutputExcelName();判断是否保存到服务器saveOnServer(ouputName);获取所需数据Map<String, Object> dataMap = getData();将获取的数据放入jxlsBuilder中,并实际生成报表文件setData(dataMap);return this.jxlsBuilder.build().getOutFile()。
可选地,第二生成流程可定义如下,定义例外模板Jxlsexception,该模板内部包含加入到第一生成流程的步骤:判断是否加入到第一生成流程的标记this.alarm();当需要加入到第一生成流程时private boolean alarmFlag = true,将例外模板的执行函数加入到第一生成流程中执行public void start(){isAlarm()}。
本实施例与现有针对系统的多个不同报表而创建多个接口相比,只要一个接口即可实现,简化接口调用逻辑。与现有针对不同报表结构而对每个报表编写一套数据处理和绘制报表的逻辑相比,所有报表共用一套通用模板,完成抽离通用逻辑和分割例外逻辑的操作,降低代码冗余。以及便于在通用模板新增通用逻辑,而无需对每个报表逻辑编写代码,增加通用模板的通用性和可拓展性。
S103,根据预设报表生成流程,获取标识信息对应的目标数据,目标数据包括报表数据和预设报表模板;
在上述S103中,报表数据可以为待生成报表的业务数据,如组成财务报表的财务数据。预设报表模板可以为可视化jxls模板,其为基于jxls引擎预设的每个表格与代码存在对应关系的execl模板。其中,当报表本身比较复杂时,可人为绘制jxls模板,并运用jxls做为生成工具;当jxls模板根据数据传输对象(Data Transfer Object,DTO)横排展开时,可自动生成jxls模板,具体包括:调用jxls工具,模板化读取excel模板,从而无需像传统使用poi编写代码并逐行逐列读取excel;以及将业务bean与excel的对应逻辑抽取出来,自定义成注解配置,将注解配置定义到对应的业务bean上,这样无需再为每一个业务bean和excel的对应关系手写代码。
S104,根据预设报表生成流程,将报表数据填充至预设报表模板中,得到所述报表数据对应的数据报表。
在上述S104中,基于jxls定义一个DomainDtoAutoScanServiceImpl服务类,服务启动时, 扫描业务领域包并通过反射获取类、属性信息和注解配置,将以上信息导入freemarker模板,生成该业务领域的jxls的xml。
具体地,通过预设报表生成模板中的预设函数,根据报表数据与jxls模板中的单元格属性的对应关系,将报表数据填充至对应的单元格属性的单元格中,基于jxls引擎,根据代码与单元格属性的对应关系,将单元格中的报表数据赋值给代码语句,并生成数据报表。
本实施例通过将报表数据填充至jxls模板,无需通过poi在代码中里面绘制不同报表;即使后期用户需要修改模板,仅需在jxls模板(excel文件)上修改即可,无需改动poi代码,也无需变更代码中的取数逻辑,这样更加简单方便。
在图1所示实施例的基础上,图2示出了本申请实施例提供的另一种报表生成方法的流程性示意图。需要说明的是,与图1实施例相同的步骤,此处不再赘述。
如图2所示,在一种可能实现的方式中,上述S102包括S201和S202。
S201,若标识信息不是预设标识信息,则调用标识信息对应的第一生成流程,并将第一生成流程作为预设报表生成流程;
S202,若标识信息是预设标识信息,则调用标识信息对应的第一生成流程和第二生成流程,并将第一生成流程与第二生成流程结合为预设报表生成流程。
在上述S201和S202中,大部分的报表都是具有通用步骤的,但是无法排除部分报表存在其他报表所不需要的步骤的情况,为了避免将非通用步骤加入到通用模板中而导致通用模板的生成步骤变得繁琐,因此将非通用步骤分离出来中,从而分离通用逻辑和例外逻辑,使得报表生成逻辑更加清晰和合理化。
具体地,当tmpkey(标识信息)不为预设tmpkey时,即待生成报表为通用报表时,只需要第一生成流程即可实现通用报表的生成过程,因此调用tmpkey对应的第一生成流程,将该第一生成流程作为预设报表生成流程。应理解,第一生成流程内可以包括每个标识信息对应的代码函数。
当tmpkey为预设tmpkey时,即待生成报表为特殊报表时,根据tmpkey查询代码库中tmpkey对应的第二生成流程;根据第二生成流程对应的预设钩子机制,查找到第一生成流程中可被第二生成流程的函数加入的函数位置,并将第二生成流程的函数添加至第一生成流程的函数中,得到预设报表生成流程。
可选地,在图2实施例的基础上,上述调用标识信息对应的第一生成流程,包括:
S2011,调用第一生成流程中的数据获取流程,以及根据标识信息,调用第一生成流程中与标识信息对应的数据填充流程和数据报表生成流程。
在上述S2011中,将第一生成流程编写为第一生成函数作为父类,并定义第一生成函数中的固定函数、抽象函数和默认函数。其中固定函数可以无需重写函数而被直接执行,抽象函数需要重写函数后才能被执行,默认函数可以不重写函数而被直接执行,也可以重写函数后才被执行。
例如,将数据获取流程编写为执行固定函数的数据获取函数,并将数据获取函数作为继承父类的子类,无需重写固定函数而可以执行固定函数;将数据填充流程编写为重写抽象函数的数据填充函数,并将数据填充函数作为继承父类的子类,可以重写抽象函数,并执行重写抽象函数后的函数;将数据报表生成流程编写为可选择重写默认函数的数据报表生成函数,并将数据报表生成函数作为继承父类的子类,可以重写默认函数,并执行重写默认函数后的函数,或者无需重写默认函数而可以执行默认函数,其中数据报表生成函数基于hook机制实现。
应理解,上述示例仅用于举例说明,在其他实施例中,数据获取流程也可以编写为抽象函数或默认函数,数据填充流程也可以编写为固定函数或默认函数,数据报表生成流程也可以编写为固定函数或抽象函数。
本实施例将第一生成流程中的报表生成函数分割为三种不同功能的功能函数,实现报表生成函数可执行性和重用性。
可选地,在图2实施例的基础上,上述将第一生成流程与第二生成流程结合为预设报表生成流程,包括:
S2021,根据标识信息与预设流程节点的对应关系,确定第一生成流程中能够被第二生成流程加入的预设流程节点;
S2022,将第二生成流程加入到第一生成流程中的预设流程节点,得到预设报表生成流程。
在上述S2021和S2022中,基于钩子机制,确定第一生成流程中能够被第二生成流程加入的预设流程节点。可选地,基于钩子机制,预先将第一生成流程中的某个函数(流程节点)的首地址修改第二生成流程的函数地址,从而可以在第一生成函数运行时,判断标识信息是否为预设标识信息,若是,则根据该标识信息与流程节点的对应关系,查询到第一生成流程中的可被第二生成流程加入的流程节点,并根据该流程节点对应函数的首地址,将在该流程节点对应的函数执行之前跳转至第二生成流程对应的执行函数,当第二生成流程的执行函数执行完成时,再跳转回上述流程节点对应的函数,进而实现将第二生成流程加入到第一生成流程中。
在图1所示实施例的基础上,图3示出了本申请实施例提供的另一种报表生成方法的流程性示意图。需要说明的是,与图1实施例相同的步骤,此处不再赘述。
如图3所示,在一种可能实现的方式中,上述预设报表生成流程包括第一生成流程,所述第一生成流程包括数据获取流程、数据填充流程和数据报表生成流程;
相应地,上述S103,包括S301,根据所述数据获取流程,将所述标识信息传入预设数据接口,获取所述数据接口返回的所述标识信息对应的目标数据;
在上述S301中,数据获取流程属于每个报表生成过程都需要执行且无差异化执行的步骤,因此,可以将tmpkey传入第一报表生成函数,执行第一报表生成函数中的固定函数,以获取tmpkey对应的报表数据和jxls模板。
相应地,上述S104,包括S302和S303。
S302,根据所述数据填充流程,将所述报表数据填充至所述预设报表模板中的表格属性与所述报表数据的数据属性对应的表格;
在上述S302中,数据填充流程属于数据处理流程,数据处理流程为每个报表生成过程都需要执行且可能存在差异化执行的步骤。例如在表1中将数据“张三”填充至单元格属性为“学生”的单元格中,在表2中将数据“张三”填充至单元格属性为“老师”的单元格中。因此,可将报表数据传入数据填充函数中,根据数据填充流程,将报表数据作为参数重写第一报表生成函数中的抽象函数,执行包含报表数据的抽象函数,以将报表数据填充至jxls模板对应的单元格中。
S303,根据所述报表数据生成流程,将填充所述报表数据后的预设报表模板生成为预设格式的数据报表。
在上述S303中,数据报表生成流程属于每个报表生成过程都需要执行且可以存在差异化执行或可不存在差异化执行的步骤。如表1可以生成横表,也可以生成竖表。因此,根据数据报表生成流程,可通过执行第一报表生成函数中的默认函数生成横表,也可通过重写第一报表生成函数中的默认函数并执行,从而生成竖表。
可选地,在图3实施例的基础上,若所述标识信息为预设标识信息,则所述预设报表生成流程还包括第二生成流程;
相应地,上述S303之前或之后,还包括:
S3031,根据所述第二生成流程,处理所述报表数据或所述预设报表模板。
在上述S3031中,处理表格的过程不是每个报表生成过程都需要执行的步骤。例如在数据报表生成之后,需要在学生成绩表中标记成绩最好的学生姓名,或者在数据报表生成之前,需要统计成绩最好的学生的平均分。针对这些不是每个报表都需要执行的步骤,将这些步骤与第一生成流程区别开来,作为第二生成流程,并编写第二生成流程中每个标识信息对应的执行函数,根据对应执行函数对报表数据或预设报表模板进行处理。
在一种可能实现的方式中,在图1至图3任一实施例的基础上,报表生成方法还包括S104至S106。
S104,获取模板修改信息,所述模板修改信息携带待修改参数;
S105,配置预设映射表中预设报表模板的表格属性与待修改参数的对应关系;
S106,根据所述对应关系,将与所述预设报表模板的表格属性对应的单元格参数更新为所述待修改参数。
在上述S104至S106中,在报表没有新的数据要展示的情况下,可以很方便的通过修改jxls模板进行修改,无需修改代码和发布。但是,如果报表中有新的数据需要展示,则目前的方法还是需要修改报表类中获取数据的代码逻辑。因此针对这种情况,本申请实施例添加了一个数据映射功能。
具体地,系统的系统管理员有权限去设置数据key值和sql对应的关系,通过这样一个映射池,可以无需在后台修改代码,而是在页面上维护好这样的映射关系即可。后期即使报表有新的数据需求,在这边添加映射,然后在jxls模板中通过key值即可获取到对应的报表数据来展示。
例如,以座位费用统计(SeatStatic)为例,如果后期需要新增一栏座位号seatnumber,则可在报表页面中新增该座位号(即待修改参数),后台自动通过系统管理员权限获取到SeatStatic对应的sql(数据库)映射表,该sql映射表记录有模板的表格属性(例如表格坐标),将该座位号seatnumber添加到sql映射表中,以设置seatnumber与模板表格属性的映射关系,系统会根据该映射关系将seatnumber同样放入jxls模板。这样只需要在报表页面修改,后台会根据映射关系自动更改jxls模板,而无需更新代码并重新部署。
为了进一步保证上述所有出现的数据的私密和安全性,上述所有数据(如上述预设报表生成流程)还可以存储于一区块链的节点中,即本方案中的数据库可以采用区块链节点上的数据库。
需要说明的是,本发明所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的报表生成方法,图4示出了本申请实施例提供的报表生成装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图4,该装置包括:
第一获取模块401,用于获取与待生产报表的报表类型对应的标识信息;
调用模块402,用于调用所述标识信息对应的预设报表生成流程;
第二获取模块403,用于根据所述预设报表生成流程,获取所述标识信息对应的目标数据,所述目标数据包括报表数据和预设报表模板;
生成模块404,用于根据所述预设报表生成流程,将所述报表数据填充至所述预设报表模板中,得到所述报表数据对应数据报表。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
图5为本申请一实施例提供的终端设备的结构示意图。如图5所示,该实施例的终端设备5包括:至少一个处理器50(图5中仅示出一个)处理器、存储器51以及存储在所述存储器51中并可在所述至少一个处理器50上运行的计算机程序52,所述处理器50执行所述计算机程序52时实现上述任意方法实施例中的步骤。
所述终端设备5可以是手机、桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该终端设备可包括但不仅限于处理器50、存储器51。本领域技术人员可以理解,图5仅仅是终端设备5的举例,并不构成对终端设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。
所称处理器50可以是中央处理单元(Central Processing Unit,CPU),该处理器50还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器51在一些实施例中可以是所述终端设备5的内部存储单元,例如终端设备5的硬盘或内存。所述存储器51在另一些实施例中也可以是所述终端设备5的外部存储设备,例如所述终端设备5上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述终端设备5的内部存储单元也包括外部存储设备。所述存储器51用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器51还可以用于暂时地存储已经输出或者将要输出的数据。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。所述计算机可读存储介质可以是非易失性的,也可以是易失性的。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述各个方法实施例中的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种报表生成方法,包括:
    获取与待生成报表的报表类型对应的标识信息;
    调用所述标识信息对应的预设报表生成流程;
    根据所述预设报表生成流程,获取所述标识信息对应的目标数据,所述目标数据包括报表数据和预设报表模板;
    根据所述预设报表生成流程,将所述报表数据填充至所述预设报表模板中,得到所述报表数据对应的数据报表。
  2. 如权利要求1所述的报表生成方法,其中,所述调用所述标识信息对应的预设报表生成流程,包括:
    若所述标识信息不是预设标识信息,则调用所述标识信息对应的第一生成流程,并将所述第一生成流程作为所述预设报表生成流程;
    若所述标识信息是预设标识信息,则调用所述标识信息对应的第一生成流程和第二生成流程,并将所述第一生成流程与所述第二生成流程结合为所述预设报表生成流程。
  3. 如权利要求2所述的报表生成方法,其中,所述调用所述标识信息对应的第一生成流程,包括:
    调用所述第一生成流程中的数据获取流程,以及根据所述标识信息,调用所述第一生成流程中与所述标识信息对应的数据填充流程和数据报表生成流程。
  4. 如权利要求2所述的报表生成方法,其中,所述将所述第一生成流程与所述第二生成流程结合为所述预设报表生成流程,包括:
    根据所述标识信息与预设流程节点的对应关系,确定所述第一生成流程中能够被所述第二生成流程加入的预设流程节点;
    将所述第二生成流程加入到所述第一生成流程中的所述预设流程节点,得到所述预设报表生成流程。
  5. 如权利要求1所述的报表生成方法,其中,所述预设报表生成流程包括第一生成流程,所述第一生成流程包括数据获取流程、数据填充流程和数据报表生成流程;
    相应地,所述根据所述预设报表生成流程,获取所述标识信息对应的目标数据,包括:根据所述数据获取流程,将所述标识信息传入预设数据接口,获取所述数据接口返回的所述标识信息对应的目标数据;
    相应地,所述根据所述预设报表生成流程,将所述报表数据填充至所述预设报表模板中,得到所述报表数据对应数据报表,包括:
    根据所述数据填充流程,将所述报表数据填充至所述预设报表模板中的表格属性与所述报表数据的数据属性对应的表格;
    根据所述数据报表生成流程,将填充所述报表数据后的预设报表模板生成为预设格式的数据报表。
  6. 如权利要求5所述的报表生成方法,其中,若所述标识信息为预设标识信息,则所述预设报表生成流程还包括第二生成流程;
    相应地,所述根据所述报表数据生成流程,将填充所述报表数据后的预设报表模板生成为预设格式的数据报表之前或之后,还包括:
    根据所述第二生成流程,处理所述报表数据或所述预设报表模板。
  7. 如权利要求1至6任一项所述的报表生成方法,其中,所述方法还包括:
    获取模板修改信息,所述模板修改信息携带待修改参数;
    配置预设映射表中预设报表模板的表格属性与待修改参数的对应关系;
    根据所述对应关系,将与所述预设报表模板的表格属性对应的单元格参数更新为所述待修改参数。
  8. 一种报表生成装置,包括:
    第一获取模块,用于获取与待生产报表的报表类型对应的标识信息;
    调用模块,用于调用所述标识信息对应的预设报表生成流程;
    第二获取模块,用于根据所述预设报表生成流程,获取所述标识信息对应的目标数据,所述目标数据包括报表数据和预设报表模板;
    生成模块,用于根据所述预设报表生成流程,将所述报表数据填充至所述预设报表模板中,得到所述报表数据对应数据报表。
  9. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如下步骤:
    获取与待生成报表的报表类型对应的标识信息;
    调用所述标识信息对应的预设报表生成流程;
    根据所述预设报表生成流程,获取所述标识信息对应的目标数据,所述目标数据包括报表数据和预设报表模板;
    根据所述预设报表生成流程,将所述报表数据填充至所述预设报表模板中,得到所述报表数据对应的数据报表。
  10. 如权利要求9所述的终端设备,其中,所述处理器执行所述计算机程序时还实现如下步骤:
    若所述标识信息不是预设标识信息,则调用所述标识信息对应的第一生成流程,并将所述第一生成流程作为所述预设报表生成流程;
    若所述标识信息是预设标识信息,则调用所述标识信息对应的第一生成流程和第二生成流程,并将所述第一生成流程与所述第二生成流程结合为所述预设报表生成流程。
  11. 如权利要求10所述的终端设备,其中,所述处理器执行所述计算机程序时还实现如下步骤:
    调用所述第一生成流程中的数据获取流程,以及根据所述标识信息,调用所述第一生成流程中与所述标识信息对应的数据填充流程和数据报表生成流程。
  12. 如权利要求10所述的终端设备,其中,所述处理器执行所述计算机程序时还实现如下步骤:
    根据所述标识信息与预设流程节点的对应关系,确定所述第一生成流程中能够被所述第二生成流程加入的预设流程节点;
    将所述第二生成流程加入到所述第一生成流程中的所述预设流程节点,得到所述预设报表生成流程。
  13. 如权利要求9所述的终端设备,其中,所述处理器执行所述计算机程序时还实现如下步骤:
    相应地,所述根据所述预设报表生成流程,获取所述标识信息对应的目标数据,包括:根据所述数据获取流程,将所述标识信息传入预设数据接口,获取所述数据接口返回的所述标识信息对应的目标数据;
    相应地,所述根据所述预设报表生成流程,将所述报表数据填充至所述预设报表模板中,得到所述报表数据对应数据报表,包括:
    根据所述数据填充流程,将所述报表数据填充至所述预设报表模板中的表格属性与所述报表数据的数据属性对应的表格;
    根据所述数据报表生成流程,将填充所述报表数据后的预设报表模板生成为预设格式的数据报表。
  14. 如权利要求9所述的终端设备,其中,所述处理器执行所述计算机程序时还实现如下步骤:
    获取模板修改信息,所述模板修改信息携带待修改参数;
    配置预设映射表中预设报表模板的表格属性与待修改参数的对应关系;
    根据所述对应关系,将与所述预设报表模板的表格属性对应的单元格参数更新为所述待修改参数。
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如下步骤:
    获取与待生成报表的报表类型对应的标识信息;
    调用所述标识信息对应的预设报表生成流程;
    根据所述预设报表生成流程,获取所述标识信息对应的目标数据,所述目标数据包括报表数据和预设报表模板;
    根据所述预设报表生成流程,将所述报表数据填充至所述预设报表模板中,得到所述报表数据对应的数据报表。
  16. 如权利要求15所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现如下步骤:
    若所述标识信息不是预设标识信息,则调用所述标识信息对应的第一生成流程,并将所述第一生成流程作为所述预设报表生成流程;
    若所述标识信息是预设标识信息,则调用所述标识信息对应的第一生成流程和第二生成流程,并将所述第一生成流程与所述第二生成流程结合为所述预设报表生成流程。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现如下步骤:
    调用所述第一生成流程中的数据获取流程,以及根据所述标识信息,调用所述第一生成流程中与所述标识信息对应的数据填充流程和数据报表生成流程。
  18. 如权利要求16所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现如下步骤:
    根据所述标识信息与预设流程节点的对应关系,确定所述第一生成流程中能够被所述第二生成流程加入的预设流程节点;
    将所述第二生成流程加入到所述第一生成流程中的所述预设流程节点,得到所述预设报表生成流程。
  19. 如权利要求15所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现如下步骤:
    相应地,所述根据所述预设报表生成流程,获取所述标识信息对应的目标数据,包括:根据所述数据获取流程,将所述标识信息传入预设数据接口,获取所述数据接口返回的所述标识信息对应的目标数据;
    相应地,所述根据所述预设报表生成流程,将所述报表数据填充至所述预设报表模板中,得到所述报表数据对应数据报表,包括:
    根据所述数据填充流程,将所述报表数据填充至所述预设报表模板中的表格属性与所述报表数据的数据属性对应的表格;
    根据所述数据报表生成流程,将填充所述报表数据后的预设报表模板生成为预设格式的数据报表。
  20. 如权利要求15所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现如下步骤:
    获取模板修改信息,所述模板修改信息携带待修改参数;
    配置预设映射表中预设报表模板的表格属性与待修改参数的对应关系;
    根据所述对应关系,将与所述预设报表模板的表格属性对应的单元格参数更新为所述待修改参数。
PCT/CN2020/119297 2020-04-29 2020-09-30 报表生成方法、装置、终端设备及存储介质 WO2021218034A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010356066.X 2020-04-29
CN202010356066.XA CN111611784A (zh) 2020-04-29 2020-04-29 报表生成方法、装置、终端设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021218034A1 true WO2021218034A1 (zh) 2021-11-04

Family

ID=72199749

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119297 WO2021218034A1 (zh) 2020-04-29 2020-09-30 报表生成方法、装置、终端设备及存储介质

Country Status (2)

Country Link
CN (1) CN111611784A (zh)
WO (1) WO2021218034A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114300392A (zh) * 2021-12-30 2022-04-08 苏州赛美特科技有限公司 一种晶圆生产参数获取方法、装置、设备以及存储介质
CN114417803A (zh) * 2022-03-29 2022-04-29 深圳竹云科技股份有限公司 报表生成方法、装置、计算设备及计算机存储介质
CN116757169A (zh) * 2023-08-11 2023-09-15 山东高速信息集团有限公司 一种高速公路养护计量支付报表的生成方法、设备及介质

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611784A (zh) * 2020-04-29 2020-09-01 平安科技(深圳)有限公司 报表生成方法、装置、终端设备及存储介质
CN112036142A (zh) * 2020-09-02 2020-12-04 中国银行股份有限公司 一种基于数据配置的实时性报表生成方法及系统
CN112163941A (zh) * 2020-09-23 2021-01-01 深圳市富途网络科技有限公司 数据处理方法、装置及存储介质
CN112487163B (zh) * 2020-11-30 2024-04-12 广州品唯软件有限公司 自动化流程的执行方法及其接口数据的获取方法、装置
CN113033168A (zh) * 2021-03-30 2021-06-25 北京金山云网络技术有限公司 一种报表生成方法及相关设备
CN113221522B (zh) * 2021-04-28 2024-01-09 北京达佳互联信息技术有限公司 报表生成方法、装置、系统、电子设备及存储介质
CN113283222B (zh) * 2021-06-11 2021-10-08 平安科技(深圳)有限公司 自动化报表生成方法、装置、计算机设备及存储介质
CN114330268A (zh) * 2021-12-09 2022-04-12 北京金山云网络技术有限公司 文档生成方法、装置、电子设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7316003B1 (en) * 2002-12-18 2008-01-01 Oracle International Corp. System and method for developing a dynamic web page
CN105279228A (zh) * 2015-09-14 2016-01-27 深圳市永兴元科技有限公司 基于可扩展标记语言的报表处理方法及装置
CN110728128A (zh) * 2019-08-30 2020-01-24 平安证券股份有限公司 数据报表生成方法、装置、介质及电子设备
CN111611784A (zh) * 2020-04-29 2020-09-01 平安科技(深圳)有限公司 报表生成方法、装置、终端设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7316003B1 (en) * 2002-12-18 2008-01-01 Oracle International Corp. System and method for developing a dynamic web page
CN105279228A (zh) * 2015-09-14 2016-01-27 深圳市永兴元科技有限公司 基于可扩展标记语言的报表处理方法及装置
CN110728128A (zh) * 2019-08-30 2020-01-24 平安证券股份有限公司 数据报表生成方法、装置、介质及电子设备
CN111611784A (zh) * 2020-04-29 2020-09-01 平安科技(深圳)有限公司 报表生成方法、装置、终端设备及存储介质

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114300392A (zh) * 2021-12-30 2022-04-08 苏州赛美特科技有限公司 一种晶圆生产参数获取方法、装置、设备以及存储介质
CN114300392B (zh) * 2021-12-30 2024-03-19 赛美特科技有限公司 一种晶圆生产参数获取方法、装置、设备以及存储介质
CN114417803A (zh) * 2022-03-29 2022-04-29 深圳竹云科技股份有限公司 报表生成方法、装置、计算设备及计算机存储介质
CN116757169A (zh) * 2023-08-11 2023-09-15 山东高速信息集团有限公司 一种高速公路养护计量支付报表的生成方法、设备及介质
CN116757169B (zh) * 2023-08-11 2023-12-01 山东高速信息集团有限公司 一种高速公路养护计量支付报表的生成方法、设备及介质

Also Published As

Publication number Publication date
CN111611784A (zh) 2020-09-01

Similar Documents

Publication Publication Date Title
WO2021218034A1 (zh) 报表生成方法、装置、终端设备及存储介质
WO2018201895A1 (zh) 接口代码生成方法、装置、终端设备及介质
US8392462B2 (en) Mapping from objects to data model
US7386609B2 (en) Method, system, and program for managing devices in a network
WO2021184725A1 (zh) 用户界面测试方法、装置、存储介质及计算机设备
TWI706280B (zh) 資料讀寫方法及裝置、電子設備
EP1669904B1 (en) Verifying dynamically generated operations on a data store
TWI722592B (zh) 資料結構的讀取及更新方法、裝置、電子設備
WO2020155776A1 (zh) 一种基于核心模块的应用程序的生成方法及设备
WO2020155775A1 (zh) 一种基于核心开发环境的应用程序的生成方法及设备
US8250094B2 (en) Relational lockdown for an item store
WO2019134340A1 (zh) 薪资计算方法、应用服务器及计算机可读存储介质
US11671262B2 (en) Asynchronously determining relational data integrity using cryptographic data structures
WO2021169300A1 (zh) 一种数据库表结构导出的方法、装置及终端设备
WO2021159762A1 (zh) 数据关系抽取方法、装置、电子设备及存储介质
US20120158794A1 (en) Techniques to discover object interfaces
TW202025057A (zh) 欄位更新方法及裝置、電子設備
CN112860777B (zh) 数据处理方法、装置及设备
JP2012530972A (ja) 管理されたシステム拡張子機能
WO2019019702A1 (zh) 算法的生成方法、装置、终端设备及存储介质
WO2022095518A1 (zh) 接口自动化测试方法、装置、计算机设备及存储介质
WO2021114627A1 (zh) 基于分布式事务的数据处理方法、装置、终端及存储介质
WO2020207008A1 (zh) 一种数据验证方法、装置、电子设备及存储介质
CN113918149A (zh) 接口开发方法、装置、计算机设备和存储介质
WO2021114902A1 (zh) 程序初始化方法、程序初始化装置、终端设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20934148

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20934148

Country of ref document: EP

Kind code of ref document: A1