A Java-based Accounting Management System Completed by Computer

Code + paper download link:

http://106.55.47.97/host-pictures/java.png

Overview

The Java accounting management system is mainly used for financial personnel to judge the development direction of the company from the accounts. For individuals and families, future consumption plans can be formulated through bookkeeping, so as to draw a clear and reasonable line for financial management. This system mainly adopts JAVA programming technology and Oracle database, under Windows 7 operating system environment, adopts Eclipse development tool and Javabeans to design and develop the design and realization of the electronic commerce website based on B/S structure.
(1) User registration:
After successfully registering through the registration function, the user will jump to the login page for easy login
(2) User login:
After the user logs in successfully:
Information management: users can modify personal information
Financial management: users can view their financial information and make some new financial records
Financial Statistics: Users can check their monthly or annual income and expenditure, so as to know
(3) Administrator login:
System Management:
Administrator information management: You can perform some basic operations on administrator information
User information management: You can query and delete users to manage user groups
(4) Exit:
Safely exit the main page and return to the login page.

Application Environment

The realization of this system requires the use of B/S architecture and MVC mode, the use of JSP for the realization of the front page, and the realization of the background database using Oracle.
Software Environment :
Operating System - windows 7
Database - Oracle
Application middleware - Tomcat7.0
Editing Environment - Eclipse

1. Introduction

For those of us who have just left school or have just worked, since we have just entered the society, the most basic thing is to ensure our own survival and arrange our own consumption reasonably. Therefore, we usually pay attention to our own consumption and It is particularly critical to have a billing record of income and expenditure. Billing records allow us to more clearly understand the whereabouts of our income and expenditure, so that we can better grasp every penny of our body, and then use the money in key places, such as investment, financial management, etc. Judging from inquiring extracurricular materials, there are many software for bill management abroad, and most foreigners have strict control over the accounting in life. As far as China is concerned, looking around, most accounting software focuses on office financial software, while there are relatively few small accounting systems for individuals and families. Therefore, it is necessary to develop such a system software to achieve guidance. We consume rationally and distribute income and expenditure rationally.

As for bookkeeping, if we record directly with paper and pen like the ancients, then as we record more and more, our bookkeeping book will also become thicker and thicker, which is easy to cause loss. To find a record we want to find, we will consume a lot of time, which is very troublesome. This accounting method is very redundant and cumbersome, so we need to design a full-featured accounting software to replace the traditional manual operation.

1.1. The development of the accounting system

With the rapid development of my country's economic construction, the financial activities of enterprises have undergone profound changes. Domestic financial software has grown from nothing, and after 20 years of development, it has gradually become mature. Since the application of electronic computers to the financial field in my country in 1979, with the advent of the new era of enterprises, major changes have taken place in the operation and management mode of enterprises. Traditional financial software has been unable to adapt to the increasingly fierce market competition and high-speed information. With roads extending in all directions and foreign software coming in droves, how to adapt to the needs of the times and how to develop a new generation of financial software will become a common concern for everyone.
Over the past ten years, my country's financial software industry has achieved significant results under the unremitting efforts of all parties. Looking at my country's domestic software market, the development situation of financial software is also a group of heroes. A hundred schools of thought contend, financial software has become a domestic market. One of the most active and brilliant fields in the software world. Although the development of financial software in my country is relatively good, with China's accession to the WTO, facing the challenges of the world economy and the high standard requirements of international financial software, many problems have been exposed in the use process. How to seize favorable opportunities for the development of financial software in my country and meet the challenges of the new era will be the glorious historical mission of all financial software workers.

###1. 2. Significance of accounting management system

As for bookkeeping, if we record directly with paper and pen like the ancients, then as we record more and more, our bookkeeping book will also become thicker and thicker, which is easy to cause loss. To find a record we want to find, we will consume a lot of time, which is very troublesome. This accounting method is very redundant and cumbersome, so we need to design a full-featured accounting software to replace the traditional manual operation.

2. System structure design

The whole system is divided into user registration, user login, financial management, financial statistics, system management and other functional modules, as shown in the figure.

3. System database design

The system has a total of four entity classes, namely Admin, User, Zhang, Tong. They correspond to the four database tables admin, t_user, zhang, and tong respectively.

4. System implementation

