Spring MVC + Vue project personal health information management system

Get the source code at the end

Development language: Java

Development tool: IDEA/ Eclipse

Database: mysql5 seven

Application service: Tomcat7/Tomcat8

use framessm+vue

JDK version: jdk1.0 eight

Preface introduction

System management will also carry out overall intelligent operation through computers. There are many management and data preservation involved in personal health information management, such as administrators; Home page, personal center, user management, physician management, diet record management, exercise record management, health information management, health assessment management, health knowledge management, system management, user; Home page, personal center, diet record management, exercise record management, health information management, health assessment management, doctors; Home page, personal center, diet record management, exercise record management, health information management, health assessment management, system management, front page; Home page, health knowledge, system announcement, personal center, background management, health consultation, etc. this has brought great challenges to the work of managers. In the face of a large amount of information, the traditional management system makes detailed information statistics through notes. Later, computers appear, and the paper information is counted on the computer through computer input software. This method is more traditional, and it is more troublesome to make statistics, It is also affected by time and space, so personal health information management is developed; It provides users with a convenient management platform, which is convenient for administrators to view and maintain, and can edit and maintain the content according to their needs; For users, they can view personal health information at any time. Administrators can get the data information of the system without leaving home, and they can also save users a lot of time. Therefore, the development of personal health information management brings great convenience to managers, and it is also convenient for administrators to process user information.

System architecture

Structure diagram of personal health information management

Login system structure diagram, as shown in the figure

 

System structure diagram, as shown in Figure

Detailed system design

Front page function module

Personal health information management: in personal health information management, you can view the home page, health knowledge, system announcement, personal center, background management, health consultation and other contents, as shown in the figure

Login and user registration: obtain account, password, name, gender, height, weight, age, mobile phone, email, ID card and other information through user registration, as shown in the figure

 

Login interface diagram

For health information, you can fill in the type, date and other information on the health information page to submit, as shown in the figure

 

 

In the personal center, you can fill in the account, password, name, gender, height, weight, age, mobile phone, email, ID card, photo and other information on the page of the personal center to update the information and log out, as shown in the figure

 

For my collection, you can fill in the collection name and other information on my collection page for collection, as shown in the figure

 

Administrator function module

The administrator logs in, fills in the user name, password, role and other information, and then selects login to enter the personal health information management, as shown in the figure

 

The administrator can log in to the personal health information management to view the home page, personal center, user management, physician management, diet record management, exercise record management, health information management, health assessment management, health knowledge management, system management and other contents, as shown in the figure

 

Doctor management: on the doctor management page, you can fill in the job number, password, doctor, professional title, gender, age, mobile phone, email, ID card, photo and other information, and you can modify and delete the details of doctor management as needed, as shown in the figure

 

Diet record management: you can view the account number, name, type, diet, intake, record and other information on the diet record management page, and you can modify, delete or view the details of diet record management as needed, as shown in the figure

 

Sports record management: you can view the account number, name, type, sports, consumption, record and other information on the sports record management page, and you can modify, delete or view the details of sports record management as needed, as shown in the figure

 

Health information management: on the health information management page, you can view the account number, name, gender, age, weight, waist circumference, blood pressure, heart rate, update and other contents, and view the details, modify, delete or view the details of health information management as needed, as shown in the figure

 

For health assessment management, you can view the account number, name, file, status, diagnosis report, data analysis, registration date and other information on the health assessment management page, and you can modify, delete or view the details of health assessment management as needed, as shown in the figure

 

Rotation map; The figure shows the rotation management page. The administrator can manage the rotation chart on the home page on this page, add new pictures to the rotation chart through the new operation, modify the pictures transmitted above, and delete the pictures, as shown in the figure below

 

User function module

When the user logs in, the user can enter the personal health information management by filling in the user name, password, role and other information, and selecting login after entering, as shown in the figure

 

After logging in to personal health information management, users can view the home page, personal center, diet record management, exercise record management, health information management, health evaluation management and other contents, as shown in the figure

 

Sports record management: on the sports record management page, you can view the account number, name, type, sports, consumption, record and other detailed information for modification, as shown in the figure

Health information management: on the health information management page, you can view the account number, name, gender, age, weight, waist circumference, blood pressure, heart rate, update and other information, and delete or view the details of health information management as needed, as shown in the figure

 

For health assessment management, you can view the account number, name, file, status, diagnosis report, data analysis, registration date and other information on the health assessment management page, and delete or view the details of health assessment management as needed, as shown in the figure

 

Physician function module

Doctor login: the doctor can enter the personal health information management by filling in the user name, password, role and other information, and selecting login after input, as shown in the figure

Doctors can log in to personal health information management to view the home page, personal center, diet record management, exercise record management, health information management, health assessment management, system management and other contents, as shown in the figure

 

Sports record management: on the sports record management page, you can view the account number, name, type, sports, consumption, record and other detailed information for modification, as shown in the figure

Health information management: on the health information management page, you can view the account number, name, gender, age, weight, waist circumference, blood pressure, heart rate, update and other information, and delete or view the details of health information management as needed, as shown in the figure

For health assessment management, you can view the account number, name, file, status, diagnosis report, data analysis, registration date and other information on the health assessment management page, and delete or view the details of health assessment management as needed, as shown in the figure

Some core codes:

