计算机毕业设计 校园失物招领网站的设计与实现 Java实战项目 附源码+文档+视频讲解

发布于:2024-10-13 ⋅ 阅读:(13) ⋅ 点赞:(0)

博主介绍:✌从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌
🍅文末获取源码联系🍅
👇🏻 精彩专栏推荐订阅👇🏻 不然下次找不到哟
————————————————
计算机毕业设计《1000套》

Python毕设精品项目

微信小程序毕设精品项目

大数据及机器学习毕设精品项目

目录

1、项目介绍及开发技术

1.1 项目介绍

1.2 开发技术

2、系统功能设计结构图

3、功能截图

3.1 前台功能

3.2 后台功能

4、数据库表结构设计

5、关键代码

5.1 失物信息Controller模块 

5.2 失物信息Service模块 

5.3 失物信息ServiceImpl模块

5.4  失物信息Dao模块

6、论文目录结构

7、源码获取


1、项目介绍及开发技术

1.1 项目介绍

在校园生活中,学生和教职工经常会遇到遗失物品的情况,而传统的失物招领方式往往依赖于物理公告板或者口头传播,这些方法不仅效率低下,而且覆盖范围有限,导致失物难以及时找回。为了解决这一问题,提升失物招领的效率和准确性,我们设计并开发了一个校园失物招领网站。

背景:
随着互联网技术的普及,数字化校园建设已经成为教育信息化的重要组成部分。校园失物招领网站作为一个创新的数字化服务,旨在通过在线平台,为校园内失物的找回提供一个快速、便捷的通道。

目的意义:

  • 1. 提高招领效率:通过在线发布和查询失物信息,系统能够迅速将失物信息传达给校园内的所有成员,大大提高了失物找回的可能性。
  • 2. 便捷用户操作:用户可以通过个人中心轻松管理自己发布的失物信息和寻物启事,同时对感兴趣的信息进行留言和认领。
  • 3. 增强信息透明度:系统提供公告信息和留言板功能,使得失物招领信息更加公开透明,便于用户及时获取最新动态。
  • 4. 促进校园互动:交流论坛和留言板为校园成员提供了一个交流和互助的平台,增强了校园社区的凝聚力。
  • 5. 数据管理与分析:后端管理模块为管理员提供了用户管理、操作日志和基础数据管理等功能,便于对失物招领情况进行统计分析,优化服务流程。

综上所述,校园失物招领网站的设计与实现,不仅能够为校园成员提供一个高效、便捷的失物招领服务,还能够通过数据分析和用户互动,不断优化服务,提升校园生活的便利性和安全性。通过技术手段提升失物招领的效率,该网站有望成为校园数字化服务的一个亮点,为构建和谐校园环境做出贡献。
 

1.2 开发技术

类别 技术名称 用途/描述
开发语言 Java 一种广泛使用的面向对象编程语言。
框架 Spring Boot 简化Spring应用的初始搭建以及开发过程。
ORM工具 MyBatis Plus MyBatis的增强工具,简化CRUD操作。
数据库 MySQL 流行的关系型数据库管理系统。
构建工具 Maven 项目管理和理解工具。
开发工具 IDEA 集成开发环境,用于代码编写和调试。
JDK版本 JDK 1.8+ Java开发工具包,提供运行Java程序所需的环境。
前端框架 Vue 用于构建用户界面的渐进式JavaScript框架。
UI框架 Element UI 基于Vue的桌面端组件库。
前端技术 HTML 网页内容的标准标记语言。
前端技术 CSS 描述HTML文档的样式。
前端技术 JS 网页脚本语言,用于实现网页的动态效果。

2、系统功能设计结构图

功能模块结构图

├── 前端
│   ├── 登录
│   ├── 注册
│   ├── 留言板
│   ├── 公告信息
│   ├── 失物信息
│   ├── 寻物启事
│   └── 个人中心
│       ├── 个人信息
│       ├── 我发布的失物信息
│       ├── 失物认领
│       ├── 我发布的寻物启事
│       └── 寻物启事留言

└── 后端
    ├── 登录
    ├── 个人中心
    ├── 管理员管理
    ├── 操作日志管理
    ├── 基础数据管理
    ├── 留言板管理
    ├── 公告信息管理
    ├── 失物信息管理
    ├── 寻物启事管理
    └── 用户管理
        └── 轮播图信息管理

系统MVC框架,请求流程展示:

3、功能截图

3.1 前台功能

3.2 后台功能

4、数据库表结构设计

