Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a personalized definition method and a system of insurance application programs.
In order to achieve the purpose, the invention adopts the following technical scheme: a method for personalized definition of insurance applications, the method comprising:
establishing a rule application platform based on the self-built framework;
establishing a pure maven project based on the self-built frame;
newly building a template for the jar packet in the maven engineering dependence rule application platform;
a maven project is newly built according to the newly built template to form a personalized customization module;
and developing a page module and a function module according to the rule application platform and the personalized customization module.
The further technical scheme is as follows: the steps of developing the page module and the function module according to the rule application platform and the personalized customization module comprise the following specific steps:
under the same directory structure as the directory where the related files on the rule application platform are located, covering the original corresponding files in the rule application platform by using the files with the same name on the personalized customization module to form the page module;
and rewriting the implementation class of the interface of the corresponding functional logic on the personalized customization module, adding annotation, and calling the rewritten interface when starting to form the functional module.
The further technical scheme is as follows: and rewriting the implementation class of the interface of the corresponding functional logic on the personalized customization module, adding an annotation, calling the rewritten interface when starting, and forming the functional module, wherein the annotation is @ Primary.
The invention also provides a personalized definition system of the insurance application program, which comprises a platform establishing unit, an engineering establishing unit, a template establishing unit, a customization module forming unit and a development unit;
the platform establishing unit is used for establishing a rule application platform based on the self-constructed framework;
the engineering establishing unit is used for establishing a pure maven engineering based on the self-constructed framework;
the template establishing unit is used for establishing a template for the jar package in the maven engineering dependence rule application platform;
the customization module forming unit is used for building a maven project according to the newly built template to form a personalized customization module;
the development unit is used for developing a page module and a function module according to the rule application platform and the personalized customization module.
The further technical scheme is as follows: the development unit comprises a page module development module and a function module development module;
the page module development module is used for covering the original corresponding file in the rule application platform by using the file with the same name on the personalized customization module under the same directory structure as the directory where the related file on the rule application platform is located, so as to form the page module;
the functional module development module is used for rewriting the implementation class of the interface of the corresponding functional logic on the personalized customization module, adding annotations, and calling the rewritten interface when starting to form the functional module.
Compared with the prior art, the invention has the beneficial effects that: according to the method for defining the application program of the insurance industry in the invention, the personalized definition module and the rule application platform are established, the personalized definition module depends on the rule application platform, the page customization module is established, class rewriting is realized on the original logical interface, and the @ Primary annotation is added, so that the customization of the functional module is completed, after the two modules of the project personalized customization and the general rule application platform are independently extracted, the two modules can be combined for each development project, and the development time and the personnel cost are reduced.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
Detailed Description
In order to more fully understand the technical content of the present invention, the technical solution of the present invention will be further described and illustrated with reference to the following specific embodiments, but not limited thereto.
As shown in the specific embodiments of fig. 1 to 4, the method for defining an insurance application program in an insurance industry provided in this embodiment can be applied to an insurance application program project development process, and after two modules of a project personalized customization and a general rule application platform are separately extracted, the two modules can be combined for each development project, so that development time and personnel cost are reduced.
As shown in fig. 1, a method for personalized definition of insurance application includes:
s1, establishing a rule application platform based on the self-constructed framework;
s2, building a pure maven project based on the self-built frame;
s3, building a template for the jar package in the maven engineering dependence rule application platform;
s4, a maven project is newly built according to the newly built template to form a personalized customization module;
and S5, developing a page module and a function module according to the rule application platform and the personalized customization module.
In the step S1, a rule application platform is established based on the self-built framework, and the rule application platform includes two modules, namely a core module and a business logic module, which are both established based on the self-built framework of the company.
The step of S2 is a step of creating a pure maven project based on the self-built framework, and is also created based on the self-built framework of the company.
Further, as shown in fig. 2, the step of S5, the step of developing the page module and the function module according to the rule application platform and the personalized customization module, includes the following specific steps:
s51, under the same directory structure as the directory where the related files on the rule application platform are located, covering the original corresponding files in the rule application platform with the files with the same name on the personalized customization module to form the page module;
and S52, rewriting the implementation class of the interface of the corresponding functional logic on the personalized customization module, adding annotation, and calling the rewritten interface when starting to form the functional module.
For the step of S51, in the same directory structure, the original file is covered by the file with the same name on the personalized customization module to form the page module; in some customer personalized requirements, some adaptive adjustment needs to be made on the page structure of a product system, the realization in a product module does not need to be changed, and only the original file of the product module needs to be covered by a file with the same name under the same directory structure of a personalized customization module.
Taking a platform logo as an example: the stored picture directory of the rule application platform comprises a logo.
A client self-defining module is newly built, and a rule application platform is relied on;
a catalog src/main/webapp/img/' is newly built in a self-defining module, and then a logo picture defined by a customer is named as logo.
And when the service is started, the logo pattern is found to be changed into a logo picture customized by a customer, and other contents cannot be influenced.
And for the step of S52, rewriting the implementation class of the interface of the corresponding functional logic on the personalized customization module, adding an annotation, calling the rewritten interface when starting, and forming the functional module, wherein the type of the annotation is @ Primary.
According to the requirements of different customers on the system, different functional requirements can be applied to the system, namely the logic for realizing the function is different from the logic for realizing the function in a production mode, the realization logic of the function is required to be modified, the logic modification is not carried out on a production module, but a personalized customization module is carved, the realization class of the interface for realizing the function logic is rewritten and a @ Primary annotation is added, so that the rewritten interface realization class is called to realize the function when the customer personalized module is started.
Taking the acquisition of the organization code as an example, the acquisition of the organization code may be performed as follows:
an interface class CodeService is newly established on a rule application platform, and a method for acquiring the mechanism code is defined.
The rule application platform presents a default implementation, which is queried from a table of the rule application platform.
And a client self-defining module is newly built and depends on a rule application platform.
A class realization CodeService is newly established in the personalized customization module, and a @ Primary annotation is added in the realization class,
and starting the service, and preferentially selecting the direct implementation class plus @ Primary when the interface is called.
In the development process, the overlyys technology of maven is used, a plurality of projects war can be combined into one project, if the project has files with the same name, the files in the main project cover the files with the same name of other projects, the main technical support for customizing the page module and the functional module is the overlyys technology of maven, when the personalized customization module is realized, only the personalized customization module needs to depend on the rule application platform, the page customization module creates a directory on the personalized customization module, the directory is the same as the directory where the related files on the rule application platform are located, and the original files can be covered by naming the files needing to be replaced as the same name as the files in the rule application platform. The functional module only needs to realize an original logical interface, adds @ Primary annotation on the realization class rewriting, and then rewrites the logic, and the functional module is customized without a peer directory or a same name.
According to the personalized definition method of the insurance application program, the personalized definition module and the rule application platform are established, the personalized definition module depends on the rule application platform, the page customization module is established, class rewriting is realized on the original logical interface, and the @ Primary annotation is added, so that the function module customization is completed, after the two modules of the project personalized customization and the general rule application platform are independently extracted, the two modules can be combined each time the project is developed, and the development time and the personnel cost are reduced.
As shown in fig. 3, the embodiment further provides a personalized definition system of insurance application, which includes a platform establishing unit 10, an engineering establishing unit 20, a template establishing unit 30, a customized module forming unit 40, and a developing unit 50.
And the platform establishing unit 10 is used for establishing a rule application platform based on the self-constructed framework.
And the project establishing unit 20 is used for establishing a pure maven project based on the self-constructed frame.
And the template establishing unit 30 is used for establishing a template for the jar package in the maven engineering dependency rule application platform.
And the customization module forming unit 40 is used for newly building a maven project according to the newly built template to form a personalized customization module.
And the development unit 50 is used for developing the page module and the functional module according to the rule application platform and the personalized customization module.
The rule application platform established by the platform establishing unit 10 includes two modules, namely a core module and a business logic module, which are both established based on a framework built by a company.
The engineering building unit 20 is also created based on a framework built by the company itself.
Further, the development unit 50 includes a page module development module 51 and a function module development module 52.
And the page module development module 51 is used for covering the original corresponding file in the rule application platform by using the file with the same name on the personalized customization module under the same directory structure as the directory where the related file on the rule application platform is located, so as to form the page module.
And the functional module development module 52 is configured to rewrite the implementation class of the interface of the corresponding functional logic on the personalized customization module, add an annotation, and call the rewritten interface when starting to form the functional module.
For the page module development module 51, under the same directory structure, the original file is covered by the file with the same name on the personalized customization module to form the page module; in some customer personalized requirements, some adaptive adjustment needs to be made on the page structure of a product system, the realization in a product module does not need to be changed, and only the original file of the product module needs to be covered by a file with the same name under the same directory structure of a personalized customization module.
And as for the functional module development module 52, rewriting the implementation class of the interface of the corresponding functional logic on the personalized customization module, adding an annotation, calling the rewritten interface when starting, and forming the functional module, wherein the annotation is @ Primary. According to the requirements of different customers on the system, different functional requirements can be applied to the system, namely the logic for realizing the function is different from the logic for realizing the function in a production mode, the realization logic of the function is required to be modified, the logic modification is not carried out on a production module, but a personalized customization module is carved, the realization class of the interface for realizing the function logic is rewritten and a @ Primary annotation is added, so that the rewritten interface realization class is called to realize the function when the customer personalized module is started.
The development unit 50 uses the overrides technology of maven, can combine a plurality of projects into one project, and if the project has files with the same name, the files in the main project will cover the files with the same name of other projects, the main technical support for the customization of the page module and the function module is the overrides technology of maven, when the personalized customization module is realized, only the personalized customization module needs to depend on the rule application platform, the page customization module creates a new directory on the personalized customization module, which is the same as the directory where the related files on the rule application platform are located, and the original files can be covered by naming the files to be replaced as the same name as the files in the rule application platform. The functional module only needs to realize an original logical interface, adds @ Primary annotation on the realization class rewriting, and then rewrites the logic, and the functional module is customized without a peer directory or a same name.
According to the personalized definition system of the insurance application program, the personalized definition module and the rule application platform are established, the personalized definition module depends on the rule application platform, the page customization module is established, class rewriting is realized on the original logical interface, and the @ Primary annotation is added, so that the function module customization is completed, after the two modules of the project personalized customization and the general rule application platform are independently extracted, the two modules can be combined for each development project, and the development time and the personnel cost are reduced.
The technical contents of the present invention are further illustrated by the examples only for the convenience of the reader, but the embodiments of the present invention are not limited thereto, and any technical extension or re-creation based on the present invention is protected by the present invention. The protection scope of the invention is subject to the claims.