JAVA-based enterprises and their branches internal office management system under the framework of SSM

Record learning every day, have a good mood every day. * ^ _ ^ *

Today, a friend and together completed a business and its internal branch office management system project, we use in the development of the framework is SSM (MYECLIPSE) framework. Limited knowledge of my friend, only this framework, ha ha, is designed to facilitate him. As usual selection of simple and convenient MYECLIPSE as a development tool, which is a background program. Introduction of this system is this: network technology development and application of manufacturing enterprises in the manufacturing business activity has expanded from traditional in-house data processing step by step into a unified resource scheduling and management has the time and space of the company's financial information is the enterprise. the most important management information, how to implement in the network environment on the financial system manufacturing enterprise remote branch offices of integrated unified management, is an important topic in modern manufacturing enterprise management. according to China's manufacturers need to financial management in a networked environment proposed a financial management support system W eb manufacturing enterprise remote branch offices established based on the architecture of the system, and a key part of the technology development and technology systems and internal financial systems integration operation, etc. research. Finally, the examples demonstrate the usefulness and effectiveness of the system., a company and its branch office management system should include internal user roles administrator, employees. In order to allow the user a smooth landing system to complete the related operations, landing roles you need to set up an account and password for each field.
In order to complete the function of the system needs to be sector employees to set tables, records department information. Defined in the department table the relationship between the two, in which the minister and staff departments mingzi corresponding field, id id field corresponds Minister departments and staff
. Staff contacted the authorities, so that by association established contact between departments, to strengthen the practicality and convenience of the system. Enhancing the user experience. Relationship between them is mingcheng field corresponds to departmental employees, id id field department and department employees correspondence.

The summary results for all data systems: the administrator (admin), department (bumen), employees (yuangong)

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

 

Sector Table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | departments the above mentioned id 
mingcheng |  VARCHAR ( 255 ) |  | name 
buzhang |  VARCHAR ( 255 ) |  | Minister 
buzhangid |  VARCHAR ( 255 ) |  | Minister for the above mentioned id 
Jieshao |  VARCHAR ( 255 ) |  | Introduction

 

Employees table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | staff of the above mentioned id 
mingzi |  VARCHAR ( 255 ) |  | name 
username |  VARCHAR ( 255 ) |  | account 
password |  VARCHAR ( 255 ) |  | password 
gongling |  VARCHAR ( 255 ) |  |Seniority 
bumen |  VARCHAR ( 255 ) |  | department 
bumenid |  VARCHAR ( 255 ) |  | department id

 

 

SET FOREIGN_KEY_CHECKS=0;

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

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

-- Table structure for ggqiyefenzhiguanli

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

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_bumen`;

CREATE TABLE `t_bumen` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '部门id' , `Mingcheng` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' name ' ,` buzhang` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' Minister ' , `buzhangid` the INT ( . 11 ) the DEFAULT  NULL the COMMENT ' Minister ID ' ,` jieshao` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' introduction ' , a PRIMARY  KEY ( `id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='部门';

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

DROP TABLE IF EXISTS `t_yuangong`;

CREATE TABLE `t_yuangong` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '员工id',`mingzi` VARCHAR(255) DEFAULT NULL COMMENT '名字',`username` VARCHAR(255 ) the DEFAULT  NULL the COMMENT ' account ' , `password` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' password ' ,` gongling` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' seniority ' , `bumen` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' department ' , `bumenid` INT ( 11 ) the DEFAULT  NULL the COMMENT' Division the above mentioned id ' , PRIMARY  KEY ( `id`) 

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

 

Add department modules:

From page via the post method, the department of information passed to the server in the background, in tianjiabumenact

Receiving, including field names, Minister, who id, using the insert method describes adding data, the data is synchronized to the

Database, add the operation is complete. Add the definition of a successful message, add a department successfully, and save it to request specific code is as follows:

Through the pages of the insert method bumendao transport sector added to the database bumendao.insert (bumen);

Add the information department of success, to save the message request, the user is given prompt request.setAttribute in the page ( "message", "add the department successfully");

Return sector management interface

return "forward:/tianjiabumen.action";

Query module department:

Sector inquiry module implementations to initiate bumenguanli.action request page. By this request, the server response bumenController class bumenguanli, query data by selectByexample operation in the process. After all the sectors of information queries, save it to request the bumenall in, on display in the page and return bumenguanli.jsp, the part of the core code is as follows:

Generating a sector-based sample, defined by the example query BumenExample example = new BumenExample ();

Check out all the information department List bumenall = bumendao.selectByExample (example) by selectByExample method of bumendao;

The department information stored in the request, on display request.setAttribute ( "bumenall", bumenall) page by foreach method;

Return sector management interface

return "forward:/bumenguanli.action";

Modify department modules:

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

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

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

Corresponding modified by modifying the method according bumendao id sector bumendao.updateByPrimaryKeySelective (bumen);

The department successfully modify the information, save it to request the message, the user is given prompt request.setAttribute in the page ( "message", "modify the information department of success");

Return sector management interface

return "forward:/bumenguanli.action";

Delete the department modules:

Delete function is implemented in bumenController department, the implementation is shanchubumen. shanchubumen.action the page by the get method? Id form will need to delete the department id uploaded to the server in response to a corresponding method, call deleteByPrimaryKey method bumendao in complete deletion. Will delete successful message is returned to the page, complete the operation to delete data. The part of the core code:

Delete by deleting the corresponding method according bumendao id sector bumendao.deleteByPrimaryKey (id);

The department successfully delete information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "Delete department successfully");

Return sector management interface

return "forward:/bumenguanli.action";

Guess you like

Origin www.cnblogs.com/bfmbch/p/11587414.html