CREATE TABLE `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `news_name` varchar(200) DEFAULT NULL COMMENT '公告标题  Search111 ',
  `news_types` int(11) DEFAULT NULL COMMENT '公告类型  Search111 ',
  `news_photo` varchar(200) DEFAULT NULL COMMENT '公告图片',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '添加时间',
  `news_content` text COMMENT '公告详情',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 nameShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='公告信息';


CREATE TABLE `shiwuzhaoling` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `shiwuzhaoling_uuid_number` varchar(200) DEFAULT NULL COMMENT '失物编号',
  `shiwuzhaoling_name` varchar(200) DEFAULT NULL COMMENT '物品名称 Search111',
  `shiwuzhaoling_types` int(11) DEFAULT NULL COMMENT '物品类型 Search111',
  `renlingzhuangtai_types` int(11) DEFAULT NULL COMMENT '认领状态 Search111',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
  `shiwuzhaoling_photo` varchar(200) DEFAULT NULL COMMENT '物品图片',
  `shiwuzhaoling_time` timestamp NULL DEFAULT NULL COMMENT '拾遗时间',
  `shiwuzhaoling_dizhi` varchar(200) DEFAULT NULL COMMENT '拾遗地址 Search111',
  `shiwuzhaoling_content` text COMMENT '详情',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='失物信息';

CREATE TABLE `shiwuzhaoling_yuyue` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `shiwuzhaoling_id` int(11) DEFAULT NULL COMMENT '失物id',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '认领用户',
  `shiwuzhaoling_yuyue_text` text COMMENT '认领凭证',
  `shiwuzhaoling_yuyue_yesno_types` int(11) DEFAULT NULL COMMENT '审核',
  `shiwuzhaoling_yuyue_yesno_text` text COMMENT '详情',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '认领时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='失物认领';

CREATE TABLE `token` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `userid` bigint(20) NOT NULL COMMENT '员工id',
  `username` varchar(100) NOT NULL COMMENT '员工名',
  `tablename` varchar(100) DEFAULT NULL COMMENT '表名',
  `role` varchar(100) DEFAULT NULL COMMENT '角色',
  `token` varchar(200) NOT NULL COMMENT '密码',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  `expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='token表';


CREATE TABLE `users` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(100) NOT NULL COMMENT '员工名',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `role` varchar(100) DEFAULT '管理员' COMMENT '角色',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员';

CREATE TABLE `xunwuqishi` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `xunwuqishi_name` varchar(200) DEFAULT NULL COMMENT '物品名称 Search111',
  `shiwuzhaoling_types` int(11) DEFAULT NULL COMMENT '物品类型 Search111',
  `zhaohuizhuangtai_types` int(11) DEFAULT NULL COMMENT '找回状态 Search111',
  `xunwuqishi_photo` varchar(200) DEFAULT NULL COMMENT '物品图片',
  `xunwuqishi_time` timestamp NULL DEFAULT NULL COMMENT '丢失时间',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
  `xunwuqishi_dizhi` varchar(200) DEFAULT NULL COMMENT '丢失地址',
  `xunwuqishi_content` text COMMENT '详情',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='寻物启事';

5、关键代码

5.1 失物信息Controller模块 



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 CaozuorizhiService caozuorizhiService;//操作日志
    @Autowired
    private DictionaryService dictionaryService;//字典
    @Autowired
    private LiuyanService liuyanService;//留言板
    @Autowired
    private NewsService newsService;//公告信息
    @Autowired
    private ShiwuzhaolingYuyueService shiwuzhaolingYuyueService;//失物认领
    @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);
        }
        caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"列表查询",list.toString());
        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);
    caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"单条数据查看",view.toString());
            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("renlingzhuangtai_types", shiwuzhaoling.getRenlingzhuangtaiTypes())
            .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);
            caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"新增",shiwuzhaoling.toString());
            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更新
            List<String> strings = caozuorizhiService.clazzDiff(shiwuzhaoling, oldShiwuzhaolingEntity, request,new String[]{"updateTime"});
            caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"修改",strings.toString());
            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));

        caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"删除",oldShiwuzhaolingList.toString());
        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");
        //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
        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.setRenlingzhuangtaiTypes(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);
                        caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"批量新增",shiwuzhaolingList.toString());
                        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); //修改对应字典表字段

        caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"列表查询",list.toString());
        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);
                    caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"单条数据查看",view.toString());
                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("renlingzhuangtai_types", shiwuzhaoling.getRenlingzhuangtaiTypes())
            .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);

            caozuorizhiService.insertCaozuorizhi(String.valueOf(request.getSession().getAttribute("role")),TABLE_NAME,String.valueOf(request.getSession().getAttribute("username")),"前台新增",shiwuzhaoling.toString());
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

}

