养老院管理系统基于springboot的养老院管理系统java项目

文章目录

  • 养老院管理系统
    • 一、项目演示
    • 二、项目介绍
    • 三、系统部分功能截图
    • 四、部分代码展示
    • 五、底部获取项目源码(9.9¥带走)

养老院管理系统

一、项目演示

养老院管理系统

二、项目介绍

基于springboot的养老院管理系统

角色:超级管理员、管理员和用户

超级/管理员:管理员账号,用户账号管理、健康档案,病例档案,药品管理、每月餐饮,外出报备、入住登记,寝室分配、事故记录,访客记录、入住费用,护理费用

用户:个人信息、家人情况查看、每日餐饮、外出报备、入驻费用、护理费用

语言:java
后端框架:springboot、mybatis
前端技术:layui、html、css、JavaScript、JQuery
数据库:MySQL

三、系统部分功能截图

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

四、部分代码展示

package com.sm.graduation.root.controller;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sm.graduation.accident.pojo.AccidentRecord;
import com.sm.graduation.accident.service.AccidentRecordService;
import com.sm.graduation.admin.pojo.AdminInfo;
import com.sm.graduation.admin.service.AdminInfoService;
import com.sm.graduation.checkin.pojo.CheckIn;
import com.sm.graduation.checkin.service.CheckInService;
import com.sm.graduation.common.loginpojo.LoginPojo;
import com.sm.graduation.common.result.AjaxResult;
import com.sm.graduation.dormitory.pojo.DormitoryAllocation;
import com.sm.graduation.dormitory.service.DormitoryAllocationService;
import com.sm.graduation.food.pojo.MonthlyCatering;
import com.sm.graduation.food.service.MonthlyCateringService;
import com.sm.graduation.health.pojo.HealthRecords;
import com.sm.graduation.health.service.HealthRecordsService;
import com.sm.graduation.high.pojo.HighRisk;
import com.sm.graduation.high.service.HighRiskService;
import com.sm.graduation.medication.pojo.Medication;
import com.sm.graduation.medication.service.MedicationService;
import com.sm.graduation.nurse.pojo.Nursing;
import com.sm.graduation.nurse.service.NursingService;
import com.sm.graduation.older.pojo.OlderInfo;
import com.sm.graduation.older.service.OlderInfoService;
import com.sm.graduation.out.pojo.GoOut;
import com.sm.graduation.out.service.GoOutService;
import com.sm.graduation.usr.pojo.UsrInfo;
import com.sm.graduation.usr.service.UsrInfoService;
import com.sm.graduation.visitor.pojo.Visitor;
import com.sm.graduation.visitor.service.VisitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.sm.graduation.root.pojo.RootInfo;
import com.sm.graduation.root.service.RootInfoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.sm.graduation.common.result.AjaxResult.*;

@SuppressWarnings("all")
@RestController
@RequestMapping("/root")
public class RootInfoController {

    @Autowired
    private RootInfoService rootInfoService;

    @Autowired
    private AdminInfoService adminInfoService;

    @Autowired
    private UsrInfoService usrInfoService;

    @Autowired
    private HealthRecordsService healthRecordsService;

    @Autowired
    private HighRiskService highRiskService;

    @Autowired
    private MedicationService medicationService;

    @Autowired
    private MonthlyCateringService monthlyCateringService;

    @Autowired
    private GoOutService goOutService;

    @Autowired
    private OlderInfoService olderInfoService;

    @Autowired
    private DormitoryAllocationService dormitoryAllocationService;

    @Autowired
    private AccidentRecordService accidentRecordService;

    @Autowired
    private VisitorService visitorService;

    @Autowired
    private CheckInService checkInService;

    @Autowired
    private NursingService nursingService;

    private String olderName;



