ssm+vue居家养老系统源码和论文234
开发工具:idea 或eclipse
数据库mysql5.7+
数据库链接工具:navcat,小海豚等
技术:ssm
居家养老系统
摘要
随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了居家养老系统的开发全过程。通过分析高校学生综合素质评价管理方面的不足,创建了一个计算机管理居家养老系统的方案。文章介绍了居家养老系统的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。
本居家养老系统管理员和工作人员两个角色。管理员功能有个人中心,老人账号管理,工作人员管理,老人档案管理,订单申请管理,检查检验项目管理,维修服务管理,订单信息管理,转诊信息管理,生活服务管理,服务记录管理,生活用品信息管理,药品信息管理,食物信息管理,系统管理等。工作人员功能有个人中心,老人档案管理,订单信息管理,转诊信息管理,生活服务管理,服务记录管理等。老人功能有个人中心,老人档案管理,订单信息管理,转诊信息管理,生活服务管理,服务记录管理等。因而具有一定的实用性。
本站是一个B/S模式系统,采用SSM框架,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得居家养老系统管理工作系统化、规范化。
关键词:居家养老系统;SSM框架;MYSQL数据库
Abstract
With the deepening and extensive application of information technology in management, the implementation of management information systems has gradually matured in technology. This article introduces the whole process of the development of the home care system. By analyzing the deficiencies in the management of comprehensive quality evaluation of college students, a computer-managed home care system was created. The article introduces the system analysis part of the home care system, including feasibility analysis, etc. The system design part mainly introduces the system function design and database design.
The two roles of the home care system administrator and staff. Administrator functions include personal center, elderly account management, staff management, elderly file management, order application management, inspection project management, maintenance service management, order information management, referral information management, life service management, service record management, life Supply information management, drug information management, food information management, system management, etc. Staff functions include personal center, elderly file management, order information management, referral information management, life service management, service record management, etc. The functions of the elderly include personal center, elderly file management, order information management, referral information management, life service management, service record management, etc. So it has a certain practicability.
This site is a B/S mode system, using SSM framework, MYSQL database design and development, fully guarantee the stability of the system. The system has the characteristics of clear interface, simple operation and complete functions, which makes the management of the home care system systematized and standardized.
Keywords: Home care system; SSM framework; MYSQL database
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.LaorenzhanghaoEntity;
import com.entity.view.LaorenzhanghaoView;
import com.service.LaorenzhanghaoService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 老人账号
* 后端接口
* @author
* @email
* @date 2021-04-16 15:09:25
*/
@RestController
@RequestMapping("/laorenzhanghao")
public class LaorenzhanghaoController {
@Autowired
private LaorenzhanghaoService laorenzhanghaoService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
LaorenzhanghaoEntity user = laorenzhanghaoService.selectOne(new EntityWrapper<LaorenzhanghaoEntity>().eq("laorenzhanghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"laorenzhanghao", "老人账号" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody LaorenzhanghaoEntity laorenzhanghao){
//ValidatorUtils.validateEntity(laorenzhanghao);
LaorenzhanghaoEntity user = laorenzhanghaoService.selectOne(new EntityWrapper<LaorenzhanghaoEntity>().eq("laorenzhanghao", laorenzhanghao.getLaorenzhanghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
laorenzhanghao.setId(uId);
laorenzhanghao.setUserid(uId);
laorenzhanghaoService.insert(laorenzhanghao);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
LaorenzhanghaoEntity user = laorenzhanghaoService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
LaorenzhanghaoEntity user = laorenzhanghaoService.selectOne(new EntityWrapper<LaorenzhanghaoEntity>().eq("laorenzhanghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
laorenzhanghaoService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,LaorenzhanghaoEntity laorenzhanghao,
HttpServletRequest request){
EntityWrapper<LaorenzhanghaoEntity> ew = new EntityWrapper<LaorenzhanghaoEntity>();
PageUtils page = laorenzhanghaoService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, laorenzhanghao), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,LaorenzhanghaoEntity laorenzhanghao, HttpServletRequest request){
EntityWrapper<LaorenzhanghaoEntity> ew = new EntityWrapper<LaorenzhanghaoEntity>();
PageUtils page = laorenzhanghaoService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, laorenzhanghao), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( LaorenzhanghaoEntity laorenzhanghao){
EntityWrapper<LaorenzhanghaoEntity> ew = new EntityWrapper<LaorenzhanghaoEntity>();
ew.allEq(MPUtil.allEQMapPre( laorenzhanghao, "laorenzhanghao"));
return R.ok().put("data", laorenzhanghaoService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(LaorenzhanghaoEntity laorenzhanghao){
EntityWrapper< LaorenzhanghaoEntity> ew = new EntityWrapper< LaorenzhanghaoEntity>();
ew.allEq(MPUtil.allEQMapPre( laorenzhanghao, "laorenzhanghao"));
LaorenzhanghaoView laorenzhanghaoView = laorenzhanghaoService.selectView(ew);
return R.ok("查询老人账号成功").put("data", laorenzhanghaoView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
LaorenzhanghaoEntity laorenzhanghao = laorenzhanghaoService.selectById(id);
return R.ok().put("data", laorenzhanghao);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
LaorenzhanghaoEntity laorenzhanghao = laorenzhanghaoService.selectById(id);
return R.ok().put("data", laorenzhanghao);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody LaorenzhanghaoEntity laorenzhanghao, HttpServletRequest request){
laorenzhanghao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(laorenzhanghao);
LaorenzhanghaoEntity user = laorenzhanghaoService.selectOne(new EntityWrapper<LaorenzhanghaoEntity>().eq("laorenzhanghao", laorenzhanghao.getLaorenzhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
laorenzhanghao.setId(new Date().getTime());
laorenzhanghaoService.insert(laorenzhanghao);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody LaorenzhanghaoEntity laorenzhanghao, HttpServletRequest request){
laorenzhanghao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(laorenzhanghao);
LaorenzhanghaoEntity user = laorenzhanghaoService.selectOne(new EntityWrapper<LaorenzhanghaoEntity>().eq("laorenzhanghao", laorenzhanghao.getLaorenzhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
laorenzhanghao.setUserid((Long)request.getSession().getAttribute("userId"));
laorenzhanghao.setId(new Date().getTime());
laorenzhanghaoService.insert(laorenzhanghao);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody LaorenzhanghaoEntity laorenzhanghao, HttpServletRequest request){
//ValidatorUtils.validateEntity(laorenzhanghao);
laorenzhanghaoService.updateById(laorenzhanghao);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
laorenzhanghaoService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@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<LaorenzhanghaoEntity> wrapper = new EntityWrapper<LaorenzhanghaoEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = laorenzhanghaoService.selectCount(wrapper);
return R.ok().put("count", count);
}
}