5.2 失物信息Service模块 

 package com.service;

import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.ShiwuzhaolingEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import java.util.List;

/**
 * 失物信息 服务类
 */
public interface ShiwuzhaolingService extends IService<ShiwuzhaolingEntity> {

    /**
    * @param params 查询参数
    * @return 带分页的查询出来的数据
    */
     PageUtils queryPage(Map<String, Object> params);

}

5.3 失物信息ServiceImpl模块


package com.service.impl;

import com.utils.StringUtil;
import com.service.DictionaryService;
import com.utils.ClazzDiff;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import com.dao.ShiwuzhaolingDao;
import com.entity.ShiwuzhaolingEntity;
import com.service.ShiwuzhaolingService;
import com.entity.view.ShiwuzhaolingView;

/**
 * 失物信息 服务实现类
 */
@Service("shiwuzhaolingService")
@Transactional
public class ShiwuzhaolingServiceImpl extends ServiceImpl<ShiwuzhaolingDao, ShiwuzhaolingEntity> implements ShiwuzhaolingService {

    @Override
    public PageUtils queryPage(Map<String,Object> params) {
        Page<ShiwuzhaolingView> page =new Query<ShiwuzhaolingView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,params));
        return new PageUtils(page);
    }


}

5.4  失物信息Dao模块


package com.dao;

import com.entity.ShiwuzhaolingEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;

import org.apache.ibatis.annotations.Param;
import com.entity.view.ShiwuzhaolingView;

/**
 * 失物信息 Dao 接口
 *
 * @author 
 */
public interface ShiwuzhaolingDao extends BaseMapper<ShiwuzhaolingEntity> {

   List<ShiwuzhaolingView> selectListView(Pagination page,@Param("params")Map<String,Object> params);

}

6、论文目录结构

摘要... I

Abstract... II

1 绪论... 1
   1.1 项目简介... 1
   1.2 调查研究... 1
       1.2.1 研究背景及意义... 1
       1.2.2 国内外研究现状... 2
       1.2.3 研究主要内容... 2
   1.3 论文的章节安排... 3

2 系统相关技术介绍... 4
   2.1 Java语言... 4
   2.2 SpringBoot框架... 4
   2.3 Vue框架... 4
   2.4 MySQL数据库... 4

3 系统需求分析... 6
   3.1 可行性分析... 6
       3.1.1 技术可行性... 6
       3.1.2 经济可行性... 6
       3.1.3 操作可行性... 6
   3.2 系统功能需求... 6
       3.2.1 用户端功能需求... 6
       3.2.2 XX端功能需求... 6
       3.2.3 管理员端功能需求... 6
   3.3 系统性能需求... 6

4 系统总体设计... 7
   4.1 系统总体架构设计... 7
   4.2 系统的功能设计... 7
   4.3 数据库设计... 7
       4.3.1 概念设计E-R图... 7
       4.3.2 逻辑设计关系模式... 7
       4.3.3 数据库物理设计... 7

5 系统详细实现... 14
   5.1 系统实现环境... 14
   5.2 用户端... 14
       5.2.1 登录页面... 14
       5.2.2 注册页面... 14
       5.2.3 XXXX页面... 14
       5.2.4 XXXX页面... 14
       5.2.5 XXXX页面... 14
   5.3 XXXX端... 15
       5.3.1 XXXX页面... 15
       5.3.2 XXXX页面... 15
       5.3.3 XXXX页面... 15
       5.3.4 XXXX页面... 15
   5.4 管理端... 15
       5.4.1 用户管理页面... 15
       5.4.2 XXXX页面... 15
       5.4.3 XXXX页面... 16
       5.4.4 XXXX页面... 16

6 系统测试... 16
   6.1 测试目的... 16
   6.2 测试方法... 16
   6.3 测试用例... 16
       6.3.1 XXXX测试... 16
       6.3.2 XXXX测试... 16
   6.4 测试结果... 16

结论... 17

参考文献... 18

致谢... 19

更多源码:

计算机毕业设计选题1000套等你来!!!

Python毕设精品项目

微信小程序毕设精品项目  

大数据及机器学习毕设精品项目 

7、源码获取

感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!

喜欢文章可以点赞、收藏、关注、评论

下方联系方式获取源码