Java项目:毕业生离校管理系统(java+jsp+servlet+jquery+Mysql)

源码获取:俺的博客首页 "资源" 里下载!

需求分析

使用JSP+Servlet+Mysql技术设计一个毕业生离校管理系统, 整个系统采用BS架构, 
为高校方便进行毕业生离校流程进行统一的离校流程, 极大的减少了大量学生同时离校的过程中杂乱的情况, 
整个系统分为学生, 教务处, 辅导员, 图书馆, 宿管, 财务处, 系办公室, 管理员登等角色, 不同的角色拥有不同的功能


实现功能

该项目是一个基于JSP+Servlet+Mysql实现的毕业生离校管理系统, 用于统一离校流程, 提升学校管理效率,主要分为如下模块
系统的登录注册模块, 注意只能注册学生账号
学生角色: 可以查看未归还图书信息, 未归还宿舍信息, 欠费信息, 手动发起离线申请
教务处角色: 可以添加离校信息 并确认某人离校
辅导员角色: 辅导员可以登录系统查看离校本人并进行确认离校。
图书馆人员角色: 登录系统添加未归还的图书信息。
宿管处角色: 添加未归还钥匙信息并确认离校状态
财务处角色: 添加欠费信息并确认离校状态


运行环境

jdk1.8,tomcat8.5,mysql5.7,Eclispse/IDEA/MyEclipse


项目技术

jsp, servlet, jquery


技术原理

项目是一个基于JSP+Mysql实现的毕业生离校管理系统, 采用比较传统的javaweb模式进行开发, 除了使用dwr并没有使用任何其他大型框架, 但是本项目的servlet+jsp也是构造了一个符合mvc设计模式及的封装代码, 另外此项目自带一篇毕业论文, 项目可以直接用于毕业设计中

注意事项

系统采用jsp+servlet+mysql编写, eclipse导入项目的时候properties的编码需要调整为utf8
mysql的编码utf8, 需要在dbinfo.properties中修改数据连接与密码


使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 将项目中dbinfo.properties配置文件中的数据库配置改为自己的配置
3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;
4. 运行项目,输入localhost:8080/xxx 登录

测试账号:

管理员账号:a 密码:a
教务处账号:jwc 密码:0
辅导员账号:fdy 密码:0
图书馆账号:tsg 密码:0
宿管处账号:sgc 密码:0
财务处账号:cwc 密码:0
系办公室账号:xbgs 密码:0

 

 

 

 

 

 

 用户管理控制层:

@Controller
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("/employment/usermanage")
    public String index(){
        return "system/usermanage/usermanage";
    }

    @ResponseBody
    @RequestMapping("/employment/getallusers")
    public CommonResult<List<User>> getAllUsers(User user, @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum){
        List<User> result = userService.getAllUsers(user, pageNum, pageSize);
        return CommonResult.generateSuccessResult(result.size(), result);
    }

    @ResponseBody
    @RequestMapping("/employment/getuserbyaccount/{userAccount}")
    public CommonResult<User> getUserByAccount(@PathVariable("userAccount") String userAccount){
        return CommonResult.generateSuccessResult(1, userService.getUserByAccount(userAccount));
    }

    @ResponseBody
    @RequestMapping("/employment/adduser")
    public CommonResult<Integer> addUser(User user){
        user.setUserId(UUID.randomUUID().toString());
        user.setUserPwd(MD5Util.getMD5(user.getUserPwd()));
        userService.addUser(user);
        return CommonResult.generateSuccessResult(1, 1);
    }

    @ResponseBody
    @RequestMapping("/employment/updateuser")
    public CommonResult<Integer> updateUser(User user){
        userService.updateUser(user);
        return CommonResult.generateSuccessResult(1, 1);
    }

    @ResponseBody
    @RequestMapping("/employment/deluser/{userId}")
    public CommonResult<Integer> delInfo(@PathVariable("userId") String userId){
        userService.deleteUser(userId);
        return CommonResult.generateSuccessResult(1, 1);
    }
}

毕业管理控制层: 