/**
 * Upload file mapping table
 */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	/**
	 * Upload file
	 */
	@RequestMapping("/upload")
	public R upload(@RequestParam("file") MultipartFile file, String type,HttpServletRequest request) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("Uploaded file cannot be empty");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
		file.transferTo(dest);
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
			if(configEntity==null) {
				configEntity = new ConfigEntity();
				configEntity.setName("faceFile");
				configEntity.setValue(fileName);
			} else {
				configEntity.setValue(fileName);
			}
			configService.insertOrUpdate(configEntity);
		}
		return R.ok().put("file", fileName);
	}
	
	/**
	 * Download File
	 */
	@IgnoreAuth
	@RequestMapping("/download")
	public void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
		try {
			File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
			if (file.exists()) {
				response.reset();
				response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName+"\"");
				response.setHeader("Cache-Control", "no-cache");
				response.setHeader("Access-Control-Allow-Credentials", "true");
				response.setContentType("application/octet-stream; charset=UTF-8");
				IOUtils.write(FileUtils.readFileToByteArray(file), response.getOutputStream());
			}
 
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}
**
 * Health consultation
 * Back end interface
 * @author 
 * @email 
 * @date 2021-01-22 16:52:01
 */
@RestController
@RequestMapping("/chat")
public class ChatController {
    @Autowired
    private ChatService chatService;
    


    /**
     * Backend list
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ChatEntity chat, HttpServletRequest request){
    	if(!request.getSession().getAttribute("role").toString().equals("administrators")) {
    		chat.setUserid((Long)request.getSession().getAttribute("userId"));
    	}

        EntityWrapper<ChatEntity> ew = new EntityWrapper<ChatEntity>();
		PageUtils page = chatService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chat), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * Front end list
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ChatEntity chat, HttpServletRequest request){
    	if(!request.getSession().getAttribute("role").toString().equals("administrators")) {
    		chat.setUserid((Long)request.getSession().getAttribute("userId"));
    	}

        EntityWrapper<ChatEntity> ew = new EntityWrapper<ChatEntity>();
		PageUtils page = chatService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chat), params), params));
        return R.ok().put("data", page);
    }

	/**
     * list
     */
    @RequestMapping("/lists")
    public R list( ChatEntity chat){
       	EntityWrapper<ChatEntity> ew = new EntityWrapper<ChatEntity>();
      	ew.allEq(MPUtil.allEQMapPre( chat, "chat")); 
        return R.ok().put("data", chatService.selectListView(ew));
    }

	 /**
     * query
     */
    @RequestMapping("/query")
    public R query(ChatEntity chat){
        EntityWrapper< ChatEntity> ew = new EntityWrapper< ChatEntity>();
 		ew.allEq(MPUtil.allEQMapPre( chat, "chat")); 
		ChatView chatView =  chatService.selectView(ew);
		return R.ok("Query health consultation succeeded").put("data", chatView);
    }
	
    /**
     * Back end details
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ChatEntity chat = chatService.selectById(id);
        return R.ok().put("data", chat);
    }

    /**
     * Front end details
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ChatEntity chat = chatService.selectById(id);
        return R.ok().put("data", chat);
    }
    



    /**
     * Backend save
     */
    @RequestMapping("/save")
    public R save(@RequestBody ChatEntity chat, HttpServletRequest request){
    	chat.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(chat);
    	if(StringUtils.isNotBlank(chat.getAsk())) {
			chatService.updateForSet("isreply=0", new EntityWrapper<ChatEntity>().eq("userid", request.getSession().getAttribute("userId")));
    		chat.setUserid((Long)request.getSession().getAttribute("userId"));
    		chat.setIsreply(1);
    	}
    	if(StringUtils.isNotBlank(chat.getReply())) {
    		chatService.updateForSet("isreply=0", new EntityWrapper<ChatEntity>().eq("userid", chat.getUserid()));
    		chat.setAdminid((Long)request.getSession().getAttribute("userId"));
    	}

        chatService.insert(chat);
        return R.ok();
    }
    
    /**
     * Front end save
     */
    @RequestMapping("/add")
    public R add(@RequestBody ChatEntity chat, HttpServletRequest request){
    	chat.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(chat);
    	chat.setUserid((Long)request.getSession().getAttribute("userId"));
    	if(StringUtils.isNotBlank(chat.getAsk())) {
			chatService.updateForSet("isreply=0", new EntityWrapper<ChatEntity>().eq("userid", request.getSession().getAttribute("userId")));
    		chat.setUserid((Long)request.getSession().getAttribute("userId"));
    		chat.setIsreply(1);
    	}
    	if(StringUtils.isNotBlank(chat.getReply())) {
    		chatService.updateForSet("isreply=0", new EntityWrapper<ChatEntity>().eq("userid", chat.getUserid()));
    		chat.setAdminid((Long)request.getSession().getAttribute("userId"));
    	}

        chatService.insert(chat);
        return R.ok();
    }

    /**
     * modify
     */
    @RequestMapping("/update")
    public R update(@RequestBody ChatEntity chat, HttpServletRequest request){
        //ValidatorUtils.validateEntity(chat);
        chatService.updateById(chat);//Update all
        return R.ok();
    }
    

    /**
     * delete
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        chatService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * Reminder interface
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<ChatEntity> wrapper = new EntityWrapper<ChatEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = chatService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

Tags: Java Front-end Vue Back-end SSM GraduationDesign

Posted by Daveyz83 on Sun, 22 May 2022 02:18:24 +0300