CN102609483A - General Excel import method based on configuration - Google Patents
General Excel import method based on configuration Download PDFInfo
- Publication number
- CN102609483A CN102609483A CN2012100179915A CN201210017991A CN102609483A CN 102609483 A CN102609483 A CN 102609483A CN 2012100179915 A CN2012100179915 A CN 2012100179915A CN 201210017991 A CN201210017991 A CN 201210017991A CN 102609483 A CN102609483 A CN 102609483A
- Authority
- CN
- China
- Prior art keywords
- excel
- configuration
- file
- general
- class
- 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.)
- Granted
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a general Excel import method based on configuration. The general Excel import method includes steps: acquiring an upload file uploaded to a server by an Action element, parsing the upload file and placing content in a Vector container object; inquiring an implementation class corresponding to the upload file in a configuration file; regulating the content for the container object by the aid of the implementation class, and generating a data object; and calling a parent class storage function to store the data. By the aid of the general Excel import method, a user does not need to manually select an import mode, and a system judges the proper import mode automatically; different Excel template implementation methods are separated from each other, and coupling among different templates is reduced; import of different Excel files can be supported, and an integral architecture is unchanged; returned error information can be precisely recorded one by one; and the workload of business personnel is reduced, and content of the Excel files in different formats can be quickly stored.
Description
Technical field
The present invention relates to computer realm, in particular, relate to a kind of general-purpose leading-in method of Excel file, be used to solve the data importing problem of different Excel forms.
Background technology
At present in the day to day operation of enterprise; Collect Various types of data and be entered in the management system such as needs; Especially in the interlingua sound business, along with international voice wholesale business operator constantly increases, the countries and regions that product covers are more and more wider; Clearing between each operator become increasingly complex, and granularity is more and more littler.In order to support the accuracy of cost clearing, it is mutual that each operator has adopted the mode of mutual issue cost rate to carry out price, and wherein the cost rate is the quotation of operator to each national direction.These quotations are generally the Excel form; But the Excel form between each operator is not quite similar; And that these data exist is ageing, and data volume is very big, so need the general Excel lead-in mode of a cover to realize the importing of the Excel data of different-format; Thereby reduce business personnel's workload, and realize importing fast database.
Summary of the invention
The objective of the invention is Excel file, a kind of general data lead-in method is provided to the various forms of needs importing.This method configuration needs the file header of the Excel template of support, the definition unified interface.When importing, Excel file all the elements are combined as container, obtain different implementations according to the file header difference, thereby handle corresponding data and realize data loading with the mode of appointment.
The technical scheme that the present invention addresses the above problem is following:
Step 1:Action obtains the upload file that uploads onto the server, and resolves this upload file, is placed on content in the Vector container object, if resolve successfully, then gets into step 2; Otherwise, get into step 6;
Step 2: the corresponding realization class of upload file therewith in the query configuration file if corresponding realization class is arranged, then gets into step 3; Otherwise, get into step 6;
Step 3: it is regular use to realize type that container object is carried out content, generates data object, if success then gets into step 4; Otherwise, get into step 6;
Step 4: call parent and go into built-in function realization data loading; If success then gets into step 5; Otherwise, get into step 6;
Step 5: the record number that returns success, process ends;
Step 6: obtain and return error message, process ends.
Wherein, can specifically use JAVA ExcelAPI (POI) to resolve in the step 1.
The process that inquiry realizes type in the step 2 specifically can for, through recursive algorithm, this file header and All Files head in the configuration file of uploading each Sheet of Excel file is mated, obtain corresponding implementation class.
Configuration file comprises the configuration and the corresponding realization class of related multiple Excel file; Wherein in the configuration: the name of corresponding bean among the corresponding spring of the name attribute of service; Sheet_cnt is provided with the Sheet number, and sheet_head is provided with masterplate gauge outfit form.
The present invention has following beneficial effect: the user need not select lead-in mode by hand, is judged automatically by system; Different Excel masterplate implementations are isolated, and reduce the coupling between different masterplates; Can support the importing of different Excel, overall architecture is constant; Error message is returned and can be as accurate as every record.
Description of drawings
Fig. 1 is the process flow diagram of Excel general-purpose leading-in method of the present invention.
The example of the form masterplate form when Fig. 2 is single sheet.
Fig. 3 (a) and (b) example of the form masterplate form of each sheet when being respectively many sheet.
Embodiment
Below in conjunction with accompanying drawing principle of the present invention and characteristic are described, institute gives an actual example and only is used to explain the present invention, is not to be used to limit scope of the present invention.
The present invention is based on the Excel general-purpose leading-in method of configuration mode, as shown in Figure 1, comprise the steps:
Step 1:Action obtains the upload file that uploads onto the server, and uses JAVA ExcelAPI (POI) to resolve, and is placed on content in the Vector container object, if resolve successfully, then gets into step 2; Otherwise, get into step 6.
Step 2: the corresponding realization class of upload file therewith in the query configuration file if corresponding realization class is arranged, then gets into step 3; Otherwise, get into step 6.The process that inquiry realizes type specifically can be, through recursive algorithm, this file header and All Files head in the configuration file of uploading each Sheet of Excel file mated, and obtains corresponding implementation class.Wherein, the configuration and the corresponding realization class of related multiple Excel file have been put down in writing in the configuration file.
Generally, during newly-built excel/config.xml file, can be the name of bean corresponding among the corresponding spring of name attribute of following configuration: service, sheet_cnt is provided with the Sheet number, and sheet_head is provided with masterplate gauge outfit form.
For example, a kind of single sheet configuration as follows:
Its corresponding form masterplate form is as shown in Figure 2.
For example, a kind of many Sheet configurations, for example the configuration of 2 sheet is following:
The form masterplate form that it is corresponding comprises 2 sheet, and sheet1 and sheet2 are respectively shown in Fig. 3 (a) and 3 (b).
Step 3: it is regular use to realize type that container object is carried out content, generates data object, if success then gets into step 4; Otherwise, get into step 6.
Step 4: call parent and go into built-in function realization data loading, if success then gets into step 5; Otherwise, get into step 6; Specifically can be, go in the built-in function, resolve, use Hibernate to put in storage importing object at parent.
Step 5: the record number that returns success, process ends.
Step 6: obtain and return error message, process ends.
The template that need develop all supports when setting up for the first time realizes that when the file of new Excel form occurring, the just corresponding corresponding realization class of this Excel form that increases gets final product afterwards, and the realization class realization that utilizes this correspondence regular to the Excel file content.
Claims (5)
1. the Excel general-purpose leading-in method based on configuration comprises the steps:
Step 1:Action obtains the upload file that uploads onto the server, and resolves this upload file, is placed on content in the Vector container object, if resolve successfully, then gets into step 2; Otherwise, get into step 6;
Step 2: the corresponding realization class of upload file therewith in the query configuration file if corresponding realization class is arranged, then gets into step 3; Otherwise, get into step 6;
Step 3: it is regular use to realize type that container object is carried out content, generates data object, if success then gets into step 4; Otherwise, get into step 6;
Step 4: call parent and go into built-in function realization data loading; If success then gets into step 5; Otherwise, get into step 6;
Step 5: the record number that returns success, process ends;
Step 6: obtain and return error message, process ends.
2. a kind of Excel general-purpose leading-in method based on configuration according to claim 1 is characterized in that: adopt in the step 1 and use JAVA ExcelAPI (POI) to resolve.
3. a kind of Excel general-purpose leading-in method according to claim 1 based on configuration; Inquiry realizes that the process of class is specially in the step 2; Pass through recursive algorithm; This file header and All Files head in the configuration file of uploading each Sheet of Excel file is mated, obtain corresponding implementation class.
4. according to claim 1 or 3 described a kind of Excel general-purpose leading-in methods based on configuration; It is characterized in that; Said configuration file comprises the configuration and the corresponding realization class of related multiple Excel file; Wherein in the configuration: the name of corresponding bean among the corresponding spring of the name attribute of service, sheet_cnt is provided with the Sheet number, and sheet_head is provided with masterplate gauge outfit form.
5. a kind of Excel general-purpose leading-in method based on configuration according to claim 1, step 4 call parent goes into built-in function and realizes that data loading is specially, and goes in the built-in function at parent, resolves importing object into, uses Hibernate to put in storage.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210017991.5A CN102609483B (en) | 2012-01-19 | 2012-01-19 | General Excel import method based on configuration |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210017991.5A CN102609483B (en) | 2012-01-19 | 2012-01-19 | General Excel import method based on configuration |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102609483A true CN102609483A (en) | 2012-07-25 |
CN102609483B CN102609483B (en) | 2014-07-16 |
Family
ID=46526855
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210017991.5A Active CN102609483B (en) | 2012-01-19 | 2012-01-19 | General Excel import method based on configuration |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102609483B (en) |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102982096A (en) * | 2012-11-02 | 2013-03-20 | 曙光云计算技术有限公司 | Data processing method of cloud computing system |
CN103631966A (en) * | 2013-12-18 | 2014-03-12 | 用友软件股份有限公司 | Configurable multiple-valued matching field analysis method |
CN103744982A (en) * | 2014-01-15 | 2014-04-23 | 北京神州普惠科技股份有限公司 | Method for importing Excel data into database |
CN104778576A (en) * | 2015-03-13 | 2015-07-15 | 上海灵兮信息科技有限公司 | Method for automatically initializing accounting data set by using account balance report |
CN104899523A (en) * | 2015-06-29 | 2015-09-09 | 上海瀚之友信息技术服务有限公司 | Unified guiding-in method of card password data |
CN105867886A (en) * | 2015-01-19 | 2016-08-17 | 阿里巴巴集团控股有限公司 | Method and device for writing table |
CN106126667A (en) * | 2016-06-25 | 2016-11-16 | 国云科技股份有限公司 | A kind of method realizing dynamically filling EXCEL sequence |
CN106294400A (en) * | 2015-05-21 | 2017-01-04 | 阿里巴巴集团控股有限公司 | The introduction method of batch data and system |
CN106372082A (en) * | 2015-07-22 | 2017-02-01 | 克拉玛依红有软件有限责任公司 | Single-file multi-form data automatic storage method and system |
CN106651239A (en) * | 2016-09-22 | 2017-05-10 | 广州唯品会信息科技有限公司 | Out-of-stock data management method and device |
CN106648763A (en) * | 2016-12-06 | 2017-05-10 | 明博教育科技股份有限公司 | Batch data importing component and importing method thereof |
CN107168695A (en) * | 2017-04-18 | 2017-09-15 | 北京思特奇信息技术股份有限公司 | A kind of excel data analysis methods and system |
CN109471897A (en) * | 2018-11-12 | 2019-03-15 | 四川长虹电器股份有限公司 | By excel Context resolution and the method into database is stored based on SpringMVC frame |
CN109992585A (en) * | 2019-04-01 | 2019-07-09 | 北京金和网络股份有限公司 | Data lead-in method for office management system |
CN110728121A (en) * | 2019-09-17 | 2020-01-24 | 杭州安恒信息技术股份有限公司 | Data import system and method for realizing zero development based on existing interface |
CN113836213A (en) * | 2021-09-29 | 2021-12-24 | 中国平安财产保险股份有限公司 | Excel-based data import method, device, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101419628A (en) * | 2008-12-03 | 2009-04-29 | 浪潮集团山东通用软件有限公司 | Data general-purpose leading-in method based on excel file format |
CN102299965A (en) * | 2011-08-31 | 2011-12-28 | 深圳市五巨科技有限公司 | Method and device for importing EXCEL data |
-
2012
- 2012-01-19 CN CN201210017991.5A patent/CN102609483B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101419628A (en) * | 2008-12-03 | 2009-04-29 | 浪潮集团山东通用软件有限公司 | Data general-purpose leading-in method based on excel file format |
CN102299965A (en) * | 2011-08-31 | 2011-12-28 | 深圳市五巨科技有限公司 | Method and device for importing EXCEL data |
Non-Patent Citations (2)
Title |
---|
张书锋: "基于Java Excel API的excel文件的操纵技术及其应用", 《电脑知识与技术》, vol. 6, no. 16, 5 June 2010 (2010-06-05), pages 4565 - 4566 * |
杨勇虎等: "Struts+ Hibernate下实现Excel文件的导入导出", 《计算机与现代化》, no. 11, 15 November 2007 (2007-11-15), pages 135 - 137 * |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102982096B (en) * | 2012-11-02 | 2016-07-06 | 曙光云计算技术有限公司 | The data processing method of cloud computing system |
CN102982096A (en) * | 2012-11-02 | 2013-03-20 | 曙光云计算技术有限公司 | Data processing method of cloud computing system |
CN103631966A (en) * | 2013-12-18 | 2014-03-12 | 用友软件股份有限公司 | Configurable multiple-valued matching field analysis method |
CN103744982A (en) * | 2014-01-15 | 2014-04-23 | 北京神州普惠科技股份有限公司 | Method for importing Excel data into database |
CN105867886A (en) * | 2015-01-19 | 2016-08-17 | 阿里巴巴集团控股有限公司 | Method and device for writing table |
CN105867886B (en) * | 2015-01-19 | 2020-03-10 | 阿里巴巴集团控股有限公司 | Method and device for writing table |
CN104778576A (en) * | 2015-03-13 | 2015-07-15 | 上海灵兮信息科技有限公司 | Method for automatically initializing accounting data set by using account balance report |
CN106294400A (en) * | 2015-05-21 | 2017-01-04 | 阿里巴巴集团控股有限公司 | The introduction method of batch data and system |
CN104899523B (en) * | 2015-06-29 | 2018-01-26 | 上海瀚之友信息技术服务有限公司 | A kind of unified introduction method of card ciphertext data |
CN104899523A (en) * | 2015-06-29 | 2015-09-09 | 上海瀚之友信息技术服务有限公司 | Unified guiding-in method of card password data |
CN106372082A (en) * | 2015-07-22 | 2017-02-01 | 克拉玛依红有软件有限责任公司 | Single-file multi-form data automatic storage method and system |
CN106126667A (en) * | 2016-06-25 | 2016-11-16 | 国云科技股份有限公司 | A kind of method realizing dynamically filling EXCEL sequence |
CN106651239A (en) * | 2016-09-22 | 2017-05-10 | 广州唯品会信息科技有限公司 | Out-of-stock data management method and device |
CN106648763A (en) * | 2016-12-06 | 2017-05-10 | 明博教育科技股份有限公司 | Batch data importing component and importing method thereof |
CN107168695A (en) * | 2017-04-18 | 2017-09-15 | 北京思特奇信息技术股份有限公司 | A kind of excel data analysis methods and system |
CN109471897A (en) * | 2018-11-12 | 2019-03-15 | 四川长虹电器股份有限公司 | By excel Context resolution and the method into database is stored based on SpringMVC frame |
CN109992585A (en) * | 2019-04-01 | 2019-07-09 | 北京金和网络股份有限公司 | Data lead-in method for office management system |
CN110728121A (en) * | 2019-09-17 | 2020-01-24 | 杭州安恒信息技术股份有限公司 | Data import system and method for realizing zero development based on existing interface |
CN110728121B (en) * | 2019-09-17 | 2023-08-01 | 杭州安恒信息技术股份有限公司 | Data importing system and method for realizing zero development based on existing interface |
CN113836213A (en) * | 2021-09-29 | 2021-12-24 | 中国平安财产保险股份有限公司 | Excel-based data import method, device, equipment and storage medium |
CN113836213B (en) * | 2021-09-29 | 2024-02-09 | 中国平安财产保险股份有限公司 | Excel-based data importing method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN102609483B (en) | 2014-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102609483B (en) | General Excel import method based on configuration | |
US20210056259A1 (en) | System and method for reliable extraction and mapping of data to and from customer forms | |
US9817877B2 (en) | Optimizing data processing using dynamic schemas | |
US8874600B2 (en) | System and method for building a cloud aware massive data analytics solution background | |
CN106897909B (en) | Cloud service system and method for printing and storing electronic invoices | |
US11809470B2 (en) | Systems and methods for tracking assets across a distributed network environment | |
US9922104B1 (en) | Metadata driven code-generated external data feeds | |
US11475386B2 (en) | Electronic message management program coordinating defined activity and controlled recipient/respondents through a unique id | |
US9292579B2 (en) | Method and system for document data extraction template management | |
CN110275861A (en) | Date storage method and device, storage medium, electronic device | |
US20200265379A1 (en) | Systems, methods, and interfaces for transaction aggregation, management, and visualization | |
CN106547646B (en) | Data backup and recovery method and data backup and recovery device | |
AU2014343044A1 (en) | Method and system for document data extraction template management | |
US20150326664A1 (en) | System and method for managing data transactions between applications | |
WO2019071964A1 (en) | Enterprise relationship construction method, and application server | |
US20210208959A1 (en) | Systems and methods for providing uniform access in a multi-tenant system | |
CN108073705B (en) | Distributed mass data aggregation acquisition method | |
US20170116208A1 (en) | Non-uniform multi-row text file loading | |
CN103778231A (en) | Method and system for managing operation record information, of databank | |
CN114490644A (en) | Data storage method, device and storage medium | |
CN113742529A (en) | Multi-table front-end processing method and device | |
CN105447183A (en) | MPP framework database cluster sequence system and sequence management method | |
US10235649B1 (en) | Customer analytics data model | |
CN104143154A (en) | Generation method, device and system for value-added telecom service order | |
CN108241956A (en) | A kind of project process management and control software |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C53 | Correction of patent of invention or patent application | ||
CB02 | Change of applicant information |
Address after: 100085 Haidian District, Zhongguancun, South Street, No. 6,, building information, floor, No. 16 Applicant after: SI-TECH Information Technology Ltd. Address before: 100085 Haidian District, Zhongguancun, South Street, No. 6,, building information, floor, No. 16 Applicant before: Beijing Digital China SI-TECH Information Technology Co., Ltd. |
|
COR | Change of bibliographic data |
Free format text: CORRECT: APPLICANT; FROM: BEIJING DIGITAL CHINA SI-TECH INFORMATION TECHNOLOGY LTD. TO: BEIJING SI-TECH INFORMATION TECHNOLOGY LTD. |
|
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |