赞
踩
✨作者主页:IT毕设梦工厂✨
个人简介:曾从事计算机专业培训教学,擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。
☑文末获取源码☑
精彩专栏推荐⬇⬇⬇
Java项目
Python项目
安卓项目
微信小程序项目
随着社会的发展和科技的进步,人们的生活变得越来越智能化和便捷。然而,在这个过程中,我们仍然面临着许多传统的问题,其中之一就是失物招领和寻物启示的需求。在校园这个特定环境中,这些问题尤为突出。失物招领和寻物启示的需求在日常生活中频繁出现,给学生带来诸多不便。因此,开发一款校园失物招领系统,以解决这一问题,具有很强的现实意义。
尽管目前存在一些失物招领和寻物启示的平台或系统,但它们往往存在诸多问题。首先,这些平台或系统的信息发布和更新往往不及时,导致用户无法快速找到自己失物或找到丢失物品的人。其次,这些平台或系统的信息往往比较混乱,没有分类和筛选,导致用户需要花费大量时间和精力去查找自己感兴趣的信息。再次,这些平台或系统的用户参与度和活跃度往往较低,导致信息的传播范围和影响力有限。
本课题旨在开发一款校园失物招领系统,解决校园内失物招领和寻物启示的需求。该系统将提供用户注册登录、信息发布、信息浏览、信息搜索、信息评论等功能,同时管理人员可以通过后台管理界面进行用户管理、信息管理、基础信息管理等操作。该系统将基于Web技术实现,采用B/S架构,服务器端采用Java语言编写,数据库采用MySQL数据库。
本课题的研究意义在于提供一款更加便捷、实用的校园失物招领系统,以满足校园内师生对于失物招领和寻物启示的需求。该系统的实现将带来以下几方面的效益:
提高信息发布和更新的及时性,让用户能够快速找到自己失物或找到丢失物品的人;
通过对信息的分类和筛选,减少用户查找自己感兴趣的信息的时间和精力;
通过用户参与和活跃度的提高,扩大信息的传播范围和影响力;
提高校园内师生对于失物招领和寻物启示的满意度;
增进校园内师生之间的交流和互动,增强校园文化氛围。
@Controller public class FoundController extends BaseController{ @Resource private FoundService fservice; @Resource private IdcardService idcardService; @Resource private AuthService authService; @Resource private UserService userService; @Autowired private AsyncService asyncService; /** * 跳转添加物品页面 */ @RequestMapping("/tofoundPub") public String toAddFound(HttpServletRequest request) { //没有登录先登录 if(request.getSession().getAttribute("loginUser") == null) { return "login"; } return "foundPub"; } @RequestMapping("/toFoundDetail") public String toFound(ModelMap map,@RequestParam("id")Integer foundId) { Found found = null; try { found = fservice.findFoundById(foundId); } catch (Exception e) { e.printStackTrace(); } map.addAttribute("found", found); return "foundDetail"; } /** * 添加失物招领信息到数据库 * @return 跳转到XX页面 */ @RequestMapping("/addFound") public String addFoundInfo(Found found, HttpServletRequest request) { User u = (User)(request.getSession().getAttribute("loginUser")); found.setFoundType(request.getParameter("foundType")); found.setUserId(u.getUserID()); found.setUserName(u.getUsername()); String filename = (String) request.getSession().getAttribute("fileName"); found.setImage(filename); String foundType=found.getFoundType(); String idcardType="身份证"; if(idcardType.equals(foundType)) { asyncService.executeAsync(filename); } request.getSession().removeAttribute("fileName"); try { fservice.insertFound(found); } catch (Exception e) { e.printStackTrace(); } return "redirect:/index"; } @RequestMapping("/getFoundInfo") @ResponseBody public String getFoundInfo(Found found, ModelMap map) { map.addAttribute("foundInfo", found); return "foundInfo"; } /** * 跳转更新物品页面 * @return */ @RequestMapping("/tofoundUpdate") public String toUpdateFound(ModelMap map,@RequestParam("id")Integer id) { Found found = null; try { found = fservice.findFoundById(id); } catch (Exception e) { e.printStackTrace(); } map.addAttribute("found",found); return "foundUpdate"; } /** * 修改招领信息,或者更改状态 * @return 跳转xx页面 */ @RequestMapping("/updateFound") public String updateFound(Found found, HttpServletRequest request) { User u = (User)(request.getSession().getAttribute("loginUser")); found.setUserId(u.getUserID()); found.setFoundType(request.getParameter("foundType")); try { fservice.updateFound(found); } catch (Exception e) { e.printStackTrace(); } return "redirect:/toFoundDetail?id=" + found.getFoundId(); } @RequestMapping("/toFoundList") public String toFoundlist(ModelMap map,@RequestParam("currentpage") Integer currentpage) throws Exception { Page page = new Page(); List l = fservice.findAllFounds(); page.setTotalRecord(l.size()); PageHelper.startPage(currentpage,5); List found = fservice.findAllFounds(); page.setTotalPage(page.getTotalRecord()); page.setCurrentPage(currentpage); map.addAttribute("page",page); map.addAttribute("founds", found); return "foundList"; } }
@Controller public class LostController extends BaseController{ @Resource private LostService lservice; /** * 跳转添加物品页面 * @return */ @RequestMapping("/tolostPub") public String toAddLost(HttpServletRequest request) { //没有登录先登录 if(request.getSession().getAttribute("loginUser") == null) { return "login"; } return "lostPub"; } /* * 添加lost信息 */ @RequestMapping("/addLost") public String addLostInfo(Lost lost, HttpServletRequest request) { User u = (User)(request.getSession().getAttribute("loginUser")); lost.setLostType(request.getParameter("lostType")); lost.setUserId(u.getUserID()); lost.setUserName(u.getUsername()); String file = (String) request.getSession().getAttribute("fileName"); lost.setImage(file); request.getSession().removeAttribute("fileName"); try { lservice.insertLost(lost); } catch (Exception e) { e.printStackTrace(); } return "redirect:/index"; } @RequestMapping("/toLostDetail") public String toLost(ModelMap map, @RequestParam("id") Integer lostId, HttpServletRequest request) { Lost lost = null; try { lost = lservice.findLostById(lostId); } catch (Exception e) { e.printStackTrace(); } map.addAttribute("lost", lost); return "lostDetail"; } @RequestMapping("/getLostInfo") public String getLostInfo(Lost lost, ModelMap map) { map.addAttribute("lostInfo", lost); return "lostInfo"; } /** * 跳转更新物品页面 * @return */ @RequestMapping("/tolostUpdate") public String toUpdateLost(ModelMap map,@RequestParam("id")Integer id) { Lost lost = null; try { lost = lservice.findLostById(id); } catch (Exception e) { e.printStackTrace(); } map.addAttribute("lost", lost); return "lostUpdate"; } /** * 修改失物信息,或者更改状态 * @return 跳转xx页面 */ @RequestMapping("/updateLost") public String updateLostInfo(Lost lost, HttpServletRequest request) { User u = (User)(request.getSession().getAttribute("loginUser")); lost.setUserId(u.getUserID()); lost.setLostType(request.getParameter("lostType")); try { boolean flag = lservice.updateLost(lost); } catch (Exception e) { e.printStackTrace(); } return "redirect:/toLostDetail?id=" + lost.getLostId(); } @RequestMapping("/toLostList") public String toLostlist(ModelMap map,@RequestParam("currentpage") Integer currentpage) throws Exception { Page page = new Page(); List l = lservice.findAllLost(); page.setTotalRecord(l.size()); PageHelper.startPage(currentpage,5); List lost = lservice.findAllLost(); page.setTotalPage(page.getTotalRecord()); page.setCurrentPage(currentpage); map.addAttribute("page",page); map.addAttribute("losts", lost); return "lostList"; } }
@Controller public class PicController { private final ResourceLoader resourceLoader; @Autowired public PicController(ResourceLoader resourceLoader) { this.resourceLoader = resourceLoader; } @Value("${web.upload-path}") private String path; @RequestMapping("/fileUpload") public String upload(@RequestParam("image") MultipartFile file, Map<String, Object> map, HttpServletRequest request){ // 要上传的目标文件存放路径 String localPath = path; // 上传成功或者失败的提示 String msg = ""; if (FileUtils.upload(file, localPath, file.getOriginalFilename())){ // 上传成功,给出页面提示 msg = "上传成功!"; }else { msg = "上传失败!"; } // 显示图片 map.put("msg", msg); map.put("fileName", file.getOriginalFilename()); request.getSession().setAttribute("fileName", file.getOriginalFilename()); return "lostPub"; } /** * 显示单张图片 * @return */ @RequestMapping("/show{fileName}") @ResponseBody public ResponseEntity<?> showPhotos(@PathVariable String fileName){ // System.out.println(fileName); try { // 由于是读取本机的文件,file是一定要加上的, path是在application配置文件中的路径 return ResponseEntity.ok(resourceLoader.getResource("file:" + path + "/" + fileName)); } catch (Exception e) { return ResponseEntity.notFound().build(); } } @RequestMapping("/fileUpload_found") public String upload_found(@RequestParam("image") MultipartFile file, Map<String, Object> map, HttpServletRequest request){ // 要上传的目标文件存放路径 String localPath = path; // 上传成功或者失败的提示 String msg = ""; if (FileUtils.upload(file, localPath, file.getOriginalFilename())){ // 上传成功,给出页面提示 msg = "上传成功!"; }else { msg = "上传失败!"; } // 显示图片 map.put("msg", msg); map.put("fileName", file.getOriginalFilename()); request.getSession().setAttribute("fileName", file.getOriginalFilename()); return "foundPub"; } }
校园失物招领系统-项目视频:
计算机毕业设计选题推荐-校园失物招领系统-Java项目实战
计算机毕业设计选题推荐-校园失物招领系统-Java项目实战
大家可以帮忙点赞、收藏、关注、评论啦~
源码获取:私信我
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。