The focus of this chapter is to describe the key interface and key code of the completed project. It is not necessary to reflect all the interface and all the code of the completed project here, especially the interface design code. The description of the key code can use the flow chart or code. When copying the code, you should pay attention to the English format. In addition, because the indentation of the code is different from that of the paper, it should be handled according to the format requirements of the paper. In principle, the modules that appear in this part should be consistent with the key business analysis.

4.1 User login

Function description
Login is the process of authenticating users using system functions, and the login interface is required to be concise and easy to understand. Each user has its own account and password, and every operation of the user in the system is recorded in a log, which can effectively ensure data traceability and ensure that the responsibility is assigned to the person. The interface is as follows.

4.2 Implementation process

When the user logs in to the page through the user name and password, if the user name or password or verification code is empty, the front page judges by calling the login JS method, and gives a prompt that cannot be empty; when the user fills in the correct user When the name, password and verification code are used in the background, the loginUser() method is called in the background to query whether there is the user through the database. If the user exists, the login is successful and the home page is redirected. , a prompt box will be generated, prompting the user to re-enter.
Part of the code is as follows:

protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String username = req.getParameter("username");
		String password = req.getParameter("password");
		String type = req.getParameter("type");
		HttpSession session = req.getSession();
		try {
			if(type.equals("user")){

				if(str.equals(randomCode)){
				User user = userService.loginUser(username, password);
				session.setAttribute("currentUser", user);
				session.setAttribute("currentType", "user");
				req.getRequestDispatcher("index.jsp").forward(req, resp);
				}
				else{
					req.setAttribute("messageInfo", "Verification code error! please enter again");
					req.getRequestDispatcher("login.jsp").forward(req, resp);
				}		} catch (Exception e) {
			req.setAttribute("messageInfo", e.getMessage());
			e.printStackTrace();
			req.getRequestDispatcher("login.jsp").forward(req, resp);
		}
		
	}
@Override
	public User loginUser(String username, String password) throws UserException {
		User user2 = userDao.findUserByName(username);
		if(user2==null){
			
				throw new UserException("The username does not exist. Please enter again!");
		}if(!password.equals(user2.getPassword())){
			
				throw new UserException("The login password is wrong, please re-enter!");
		}
		return user2;
	}

...

Other key codes:

protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String str = req.getParameter("user.id");
		long id = Long.parseLong(str);
		String name = req.getParameter("user.name");
		String password = req.getParameter("user.pass");
		String rname = req.getParameter("user.rname");
		String sex = req.getParameter("user.sex");
		String age = req.getParameter("user.age");
		String tel = req.getParameter("user.tel");
		HttpSession session = req.getSession();
		user = new User(id,name,sex,age,password,tel,rname,new Date());
		try{
			userService.editUser(user);
			
			resp.sendRedirect("editUserSuccess.jsp");
		}

@Override
	public void editUser(User user) {
		userDao.updateUser(user);
	}
<script type="text/javascript">
var myChart = new FusionCharts("<%=path%>/FusionCharts/Charts/Pie3D.swf", "myChartId",
		"600", "400");
var strXML = "<chart caption='Income at a glance'>${data}</chart>";
myChart.setDataXML(strXML);

myChart.render("chartdiv1");

$(document).ready(function(){
	 var $messageInfo = $("#messageInfo").val();
	 if($messageInfo != null && $messageInfo != ""){
		 $.messager.show({
			title:'hint',
			msg:$messageInfo,
			timeout:2000,
			showType:'slide'
		 });
		 $("#messageInfo").val("");
	 }
  });
  
</script>
         