    private boolean login;
    /** 登录验证 */
    @RequestMapping("/loginIn")
    public AjaxResult loginIn(HttpServletRequest request, HttpSession session, String username,
                              LoginPojo loginPojo, RootInfo rootInfo,AdminInfo adminInfo, UsrInfo usrInfo){


        if (loginPojo.getCaptcha().equalsIgnoreCase(String.valueOf(request.getSession().getAttribute("captCode")))) {
            //超管登录
            if (0 == loginPojo.getPower()){
                rootInfo.setName(loginPojo.getUsername());
                rootInfo.setPwd(loginPojo.getPassword());
                RootInfo root = rootInfoService.sltName(rootInfo);
                if (root == null){
                    return AjaxResult.error("登录名不存在");
                }
                login = rootInfoService.loginIn(rootInfo);
                if (login) {
                    session.setAttribute("username",root.getNickName());
                    session.setAttribute("power",root.getPower());
                    session.setAttribute("root",root);
                    return AjaxResult.success(0,"登录成功");
                } else return AjaxResult.error("登录名或密码错误");
            }

            //管理员登录
            if (1 == loginPojo.getPower()){
                adminInfo.setAdminLogin(loginPojo.getUsername());
                adminInfo.setAdminPwd(loginPojo.getPassword());
                AdminInfo admin = adminInfoService.sltName(adminInfo);
                if (admin == null){
                    return AjaxResult.error("登录名不存在");
                }
                login = adminInfoService.loginIn(adminInfo);
                if (login) {
                    session.setAttribute("username",admin.getAdminName());
                    session.setAttribute("power",admin.getPower());
                    session.setAttribute("admin",admin);
                    return AjaxResult.success(1,"登录成功");
                } else return AjaxResult.error("登录名或密码错误");
            }

            //用户登录
            if (2 == loginPojo.getPower()){
                usrInfo.setUsrLogin(loginPojo.getUsername());
                usrInfo.setUsrPwd(loginPojo.getPassword());
                UsrInfo usr = usrInfoService.sltName(usrInfo);
                if (usr == null){
                    return AjaxResult.error("登录名不存在");
                }
                login = usrInfoService.loginIn(usrInfo);
                if (login) {
                    String olderName = usr.getOlderName();
                    HealthRecords older = healthRecordsService.older_dorm(olderName);
                    this.olderName = older.getName();
                    session.setAttribute("username",usr.getUsrName());
                    session.setAttribute("power",usr.getUsrPwd());
                    session.setAttribute("usr",usr);
                    session.setAttribute("older",older);
                    return AjaxResult.success(2,"登录成功");
                } else return AjaxResult.error("登录名或密码错误");
            }

        }
            return AjaxResult.error("验证码错误");

    }


    /** admin  ---  List */
    @RequestMapping("/adminList")
    public AjaxResult adminList(@RequestParam(defaultValue = "1" , value = "page") Integer pageNum,
                                @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                                @RequestParam(defaultValue = ""  , value = "adminName") String user
                                ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (user == null || user.equals("")) {
            map.put("user","");
            List<AdminInfo> admins = adminInfoService.listAll(map);
            PageInfo<AdminInfo> page = new PageInfo<>(admins);
            return successData(page.getTotal(), admins);
        }
            map.put("user",user);
            List<AdminInfo> admins = adminInfoService.listAll(map);
            PageInfo<AdminInfo> page = new PageInfo<>(admins);
            return successData(page.getTotal(), admins);
    }


