AEAI DP Development Statistical Analysis

1 Background overview

Usually doing statistical analysis is to adjust the rest service, provide data to the front desk, and then configure the portlet in the management console. But not all projects will use the portal. At this time, it is necessary to develop statistical analysis in the AEAI DP application development platform. The following explains how to develop statistical analysis in the AEAI DP application development platform.

2 General idea

First create the basic function model in DP, then manually create the xml configuration file, then introduce the chart component, and then write the implementation code in jsp and handler.

3 Implementation steps

3.1 Create a functional model

Open the DP development platform application, create a project named demo according to the AEAI DP development platform manual, right-click on the project to create a directory, and create a sample module. Right-click on the sample module and select Create Function.

In the pop-up window, select the basic function model in the window, the function name is Statistical Analysis, and click finish to complete.

 

Then click the lightning icon to generate the code.

 

The project directory is shown in the figure:

3.2 Create a configuration file

There is no service package, sqlmap package and xml configuration file in the code generated by the basic functional model. You need to create it yourself. The creation directory is as follows:

The code of the ServiceModule.xml configuration file is as follows

The SqlMapModule.xml configuration file code is as follows:

Note: When configuring the ServiceModule.xml file, pay attention to capitalization. The namespace in sqlmap should be the same as the name in the configuration file.

3.3 Introducing Chart Components

1) Introduce the .swf format file

Import chart graphics swf files, and put these files directly into the WebRoot directory.

 

2) Introduce the FusionCharts_pc.js file

Import the chart component FusionCharts_pc.js file, and put the js file into the js directory under the WebRoot directory.

Introduce the FusionCharts_pc.js file in jsp, the code is as follows:

3.4 Jsp code implementation

There is only a piece of sample code in the jsp page generated by the basic function model, and there is no function for browsing and running. All functions and styles and layouts need to be written by yourself.

 

1) div and css

The div code is as follows:

The css code is as follows:

2)javascript方法

JavaScript方法代码如下:

3.5 Handler实现

handler代码如下:

 

3.6 接口和实现类

1)接口

DemoManage代码如下:

2)实现类

DemoManageImpl代码如下 

3.7 MySQL查询

sqlmap代码如下:

4 演示效果

在浏览器里输入网址:http://localhost:6060/demo/index?Homepage预览

5 个人总结

在项目开发过程中,有时会遇到用图表做统计分析的情况,做统计分析的方法可能很多,笔者这次是用AEAI DP应用开发平台产品进行开发统计分析,通过实践发现AEAI DP可以方便、快捷的开发出统计分析功能,并可以很好的实现这个功能。笔者在这里推荐给大家,AEAI DP应用开发平台产品是开源的,大家可以到数通畅联官网下载产品介质www.agileai.com。

6 附件说明

打开AEAI DP设计器导入工程即可执行。

该项目相关的数据库。

 

文档及附件下载地址:http://pan.baidu.com/s/1dE6XEpj

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326616282&siteId=291194637