@Controller
public class EmploymentInfoController {
    @Autowired
    EmploymentInfoService employmentInfoService;

    @RequestMapping({"/employment/index", "/employment/employmentinfo"})
    public String index(){
        return "system/employmentinfo/employmentinfo";
    }

    @ResponseBody
    @RequestMapping("/employment/getallinfo")
    public CommonResult<List<EmploymentInfo>> getAllInfo(EmploymentInfo employmentInfo, @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum){
        List<EmploymentInfo> infoList = employmentInfoService.getAllEmploymentInfo(employmentInfo, pageNum, pageSize);
        CommonResult<List<EmploymentInfo>> rtInfoResult = CommonResult.generateSuccessResult(infoList.size(), infoList);

        return rtInfoResult;
    }

    @ResponseBody
    @RequestMapping("/employment/getinfo")
    public CommonResult<List<EmploymentInfo>> getinfo(EmploymentInfo info, @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum){
        List<EmploymentInfo> infoList = employmentInfoService.getEmploymentInfo(info, pageNum, pageSize);
        CommonResult<List<EmploymentInfo>> rtInfoResult = CommonResult.generateSuccessResult(infoList.size(), infoList);

        return rtInfoResult;
    }

    @ResponseBody
    @RequestMapping("/employment/addinfo")
    public CommonResult<Integer> addInfo(EmploymentInfo info){
        info.setInformationId(UUID.randomUUID().toString());
        employmentInfoService.addEmploymentInfo(info);
        return CommonResult.generateSuccessResult(1, 1);
    }

    @ResponseBody
    @RequestMapping("/employment/updateinfo")
    public CommonResult<Integer> updateInfo(EmploymentInfo info){
        employmentInfoService.updateEmploymentInfo(info);
        return CommonResult.generateSuccessResult(1, 1);
    }

    @ResponseBody
    @RequestMapping("/employment/delinfo/{infoId}")
    public CommonResult<Integer> delInfo(@PathVariable("infoId") String infoId){
        employmentInfoService.deleteEmploymentInfo(infoId);
        return CommonResult.generateSuccessResult(1, 1);
    }
}

图书管理控制层:

/**
 * @description: 图书类别处理
 */
@Controller
@RequestMapping("/admin/ch/category")
public class CategoryController {
    //注入
    @Autowired
    private LibraryCategoryService libraryCategoryService;

    /**
     * 添加 图书类目
     *
     * @param category 图书类目信息
     * @param session  添加人
     * @return url
     * @author hiseico
     */
    @RequestMapping(value = "/addCategory", method = RequestMethod.POST)
    public String addCategory(TbCategory category, HttpSession session, Model model) {
        List<TbCategory> categoryList = libraryCategoryService.getCategoryAll();
        boolean is = false;
        for (TbCategory tbCategory : categoryList) {
            if (category.getCatname().equals(tbCategory.getCatname())) {
                is = true;
                break;
            }
        }
        if (!is) {
            // 添加 数据到 数据库,并 修改 父类目
            libraryCategoryService.addBookCategory(category, session);
        } else {
            model.addAttribute("errorMsg", "类目已经存在");
            return "errorMsg";
        }
        return "redirect:/admin/ch/loan_BookClassify.action";
    }

    /**
     * 删除类目信息
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "/delCategory", method = RequestMethod.GET)
    public String delCategory(int id) {

        // 通过 类目id 删除数据
        libraryCategoryService.delBookCategoryById(id);

        return "redirect:/admin/ch/loan_BookClassify.action";
    }

    /**
     * 修改 类目关系
     *
     * @param category
     * @return
     */
    @RequestMapping(value = "/updateCategory", method = RequestMethod.POST)
    public String updateCategory(TbCategory category) {

        return "redirect:/admin/ch/loan_BookClassify.action";
    }

    @RequestMapping("/toUpdatePage")
    @ResponseBody
    public TbCategory toUpdatePage(int id) {
        return libraryCategoryService.getCategoryById(id);
    }
}

源码获取:俺的博客首页 "资源" 里下载!

猜你喜欢

转载自blog.csdn.net/pastclouds/article/details/125231104