JAVA-based SSM's financial management under the framework

Recently learned about personal financial management program, records about the personal financial management program in the platform, use the time to learn again later or convenient to be able to timely read. In the completion of this project, considering a lot of the framework. The final decision to use SSM (MYECLIPSE), the frame is extremely portable, multi-platform, ease of operability and so on. This framework can write and run in perfect MYECLIPSE development tools, personal financial management as a background item. Description of the project is this: In this era of data that is resource-based personal financial management application account management will be the new direction of development of Internet banking big data era. This paper describes the concept and significance of personal financial management, to present a variety of viable service model were aligned, and discusses its business model on this basis. Personal Financial Management (Money Watcher) is a simple everyday personal finance management software for your daily expenses and income were simple statistical summary of the data for a variety of expenses and income analysis. Help you rationalize your daily consumption.
When personal financial management project needs analysis, obtained the system login roles include administrator. Corresponding to the user can be carried out into the system by logging into your account. Systems have different privileges for different roles.

The summary results of all system data: administrator (admin), income (shouru), expenses (zhichu), balance (jieyu)

Administrators table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | administrator the above mentioned id 
username |  VARCHAR ( 255 ) |  | account 
password |  VARCHAR ( 255 ) |  | password

 

Income Statement

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | income the above mentioned id 
gongzishouru |  VARCHAR ( 255 ) |  | wage 
licaishouru |  VARCHAR ( 255 ) |  | financial income 
qitashouru |  VARCHAR ( 255 ) |  | Other income

 

Expenditure Table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | spending the above mentioned id 
shenghuokaizhi |  VARCHAR ( 255 ) |  | living expenses 
yulekaizhi |  VARCHAR ( 255 ) |  | entertainment expenses 
xuexikaizhi |  VARCHAR ( 255 ) |  | academic expenses 
qitakaizhi |  VARCHAR ( 255 ) | | Other expenses

 

Balances

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | balance of the above mentioned id 
shangyuejieyu |  VARCHAR ( 255 ) |  | last month balance 
benyuejieyu |  VARCHAR ( 255 ) |  | month balances 
yuemohuizong |  VARCHAR ( 255 ) |  | end summary

 

 

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------

-- ----------------------------

-- Table structure for gggerencaiwuguanli

-- ----------------------------

DROP TABLE IF EXISTS `t_admin`;

CREATE TABLE `t_admin` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '管理员id',`username` VARCHAR(255) DEFAULT NULL COMMENT '账号',`password` VARCHAR(255) DEFAULT NULL COMMENT '密码',PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='管理员';

-- ----------------------------

DROP TABLE IF EXISTS `t_shouru`;

CREATE TABLE `t_shouru` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '收入id' , `Gongzishouru` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' wages ' ,` licaishouru` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' financial income ' , `qitashouru` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' other income ' , PRIMARY  KEY ( id` `) 

) ENGINE = MyISAM the DEFAULT CHARSET = utf8 the COMMENT = ' income' ; 

- ---------------------------- 

the DROP  TABLE  the IF  EXISTS `t_zhichu`; 

the CREATE  TABLE ` t_zhichu` ( `id` the INT ( 11 ) the NOT  NULL AUTO_INCREMENT the COMMENT ' spending the above mentioned id ' , `shenghuokaizhi` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' living expenses ' ,` yulekaizhi` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' entertainment expenses ' , `xuexikaizhi`VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' learning expenditure ' , `qitakaizhi` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' other expenses ' , a PRIMARY  KEY (` id`) 

) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' expenditure ' ; 

- ---------------------------- 

the DROP  TABLE  the IF  EXISTS `t_jieyu`; 

the CREATE  TABLE ` t_jieyu` ( `id`The INT ( . 11 ) the NOT  NULL the AUTO_INCREMENT the COMMENT ' balances ID ' , `shangyuejieyu` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' month balance ' ,` benyuejieyu` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' month balance ' , `yuemohuizong` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' end summary ' , a PRIMARY  KEY ( `id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='结余';

 

 

 

Add Income Module:

Present in the system to add revenue function, you can jump to the function module by clicking the Add income, the function module, fill in the corresponding income information. Income includes salary information, financial income and other income, after filling out all the information, via the post method to submit data to tianjiashouru.action, the address will respond in the server tianjiashouruact method shouruController in class. Response result acquire all revenue information, a package shouru class, using the insert method shourudao shouruController defined in the class, inserted into shouru revenue data table in the database. And gives the user prompts, add revenue success, save the information to the message request, this information will be shown on the page. The part of the core code is as follows:

The page transmitted by the insert method shourudao added revenue to the database shourudao.insert (shouru);

Add the successful income information, saved to the message request, the user is given the page prompt request.setAttribute ( "message", "Successfully added income");

Return to revenue management interface

return "forward:/tianjiashouru.action";

Revenue Module query:

In the background shouruguanli method, get all the data through selectByexample method. Save it to your request by foreach method in the page

Circulated to display the table. Revenue complete query operation. Specific code as follows:

Sample generating revenue class, ShouruExample example = new ShouruExample () define the query by example;

Check out all the income information List shouruall = shourudao.selectByExample (example) by selectByExample method of shourudao;

The income information is saved to the request, on display request.setAttribute ( "shouruall", shouruall) page by foreach method;

Return to revenue management interface

return "forward:/shouruguanli.action";

Modify income modules:

After filling out the page modify information, click the Modify button to submit data to xiugaishouru, the package as a revenue

, Using a method to modify the update revenue information, synchronize data to the database, to complete the modification operation.

Modify the definition of a successful message, modify succeed income, and save it to request specific code is as follows:

Modified corresponding income shourudao.updateByPrimaryKeySelective (shouru) by modifying the method according to the id of shourudao;

The amendment is successful revenue information, save it to a message request, the user is given prompt request.setAttribute in the page ( "message", "modify the income information successfully");

Return to revenue management interface

return "forward:/shouruguanli.action";

Delete Revenue module:

In the management page, click Delete. Page through the href attribute a label, use the get method income

Id is uploaded to the server, receiving by shouruController shanchushouru class in the server, after calling deleteByPrimaryKey shouruMapper method according to delete the ID. Save the information to delete the message request, the user is given delete successful message in the page, the part of the core code is as follows:

Delete by deleting the corresponding method according shourudao id income shourudao.deleteByPrimaryKey (id);

The income information deleted successfully saved to the message request, the user is given prompt request.setAttribute in the page ( "message", "delete success income");

Return to revenue management interface

return "forward:/shouruguanli.action";

Guess you like

Origin www.cnblogs.com/lqs11/p/11580797.html