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

news2024/11/27 7:21:33

文章目录

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

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

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【乐吾乐3D可视化组态编辑器】相机与视角

系统默认的相机为环绕旋转相机&#xff0c;它可以环绕一个中心点做上下左右的旋转&#xff0c;来从不同角度观察场景。当然&#xff0c;您也可以把一些特定角度的信息保存下来&#xff0c;在系统中我们把这个信息称作视角。通过交互中的切换视角动作&#xff0c;您就可以实现把…

【OpenGL手册14】实例化

目录 一、说明 二、实例化 三、实例化数组 四、小行星带 五、完整代码 六、结论 一、说明 实例化渲染&#xff0c;是用少数数据做模板&#xff0c;实现海量物体渲染的手段方法。用实例化渲染&#xff0c;需要对每个实例产生一定描述数据。如何实现&#xff1f;请看本文下…

攻击同学网络,让同学断网

技术介绍&#xff1a;ARP欺骗 ARP欺骗&#xff08;ARP spoofing&#xff09;是一种网络攻击技术&#xff0c;它通过伪造ARP&#xff08;地址解析协议&#xff09;响应包来欺骗目标设备&#xff0c;使其将网络流量发送到攻击者指定的位置。具体操作步骤如下&#xff1a; 攻击者…

你的手机是如何控制你的手表之广播篇

前言 要让手机能够控制手表&#xff0c;第一步当然要让手机能够“看见”手表&#xff0c;人类作为上帝视角&#xff0c;我们是能够通过眼睛直接看见手机和手表的&#xff0c;但要让手机“看见”手表&#xff0c;就需要一端把自己的信息通过电磁波的形式发往空中&#xff0c;另…

ADIL简单测试实例

参考资料&#xff1a;https://blog.csdn.net/geyichongchujianghu/article/details/130045373这个连接是Java的代码&#xff0c;我根据它的链接写了一个kotlin版本的。 AIDL&#xff08;Android Interface Definition Language&#xff09;是Android平台上用于进程间通信&…

redis 主从复制薪火相传 哨兵sentinel配置以及底层原理

薪火相传 我们知道redis的主从复制还有一个常见的架构 ---薪火相传 使用这种结构可以有效减轻master节点的复制数据同步压力 注意这里的6380节点仍然是slave节点 可以理解为一个中间节点,仍然是不可以写只可以读取的 我们只需要使用 slaveof ip port 这里可能访问节点的时候出…

电力电子技术03 (1)---电路稳态分析方法

学习来源&#xff08;只用于个人学习笔记&#xff0c;建议对着老师视频学习理解更深入&#xff09;&#xff1a;2.2稳态分析的基本方法_哔哩哔哩_bilibili 一、Buck降压电路 Buck电路&#xff0c;也称为降压转换器&#xff0c;是一种DC-DC电压转换器&#xff0c;用于将输入电…

7个靠谱的副业赚钱方法,宝妈,上班族,学生党可以做的兼职副业

你是否也曾面临过这样的困境&#xff1a;生活费紧张&#xff0c;想要找份兼职来补贴家用或是满足自己的小心愿&#xff1f;别担心&#xff0c;今天我将带领你踏入这个丰富多彩的兼职世界&#xff0c;助你轻松达成月入过千的小目标&#xff01; 在我漫长的兼职探索旅程中&#…

Java GC问题排查的一些个人总结和问题复盘

个人博客 Java GC问题排查的一些个人总结和问题复盘 | iwts’s blog 是否存在GC问题判断指标 有的比较明显&#xff0c;比如发布上线后内存直接就起飞了&#xff0c;这种也是比较好排查的&#xff0c;也是最多的。如果单纯从优化角度&#xff0c;看当前应用是否需要优化&…

C++的算法:枚举法的原理及应用

在C++编程中,枚举法,又称穷举法或暴力法,是一种非常基础和常见的算法解题方法。它的核心思想在于:通过遍历所有可能的情况,然后逐一检查每个情况是否满足问题的要求,从而找到问题的解决方案。 一、枚举法的原理 枚举法的核心在于穷举和验证。它将问题的所有可能性一一列举…