Tong tong1 = tongService.findTongByMonth(month,username);
				
				if(tong1==null){
					Tong tong = new Tong(username,"account","public expense",new Date(),year,month,num1,num2);
					tongService.saveTong(tong);
					String info="<set name='bill' value='"+tong.getZhi()+"' /><set name='account' value='"+tong.getShou()+"' />";
					req.setAttribute("data", info);
					req.getRequestDispatcher("zhang/zhang_ylist.jsp").forward(req, resp);
				}else{
					long id =tong1.getId();
					Tong tong = new Tong(id,username,"account","public expense",new Date(),year,month,num1,num2);
					tongService.updateTong(tong);
					String info="<set name='bill' value='"+tong.getZhi()+"' /><set name='account' value='"+tong.getShou()+"' />";
					req.setAttribute("data", info);
					req.getRequestDispatcher("zhang/zhang_ylist.jsp").forward(req, resp);
					protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		try {
			String name = req.getParameter("zhang.name");
			String type = req.getParameter("zhang.type");
			String kind = req.getParameter("zhang.kind");
			String date = req.getParameter("zhang.date");
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
			Date time = simpleDateFormat.parse(date);
			String string = req.getParameter("zhang.count");
			double count =Double.parseDouble(string);
			String yong = req.getParameter("zhang.yong");
			String info = req.getParameter("zhang.info");
			HttpSession session = req.getSession();
			User user = (User) session.getAttribute("currentUser");
			String rname = user.getRname();
			String username = user.getName();
			Zhang zhang = new Zhang(name,username,rname,type,kind,time,count,yong,info);
			zhangService.addZhang(zhang);
			List<Zhang> list = zhangService.findZhangByUserName(username);
			System.out.println(list);
			req.getSession().setAttribute("zhang_list", list);
			resp.sendRedirect("zhang/zhang_list.jsp");	
			
@Override
	public void addZhang(Zhang zhang) throws ZhangException {
		try{
		zhangdao.addZhang(zhang);
		}catch(Exception e){
			throw new ZhangException("add failed,please add it again");
		}
		
	}

Screenshot of project part




6. Summary

After several months of continuous efforts, the accounting management system was finally completed. This project is a typical web-based development project. Each module has a clear division of labor and cooperation through the mvc design mode, making the system code clear.
Here is my summary of the system:
1. Demand analysis stage: This stage mainly clarifies the user needs. For this training, the demand analysis is analyzed from the task book, and then further in the e-commerce system, the ideas are expressed in UML diagrams, so as to know more clearly what It's what the system does.
2. Database design stage: After the requirements analysis stage, it is basically clear which participants, which entities, the connections between entities, and which fields the entities have.
3. Architecture design stage: Due to the small size of the project, the data transfer can be clearly seen by using the MVC mode, JSP<—>Controller<—>Dao<—>Oracle
4. Detailed design stage: According to the business, design the corresponding function in the processing layer.
Overall, the system finally achieved the expected main functions. Due to my limited level and lack of experience in design and programming, the system still has more or less defects.

7. References

[1] Tian Shumei. Software Engineering: Theory and Practice Tsinghua University Press.
[2] Geng Xiangyi. "Java2 Practical Tutorial (Third Edition)". Tsinghua University Press, 2006(8).
[3] Wang Yonghong. Using JavaScript to enhance the function of web pages [J]. Anhui Architecture, 2001, (2): 27-34.
[4] Sun Weiqin, Li Hongcheng. Detailed Explanation of Tomcat and JSP Web Development Technology. Electronic Industry Press, June 2003: 1~205.
[5] Ji Lei, Li Li, Zhou Wei. J2EE integration application case [M]. Beijing: People's Posts and Telecommunications Press, 2007.
[6] Wang Shan, Chen Hong. Principles of Database System Tutorial [M]. Beijing: Tsinghua University Press, 2004-6.
[7] Wu Yanjun, Huang Feiyue. Proficient in JSP programming technology [J]. Beijing: People's Posts and Telecommunications Publishing.
[8] Wang Lin. Java multithreading mechanism and its application [J]. Journal of Wuhan University of Technology (Information and Management Engineering).
[9] Liu Yongpo, Liu Xuemei, Zhao Changhai. JSP application development technology [M]. Beijing: People's Posts and Telecommunications Publishing, 2005.
[10] He Songping. Research and application of B/S architecture based on MVC pattern [D]. Wuhan: Huazhong University of Science and Technology.
[11] Zhang Haifan. Introduction to Software Engineering. Beijing: Tsinghua University Press. 2008, 02.
[12] Pu Ziming, Xu Yong, Wang Li, etc. Detailed explanation of Struts2+Hibernate+Spring integrated development technology. Beijing: Tsinghua University Press, 2010,10.
[13] Li Lei, Wang Yangting. Object-Oriented Technology and UML Tutorial. Beijing: People's Posts and Telecommunications Press. 2010.05.
[14] Tao Hongcai. Database Principle and Application Design. Sichuan: Southwest Jiaotong University Press. 2011.07.
[15]Andrew S. Tanenbaum et al. Computer Network. Beijing: Tsinghua University Press. 2004.11.

Attachment: Article Directory


Tags: Java Database GraduationDesign programming language

Posted by dotnotwhat on Sat, 22 Oct 2022 22:56:11 +0300