1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 基于SSM+SpringBoot+MySQL+Bootstrap的OA办公自动化管理系统

基于SSM+SpringBoot+MySQL+Bootstrap的OA办公自动化管理系统

时间:2020-04-08 12:14:18

相关推荐

基于SSM+SpringBoot+MySQL+Bootstrap的OA办公自动化管理系统

登陆首页

部门管理

职位管理

考勤报表

新建流程

通知管理

邮件管理

任务管理

日程管理

部门

笔记

通讯录

讨论区

技术描述

开发工具: Idea/Eclipse

数据库: mysql

Jar包仓库: 普通jar包

前段框架:jquery

后端框架: Spring+SpringMVC+Mybatis

资料说明

基于SSM+SpringBoot+MySQL+Bootstrap的OA在线办公自动化管理系统,分为管理员,经理,总经理,人事等多个自定义角色。整体功能包含部门管理,职位管理,用户管理,考勤管理,流程管理,公告管理,邮件管理,任务管理,日程管理,工作计划,通讯录,笔记。

@Controller@RequestMapping("/")public class FileAjaxController {@AutowiredFileServices fs;@AutowiredFileListdao fldao;@AutowiredFilePathdao fpdao;@AutowiredUserDao udao;@RequestMapping("mcloadpath")public String mcloadpath(@RequestParam("mctoid") Long mctoid,@RequestParam("mcpathids") List<Long> mcpathids,Model model){System.out.println("进来了是吧!~~");System.out.println(mctoid);System.out.println(mcpathids);List<FilePath> showsonpaths = fs.mcpathload(mctoid, mcpathids);model.addAttribute("mcpaths",showsonpaths);return "file/mcpathload";}/*** 文件类型筛选显示load* @param userid* @param type* @param model* @return*/@RequestMapping("filetypeload")public String filetypeload(@SessionAttribute("userId")Long userid,@RequestParam("type") String type,Model model){User user = udao.findOne(userid);String contenttype;List<FileList> fileLists = null;List<FilePath> filePaths = null;switch (type) {case "document":fileLists = fldao.finddocument(user);System.out.println(fileLists);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "picture":contenttype = "image/%";fileLists = fldao.findByUserAndContentTypeLikeAndFileIstrash(user, contenttype, 0L);System.out.println(fileLists);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "music":contenttype = "audio/%";fileLists = fldao.findByUserAndContentTypeLikeAndFileIstrash(user, contenttype, 0L);System.out.println(fileLists);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "video":contenttype = "video/%";fileLists = fldao.findByUserAndContentTypeLikeAndFileIstrash(user, contenttype, 0L);System.out.println(fileLists);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "yasuo":contenttype = "application/x%";fileLists = fldao.findByUserAndContentTypeLikeAndFileIstrash(user, contenttype, 0L);System.out.println(fileLists);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "trash":filePaths = fpdao.findByPathUserIdAndPathIstrash(userid, 1L);fileLists = fldao.findByUserAndFileIstrash(user, 1L);model.addAttribute("paths", filePaths);model.addAttribute("files", fileLists);model.addAttribute("istrash", 1);model.addAttribute("isload",1);break;case "share":fileLists = fldao.findByFileIsshareAndFileIstrash(1L, 0L);model.addAttribute("files", fileLists);model.addAttribute("isshare", 1);model.addAttribute("isload",1);model.addAttribute("userid",userid);break;default:break;}model.addAttribute("type", type);return "file/filetypeload";}@RequestMapping("findfileandpath")public String findfileandpath(@SessionAttribute("userId") Long userid,@RequestParam(value = "findfileandpath",required=false) String findfileandpath,@RequestParam(value = "type",defaultValue="all") String type,Model model){System.out.println("查找!~~~~~~");String findlike = "%" +findfileandpath+ "%";User user = udao.findOne(userid);FilePath fpath = fpdao.findByParentIdAndPathUserId(1L, userid);String contenttype;List<FileList> fileLists = null;List<FilePath> filePaths = null;System.out.println(type);switch (type) {case "document":fileLists = fldao.finddocumentlike(user, findlike);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "picture":contenttype = "image/%";fileLists = fldao.findByUserAndFileIstrashAndContentTypeLikeAndFileNameLike(user, 0L, contenttype, findlike);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "music":contenttype = "audio/%";fileLists = fldao.findByUserAndFileIstrashAndContentTypeLikeAndFileNameLike(user, 0L, contenttype, findlike);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "video":contenttype = "video/%";fileLists = fldao.findByUserAndFileIstrashAndContentTypeLikeAndFileNameLike(user, 0L, contenttype, findlike);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "yasuo":contenttype = "application/x%";fileLists = fldao.findByUserAndFileIstrashAndContentTypeLikeAndFileNameLike(user, 0L, contenttype, findlike);model.addAttribute("files", fileLists);model.addAttribute("isload",1);break;case "trash":filePaths = fpdao.findByPathUserIdAndPathIstrashAndPathNameLikeAndParentIdNot(userid, 1L, findlike, 1L);fileLists = fldao.findByUserAndFileIstrashAndContentTypeLikeAndFileNameLike(user, 1L, "%%", findlike);model.addAttribute("istrash", 1);model.addAttribute("isload",1);model.addAttribute("paths", filePaths);model.addAttribute("files", fileLists);break;case "share":fileLists = fldao.findByFileIsshareAndFileNameLike(1L, findlike);model.addAttribute("files", fileLists);model.addAttribute("isshare", 1);model.addAttribute("isload",1);break;default:System.out.println("什么都不是");filePaths = fpdao.findByPathUserIdAndPathIstrashAndPathNameLikeAndParentIdNot(userid, 0L, findlike, 1L);fileLists = fldao.findByUserAndFileIstrashAndFileNameLike(user, 0L,findlike);model.addAttribute("files", fileLists);model.addAttribute("paths", filePaths);model.addAttribute("isload",1);break;}model.addAttribute("type", type);return "file/filetypeload";}@RequestMapping("fileloadshare")public String fileloadshare(@RequestParam("type") String type,@RequestParam(value="checkfileids[]",required=false) List<Long> checkfileids,Model model){if (checkfileids!=null) {fs.doshare(checkfileids);}model.addAttribute("message","分享成功");model.addAttribute("type", type);return "forward:/filetypeload";}/*** load删除controller* @param type* @param checkpathids* @param checkfileids* @param model* @return*/@RequestMapping("fileloaddeletefile")public String fileloaddeletefile(@RequestParam("type") String type,@RequestParam(value="checkpathids[]",required=false) List<Long> checkpathids,@RequestParam(value="checkfileids[]",required=false) List<Long> checkfileids,Model model){System.out.println(type+checkpathids+checkfileids);if (checkfileids!=null) {// 删除文件fs.deleteFile(checkfileids);}if (checkpathids!=null) {// 删除文件夹fs.deletePath(checkpathids);}model.addAttribute("type", type);return "forward:/filetypeload";}/*** 将文件放入回收战* @param userid* @param type* @param checkpathids* @param checkfileids* @param model* @return*/@RequestMapping("fileloadtrashfile")public String fileloadtrashfile(@SessionAttribute("userId") Long userid,@RequestParam("type") String type,@RequestParam(value="checkpathids[]",required=false) List<Long> checkpathids,@RequestParam(value="checkfileids[]",required=false) List<Long> checkfileids,Model model){System.out.println(type+checkpathids+checkfileids);if (checkfileids!=null) {// 文件放入回收站fs.trashfile(checkfileids, 1L,userid);}if (checkpathids!=null) {// 删除文件夹fs.trashpath(checkpathids,1L,true);//fs.trashPath(checkpathids);}model.addAttribute("type", type);return "forward:/filetypeload";}/*** load重命名* @param type* @param renamefp* @param creatpathinput* @param isfile* @param pathid* @param model* @return*/@RequestMapping("fileloadrename")public String fileloadrename(@RequestParam("type") String type,@RequestParam("renamefp") Long renamefp,@RequestParam("creatpathinput") String creatpathinput,@RequestParam("isfile") boolean isfile,@RequestParam(value="pathid",required=false) Long pathid,Model model){System.out.println(type+renamefp+creatpathinput+isfile);fs.rename(creatpathinput, renamefp, pathid, isfile);model.addAttribute("type", type);return "forward:/filetypeload";}/*** 回收站load 复原* @param userid* @param type* @param checkpathids* @param checkfileids* @param model* @return*/@RequestMapping("filereturnback")public String filereturnback(@SessionAttribute("userId") Long userid,@RequestParam("type") String type,@RequestParam(value="checkpathids[]",required=false) List<Long> checkpathids,@RequestParam(value="checkfileids[]",required=false) List<Long> checkfileids,Model model){if (checkfileids!=null) {fs.filereturnback(checkfileids,userid);}if (checkpathids!=null) {fs.pathreturnback(checkpathids, userid);}model.addAttribute("type", type);return "forward:/filetypeload";}}

@Controller@RequestMapping("/")public class IndexController {Logger log = LoggerFactory.getLogger(getClass());@Autowiredprivate MenuSysService menuService;@Autowiredprivate NoticeMapper nm;@Autowiredprivate StatusDao statusDao;@Autowiredprivate TypeDao typeDao;@Autowiredprivate UserDao uDao;@Autowiredprivate AttendceDao attendceDao;@Autowiredprivate DirectorDao directorDao;@Autowiredprivate DiscussDao discussDao;@Autowiredprivate FileListdao filedao;@Autowiredprivate PlanDao planDao;@Autowiredprivate NotepaperDao notepaperDao;@Autowiredprivate UserLogDao userLogDao;@Autowiredprivate ProcessListDao processListDao;@Autowiredprivate InformRelationDao irdao;@Autowiredprivate MailreciverDao mdao;@Autowiredprivate TaskuserDao tadao;@Autowiredprivate RolepowerlistDao rdao;@Autowiredprivate DaymanageServices dayser;@Autowiredprivate InformService informService;@Autowiredprivate DaymanageDao daydao;@Autowiredprivate InformRelationService informrelationservice;// 格式转化导入DefaultConversionService service = new DefaultConversionService();@RequestMapping("index")public String index(HttpServletRequest req,Model model) {HttpSession session = req.getSession();if(StringUtils.isEmpty(session.getAttribute("userId"))){return "login/login";}Long userId = Long.parseLong(session.getAttribute("userId") + "");User user=uDao.findOne(userId);menuService.findMenuSys(req,user);List<ScheduleList> aboutmenotice = dayser.aboutmeschedule(userId);for (ScheduleList scheduleList : aboutmenotice) {if(scheduleList.getIsreminded()!=null&&!scheduleList.getIsreminded()){System.out.println(scheduleList.getStartTime());SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");//24小时制 //simpleDateFormat.parse(scheduleList.getStartTime()).getTime(); String start = simpleDateFormat.format(scheduleList.getStartTime());String now = simpleDateFormat.format(new Date());try {long now2 = simpleDateFormat.parse(now).getTime();long start2 = simpleDateFormat.parse(start).getTime(); long cha = start2-now2;if(0<cha && cha <86400000){NoticesList remindnotices = new NoticesList();remindnotices.setTypeId(11l);remindnotices.setStatusId(15l);remindnotices.setTitle("您有一个日程即将开始");remindnotices.setUrl("/daycalendar");remindnotices.setUserId(userId);remindnotices.setNoticeTime(new Date());NoticesList remindnoticeok = informService.save(remindnotices);informrelationservice.save(new NoticeUserRelation(remindnoticeok, user, false));scheduleList.setIsreminded(true);daydao.save(scheduleList);}} catch (ParseException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}List<NoticeUserRelation> notice=irdao.findByReadAndUserId(false,user);//通知List<Mailreciver> mail=mdao.findByReadAndDelAndReciverId(false, false, user);//邮件List<Taskuser> task=tadao.findByUserIdAndStatusId(user, 3);//新任务model.addAttribute("notice", notice.size());model.addAttribute("mail", mail.size());model.addAttribute("task", task.size());model.addAttribute("user", user);//展示用户操作记录 由于现在没有登陆 不能获取用户idList<UserLog> userLogs=userLogDao.findByUser(userId);req.setAttribute("userLogList", userLogs);return "index/index";}/*** 菜单查找* @param userId* @param req* @return*/@RequestMapping("menucha")public String menucha(HttpSession session, Model model,HttpServletRequest req){Long userId = Long.parseLong(session.getAttribute("userId") + "");User user=uDao.findOne(userId);String val=null;if(!StringUtils.isEmpty(req.getParameter("val"))){val=req.getParameter("val");}if(!StringUtils.isEmpty(val)){List<Rolemenu> oneMenuAll=rdao.findname(0L, user.getRole().getRoleId(), true, true, val);//找父菜单List<Rolemenu> twoMenuAll=null;for (int i = 0; i < oneMenuAll.size(); i++) {twoMenuAll=rdao.findbyparentxianall(oneMenuAll.get(i).getMenuId(), user.getRole().getRoleId(), true, true);//找子菜单}req.setAttribute("oneMenuAll", oneMenuAll);req.setAttribute("twoMenuAll", twoMenuAll);}else{menuService.findMenuSys(req,user);}return "common/leftlists";}@RequestMapping("userlogs")public String usreLog(@SessionAttribute("userId") Long userId,HttpServletRequest req){List<UserLog> userLogs=userLogDao.findByUser(userId);req.setAttribute("userLogList", userLogs);return "user/userlog";}private void showalist(Model model, Long userId) {// 显示用户当天最新的记录SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Date date = new Date();String nowdate = sdf.format(date);Attends aList = attendceDao.findlastest(nowdate, userId);if (aList != null) {String type = typeDao.findname(aList.getTypeId());model.addAttribute("type", type);}model.addAttribute("alist", aList);}/*** 控制面板主页* * @param session* @param model* @return*/@RequestMapping("test2")public String test2(HttpSession session, Model model, HttpServletRequest request) {Long userId = Long.parseLong(session.getAttribute("userId") + "");User user=uDao.findOne(userId);request.setAttribute("user", user);//计算三个模块的记录条数request.setAttribute("filenum", filedao.count());request.setAttribute("directornum", directorDao.count());request.setAttribute("discussnum", discussDao.count());List<Map<String, Object>> list = nm.findMyNoticeLimit(userId);model.addAttribute("user", user);for (Map<String, Object> map : list) {map.put("status", statusDao.findOne((Long) map.get("status_id")).getStatusName());map.put("type", typeDao.findOne((Long) map.get("type_id")).getTypeName());map.put("statusColor", statusDao.findOne((Long) map.get("status_id")).getStatusColor());map.put("userName", uDao.findOne((Long) map.get("user_id")).getUserName());map.put("deptName", uDao.findOne((Long) map.get("user_id")).getDept().getDeptName());}// List<Map<String, Object>>// noticeList=informRService.setList(noticeList1);showalist(model, userId);System.out.println("通知"+list);model.addAttribute("noticeList", list);//列举计划List<Plan> plans=planDao.findByUserlimit(userId);model.addAttribute("planList", plans);List<SystemTypeList> ptype = (List<SystemTypeList>) typeDao.findByTypeModel("aoa_plan_list");List<SystemStatusList> pstatus = (List<SystemStatusList>) statusDao.findByStatusModel("aoa_plan_list");model.addAttribute("ptypelist", ptype);model.addAttribute("pstatuslist", pstatus);//列举便签List<Notepaper> notepapers=notepaperDao.findByUserIdOrderByCreateTimeDesc(userId);model.addAttribute("notepaperList", notepapers);//列举几个流程记录List<ProcessList> pList=processListDao.findlastthree(userId);model.addAttribute("processlist", pList);List<SystemStatusList> processstatus = (List<SystemStatusList>) statusDao.findByStatusModel("aoa_process_list");model.addAttribute("prostatuslist", processstatus);return "systemcontrol/control";}@RequestMapping("test3")public String test3() {return "note/noteview";}@RequestMapping("test4")public String test4() {return "mail/editaccount";}@RequestMapping("notlimit")public String notLimit() {return "common/notlimit";}// 测试系统管理@RequestMapping("one")public String witeMail() {return "mail/wirtemail";}@RequestMapping("two")public String witeMail2() {return "mail/seemail";}@RequestMapping("three")public String witeMail3() {return "mail/allmail";}@RequestMapping("mmm")public String witeMail4() {return "mail/mail";}@RequestMapping("ffff")public @ResponseBody PageInfo<Map<String, Object>> no() {PageHelper.startPage(2, 10);List<Map<String, Object>> list = nm.findMyNotice(2L);PageInfo<Map<String, Object>> info = new PageInfo<Map<String, Object>>(list);System.out.println(info);return info;}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。