高铁VR虚拟全景展示提升企业实力和形象

步入VR的神奇世界&#xff0c;感受前所未有的汽车展示体验。VR虚拟现实技术以其独特的沉浸式模拟&#xff0c;让你仿佛置身于真实展厅之中&#xff0c;尽情探索汽车的每一处细节。 一、定制化展示&#xff0c;随心所欲 VR汽车虚拟展厅打破空间束缚&#xff0c;让汽车制造商能够…

官宣|HelpLook现已入驻钉钉应用市场,助力企业知识管理知识

前一阵子OpenAI公司最新的GPT-4o技术震撼发布&#xff0c;人工智能的实际应用前景再次引起行业瞩目&#xff0c;或者被GPT4o的数据分析等特色功能折服。如您正寻求将AI技术融入企业知识管理&#xff0c;不要错过HelpLook&#xff01;HelpLook AI知识库已经正式入驻钉钉应用市场…

go语言初识别(五)

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

轻松拿捏C语言——自定义类型之【结构体】

&#x1f970;欢迎关注 轻松拿捏C语言系列&#xff0c;来和 小哇 一起进步&#xff01;✊ &#x1f389;创作不易&#xff0c;请多多支持&#x1f389; &#x1f308;感谢大家的阅读、点赞、收藏和关注&#x1f495; &#x1f339;如有问题&#xff0c;欢迎指正 1. 结构体类型的…

《当微服务遇上Ribbon:一场负载均衡的华丽舞会》

在微服务的厨房里&#xff0c;如何确保每一道服务都恰到好处&#xff1f;揭秘Spring Cloud Ribbon如何像大厨一样精心调配资源&#xff0c;让负载均衡变得像烹饪艺术一样简单&#xff01; 文章目录 Spring Cloud Ribbon 详解1. 引言微服务架构中的负载均衡需求Spring Cloud Rib…

【chagpt】广泛使用API之前:考虑成本和数据隐私

文章目录 一. 定价和标记限制二. 安全和隐私 在广泛使用API之前&#xff0c;应该考虑两个重要因素&#xff1a;成本和数据隐私。 一. 定价和标记限制 OpenAI在Pricing页面上列出了模型的定价。请注意&#xff0c;OpenAI不一定及时更新该页面上的定价信息&#xff0c;因此实际…

爱岗敬业短视频:成都科成博通文化传媒公司

爱岗敬业短视频&#xff1a;传递正能量&#xff0c;塑造职场新风尚 在当今社会&#xff0c;短视频以其独特的传播方式和广泛的受众群体&#xff0c;成为了信息传播的重要渠道。在众多短视频内容中&#xff0c;以“爱岗敬业”为主题的短视频尤为引人注目&#xff0c;成都科成博…

链表mark

什么是链表&#xff0c;链表是一种通过指针串联在一起的线性结构&#xff0c;每一个节点由两部分组成&#xff0c;一个是数据域一个是指针域&#xff08;存放指向下一个节点的指针&#xff09;&#xff0c;最后一个节点的指针域指向null&#xff08;空指针的意思&#xff09;。…

《TCP/IP网络编程》(第十一章)进程间通信

进程间通信意味着两个不同的进程间可以交换数据&#xff0c;它使得不同的进程能够协同工作&#xff0c;实现复杂的系统功能。 1.通过管道实现进程间通信 下图是基于 管道&#xff08;PIPE&#xff09; 的进程间通信结构模型 管道不属于进程的资源&#xff0c;属于操作系统的资…

怎么简单的把图片缩小?图片在线改大小的方法

在日常工作中经常需要在网上上传图片&#xff0c;但是一般网上不同的平台对上传的图片大小和尺寸都会有限定的要求&#xff0c;不符合要求无法正常上传使用。所以当遇到图片太大的问题时&#xff0c;该如何快速修改图片大小&#xff0c;有很多的小伙伴都很关注这个问题的解决方…