    /** usr --- List */
    @RequestMapping("/userList")
    public AjaxResult userList(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                               @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                               @RequestParam(defaultValue = "" , value = "usrName") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<UsrInfo> usrInfos = usrInfoService.listAll(map);
            PageInfo<UsrInfo> page = new PageInfo<>(usrInfos);
            return successData(page.getTotal(), usrInfos);
        }
        map.put("usr",usr);
        List<UsrInfo> usrInfos = usrInfoService.listAll(map);
        PageInfo<UsrInfo> page = new PageInfo<>(usrInfos);
        return successData(page.getTotal(), usrInfos);
    }


    /** 健康档案 */
    @RequestMapping("/healthRisk")
    public AjaxResult healthRisk(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                                 @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                                 @RequestParam(defaultValue = "" , value = "olderName") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<HealthRecords> healthRecords = healthRecordsService.listAll(map);
            PageInfo<HealthRecords> page = new PageInfo<>(healthRecords);
            return successData(page.getTotal(), healthRecords);
        }
        map.put("usr",usr);
        List<HealthRecords> healthRecords = healthRecordsService.listAll(map);
        PageInfo<HealthRecords> page = new PageInfo<>(healthRecords);
        return successData(page.getTotal(), healthRecords);
    }


    /** 高危存档 */
    @RequestMapping("/highRisk")
    public AjaxResult highRisk(@RequestParam(defaultValue = "1",  value = "page") Integer pageNum,
                               @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                               @RequestParam(defaultValue = ""  , value = "olderName") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<HighRisk> highRisks = highRiskService.listAll(map);
            PageInfo<HighRisk> page = new PageInfo<>(highRisks);
            return successData(page.getTotal(), highRisks);
        }
        map.put("usr",usr);
        List<HighRisk> highRisks = highRiskService.listAll(map);
        PageInfo<HighRisk> page = new PageInfo<>(highRisks);
        return successData(page.getTotal(), highRisks);
    }


    /** 药品管理 */
    @RequestMapping("/medication")
    public AjaxResult medication(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                                 @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                                 @RequestParam(defaultValue = "" , value = "medication") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<Medication> medications = medicationService.listAll(map);
            PageInfo<Medication> page = new PageInfo<>(medications);
            return successData(page.getTotal(), medications);
        }
        map.put("usr",usr);
        List<Medication> medications = medicationService.listAll(map);
        PageInfo<Medication> page = new PageInfo<>(medications);
        return successData(page.getTotal(), medications);
    }


    /** 每月餐饮 */
    @RequestMapping("/catering")
    public AjaxResult catering(@RequestParam(defaultValue = "1",  value = "page") Integer pageNum,
                               @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                               @RequestParam(defaultValue = ""  , value = "monTime") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<MonthlyCatering> monthlyCaterings = monthlyCateringService.listAll(map);
            PageInfo<MonthlyCatering> page = new PageInfo<>(monthlyCaterings);
            return successData(page.getTotal(), monthlyCaterings);
        }
        map.put("usr",usr);
        List<MonthlyCatering> monthlyCaterings = monthlyCateringService.listAll(map);
        PageInfo<MonthlyCatering> page = new PageInfo<>(monthlyCaterings);
        return successData(page.getTotal(), monthlyCaterings);
    }


    /** 外出报备 */
    @RequestMapping("/goOut")
    public AjaxResult goOut(@RequestParam(defaultValue = "1",  value = "page") Integer pageNum,
                            @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                            @RequestParam(defaultValue = ""  , value = "olderName") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<GoOut> goOuts = goOutService.listAll(map);
            PageInfo<GoOut> page = new PageInfo<>(goOuts);
            return successData(page.getTotal(), goOuts);
        }
        map.put("usr",usr);
        List<GoOut> goOuts = goOutService.listAll(map);
        PageInfo<GoOut> page = new PageInfo<>(goOuts);
        return successData(page.getTotal(), goOuts);
    }

    @RequestMapping("/goOutUsr")
    public AjaxResult goOutUsr(@RequestParam(defaultValue = "1",  value = "page") Integer pageNum,
                            @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                            @RequestParam(defaultValue = ""  , value = "olderName") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("olderName",olderName);
            List<GoOut> goOuts = goOutService.go_listAll(map);
            PageInfo<GoOut> page = new PageInfo<>(goOuts);
            return successData(page.getTotal(), goOuts);
        }
        map.put("usr",usr);
        List<GoOut> goOuts = goOutService.listAll(map);
        PageInfo<GoOut> page = new PageInfo<>(goOuts);
        return successData(page.getTotal(), goOuts);
    }


    /** 入住登记 */
    @RequestMapping("/register")
    public AjaxResult register(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                               @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                               @RequestParam(defaultValue = ""  , value = "olderName") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<OlderInfo> olderInfos = olderInfoService.listAll(map);
            PageInfo<OlderInfo> page = new PageInfo<>(olderInfos);
            return successData(page.getTotal(), olderInfos);
        }
        map.put("usr",usr);
        List<OlderInfo> olderInfos = olderInfoService.listAll(map);
        PageInfo<OlderInfo> page = new PageInfo<>(olderInfos);
        return successData(page.getTotal(), olderInfos);
    }


    /** 寝室分配 */
    @RequestMapping("/dormitory")
    public AjaxResult dormitory(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                                @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                                @RequestParam(defaultValue = ""  , value = "dormitory") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<DormitoryAllocation> dormitoryAllocations = dormitoryAllocationService.listAll(map);
            PageInfo<DormitoryAllocation> page = new PageInfo<>(dormitoryAllocations);
            return successData(page.getTotal(), dormitoryAllocations);
        }
        map.put("usr",usr);
        List<DormitoryAllocation> dormitoryAllocations = dormitoryAllocationService.listAll(map);
        PageInfo<DormitoryAllocation> page = new PageInfo<>(dormitoryAllocations);
        return successData(page.getTotal(), dormitoryAllocations);
    }

    /** 事故记录 */
    @RequestMapping("/accident")
    public AjaxResult accident(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                               @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                               @RequestParam(defaultValue = ""  , value = "accTime") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<AccidentRecord> accidentRecords = accidentRecordService.listAll(map);
            PageInfo<AccidentRecord> page = new PageInfo<>(accidentRecords);
            return successData(page.getTotal(), accidentRecords);
        }
        map.put("usr",usr);
        List<AccidentRecord> accidentRecords = accidentRecordService.listAll(map);
        PageInfo<AccidentRecord> page = new PageInfo<>(accidentRecords);
        return successData(page.getTotal(), accidentRecords);
    }

    /** 访客记录 */
    @RequestMapping("/visitor")
    public AjaxResult visitor(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                              @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                              @RequestParam(defaultValue = ""  , value = "name") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<Visitor> visitors = visitorService.listAll(map);
            PageInfo<Visitor> page = new PageInfo<>(visitors);
            return successData(page.getTotal(), visitors);
        }
        map.put("usr",usr);
        List<Visitor> visitors = visitorService.listAll(map);
        PageInfo<Visitor> page = new PageInfo<>(visitors);
        return successData(page.getTotal(), visitors);
    }
    /** 入住费用 */
    @RequestMapping("/checkIn")
    public AjaxResult checkIn(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                              @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                              @RequestParam(defaultValue = ""  , value = "year") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<CheckIn> checkIns = checkInService.listAll(map);
            PageInfo<CheckIn> page = new PageInfo<>(checkIns);
            return successData(page.getTotal(), checkIns);
        }
        map.put("usr",usr);
        List<CheckIn> checkIns = checkInService.listAll(map);
        PageInfo<CheckIn> page = new PageInfo<>(checkIns);
        return successData(page.getTotal(), checkIns);
    }
    /** 护理费用 */
    @RequestMapping("/nursing")
    public AjaxResult nursing(@RequestParam(defaultValue = "1", value = "page") Integer pageNum,
                              @RequestParam(defaultValue = "10", value = "limit") Integer pageSize,
                              @RequestParam(defaultValue = ""  , value = "nurseRank") String usr
    ){
        HashMap<String, Object> map = new HashMap<>();
        PageHelper.startPage(pageNum,pageSize);
        if (usr == null || usr.equals("")) {
            map.put("usr","");
            List<Nursing> nursings = nursingService.listAll(map);
            PageInfo<Nursing> page = new PageInfo<>(nursings);
            return successData(page.getTotal(), nursings);
        }
        map.put("usr",usr);
        List<Nursing> nursings = nursingService.listAll(map);
        PageInfo<Nursing> page = new PageInfo<>(nursings);
        return successData(page.getTotal(), nursings);
    }



    //==============添加功能=================

    /** 添加管理员 */
    @RequestMapping("/addAdmin")
    public AjaxResult addAmin(AdminInfo adminInfo){
        int insert = adminInfoService.insert(adminInfo);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }

    /** 添加用户 */
    @RequestMapping("/addUsr")
    public AjaxResult addUsr(UsrInfo usrInfo){
        UsrInfo results = usrInfoService.sltName(usrInfo);
        if (results != null){
            return error("添加失败,登录名已被注册");
        }
        int insert = usrInfoService.insert(usrInfo);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }


    @RequestMapping("/addHealth")
    public AjaxResult addHealth(HealthRecords healthRecords){
        System.out.println(healthRecords);
        int insert = healthRecordsService.insert(healthRecords);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }

    @RequestMapping("/addHigh")
    public AjaxResult addHigh(HighRisk highRisk){
        System.out.println(highRisk);
        int insert = highRiskService.insert(highRisk);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }

    @RequestMapping("/addMedication")
    public AjaxResult addMedication(Medication medication){
        System.out.println(medication);
        int insert = medicationService.insert(medication);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }


    @RequestMapping("/addMon")
    public AjaxResult addMon(MonthlyCatering monthlyCatering){
        System.out.println(monthlyCatering);
        int insert = monthlyCateringService.insert(monthlyCatering);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }


    @RequestMapping("/addOut")
    public AjaxResult addOut(GoOut goOut){
        System.out.println(goOut);
        int insert = goOutService.insert(goOut);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }


    @RequestMapping("/addOlder")
    public AjaxResult addOlder(OlderInfo olderInfo){
        System.out.println(olderInfo);
        int insert = olderInfoService.insert(olderInfo);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }


    @RequestMapping("/addDorm")
    public AjaxResult addDorm(DormitoryAllocation dormitoryAllocation){
        System.out.println(dormitoryAllocation);
        int insert = dormitoryAllocationService.insert(dormitoryAllocation);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }

    @RequestMapping("/addAcc")
    public AjaxResult addAcc(AccidentRecord accidentRecord){
        System.out.println(accidentRecord);
        int insert = accidentRecordService.insert(accidentRecord);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }

    @RequestMapping("/addVis")
    public AjaxResult addVis(Visitor visitor){
        System.out.println(visitor);
        int insert = visitorService.insert(visitor);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }

    @RequestMapping("/addCheck")
    public AjaxResult addCheck(CheckIn checkIn){
        System.out.println(checkIn);
        int insert = checkInService.insert(checkIn);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }

    @RequestMapping("/addNurs")
    public AjaxResult addNurs(Nursing nursing){
        System.out.println(nursing);
        int insert = nursingService.insert(nursing);
        if (1 == insert){
            return success("添加成功");
        }
        return error("添加失败");
    }




    //==============修改功能=================

    /** 修改管理员 */
    @RequestMapping("/modifyAdmin")
    public AjaxResult modifyAmin(AdminInfo adminInfo){
        int update = adminInfoService.update(adminInfo);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyUsr")
    public AjaxResult modifyUsr(UsrInfo usrInfo){
        int update = usrInfoService.update(usrInfo);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyHealth")
    public AjaxResult modifyHealth(HealthRecords healthRecords){
        System.out.println(healthRecords);
        int update = healthRecordsService.update(healthRecords);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }


    @RequestMapping("/modifyHigh")
    public AjaxResult modifyHigh(HighRisk highRisk){
        System.out.println(highRisk);
        int update = highRiskService.update(highRisk);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }


    @RequestMapping("/modifyMedication")
    public AjaxResult modifyMedication(Medication medication){
        System.out.println(medication);
        int update = medicationService.update(medication);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyMon")
    public AjaxResult modifyMon(MonthlyCatering monthlyCatering){
        System.out.println(monthlyCatering);
        int update = monthlyCateringService.update(monthlyCatering);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyOut")
    public AjaxResult modifyOut(GoOut goOut){
        System.out.println(goOut);
        int update = goOutService.update(goOut);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyOlder")
    public AjaxResult modifyOlder(OlderInfo olderInfo){
        int update = olderInfoService.update(olderInfo);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyDorm")
    public AjaxResult modifyDorm(DormitoryAllocation dormitoryAllocation){
        int update = dormitoryAllocationService.update(dormitoryAllocation);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyAcc")
    public AjaxResult modifyAcc(AccidentRecord accidentRecord){
        int update = accidentRecordService.update(accidentRecord);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyVis")
    public AjaxResult modifyVis(Visitor visitor){
        int update = visitorService.update(visitor);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyCheck")
    public AjaxResult modifyCheck(CheckIn checkIn){
        int update = checkInService.update(checkIn);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }

    @RequestMapping("/modifyNurs")
    public AjaxResult modifyNurs(Nursing nursing){
        int update = nursingService.update(nursing);
        if (1 == update){
            return success("修改成功");
        }
        return error("修改失败");
    }




    //==============删除功能=================


    /** 删除管理员 */
    @RequestMapping("/delAdmin")
    public AjaxResult delAdmin(Integer adminId){
        adminInfoService.delAdmin(adminId);
        return success("删除成功");
    }
    /** 批量删除管理员 */
    @RequestMapping("/batchDelAdmin")
    public AjaxResult batchDel(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    adminInfoService.delAdmin(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }

    /** 删除用户 */
    @RequestMapping("/delUsr")
    public AjaxResult delUsr(Integer usrId){
        usrInfoService.delete(usrId);
        return success("删除成功");
    }
    /** 批量删除用户 */
    @RequestMapping("/batchDelUsr")
    public AjaxResult batchDelUsr(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    usrInfoService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }


    @RequestMapping("/delHealth")
    public AjaxResult delHealth(Integer id){
        healthRecordsService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelHealth")
    public AjaxResult batchDelHealth(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    healthRecordsService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }

    @RequestMapping("/delHigh")
    public AjaxResult delHigh(Integer id){
        highRiskService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelHigh")
    public AjaxResult batchDelHigh(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    highRiskService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }

    @RequestMapping("/delMedication")
    public AjaxResult delMedication(Integer id){
        medicationService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelMedication")
    public AjaxResult batchDelMedication(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    medicationService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }


    @RequestMapping("/delMon")
    public AjaxResult delMon(Integer id){
        monthlyCateringService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelMon")
    public AjaxResult batchDelMon(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    monthlyCateringService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }

    @RequestMapping("/delOut")
    public AjaxResult delOut(Integer id){
        goOutService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelOut")
    public AjaxResult batchDelOut(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    goOutService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }


    @RequestMapping("/delOlder")
    public AjaxResult delOlder(@RequestParam(value = "olderId") Integer id){
        olderInfoService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelOlder")
    public AjaxResult batchDelOlder(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    olderInfoService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }

    @RequestMapping("/delDorm")
    public AjaxResult delDorm(@RequestParam(value = "id") Integer id){
        dormitoryAllocationService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelDorm")
    public AjaxResult batchDelDorm(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    dormitoryAllocationService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }


    @RequestMapping("/delAcc")
    public AjaxResult delAcc(@RequestParam(value = "id") Integer id){
        accidentRecordService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelAcc")
    public AjaxResult batchDelAcc(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    accidentRecordService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }


    @RequestMapping("/delVis")
    public AjaxResult delVis(@RequestParam(value = "id") Integer id){
        visitorService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelVis")
    public AjaxResult batchDelVis(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    visitorService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }

    @RequestMapping("/delCheck")
    public AjaxResult delCheck(@RequestParam(value = "id") Integer id){
        checkInService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelCheck")
    public AjaxResult batchDelCheck(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    checkInService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }

    @RequestMapping("/delNurs")
    public AjaxResult delNurs(@RequestParam(value = "id") Integer id){
        nursingService.delete(id);
        return success("删除成功");
    }

    @RequestMapping("/batchDelNurs")
    public AjaxResult batchDelNurs(String listStr){
        if (null != listStr && !"".equals(listStr)){
            String[] ids = listStr.split(",");
            for (String id:ids) {
                if (null != id && !"".equals(id)) {
                    System.out.println(id);
                    nursingService.delete(Integer.valueOf(id));
                }
            }
        }
        return success("删除成功");
    }




    /** root 修改密码 */
    @RequestMapping("/altPwd")
    public AjaxResult altPwd(String pwd,String rpwd) {
        if(!pwd.equals(rpwd)) return error( "两次密码不一致");

        if (pwd != null && !pwd.equals("")) {
            int i = rootInfoService.altPwd(pwd);
            if (i != 0) {
                return success(0, "修改成功");
            }
        }
        return error("密码不允许为空");
    }

    @RequestMapping("/adminAltPwd")
    public AjaxResult adminAltPwd(String pwd,String rpwd,Map map,HttpServletRequest request) {
        if(!pwd.equals(rpwd)) return error( "两次密码不一致");

        if (pwd != null && !pwd.equals("")) {
            AdminInfo admin= (AdminInfo) request.getSession().getAttribute("admin");
            Long id = admin.getAdminId();
            map.put("pwd",pwd);
            map.put("id",id);
            int i = adminInfoService.altPwd(map);
            if (i != 0) {
                return success(0, "修改成功");
            }
        }
        return error("密码不允许为空");
    }

    @RequestMapping("/usrAltPwd")
    public AjaxResult usrAltPwd(String pwd,String rpwd,Map map,HttpServletRequest request) {
        if(!pwd.equals(rpwd)) return error( "两次密码不一致");

        if (pwd != null && !pwd.equals("")) {
            UsrInfo usr = (UsrInfo) request.getSession().getAttribute("usr");
            Long id = usr.getUsrId();
            map.put("pwd",pwd);
            map.put("id",id);
            int i = usrInfoService.altPwd(map);
            if (i != 0) {
                return success(0, "修改成功");
            }
        }
        return error("密码不允许为空");
    }
}

五、底部获取项目源码(9.9¥带走)

有问题,或者需要协助调试运行项目的也可以

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/655924.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Python代码:十七、生成列表

1、题目 描述&#xff1a; 一串连续的数据用什么记录最合适&#xff0c;牛牛认为在Python中非列表&#xff08;list&#xff09;莫属了。现输入牛牛朋友们的名字&#xff0c;请使用list函数与split函数将它们封装成列表&#xff0c;再整个输出列表。 输入描述&#xff1a; …

011-Linux磁盘管理

文章目录 前言 一、du&#xff1a;查看文件和目录占用的磁盘空间 二、df&#xff1a;查看文件系统的整体磁盘使用情况 三、lsblk&#xff1a;查看设备挂载情况 四、fdisk&#xff1a;磁盘分区 4.1、查看磁盘分区列表 4.2、磁盘分区 4.2.1、交互命令的功能 4.2.2、对/d…

详细分析Element中的Drawer(附Demo)

目录 前言1. 基本知识2. Demo2.1 基本用法2.2 不同方向2.3 自定义大小2.4 嵌入表单2.5 嵌套抽屉 3. 实战4. Element Plus&#xff08;Drawer&#xff09; 前言 对于该组件针对Vue2比较多&#xff0c;而Element Plus中的Drawer针对Vue3比较多 此处的Demo主要偏向Vue2 后续的El…

【学习笔记】计算机组成原理(七)

指令系统 文章目录 指令系统7.1 机器指令7.1.1 指令的一般格式7.1.2 指令字长 7.2 操作数类型和操作类型7.2.1 操作数类型7.2.2 数据在存储器中的存放方式7.2.3 操作类型 7.3 寻址方式7.3.1 指令寻址7.3.1.1 顺序寻址7.3.1.2 跳跃寻址 7.3.2 数据寻址7.3.2.1 立即寻址7.3.2.2 直…

【数据结构与算法】七大排序算法(上)

【数据结构与算法】七大排序算法(上) &#x1f955;个人主页&#xff1a;开敲&#x1f349; &#x1f525;所属专栏&#xff1a;数据结构与算法&#x1f345; &#x1f33c;文章目录&#x1f33c; 1. 排序的概念及应用 1.1 排序的概念 1.2 排序的应用 1.3 常见排序算法 2. 常…

Spring MVC+mybatis 项目入门:旅游网(二) dispatcher与controller与Spring MVC

个人博客&#xff1a;Spring MVCmybatis 项目入门:旅游网&#xff08;二&#xff09;dispatcher与controller与Spring MVC | iwtss blog 先看这个&#xff01; 这是18年的文章&#xff0c;回收站里恢复的&#xff0c;现阶段看基本是没有参考意义的&#xff0c;技术老旧脱离时代…

中国上市企业行业异质性数据分析

数据简介&#xff1a;企业行业异质性数据是指不同行业的企业在运营、管理、财务等方面的差异性数据。这些数据可以反映不同行业企业的特点、优势和劣势&#xff0c;以及行业间的异质性对企业经营和投资的影响。通过对企业行业异质性数据的分析&#xff0c;投资者可以更好地了解…

杀死那个进程

一、场景 eclipse在启动tomcat时&#xff0c;出现端口被占用的情况。我寻思着“任务管理器”没出现相应程序在跑啊。 1.1问题&#xff1a;端口和进程的关系 端口和进程之间存在着一种关系&#xff0c;端口是一个逻辑概念&#xff0c;它用于标识网络通信中的一个终点&#xff0…

基于Java实现震中附近风景区预警可视化分析实践

目录 前言 一、空间数据说明 1、表结构信息展示 2、空间范围查询 二、Java后台开发实现 1、模型层设计与实现 2、控制层设计与实现 三、Leaflet地图开发 1、地震震中位置展示 2、百公里风景区列表展示 3、风景区列表展示 4、附近风景区展示 四、总结 前言 地震这类…

为表格添加背景色:\rowcolor, \columncolor,\cellcolor

设置行的背景 \rowcolor 是 LaTeX 中用于设置表格行的背景色的命令。它可以使表格更加美观和易于阅读。rowcolor 命令通常与 colortbl 宏包一起使用。 语法如下&#xff1a; \rowcolor{<color>}其中 表示要设置的背景色&#xff0c;可以是预定义的颜色名称&#xff08…

C++算术运算和自增自减运算

一 引言 表示运算的符号称为运算符。 算术运算&#xff1b; 比较运算&#xff1b; 逻辑运算&#xff1b; 位运算&#xff1b; 1 算术运算 算术运算包括加、减、乘、除、乘方、指数、对数、三角函数、求余函数&#xff0c;这些都是算术运算。 C中用、-、*、/、%分别表示加、减…

Redis 中 List 数据结构详解

目录 List 用法 1. 增 2. 删 3. 查 内部编码 应用场景 前言 Redis 中的 List 和 Set 数据结构各有特点&#xff0c;适用于不同的应用场景。List 提供了有序的列表结构&#xff0c;适合用于消息队列和任务列表等场景&#xff1b;Set 提供了无序且不重复的集合结构&#…

9.Docker网络

文章目录 1、Docker网络简介2、常用基本命令3、网络模式对比举例3.1、bridge模式3.2、host模式3.3、none模式3.4、container模式3.5、自定义网络 1、Docker网络简介 作用&#xff1a; 容器间的互联和通信以及端口映射容器IP变动时候可以通过服务名直接进行网络通信而不受到影…

module ‘plotting‘ has no attribute ‘EpisodeStats‘

plotting.py 的版本不同&#xff0c;可以使用下列版本 reinforcement-learning/lib/plotting.py at master dennybritz/reinforcement-learning GitHubImplementation of Reinforcement Learning Algorithms. Python, OpenAI Gym, Tensorflow. Exercises and Solutions to a…

机器人运动轨迹学习——GMM/GMR算法

机器人运动轨迹学习——GMM/GMR算法 前置知识 GMM的英文全称为&#xff1a;Gaussian mixture model&#xff0c;即高斯混合模型&#xff0c;也就是说&#xff0c;它是由多个高斯模型进行混合的结果&#xff1a;当然&#xff0c;这里的混合是带有权重概念的。 一维高斯分布 GMM中…

「Python Socket超能力:网络世界的隐形斗篷!」

Hi&#xff0c;我是阿佑&#xff0c;今天将带领大家揭开Python Socket编程的神秘面纱&#xff0c;赋予我们的网络应用隐形斗篷般的超能力&#xff01; 深入探讨Socket编程的革命性力量&#xff0c;教你如何用Python的Socket模块来构建强大的网络应用。从简单的HTTP服务器到复杂…

go语言初识别(五)

本博客内容涉及到&#xff1a;切片 切片 1. 切片的概念 首先先对数组进行一下回顾&#xff1a; 数组定义完&#xff0c;长度是固定的&#xff0c;例如&#xff1a; var num [5]int [5]int{1,2,3,4,5}定义的num数组长度是5&#xff0c;表示只能存储5个整形数字&#xff0c…

【problem】解决EasyExcel导出日期数据显示为#####问题

前言 在使用EasyExcel进行数据导出时&#xff0c;你可能遇到日期或其他数据在Excel中显示为“#######”的情况&#xff0c;这通常是因为列宽不足以展示单元格内的全部内容。本文将指导你如何通过简单的步骤解决这一问题&#xff0c;并确保导出的Excel文件自动调整列宽或直接指…

调整图片和表格尺寸的命令:resizebox

\resizebox 是 LaTeX 中的一个命令&#xff0c;用于调整插入的内容&#xff08;如图像、表格、文本等&#xff09;的大小。它的语法如下&#xff1a; \resizebox{<width>}{<height>}{<content>}其中&#xff1a; <width> 和 <height> 分别表示…

Niantic利用Meta Llama让数字生物栩栩如生

每周跟踪AI热点新闻动向和震撼发展 想要探索生成式人工智能的前沿进展吗&#xff1f;订阅我们的简报&#xff0c;深入解析最新的技术突破、实际应用案例和未来的趋势。与全球数同行一同&#xff0c;从行业内部的深度分析和实用指南中受益。不要错过这个机会&#xff0c;成为AI领…