Personal health data collection, analysis and management system based on JavaWeb+SqlServer

Table of Contents
Abstract I
ABSTRACT II
Table of Contents III
Chapter 1 Preface 1
1.1 Background of the project 1
1.2 Purpose and significance of the project 2
1.3 Contents of this study 3
1.4 Introduction to the structure of the paper 3
Chapter 2 Object-oriented system analysis 5
2.1 Feasibility analysis 5
2.1. 1 Economic feasibility analysis 5
2.1.2 Technical feasibility analysis 5
2.1.3 Operational feasibility analysis 6
2.2 Demand acquisition 6
2.3 Business process analysis 7
2.4 Demand modeling 8
2.5 System data demand analysis 11
2.6 Summary of this chapter 12
Chapter 3 is for Object system design 13
3.1 Outline design 13
3.1.1 Function module diagram 13
3.1.2 Module design 13
3.2 Database design 14
3.2.1 Database physical model diagram 14
3.2.2 Database table 15
3.3 Class diagram 18
3.4 Summary of this chapter 19
Fourth Chapter System Implementation and Testing 21
4.1 Description of system implementation 21
4.2 Project program structure 21
4.3 System interface implementation 23
4.4 System testing 25
4.4.1 Purpose and content of the test 25
4.4.2 Specific test instructions 25
4.4.3 Test conclusion 27
4.5 Summary of this chapter 27 Conclusion 29
References 在这里插入代码片
31
Acknowledgments 33
Appendix A: Full-text icon index 35
Appendix B: Part of the core code 37
1.3 Research on this article The content of
this topic will be to design and implement a Web system that allows users to enter their own various health data in real time, make simple analysis based on the data to establish a personal health curve, and provide relevant information and knowledge as a learning tool for people. Health knowledge and a platform to better manage your own health.
1.4 Introduction to thesis structure
This thesis records the entire process from early system development research and design to system development, testing and summary.
1. Introduction
This chapter mainly introduces the current social background of the system and the purpose and significance of development, and also explains the corresponding technologies and development tools.
2. Object-oriented system analysis
This chapter mainly conducts feasibility analysis and user demand research on the development system, and performs demand modeling based on user needs. Draw use case diagrams and data flow diagrams according to requirements. Lay the foundation for system design.
3. Object-oriented system design:
Based on user needs, outline the system design, design modules, draw functional module diagrams, design the database, draw database physical model diagrams and explain tables to provide guidance for system implementation.
4. System implementation and testing:
Introduce the function implementation in the system, introduce and display the implemented UI interface at the same time. In addition, the system test is explained.
5. Conclusion
Summarize and summarize the system. In addition, the paper also includes three parts: conclusion, references and acknowledgments. Finally, the full-text table index and full-text figure index are appended.

/*主界面添加数据*/
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.ms.alex.dao.MedicalRecordDao;
import com.ms.alex.util.JsonUtil;
import com.sun.org.apache.bcel.internal.generic.NEW;

import net.sf.json.JSONArray;

@WebServlet("/medical")
public class MedicalRecordServlet extends HttpServlet {
    
    
	private static final long serialVersionUID = 1L;
	private MedicalRecordDao medicalRecordDao;

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public MedicalRecordServlet() {
    
    
		medicalRecordDao = new MedicalRecordDao();
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
    
    
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8"); 
		response.setContentType("text/html;charset=UTF-8");
		HttpSession session = request.getSession();
		PrintWriter printWriter = response.getWriter();
		String category = (String) session.getAttribute("category");
		String type = request.getParameter("type");
		if (type == null) {
    
    
			switch (category) {
    
    
			case "admin":

				break;
			case "emp":
				break;
			case "user":
				// (String)session.getAttribute("idCard")
				
				String idCard = request.getParameter("idCard");
				List<List<Object>> list;
				System.out.println("idCard: "+idCard);
				if(idCard == null){
    
    
					list = medicalRecordDao.query();
				}else {
    
    
					if(idCard.equals("")){
    
    
						list = medicalRecordDao.query();
					}else {
    
    
						list = medicalRecordDao.query(idCard);
					}
				}
				JSONArray jsonArray = new JSONArray();
				for (List<Object> i : list) {
    
    
					jsonArray.add(i);
				}
				printWriter.print(jsonArray);
				break;
			default:
				break;
			}
		}else {
    
    
			System.out.println(type);
			switch (type) {
    
    
			case "add":
				List<String> list = new ArrayList<>();
				for (int i = 0; i < 12; i++) {
    
    
					list.add(request.getParameter(Integer.toString(i)));
				}
				int result = medicalRecordDao.addition(list);
				if (result>0) {
    
    
					request.setAttribute("addTips", "添加成功");
				}else {
    
    
					request.setAttribute("addTips", "请按格式添加数据");
				}
				System.out.println(result);
				forward(request, response, "/dataManage/medicalRecord.jsp");
				break;
			case "delete":
				System.out.println(request.getParameter("recordID"));
				medicalRecordDao.delete(request.getParameter("recordID"));
				forward(request, response, "/dataManage/medicalRecord.jsp");
				break;
			case "queryIn5Year":
				System.out.println(session.getAttribute("idCard"));
				
				printWriter.println(
						medicalRecordDao.queryIn5Year((String)session.getAttribute("idCard")));
				break;
			default:
				break;
			}
		}
		printWriter.close();
		// List list = medicalRecordDao.query();
		// request.setAttribute("info", new JSONArray(list));
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
    
    
		doGet(request, response);
	}
	
	private void forward(HttpServletRequest request, HttpServletResponse response,String url) {
    
    
		try {
    
    
			request.getRequestDispatcher(url).forward(request, response);
		} catch (ServletException | IOException e) {
    
    
			e.printStackTrace();
		}
	}
}

Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/newlw/article/details/132687095