✨作者主页:IT毕设梦工厂✨
个人简介:曾从事计算机专业培训教学,擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。
☑文末获取源码☑
精彩专栏推荐⬇⬇⬇
Java项目
Python项目
安卓项目
微信小程序项目
一、前言
随着我国人口老龄化的加剧,养老问题逐渐成为社会关注的焦点。据统计,截至2023年,我国60岁及以上的老年人口已达到2.94亿,占总人口的20.8%。这一比例预计在未来几年将继续上升。在此背景下,养老院作为老年人社会化养老的重要场所,其管理水平和服务质量直接影响到老年人的生活质量和养老体验。然而,目前许多养老院仍采用传统的管理模式,存在信息孤岛、管理效率低下、服务难以个性化等问题,这些问题制约制了养老院服务的质量和效率。
现有的养老院管理系统普遍存在一些问题。例如,信息更新不及时,导致家属难以实时了解老人在院情况;服务流程不够透明,老人和家属对服务内容和质量缺乏了解;个性化服务不足,难以满足不同老人的个性化需求;此外,系统的用户交互体验差,操作复杂,对老年用户不够友好。这些问题不仅影响了养老院的管理效率,也降低了老人和家属的满意度。
本课题旨在设计并实现一个功能齐全、操作简便、用户友好的养老院管理系统。系统将提供老人信息管理、床位分配、健康档案管理、日常活动记录、费用管理等功能,通过信息化手段提高养老院的管理效率和服务水平。同时,系统将采用模块化设计,便于根据养老院的实际需求进行功能扩展和维护。
本课题的研究具有重要的理论意义和实际意义。从理论角度来看,它为养老院管理领域提供了新的研究思路,即如何利用信息技术提升养老院的管理效率和服务质量。从实际角度来看,养老院管理系统的应用将有助于提高养老院的管理效率,优化服务流程,提升老人和家属的满意度,增进养老院服务的个性化和准确化。同时,系统的推广应用也将推动养老服务行业的信息化和现代化进程,为应对人口老龄化挑战提供支持。
在养老院管理系统中,管理人员负责用户账户的创建与维护、养老院信息的更新与管理、老人入住与退房的登记、老人健康档案的管理、日常活动与费用的记录、家属信息的维护;护工可以查看和管理自己负责的老人信息、记录老人的日常生活和健康情况、提交老人的护理报告;老人及其家属能够查看老人的基本信息、健康档案、日常活动记录、费用明细,以及与养老院沟通的渠道。系统通过这些功能模块的整合,旨在提供一个便捷的养老院管理服务平台。
二、开发环境
- 开发语言:Java/Python
- 数据库:MySQL
- 系统架构:B/S
- 后端:SpringBoot/SSM/Django/Flask
- 前端:Vue
三、系统界面展示
- 养老院管理系统界面展示:
管理员-入住登记:
管理员-老人外出登记:
管理员-老人健康信息管理:
管理员-老人安全情况管理:
亲属-查看老人每日餐饮:
亲属-费用缴纳:
四、部分代码设计
- 项目实战-代码参考:
@RestController
@Controller
@RequestMapping("/jiankangdangan")
public class JiankangdanganController {
private static final Logger logger = LoggerFactory.getLogger(JiankangdanganController.class);
private static final String TABLE_NAME = "jiankangdangan";
@Autowired
private JiankangdanganService jiankangdanganService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private GongzuorenyuanService gongzuorenyuanService;
@Autowired
private JiashuService jiashuService;
@Autowired
private YishengService yishengService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("老人".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("社区工作人员".equals(role))
params.put("gongzuorenyuanId",request.getSession().getAttribute("userId"));
else if("家属".equals(role))
params.put("jiashuId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
params.put("jiankangdanganDeleteStart",1);params.put("jiankangdanganDeleteEnd",1);
CommonUtil.checkMap(params);
PageUtils page = jiankangdanganService.queryPage(params);
//字典表数据转换
List<JiankangdanganView> list =(List<JiankangdanganView>)page.getList();
for(JiankangdanganView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiankangdanganEntity jiankangdangan = jiankangdanganService.selectById(id);
if(jiankangdangan !=null){
//entity转view
JiankangdanganView view = new JiankangdanganView();
BeanUtils.copyProperties( jiankangdangan , view );//把实体数据重构到view中
//级联表 老人
//级联表
YonghuEntity yonghu = yonghuService.selectById(jiankangdangan.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JiankangdanganEntity jiankangdangan, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,jiankangdangan:{}",this.getClass().getName(),jiankangdangan.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("老人".equals(role))
jiankangdangan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<JiankangdanganEntity> queryWrapper = new EntityWrapper<JiankangdanganEntity>()
.eq("jiankangdangan_name", jiankangdangan.getJiankangdanganName())
.eq("jiankangdangan_types", jiankangdangan.getJiankangdanganTypes())
.eq("yonghu_id", jiankangdangan.getYonghuId())
.eq("jiankangdangan_delete", jiankangdangan.getJiankangdanganDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiankangdanganEntity jiankangdanganEntity = jiankangdanganService.selectOne(queryWrapper);
if(jiankangdanganEntity==null){
jiankangdangan.setJiankangdanganDelete(1);
jiankangdangan.setInsertTime(new Date());
jiankangdangan.setCreateTime(new Date());
jiankangdanganService.insert(jiankangdangan);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiankangdanganEntity jiankangdangan, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,jiankangdangan:{}",this.getClass().getName(),jiankangdangan.toString());
JiankangdanganEntity oldJiankangdanganEntity = jiankangdanganService.selectById(jiankangdangan.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("老人".equals(role))
// jiankangdangan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<JiankangdanganEntity> queryWrapper = new EntityWrapper<JiankangdanganEntity>()
.notIn("id",jiankangdangan.getId())
.andNew()
.eq("jiankangdangan_name", jiankangdangan.getJiankangdanganName())
.eq("jiankangdangan_types", jiankangdangan.getJiankangdanganTypes())
.eq("yonghu_id", jiankangdangan.getYonghuId())
.eq("jiankangdangan_delete", jiankangdangan.getJiankangdanganDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiankangdanganEntity jiankangdanganEntity = jiankangdanganService.selectOne(queryWrapper);
if("".equals(jiankangdangan.getJiankangdanganFile()) || "null".equals(jiankangdangan.getJiankangdanganFile())){
jiankangdangan.setJiankangdanganFile(null);
}
if(jiankangdanganEntity==null){
jiankangdanganService.updateById(jiankangdangan);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<JiankangdanganEntity> oldJiankangdanganList =jiankangdanganService.selectBatchIds(Arrays.asList(ids));//要删除的数据
ArrayList<JiankangdanganEntity> list = new ArrayList<>();
for(Integer id:ids){
JiankangdanganEntity jiankangdanganEntity = new JiankangdanganEntity();
jiankangdanganEntity.setId(id);
jiankangdanganEntity.setJiankangdanganDelete(2);
list.add(jiankangdanganEntity);
}
if(list != null && list.size() >0){
jiankangdanganService.updateBatchById(list);
}
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<JiankangdanganEntity> jiankangdanganList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
JiankangdanganEntity jiankangdanganEntity = new JiankangdanganEntity();
// jiankangdanganEntity.setJiankangdanganName(data.get(0)); //档案标题 要改的
// jiankangdanganEntity.setJiankangdanganTypes(Integer.valueOf(data.get(0))); //档案类型 要改的
// jiankangdanganEntity.setJiankangdanganFile(data.get(0)); //档案下载 要改的
// jiankangdanganEntity.setYonghuId(Integer.valueOf(data.get(0))); //老人 要改的
// jiankangdanganEntity.setJiankangdanganContent("");//详情和图片
// jiankangdanganEntity.setJiankangdanganDelete(1);//逻辑删除字段
// jiankangdanganEntity.setInsertTime(date);//时间
// jiankangdanganEntity.setCreateTime(date);//时间
jiankangdanganList.add(jiankangdanganEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
jiankangdanganService.insertBatch(jiankangdanganList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
PageUtils page = jiankangdanganService.queryPage(params);
//字典表数据转换
List<JiankangdanganView> list =(List<JiankangdanganView>)page.getList();
for(JiankangdanganView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiankangdanganEntity jiankangdangan = jiankangdanganService.selectById(id);
if(jiankangdangan !=null){
//entity转view
JiankangdanganView view = new JiankangdanganView();
BeanUtils.copyProperties( jiankangdangan , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(jiankangdangan.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiankangdanganEntity jiankangdangan, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,jiankangdangan:{}",this.getClass().getName(),jiankangdangan.toString());
Wrapper<JiankangdanganEntity> queryWrapper = new EntityWrapper<JiankangdanganEntity>()
.eq("jiankangdangan_name", jiankangdangan.getJiankangdanganName())
.eq("jiankangdangan_types", jiankangdangan.getJiankangdanganTypes())
.eq("yonghu_id", jiankangdangan.getYonghuId())
.eq("jiankangdangan_delete", jiankangdangan.getJiankangdanganDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiankangdanganEntity jiankangdanganEntity = jiankangdanganService.selectOne(queryWrapper);
if(jiankangdanganEntity==null){
jiankangdangan.setJiankangdanganDelete(1);
jiankangdangan.setInsertTime(new Date());
jiankangdangan.setCreateTime(new Date());
jiankangdanganService.insert(jiankangdangan);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
@RestController
@Controller
@RequestMapping("/daibanshiyi")
public class DaibanshiyiController {
private static final Logger logger = LoggerFactory.getLogger(DaibanshiyiController.class);
private static final String TABLE_NAME = "daibanshiyi";
@Autowired
private DaibanshiyiService daibanshiyiService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private GongzuorenyuanService gongzuorenyuanService;
@Autowired
private JiashuService jiashuService;
@Autowired
private YishengService yishengService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("老人".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("社区工作人员".equals(role))
params.put("gongzuorenyuanId",request.getSession().getAttribute("userId"));
else if("家属".equals(role))
params.put("jiashuId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
params.put("daibanshiyiDeleteStart",1);params.put("daibanshiyiDeleteEnd",1);
CommonUtil.checkMap(params);
PageUtils page = daibanshiyiService.queryPage(params);
//字典表数据转换
List<DaibanshiyiView> list =(List<DaibanshiyiView>)page.getList();
for(DaibanshiyiView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
DaibanshiyiEntity daibanshiyi = daibanshiyiService.selectById(id);
if(daibanshiyi !=null){
//entity转view
DaibanshiyiView view = new DaibanshiyiView();
BeanUtils.copyProperties( daibanshiyi , view );//把实体数据重构到view中
//级联表 社区工作人员
//级联表
GongzuorenyuanEntity gongzuorenyuan = gongzuorenyuanService.selectById(daibanshiyi.getGongzuorenyuanId());
if(gongzuorenyuan != null){
BeanUtils.copyProperties( gongzuorenyuan , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "gongzuorenyuanId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setGongzuorenyuanId(gongzuorenyuan.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody DaibanshiyiEntity daibanshiyi, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,daibanshiyi:{}",this.getClass().getName(),daibanshiyi.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("社区工作人员".equals(role))
daibanshiyi.setGongzuorenyuanId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<DaibanshiyiEntity> queryWrapper = new EntityWrapper<DaibanshiyiEntity>()
.eq("daibanshiyi_name", daibanshiyi.getDaibanshiyiName())
.eq("daibanshiyi_types", daibanshiyi.getDaibanshiyiTypes())
.eq("gongzuorenyuan_id", daibanshiyi.getGongzuorenyuanId())
.eq("daibanshiyi_delete", daibanshiyi.getDaibanshiyiDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaibanshiyiEntity daibanshiyiEntity = daibanshiyiService.selectOne(queryWrapper);
if(daibanshiyiEntity==null){
daibanshiyi.setDaibanshiyiDelete(1);
daibanshiyi.setInsertTime(new Date());
daibanshiyi.setCreateTime(new Date());
daibanshiyiService.insert(daibanshiyi);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody DaibanshiyiEntity daibanshiyi, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,daibanshiyi:{}",this.getClass().getName(),daibanshiyi.toString());
DaibanshiyiEntity oldDaibanshiyiEntity = daibanshiyiService.selectById(daibanshiyi.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("社区工作人员".equals(role))
// daibanshiyi.setGongzuorenyuanId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<DaibanshiyiEntity> queryWrapper = new EntityWrapper<DaibanshiyiEntity>()
.notIn("id",daibanshiyi.getId())
.andNew()
.eq("daibanshiyi_name", daibanshiyi.getDaibanshiyiName())
.eq("daibanshiyi_types", daibanshiyi.getDaibanshiyiTypes())
.eq("gongzuorenyuan_id", daibanshiyi.getGongzuorenyuanId())
.eq("daibanshiyi_delete", daibanshiyi.getDaibanshiyiDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaibanshiyiEntity daibanshiyiEntity = daibanshiyiService.selectOne(queryWrapper);
if("".equals(daibanshiyi.getDaibanshiyiPhoto()) || "null".equals(daibanshiyi.getDaibanshiyiPhoto())){
daibanshiyi.setDaibanshiyiPhoto(null);
}
if(daibanshiyiEntity==null){
daibanshiyiService.updateById(daibanshiyi);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<DaibanshiyiEntity> oldDaibanshiyiList =daibanshiyiService.selectBatchIds(Arrays.asList(ids));//要删除的数据
ArrayList<DaibanshiyiEntity> list = new ArrayList<>();
for(Integer id:ids){
DaibanshiyiEntity daibanshiyiEntity = new DaibanshiyiEntity();
daibanshiyiEntity.setId(id);
daibanshiyiEntity.setDaibanshiyiDelete(2);
list.add(daibanshiyiEntity);
}
if(list != null && list.size() >0){
daibanshiyiService.updateBatchById(list);
}
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<DaibanshiyiEntity> daibanshiyiList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
DaibanshiyiEntity daibanshiyiEntity = new DaibanshiyiEntity();
// daibanshiyiEntity.setDaibanshiyiName(data.get(0)); //事宜标题 要改的
// daibanshiyiEntity.setDaibanshiyiTypes(Integer.valueOf(data.get(0))); //事宜类型 要改的
// daibanshiyiEntity.setGongzuorenyuanId(Integer.valueOf(data.get(0))); //工作人员 要改的
// daibanshiyiEntity.setDaibanshiyiPhoto("");//详情和图片
// daibanshiyiEntity.setDaibanshiyiContent("");//详情和图片
// daibanshiyiEntity.setDaibanshiyiDelete(1);//逻辑删除字段
// daibanshiyiEntity.setInsertTime(date);//时间
// daibanshiyiEntity.setCreateTime(date);//时间
daibanshiyiList.add(daibanshiyiEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
daibanshiyiService.insertBatch(daibanshiyiList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
PageUtils page = daibanshiyiService.queryPage(params);
//字典表数据转换
List<DaibanshiyiView> list =(List<DaibanshiyiView>)page.getList();
for(DaibanshiyiView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
DaibanshiyiEntity daibanshiyi = daibanshiyiService.selectById(id);
if(daibanshiyi !=null){
//entity转view
DaibanshiyiView view = new DaibanshiyiView();
BeanUtils.copyProperties( daibanshiyi , view );//把实体数据重构到view中
//级联表
GongzuorenyuanEntity gongzuorenyuan = gongzuorenyuanService.selectById(daibanshiyi.getGongzuorenyuanId());
if(gongzuorenyuan != null){
BeanUtils.copyProperties( gongzuorenyuan , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setGongzuorenyuanId(gongzuorenyuan.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody DaibanshiyiEntity daibanshiyi, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,daibanshiyi:{}",this.getClass().getName(),daibanshiyi.toString());
Wrapper<DaibanshiyiEntity> queryWrapper = new EntityWrapper<DaibanshiyiEntity>()
.eq("daibanshiyi_name", daibanshiyi.getDaibanshiyiName())
.eq("daibanshiyi_types", daibanshiyi.getDaibanshiyiTypes())
.eq("gongzuorenyuan_id", daibanshiyi.getGongzuorenyuanId())
.eq("daibanshiyi_delete", daibanshiyi.getDaibanshiyiDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaibanshiyiEntity daibanshiyiEntity = daibanshiyiService.selectOne(queryWrapper);
if(daibanshiyiEntity==null){
daibanshiyi.setDaibanshiyiDelete(1);
daibanshiyi.setInsertTime(new Date());
daibanshiyi.setCreateTime(new Date());
daibanshiyiService.insert(daibanshiyi);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
五、论文参考
- 计算机毕业设计选题推荐-养老院管理系统-论文参考:
六、系统视频
- 养老院管理系统-项目视频:
计算机毕业设计选题推荐-养老院管理系统-项目实战
结语
计算机毕业设计选题推荐-养老院管理系统-Java/Python项目实战
大家可以帮忙点赞、收藏、关注、评论啦~
源码获取:⬇⬇⬇