CN-115309812-B - Financial platform exporting system based on Java reflection and springIOC
Abstract
The invention relates to the relevant field of a financial platform export system, in particular to a financial platform export system based on Java reflection and springIOC, wherein each time the query function is added with an export function, additional export interface writing is not needed, so that the number of interfaces in the system is greatly reduced, a large number of meaningless coding works are avoided, and the productivity is improved; the concurrent protection unit is arranged to ensure that when the frequently exported or exported file data volume is detected to be larger, the export function is used for exporting the same user and the same query condition, a distributed lock is added, and only one export of the same user and the same query condition is allowed in the same time.
Inventors
- DENG JIE
Assignees
- 上海镁信健康科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20220919
Claims (8)
- 1. The financial platform export system based on Java reflection and springIOC comprises a financial platform (1), a comprehensive processing module (2), a file export functional module (3), a field mapping unit (4), a file generating unit (5), a file splitting unit (6) and a concurrency protection unit (7), and is characterized in that the financial platform (1) is connected to the comprehensive processing module (2), and the comprehensive processing module (2) is connected with the file export functional module (3); The comprehensive processing module (2) is used for constructing a corresponding field mapping unit (4), a file generating unit (5), a file splitting unit (6) and a concurrency protection unit (7) according to file export information based on a SpringIOC injection mode, wherein the input ends of the file generating unit (5) and the file splitting unit (6) are connected with the financial platform (1), the file generating unit (5) is used for receiving signals sent by the file export function module (3) and processing files needing to be exported in the financial platform (1), the field mapping unit (4) is used for mapping file fields in the financial platform (1), and the concurrency protection unit (7) enables the exportation of the same user and the same query condition to only allow one file to exist in the same time.
- 2. A financial platform export system based on Java reflection and springIOC according to claim 1, wherein the file generating unit (5) is connected to a file splitting unit (6), the file splitting unit (6) is configured to split the query file into a plurality of file units, wherein the file units are transmitted to the file generating unit (5).
- 3. The financial platform export system according to claim 2, wherein the file names of the file units are written in order of 0,1, 2.
- 4. The financial platform export system based on Java reflection and springIOC according to claim 1, wherein the field mapping unit (4) uses json interaction and uses VO objects for data encapsulation, and the field mapping unit (4) uses @ CsvColumn annotation for field mapping, reducing additional mapping encoding.
- 5. The financial platform export system based on Java reflection and springIOC as claimed in claim 1, wherein the file generation unit (5) adopts paging inquiry, writes the content in an added form after each inquiry, and then closes the file to ensure stable performance consumption of the whole system.
- 6. The financial platform export system based on Java reflection and springIOC according to claim 1, wherein the file generating unit (5) comprises a mail sending unit (501) and a front end export unit (502), the front end export unit (502) is connected with the file export functional module (3), the file generating unit (5) selects mail sending or front end export according to the file data amount, and the file name generated in the file generating unit (5) is generated in a format of file name_timestamp_export user_file number.
- 7. The financial platform export system based on Java reflection and springIOC as claimed in claim 1, wherein the file export functional module (3) includes a query unit (301) and an export unit (302), and the query unit (301) and the export unit (302) share an API, so that when the query unit (301) executes the query function, the export unit (302) executes the query function simultaneously, thereby reducing additional export interface writing and reducing the number of interfaces in the system.
- 8. The financial platform export system based on Java reflection and springIOC according to claim 1, wherein when the concurrency protection unit (7) detects that the data volume of frequently exported or exported files is large, the export function adds a distributed lock for exporting the same user and the same query condition, so that only one export of the same user and the same query condition is allowed in the same time.
Description
Financial platform exporting system based on Java reflection and springIOC Technical Field The invention relates to the related field of financial platform export systems, in particular to a Java reflection and springIOC-based financial platform export system. Background Because of competing relationships between different financial software companies, manual downloading of financial data is typically only provided. If it is desired to migrate the created account and balance list, history credentials, reports, etc. from within the financial system of the financial software company to a new financial system (if it is a different vendor), existing export migration tools, such as the common-csv of apache, although encapsulating the file generation and export methods, still require the technician to code themselves. For example, a method for generating a file is called after field mapping is specified and data is acquired. And if export is required, then the query is separated from the export requirement. With the increase of business functions, the method is numerous and not easy to manage, and a financial platform export system based on Java reflection and springIOC is designed for solving the problems. Disclosure of Invention The invention aims to provide a financial platform export system based on Java reflection and springIOC, which solves the problems in the background technology. The invention provides a financial platform export system based on Java reflection and springIOC, which comprises a financial platform, a comprehensive processing module, a file export function module, a field mapping unit, a file generating unit, a file splitting unit and a concurrency protection unit, and is characterized in that the financial platform is connected to the comprehensive processing module, and the comprehensive processing module is connected with the file export function module; the comprehensive processing module is used for constructing a corresponding field mapping unit, a file generating unit, a file splitting unit and a concurrency protection unit according to file export information based on a SpringIOC injection mode, wherein the input ends of the file generating unit and the file splitting unit are connected with the financial platform, the file generating unit is used for receiving signals sent by a file export function module and processing files needing to be exported in the financial platform, the field mapping unit is used for mapping file fields in the financial platform, and the concurrency protection unit enables the exportation of the same user and the same query condition to only allow one file to exist in the same time. Preferably, the file generating unit is connected to a file splitting unit, and the file splitting unit is configured to split the query file into a plurality of file units, where the file units are transmitted to the file generating unit, for example: # derived data, the number of each query of the query database is not larger than the maximum record number of the file spring.export.csv.pageSize=1000 Maximum number of records per csv file spring.export.csv.recordCount=600000。 Preferably, the file names of the file units are written to the records in the order of 0,1, 2. Preferably, the field mapping unit adopts json interaction and uses VO objects to perform data encapsulation, and the field mapping unit uses @ CsvColumn annotation to perform field mapping, so as to reduce additional mapping codes, such as: @ CsvColumn (alias= "payment OBJECT TYPE", dictCode = "pay_object_type", index=13) PRIVATE STRING objectType; where alias represents the file's lead-out name, if the return field is an enumerated code, the system is required to translate, then dictCode needs to be specified, and index represents the column order in the file. When the file is assembled, the fields are parsed according to the annotations. In addition, some exports are annotated with the @ CsvSummary annotation, as well as with the alias and indx fields, acting as @ CsvColumn annotation. The summary data will be written in another row in the document. @ CsvSummary (alias= "payment amount aggregate") private String totalPrice。 Preferably, the file generating unit adopts paging inquiry, writes the content in an added form after each inquiry, and then closes the file to ensure the stable performance consumption of the whole system. Preferably, the file generating unit comprises a mail sending unit and a front end export unit, the front end export unit is connected with the file export function module, the file generating unit selects mail sending or front end export according to the file data quantity, wherein the file name generated in the file generating unit is generated in a format of file name_timestamp_export user_file number Preferably, the file export function module includes a query unit and an export unit, where the query unit and the export unit share an API, so that when the query unit executes the qu