——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM高校教职工差旅报销管理系统(java+ssm+jsp+mysql)
项目介绍
管理员角色包含以下功能: 管理员登录,修改管理员资料,用户管理,公告管理,报销类型管理,系别信息管理,报销审核管理等功能。
用户角色包含以下功能: 用户登录,修改个人资料,查看公告,报销类型查看,系别信息查看,报销审批查看等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本;
技术栈
后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 } if (newPwd.equals(oldPwd)) { model.addAttribute("errMsg" , "旧密码不能与新密码一致" ); model.addAttribute("util" , userTmp); return "User/updatepwd" ; } if (!oldPwd.equals(userTmp.getS_1())) { model.addAttribute("errMsg" , "旧密码错误" ); model.addAttribute("util" , userTmp); return "User/updatepwd" ; } userTmp.setS_1(newPwd); userMapper.updateObject(userTmp); return "User/uppwdok" ; } @RequestMapping(value = "/updateinfo.do") public String updateinfo (HttpServletRequest request, User util, Model model) { userMapper.updateObject(util); model.addAttribute("util" , util); model.addAttribute("errMsg" , "个人信息修改成功" ); return "User/updateinfo" ; } @RequestMapping(value = "/beforepass.do") public String beforepass (HttpServletRequest request, User util, Model model) { HttpSession session = request.getSession(); int user_id = (Integer) session.getAttribute("user_id" ); util = userMapper.selectObject(user_id); model.addAttribute("util" , util); return "User/updatepwd" ; } @RequestMapping(value = "/beforeinfo.do") public String beforeinfo (HttpServletRequest request, User util, Model model) { HttpSession session = request.getSession(); int user_id = (Integer) session.getAttribute("user_id" ); util = userMapper.selectObject(user_id); model.addAttribute("util" , util);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 savePath = PathFormat.parse(savePath, originFileName); String physicalPath = (String) conf.get("rootPath" ) + savePath; InputStream is = fileStream.openStream(); State storageState = StorageManager.saveFileByInputStream(is, physicalPath, maxSize); is.close(); if (storageState.isSuccess()) { storageState.putInfo("url" , PathFormat.format(savePath)); storageState.putInfo("type" , suffix); storageState.putInfo("original" , originFileName + suffix); } return storageState; } catch (FileUploadException e) { return new BaseState(false , AppInfo.PARSE_REQUEST_ERROR); } catch (IOException e) { } return new BaseState(false , AppInfo.IO_ERROR); } private static boolean validType (String type, String[] allowTypes) { List<String> list = Arrays.asList(allowTypes); return list.contains(type); } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 pageModel = pageModel.getUtilByController(list, currentPageNo); model.addAttribute("pageModel" , pageModel); model.addAttribute("fieldValue" , fieldValue); model.addAttribute("field" , field); return "BaoxiaoStatus/find" ; } @RequestMapping(value = "/deleteUtil.do") public String deleteUtil (HttpServletRequest request, BaoxiaoStatus util, Model model) { try { baoxiaoStatusMapper.deleteObject(util.getId()); }catch (Exception e){ } return this .getAllUtil(request, model); } @RequestMapping(value = "/deleteManyUtil.do") public String deleteManyUtil (HttpServletRequest request, User util, Model model) { String ids[] = request.getParameterValues("id" ); for (String id : ids) { util = new User(); util.setId(Integer.parseInt(id)); try { baoxiaoStatusMapper.deleteObject(util.getId()); }catch (Exception e){} } return this .getAllUtil(request, model); } @RequestMapping(value = "/saveOrUpdateObject.do") public String saveOrUpdateObject (HttpServletRequest request, BaoxiaoStatus util, Model model) { List<BaoxiaoStatus> list = baoxiaoStatusMapper.getObjectList("s_0" , util.getS_0()); if (0 == util.getId()) { if (list.size() > 0 ) { model.addAttribute("util" , util); model.addAttribute("errMsg" , "该信息已存在!" ); return "BaoxiaoStatus/saveOrUpdate" ; } baoxiaoStatusMapper.insertObject(util); } else { if (list.size() > 1 ) { model.addAttribute("util" , util);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 state = new Uploader( request, conf ).doExec(); break ; case ActionMap.CATCH_IMAGE: conf = configManager.getConfig( actionCode ); String[] list = this .request.getParameterValues( (String)conf.get( "fieldName" ) ); state = new ImageHunter( conf ).capture( list ); break ; case ActionMap.LIST_IMAGE: case ActionMap.LIST_FILE: conf = configManager.getConfig( actionCode ); int start = this .getStartIndex(); state = new FileManager( conf ).listFile( start ); break ; } return state.toJSONString(); } public int getStartIndex () { String start = this .request.getParameter( "start" ); try { return Integer.parseInt( start ); } catch ( Exception e ) { return 0 ; } } public boolean validCallbackName ( String name ) { if ( name.matches( "^[a-zA-Z_]+[\\w0-9_]*$" ) ) { return true ; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 public int getStartIndex () { String start = this .request.getParameter( "start" ); try { return Integer.parseInt( start ); } catch ( Exception e ) { return 0 ; } } public boolean validCallbackName ( String name ) { if ( name.matches( "^[a-zA-Z_]+[\\w0-9_]*$" ) ) { return true ; } return false ; } } public class ActionEnter {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 public class BinaryUploader { public static final State save (HttpServletRequest request, Map<String, Object> conf) { FileItemStream fileStream = null ; boolean isAjaxUpload = request.getHeader( "X_Requested_With" ) != null ; if (!ServletFileUpload.isMultipartContent(request)) { return new BaseState(false , AppInfo.NOT_MULTIPART_CONTENT); } ServletFileUpload upload = new ServletFileUpload( new DiskFileItemFactory()); if ( isAjaxUpload ) { upload.setHeaderEncoding( "UTF-8" ); } try { FileItemIterator iterator = upload.getItemIterator(request); while (iterator.hasNext()) { fileStream = iterator.next(); if (!fileStream.isFormField()) break ; fileStream = null ; } if (fileStream == null ) { return new BaseState(false , AppInfo.NOTFOUND_UPLOAD_DATA); } String savePath = (String) conf.get("savePath" ); String originFileName = fileStream.getName(); String suffix = FileType.getSuffixByFilename(originFileName); originFileName = originFileName.substring(0 ,
——————————PayStart——————————
项目链接: https://javayms.github.io?id=301122542008200sr https://javayms.pages.dev?id=301122542008200sr