基于javaweb+springboot的宿舍寝室维修上报管理系统(java+SpringBoot+FreeMarker+Mysql)

基于javaweb+springboot的宿舍寝室维修上报管理系统(java+SpringBoot+FreeMarker+Mysql)

管理员:校园管理(楼栋管理、宿舍管理)、师生管理(学生管理、辅导员管理)、维修管理(维修工管理、维修进度管理)、阅览室管理(座位生成等)、学生信用积分管理、座位预约统计管理等。
学生:登录、修改个人信息、上报宿舍维修信息、查看维修进度、完成维修进度等。
维修工:登录、查看分配给自己的维修任务、标记自己的维修进度等。
运行环境:windows/Linux均可、jdk1.8、mysql5.7、idea/eclipse均可。

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

		}
		//到这说明一切符合条件,进行数据库新增
		if(userService.save(user) == null){
			return Result.error(CodeMsg.ADMIN_USE_ADD_ERROR);
		}
		operaterLogService.add("添加用户,用户名:" + user.getUsername());
		return Result.success(true);
	}
	
	/**
	 * 用户编辑页面
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.GET)
	public String edit(Model model,@RequestParam(name="id",required=true)Long id){
		model.addAttribute("roles", roleService.findAll());
		model.addAttribute("user", userService.find(id));
		return "admin/user/edit";
	}
	
	@RequestMapping(value="/edit",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> edit(User user){
		//用统一验证实体方法验证是否合法
		CodeMsg validate = ValidateEntityUtil.validate(user);
		if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
			return Result.error(validate);
		}
		if(user.getRole() == null || user.getRole().getId() == null){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);
		}
		if(user.getId() == null || user.getId().longValue() <= 0){
			return Result.error(CodeMsg.ADMIN_USE_NO_EXIST);
        List<Coach> all1 = coachDao.findAll();
        //model.addAttribute("dormitorys",all);
        model.addAttribute("coachs",all1);
        model.addAttribute("buildings",all2);
        return "admin/student/add";
    }
    @RequestMapping(value="delete",method= RequestMethod.POST)
    @ResponseBody
    public Result delete(long id){
        try {
            studentService.delete(id);
        } catch (Exception e) {
            return Result.error(CodeMsg.ADMIN_ROLE_DELETE_ERROR);
        }
        return Result.success(true);
    }
    @RequestMapping(value="/building",method= RequestMethod.POST)
    @ResponseBody
    public Result getuilding(long id){
        List<Dormitory> byBuilding_id = dormitoryService.findByBuilding_Id(id);
        return Result.success(byBuilding_id);
            if (!StringUtil.isMobile(student.getMobile())){
                return   Result.error(CodeMsg.ADMIN_STUDENT_MOBILE);
            }
            student.setRole(roleService.findByRoleType(RoleType.STUDENT));
            String s = StringUtil.generateSn("S", "");
            student.setStudentNo(s);
            student.setPassword(s);
            studentService.save(student);
        }
        return Result.success(true);
    }
    @Autowired
    private OperaterLogService operaterLogService;
    @Autowired
    private DatabaseBakService databaseBakService;
    private Logger log = LoggerFactory.getLogger(SystemController.class);
}
    @RequestMapping(value="/edit",method=RequestMethod.GET)
    public String edit(Model model,@RequestParam(name="id")Long id){
        Student byID = studentService.findByID(id);
        List<Building> all2 = buildingService.findAll();
        List<Dormitory> byBuilding_id = dormitoryService.findByBuilding_Id(byID.getDormitory().getBuilding().getId());
        List<Coach> all1 = coachDao.findAll();
        model.addAttribute("coachs",all1);
        model.addAttribute("dormitorys",byBuilding_id);
        model.addAttribute("buildings",all2);
        model.addAttribute("student",byID );
        return "admin/student/edit";
    }
    @Autowired
   private BuildingService buildingService;
    /**
     * 角色添加页面
     * @param
     * @return
     */
    @RequestMapping(value="/add",method= RequestMethod.GET)
    public String add(Model model){
        //查出所有的宿舍
        try {
            buildingService.delete(id);
        } catch (Exception e) {
            return Result.error(CodeMsg.ADMIN_BUILDING_DELETE_ERROR);
        }
        operaterLogService.add("添加用户,用户ID:" + id);
生管理控制层:
@RequestMapping("/stu")
@Controller
public class StudentController {
    @Autowired
   private StudentService studentService;
    @Autowired
    private DormitoryService  dormitoryService;
    @Autowired
    CoachDao coachDao;
    @Autowired
    private RoleService roleService  ;
    @RequestMapping(value="/list")
    public String list(Model model, Student student, PageBean<Student> pageBean){
        model.addAttribute("title", "学生列表");
		//判断用户名是否存在
		if(userService.isExistUsername(user.getUsername(), 0l)){
			return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
		}
		//到这说明一切符合条件,进行数据库新增
		if(userService.save(user) == null){
			return Result.error(CodeMsg.ADMIN_USE_ADD_ERROR);
		}
		operaterLogService.add("添加用户,用户名:" + user.getUsername());
		return Result.success(true);
	}
	
	/**
	 * 用户编辑页面
	 * @param model
	 * @return
		//判断用户名是否存在
		if(userService.isExistUsername(user.getUsername(), 0l)){
			return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
		}
		//到这说明一切符合条件,进行数据库新增
		if(userService.save(user) == null){
			return Result.error(CodeMsg.ADMIN_USE_ADD_ERROR);
		}
		operaterLogService.add("添加用户,用户名:" + user.getUsername());
		return Result.success(true);
	}
	
	/**
	 * 用户编辑页面
	 * @param model
	 * @return
 * @author yy
 *
 */
@RequestMapping("/user")
@Controller
public class UserController {
	@Autowired
	private UserService userService;
	@Autowired
	private RoleService roleService;
	@Autowired
	private OperaterLogService operaterLogService;
	/**
	 * 用户列表页面
	 * @param model
	 * @param user
	 * @param pageBean
	 * @return
	 */
	@RequestMapping(value="/list")
        operaterLogService.add("添加用户,用户ID:" + id);
生管理控制层:
@RequestMapping("/stu")
@Controller
public class StudentController {
    @Autowired
   private StudentService studentService;
    @Autowired
    private DormitoryService  dormitoryService;
    @Autowired
    CoachDao coachDao;
    @Autowired
    private RoleService roleService  ;
    @RequestMapping(value="/list")
    public String list(Model model, Student student, PageBean<Student> pageBean){
        model.addAttribute("title", "学生列表");
        model.addAttribute("name", student.getStudentName());
        model.addAttribute("pageBean", studentService.findByName(student, pageBean));
        return "admin/student/list";
    }
    /**
     * 学生修改
     * @param model
@Controller
public class UserController {
	@Autowired
	private UserService userService;
	@Autowired
	private RoleService roleService;
	@Autowired
	private OperaterLogService operaterLogService;
	/**
	 * 用户列表页面
	 * @param model
	 * @param user
	 * @param pageBean
	 * @return
	 */
	@RequestMapping(value="/list")
	public String list(Model model,User user,PageBean<User> pageBean){
		model.addAttribute("title", "用户列表");
		if(user.getRole() == null || user.getRole().getId() == null){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);
		}
		if(user.getId() == null || user.getId().longValue() <= 0){
			return Result.error(CodeMsg.ADMIN_USE_NO_EXIST);
		}
		if(userService.isExistUsername(user.getUsername(), user.getId())){
			return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
		}
		//到这说明一切符合条件,进行数据库保存
		User findById = userService.find(user.getId());
		//讲提交的用户信息指定字段复制到已存在的user对象中,该方法会覆盖新字段内容
		BeanUtils.copyProperties(user, findById, "id","createTime","updateTime");
		if(userService.save(findById) == null){
			return Result.error(CodeMsg.ADMIN_USE_EDIT_ERROR);
		}
		operaterLogService.add("编辑用户,用户名:" + user.getUsername());
		return Result.success(true);
        model.addAttribute("coachs",all1);
        model.addAttribute("buildings",all2);
        return "admin/student/add";
    }
    @RequestMapping(value="delete",method= RequestMethod.POST)
    @ResponseBody
    public Result delete(long id){
        try {
            studentService.delete(id);
        } catch (Exception e) {
            return Result.error(CodeMsg.ADMIN_ROLE_DELETE_ERROR);
        }
        return Result.success(true);
    }
    @RequestMapping(value="/building",method= RequestMethod.POST)
	/**
	 * 删除用户
	 * @param id
	 * @return
	 */
	@RequestMapping(value="/delete",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
		try {
			userService.delete(id);
		} catch (Exception e) {
			return Result.error(CodeMsg.ADMIN_USE_DELETE_ERROR);
		}
		operaterLogService.add("添加用户,用户ID:" + id);
		return Result.success(true);
	}
}
建筑控制层:
@Controller
@RequestMapping("/building")
public class BuildingController {
    @Autowired
    private BuildingService buildingService;
 */
@RequestMapping("/user")
@Controller
public class UserController {
	@Autowired
	private UserService userService;
	@Autowired
	private RoleService roleService;
	@Autowired
	private OperaterLogService operaterLogService;
	/**
	 * 用户列表页面
    }
    @Autowired
    private OperaterLogService operaterLogService;
    @Autowired
    private DatabaseBakService databaseBakService;
    private Logger log = LoggerFactory.getLogger(SystemController.class);
}
后台用户管理控制器:
/**
 * 后台用户管理控制器
 * @author yy
 *
 */
@RequestMapping("/user")
@Controller
public class UserController {
	 * @param id
	 * @return
	 */
	@RequestMapping(value="/delete",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
		try {
			userService.delete(id);
		} catch (Exception e) {
			return Result.error(CodeMsg.ADMIN_USE_DELETE_ERROR);
		}
		operaterLogService.add("添加用户,用户ID:" + id);
		return Result.success(true);
	}
}
建筑控制层:
@Controller
@RequestMapping("/building")
public class BuildingController {
    @Autowired
    private BuildingService buildingService;
           }
            if (!StringUtil.isMobile(student.getMobile())){
                return   Result.error(CodeMsg.ADMIN_STUDENT_MOBILE);
            }
            student.setRole(roleService.findByRoleType(RoleType.STUDENT));
            String s = StringUtil.generateSn("S", "");
            student.setStudentNo(s);
            student.setPassword(s);
            studentService.save(student);
        }
        return Result.success(true);
    }
    @Autowired
    private OperaterLogService operaterLogService;
    @Autowired
    private DatabaseBakService databaseBakService;
        return "admin/building/add";
    }
    /**
     * 楼栋编辑页面
     * @param model
     * @return
     */
    @RequestMapping(value="/edit",method=RequestMethod.GET)
    public String edit(Model model,@RequestParam(name="id",required=true)Long id){
        model.addAttribute("building", buildingService.find(id));
        return "admin/building/edit";
    }
    /**
     * 楼栋添加表单提交处理
     * @param building
     * @return
     */
    @RequestMapping(value="/add",method=RequestMethod.POST)
    @ResponseBody
    public Result<Boolean> add(Building building){
        //用统一验证实体方法验证是否合法
        CodeMsg validate = ValidateEntityUtil.validate(building);
        if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
            return Result.error(validate);
    }
    /**
     * 编辑用户信息表单提交处理
     * @param
     * @return
     */
    @RequestMapping(value="/add",method=RequestMethod.POST)
    @ResponseBody
    public Result<Boolean> add(Student student){
        /**
        List<Building> all2 = buildingService.findAll();
        List<Coach> all1 = coachDao.findAll();
        //model.addAttribute("dormitorys",all);
        model.addAttribute("coachs",all1);
        model.addAttribute("buildings",all2);
        return "admin/student/add";
    }
    @RequestMapping(value="delete",method= RequestMethod.POST)
    @ResponseBody
    public Result delete(long id){
        try {
            studentService.delete(id);
        } catch (Exception e) {
            return Result.error(CodeMsg.ADMIN_ROLE_DELETE_ERROR);
        }
        return Result.success(true);
		if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
			return Result.error(validate);
		}
		if(user.getRole() == null || user.getRole().getId() == null){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);
		}
		//判断用户名是否存在
		if(userService.isExistUsername(user.getUsername(), 0l)){
			return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
		}
		//到这说明一切符合条件,进行数据库新增
		if(userService.save(user) == null){
			return Result.error(CodeMsg.ADMIN_USE_ADD_ERROR);
		}
		operaterLogService.add("添加用户,用户名:" + user.getUsername());
		return Result.success(true);
	}
    @ResponseBody
    public Result<Boolean> add(Building building){
        //用统一验证实体方法验证是否合法
        CodeMsg validate = ValidateEntityUtil.validate(building);
        if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
            return Result.error(validate);
        }
        if(buildingService.isExistCampusAndBno(building.getCampus(),building.getBno(), 0L)){
            return Result.error(CodeMsg.ADMIN_BUILDING_EXIST);
        }
        //到这说明一切符合条件,进行数据库新增
        if(buildingService.save(building) == null){
            return Result.error(CodeMsg.ADMIN_BUILDING_ADD_ERROR);
        }
        operaterLogService.add("添加楼栋,楼栋校区和楼号:" + building.getCampus()+building.getBno());
        return Result.success(true);
    }
    /**
    }
    /**
     * 编辑用户信息表单提交处理
     * @param
     * @return
     */
    @RequestMapping(value="/add",method=RequestMethod.POST)
    @ResponseBody
    public Result<Boolean> add(Student student){
        /**
         * 有id是修改需要判断
         * 无id是增加无需判断
         */
        if (student.getId()!=null){
            //用统一验证实体方法验证是否合法
            CodeMsg validate = ValidateEntityUtil.validate(student);
            if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
                return Result.error(validate);
            }
            //到这说明一切符合条件,进行数据库保存
            Student byID = studentService.findByID(student.getId());
            //讲提交的用户信息指定字段复制到已存在的user对象中,该方法会覆盖新字段内容
后台用户管理控制器:
/**
 * 后台用户管理控制器
 * @author yy
 *
 */
@RequestMapping("/user")
@Controller
public class UserController {
	@Autowired
	private UserService userService;
	@Autowired
	private RoleService roleService;
	@Autowired
	private OperaterLogService operaterLogService;
	/**
	 * 用户列表页面
	 * @param model
	 * @param user
	 * @param pageBean

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
【资源说明】 1、该资源包括项目的全部源码,下载可以直接使用! 2、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业和毕设项目,作为参考资料学习借鉴。 3、本资源作为“参考资料”如果需要实现其他功能,需要能看懂代码,并且热爱钻研,自行调试。 基于springboot的在线聊天系统源码+项目说明.zip # Huxin-Project huxin项目是一套聊天系统,包括前台手机界面及后台分布式系统,基于SpringBoot+Netty+MUI+H5Plus+Nginx+FastDFS分布式文件系统搭建的聊天系统。 前端聊天系统包含首页门户登录注册、互信、通讯录、发现、我等模块,添加了扫一扫,朋友圈等功能。 后台管理系统主要实现实时聊天功能。 # huxin ## 说明 > 基于SpringBoot+Netty+MUI+H5Plus+Nginx+FastDFS分布式文件系统搭建的聊天系统,前端聊天系统包含首页门户登录注册、互信、通讯录、发现、我等模块,添加了扫一扫,朋友圈等功能。 后台通信系统主要实现实时聊天功能。 ## 前言 `huxin`项目致力于打造一个完整的聊天系统,采用现阶段流行技术实现。 ## 项目介绍 `huxin`项目是一套聊天系统,包括前台门户系统及后台通信系统,基于SpringBoot+Netty+MUI+H5Plus+Nginx+FastDFS实现。 前台聊天系统包含首页门户登录注册、互信、通讯录、发现、我等模块,添加了扫一扫,朋友圈等功能等模块。 后台通信系统主要实现实时聊天功能。 ### 组织结构 ``` lua huxin ├── huyan-huxin- -- 前端聊天系统接口 ├── huyan-huxin-mybatis -- 基于后台数据层代码生成接口 ├── huyan-huxin-netty -- 后台聊天系统接口 └── huyan-huxin-hello -- 基于聊天功能简单网络编程实现 ``` ### 技术选型 #### 后端技术 技术 | 说明 | 官网 ----|----|---- Spring Boot | 容器+MVC框架 | https://spring.io/projects/spring-boot MyBatis | ORM框架 | http://www.mybatis.org/mybatis-3/zh/index.html MyBatisGenerator | 数据层代码生成 | http://www.mybatis.org/generator/index.html HikariCP | 数据库连接池 | https://github.com/brettwooldridge/HikariCP FastDFS | 对象存储 | https://sourceforge.net/projects/fastdfs/ Nginx | 反向代理服务器 | http://nginx.org/ Netty | 网络编程框架 | https://netty.io/index.html Maven | 项目对象模型 | http://maven.apache.org/ #### 前端技术 技术 | 说明 | 官网 ----|----|---- H5plus | 用于调用手机端功能 | http://www.html5plus.org/ MUI | 原生手机端页面框架 | http://dev.dcloud.net.cn/mui/ #### 架构图 ##### 系统架构图 ![系统架构图](/document/mind/系统架构图.png) ##### 业务架构图 ![业务架构图](/document/mind/业务架构图.png) #### 开发进度 ## 环境搭建 ### 开发工具 工具 | 说明 | 官网 ----|----|---- Eclipse | 开发IDE | https://www.eclipse.org/ X-shell | Linux远程连接工具 | http://www.netsarang.com/download/software.html Navicat | 数据库连接工具 | http://www.formysql.com/xiazai.html Xmind | 思维导图设计工具 | https://www.xmind.net/ ### 开发环境 工具 | 版本号 | 下载 ----|----|---- JDK | 1.8 | https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213315

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值