分享一套优质的微信小程序校园失物招领系统(SpringBoot后端+Vue管理端)

分享一套优质的微信小程序校园失物招领系统(SpringBoot后端+Vue管理端)

大家好,我是锋哥,看到一个不错的微信小程序校园失物招领系统(SpringBoot后端+Vue管理端),分享下哈。

项目介绍

互联网发展至今,无论是其理论还是技术都已经成熟,而且它广泛参与在社会中的方方面面。它让信息都可以通过网络传播,搭配信息管理工具可以很好地为人们提供服务。针对高校教师成果信息管理混乱,出错率高,信息安全性差,劳动强度大,费时费力等问题,采用校园失物招领系统可以有效管理,使信息管理能够更加科学和规范。

校园失物招领系统使用Java语言进行编码,使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务,其管理校园失物招领系统信息,查看校园失物招领系统信息,管理校园失物招领系统。

总之,校园失物招领系统集中管理信息,有着保密性强,效率高,存储空间大,成本低等诸多优点。它可以降低信息管理成本,实现信息管理计算机化。

源码下载

链接:https://pan.baidu.com/s/1CwHLHe11xreoL5Zr7xKJ6Q?pwd=1234
提取码:1234

系统展示

核心代码

 package com.controller; import java.io.File; import java.math.BigDecimal; import java.net.URL; import java.text.SimpleDateFormat; import com.alibaba.fastjson.JSONObject; import java.util.*; import org.springframework.beans.BeanUtils; import javax.servlet.http.HttpServletRequest; import org.springframework.web.context.ContextLoader; import javax.servlet.ServletContext; import com.service.TokenService; import com.utils.*; import java.lang.reflect.InvocationTargetException; import com.service.DictionaryService; import org.apache.commons.lang3.StringUtils; import com.annotation.IgnoreAuth; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; import com.entity.*; import com.entity.view.*; import com.service.*; import com.utils.PageUtils; import com.utils.R; import com.alibaba.fastjson.*; /** * 失物信息 * 后端接口 * @author * @email */ @RestController @Controller @RequestMapping("/shiwuzhaoling") public class ShiwuzhaolingController { private static final Logger logger = LoggerFactory.getLogger(ShiwuzhaolingController.class); private static final String TABLE_NAME = "shiwuzhaoling"; @Autowired private ShiwuzhaolingService shiwuzhaolingService; @Autowired private TokenService tokenService; @Autowired private DictionaryService dictionaryService;//字典 @Autowired private ForumService forumService;//论坛 @Autowired private NewsService newsService;//公告信息 @Autowired private XunwuqishiService xunwuqishiService;//寻物启事 @Autowired private XunwuqishiLiuyanService xunwuqishiLiuyanService;//寻物启事留言 @Autowired private YonghuService yonghuService;//用户 @Autowired private UsersService usersService;//管理员 /** * 后端列表 */ @RequestMapping("/page") public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){ logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params)); String role = String.valueOf(request.getSession().getAttribute("role")); if(false) return R.error(511,"永不会进入"); else if("用户".equals(role)) params.put("yonghuId",request.getSession().getAttribute("userId")); CommonUtil.checkMap(params); PageUtils page = shiwuzhaolingService.queryPage(params); //字典表数据转换 List<ShiwuzhaolingView> list =(List<ShiwuzhaolingView>)page.getList(); for(ShiwuzhaolingView c:list){ //修改对应字典表字段 dictionaryService.dictionaryConvert(c, request); } return R.ok().put("data", page); } /** * 后端详情 */ @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id, HttpServletRequest request){ logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id); ShiwuzhaolingEntity shiwuzhaoling = shiwuzhaolingService.selectById(id); if(shiwuzhaoling !=null){ //entity转view ShiwuzhaolingView view = new ShiwuzhaolingView(); BeanUtils.copyProperties( shiwuzhaoling , view );//把实体数据重构到view中 //级联表 用户 //级联表 YonghuEntity yonghu = yonghuService.selectById(shiwuzhaoling.getYonghuId()); if(yonghu != null){ BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表 view.setYonghuId(yonghu.getId()); } //修改对应字典表字段 dictionaryService.dictionaryConvert(view, request); return R.ok().put("data", view); }else { return R.error(511,"查不到数据"); } } /** * 后端保存 */ @RequestMapping("/save") public R save(@RequestBody ShiwuzhaolingEntity shiwuzhaoling, HttpServletRequest request){ logger.debug("save方法:,,Controller:{},,shiwuzhaoling:{}",this.getClass().getName(),shiwuzhaoling.toString()); String role = String.valueOf(request.getSession().getAttribute("role")); if(false) return R.error(511,"永远不会进入"); else if("用户".equals(role)) shiwuzhaoling.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")))); Wrapper<ShiwuzhaolingEntity> queryWrapper = new EntityWrapper<ShiwuzhaolingEntity>() .eq("shiwuzhaoling_name", shiwuzhaoling.getShiwuzhaolingName()) .eq("shiwuzhaoling_types", shiwuzhaoling.getShiwuzhaolingTypes()) .eq("zhaugntai_types", shiwuzhaoling.getZhaugntaiTypes()) .eq("yonghu_id", shiwuzhaoling.getYonghuId()) .eq("shiwuzhaoling_dizhi", shiwuzhaoling.getShiwuzhaolingDizhi()) ; logger.info("sql语句:"+queryWrapper.getSqlSegment()); ShiwuzhaolingEntity shiwuzhaolingEntity = shiwuzhaolingService.selectOne(queryWrapper); if(shiwuzhaolingEntity==null){ shiwuzhaoling.setCreateTime(new Date()); shiwuzhaolingService.insert(shiwuzhaoling); return R.ok(); }else { return R.error(511,"表中有相同数据"); } } /** * 后端修改 */ @RequestMapping("/update") public R update(@RequestBody ShiwuzhaolingEntity shiwuzhaoling, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException { logger.debug("update方法:,,Controller:{},,shiwuzhaoling:{}",this.getClass().getName(),shiwuzhaoling.toString()); ShiwuzhaolingEntity oldShiwuzhaolingEntity = shiwuzhaolingService.selectById(shiwuzhaoling.getId());//查询原先数据 String role = String.valueOf(request.getSession().getAttribute("role")); // if(false) // return R.error(511,"永远不会进入"); // else if("用户".equals(role)) // shiwuzhaoling.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")))); if("".equals(shiwuzhaoling.getShiwuzhaolingPhoto()) || "null".equals(shiwuzhaoling.getShiwuzhaolingPhoto())){ shiwuzhaoling.setShiwuzhaolingPhoto(null); } shiwuzhaolingService.updateById(shiwuzhaoling);//根据id更新 return R.ok(); } /** * 删除 */ @RequestMapping("/delete") public R delete(@RequestBody Integer[] ids, HttpServletRequest request){ logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString()); List<ShiwuzhaolingEntity> oldShiwuzhaolingList =shiwuzhaolingService.selectBatchIds(Arrays.asList(ids));//要删除的数据 shiwuzhaolingService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } /** * 批量上传 */ @RequestMapping("/batchInsert") public R save( String fileName, HttpServletRequest request){ logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName); Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { List<ShiwuzhaolingEntity> shiwuzhaolingList = new ArrayList<>();//上传的东西 Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段 Date date = new Date(); int lastIndexOf = fileName.lastIndexOf("."); if(lastIndexOf == -1){ return R.error(511,"该文件没有后缀"); }else{ String suffix = fileName.substring(lastIndexOf); if(!".xls".equals(suffix)){ return R.error(511,"只支持后缀为xls的excel文件"); }else{ URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径 File file = new File(resource.getFile()); if(!file.exists()){ return R.error(511,"找不到上传文件,请联系管理员"); }else{ List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件 dataList.remove(0);//删除第一行,因为第一行是提示 for(List<String> data:dataList){ //循环 ShiwuzhaolingEntity shiwuzhaolingEntity = new ShiwuzhaolingEntity(); // shiwuzhaolingEntity.setShiwuzhaolingUuidNumber(data.get(0)); //失物编号 要改的 // shiwuzhaolingEntity.setShiwuzhaolingName(data.get(0)); //物品名称 要改的 // shiwuzhaolingEntity.setShiwuzhaolingTypes(Integer.valueOf(data.get(0))); //物品类型 要改的 // shiwuzhaolingEntity.setZhaugntaiTypes(Integer.valueOf(data.get(0))); //物品状态 要改的 // shiwuzhaolingEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的 // shiwuzhaolingEntity.setShiwuzhaolingPhoto("");//详情和图片 // shiwuzhaolingEntity.setShiwuzhaolingTime(sdf.parse(data.get(0))); //拾遗时间 要改的 // shiwuzhaolingEntity.setShiwuzhaolingDizhi(data.get(0)); //拾遗地址 要改的 // shiwuzhaolingEntity.setShiwuzhaolingContent("");//详情和图片 // shiwuzhaolingEntity.setCreateTime(date);//时间 shiwuzhaolingList.add(shiwuzhaolingEntity); //把要查询是否重复的字段放入map中 //失物编号 if(seachFields.containsKey("shiwuzhaolingUuidNumber")){ List<String> shiwuzhaolingUuidNumber = seachFields.get("shiwuzhaolingUuidNumber"); shiwuzhaolingUuidNumber.add(data.get(0));//要改的 }else{ List<String> shiwuzhaolingUuidNumber = new ArrayList<>(); shiwuzhaolingUuidNumber.add(data.get(0));//要改的 seachFields.put("shiwuzhaolingUuidNumber",shiwuzhaolingUuidNumber); } } //查询是否重复 //失物编号 List<ShiwuzhaolingEntity> shiwuzhaolingEntities_shiwuzhaolingUuidNumber = shiwuzhaolingService.selectList(new EntityWrapper<ShiwuzhaolingEntity>().in("shiwuzhaoling_uuid_number", seachFields.get("shiwuzhaolingUuidNumber"))); if(shiwuzhaolingEntities_shiwuzhaolingUuidNumber.size() >0 ){ ArrayList<String> repeatFields = new ArrayList<>(); for(ShiwuzhaolingEntity s:shiwuzhaolingEntities_shiwuzhaolingUuidNumber){ repeatFields.add(s.getShiwuzhaolingUuidNumber()); } return R.error(511,"数据库的该表中的 [失物编号] 字段已经存在 存在数据为:"+repeatFields.toString()); } shiwuzhaolingService.insertBatch(shiwuzhaolingList); return R.ok(); } } } }catch (Exception e){ e.printStackTrace(); return R.error(511,"批量插入数据异常,请联系管理员"); } } /** * 前端列表 */ @IgnoreAuth @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){ logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params)); CommonUtil.checkMap(params); PageUtils page = shiwuzhaolingService.queryPage(params); //字典表数据转换 List<ShiwuzhaolingView> list =(List<ShiwuzhaolingView>)page.getList(); for(ShiwuzhaolingView c:list) dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段 return R.ok().put("data", page); } /** * 前端详情 */ @RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id, HttpServletRequest request){ logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id); ShiwuzhaolingEntity shiwuzhaoling = shiwuzhaolingService.selectById(id); if(shiwuzhaoling !=null){ //entity转view ShiwuzhaolingView view = new ShiwuzhaolingView(); BeanUtils.copyProperties( shiwuzhaoling , view );//把实体数据重构到view中 //级联表 YonghuEntity yonghu = yonghuService.selectById(shiwuzhaoling.getYonghuId()); if(yonghu != null){ BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段 view.setYonghuId(yonghu.getId()); } //修改对应字典表字段 dictionaryService.dictionaryConvert(view, request); return R.ok().put("data", view); }else { return R.error(511,"查不到数据"); } } /** * 前端保存 */ @RequestMapping("/add") public R add(@RequestBody ShiwuzhaolingEntity shiwuzhaoling, HttpServletRequest request){ logger.debug("add方法:,,Controller:{},,shiwuzhaoling:{}",this.getClass().getName(),shiwuzhaoling.toString()); Wrapper<ShiwuzhaolingEntity> queryWrapper = new EntityWrapper<ShiwuzhaolingEntity>() .eq("shiwuzhaoling_uuid_number", shiwuzhaoling.getShiwuzhaolingUuidNumber()) .eq("shiwuzhaoling_name", shiwuzhaoling.getShiwuzhaolingName()) .eq("shiwuzhaoling_types", shiwuzhaoling.getShiwuzhaolingTypes()) .eq("zhaugntai_types", shiwuzhaoling.getZhaugntaiTypes()) .eq("yonghu_id", shiwuzhaoling.getYonghuId()) .eq("shiwuzhaoling_dizhi", shiwuzhaoling.getShiwuzhaolingDizhi()) // .notIn("shiwuzhaoling_types", new Integer[]{102}) ; logger.info("sql语句:"+queryWrapper.getSqlSegment()); ShiwuzhaolingEntity shiwuzhaolingEntity = shiwuzhaolingService.selectOne(queryWrapper); if(shiwuzhaolingEntity==null){ shiwuzhaoling.setCreateTime(new Date()); shiwuzhaolingService.insert(shiwuzhaoling); return R.ok(); }else { return R.error(511,"表中有相同数据"); } } } 

Read more

详解RabbitMQ工作模式之RPC通信模式

详解RabbitMQ工作模式之RPC通信模式

目录 RPC通信模式 概述 工作流程 特点 应用场景 代码案例 引入依赖 常量类 编写客户端代码 编写服务端代码 运行程序(先运行客户端,再运行服务端) RPC通信模式 概述 在RabbitMQ中,RPC模式通过消息队列实现远程调用功能。客户端(生产者)发送消息到消费队列,服务端(消费者)进行消息消费并执行相应的程序,然后将结果发送到回调队列供客户端使用。这是一种双向的生产消费模式,其中客户端既是生产者又是消费者,服务端则专注于处理消息并生成响应。 在RPC通信的过程中, 没有⽣产者和消费者, ⽐较像咱们RPC远程调⽤, ⼤概就是通过两个队列实现了⼀个可回调的过程. 工作流程 1.客户端发送请求: 客户端连接到RabbitMQ服务器。 客户端声明一个用于发送RPC请求的队列(通常是固定的,如rpc_queue)。 客户端创建一个临时的回调队列,并在发送请求时,将回调队列的名称作为消息属性(reply_to)发送给交换机。 客户端为每个请求生成一个唯一的correlation_id,

By Ne0inhk
【MySQL】1. MySQL安装

【MySQL】1. MySQL安装

目录 * 1.安装MySQL * 第一步:更新 Ubuntu 系统软件源 * 第二步:安装 MySQL 服务器 * 第三步:安全初始化配置 MySQL(关键步骤) * 第四步:验证 MySQL 服务运行状态 * 第五步:登录 MySQL 数据库,验证安装结果 * 总结 * 2. 相关配置 * 2.1 MySQL 配置文件核心存放位置 * 2.2 配置修改 * 2.2.1 推荐修改配置 * 2.2.2 配置修改后的后续操作 * 3. 相关问题 1.安装MySQL (默认安装 Ubuntu22.04 官方源中的

By Ne0inhk
告别 Vibe Coding | 一文拆解 OpenClaw、Claude Code 背后的 AI Agent 五层全能架构

告别 Vibe Coding | 一文拆解 OpenClaw、Claude Code 背后的 AI Agent 五层全能架构

告别 Vibe Coding | 一文拆解 OpenClaw、Claude Code 背后的 AI Agent 五层全能架构 最近,AI 圈简直比奈飞的连续剧还精彩。 先是那个顶着“龙虾”图标、号称“The AI that actually does things”的 OpenClaw(老粉可能还记得它叫 Clawdbot 或 Moltbot)上演了一出“更名记”,为了避嫌 Claude 可谓操碎了心; 紧接着,开源界 OpenCode 探索在前,Anthropic 官方的 Claude Code 紧随其后,一把火点燃了“终端 Agent”的热情;再看 IDE

By Ne0inhk
3分钟搞定!Windows上部署AI爬虫神器OpenClaw,小白也能飞

3分钟搞定!Windows上部署AI爬虫神器OpenClaw,小白也能飞

3分钟搞定!Windows上部署AI爬虫神器OpenClaw,小白也能飞 * 一. 环境准备 * 二. 安装与启动 OpenClaw * 2.1 配置镜像源并安装 * 2.2 初始化并部署服务 * 2.3 手动重启服务(可选) * 三. 功能验证 * 五. 附录:常用配置与路径参考 前言 这是我在这个网站整理的笔记,有错误的地方请指出,关注我,接下来还会持续更新。 作者:神的孩子都在歌唱 OpenClaw 负责提供美观的交互界面与协议中转能力,是连接用户与大模型服务的重要接入层。 一. 环境准备 * 操作系统:Windows 10 虚拟机(本文基于 VMware 环境演示) * Node.js 版本:推荐 v20 及以上 👉 下载地址:https:

By Ne0inhk