基于springboot的图书管理系统的设计与实现

article/2025/6/7 14:57:25

 其他源码获取可以看首页:代码老y

个人简介:专注于毕业设计项目定制开发:springboot+vue系统,Java微信小程序,javaSSM系统等技术开发,并提供远程调试部署、代码讲解、文档指导、ppt制作等技术指导。源码获取,毕设定制查看本人首页获取联系

技术范围:SpringBoot、Vue、SSM、Nodejs、小程序等设计与开发。
本人负责:系统功能设计、毕设开题报告的撰写、任务书的制定、中期检查PPT的制作、系统功能的具体实现、论文的撰写与辅导以及长期的答辩答疑辅导。

大家在毕设选题,项目以及论文编写等相关问题都可以和我沟通,我会尽自己所能给大家解答。

感兴趣的同学可在首页获取联系 

1、开发相关技术介绍

1.1 SpringBoot框架

    SpringBoot 是由 Pivotal 团队开发的开源 Java 基础框架,旨在简化 Spring 应用的初始搭建以及开发过程。它通过提供一系列的“Starters”来自动配置 Spring 及其集成的第三方库,极大地降低了开发者的配置难度。SpringBoot 应用通常可以独立运行,通常打包成 JAR 文件,内置了如 Tomcat、Jetty 或 Undertow 等 Web 服务器,无需外部 Servlet SpringBoot 提倡使用 Java 注解 来优化配置流程,简化了设置步骤。此外,它还包含了一些高级的监控和管控工具,特别是 Actuator 模块,它让开发者能够方便地追踪应用程序的运行状况和性能表现。这些特点使得 SpringBoot 成为开发微服务和云应用的优选,同样适用于企业级应用。

1.2 Vue框架

    Vue 是一款专为构建动态和响应式的用户界面而设计的渐进式前端框架。Vue 在与一些更为庞大和全面的框架相比之中以其轻量级和模块化的特性脱颖而出,它的核心专注于视图层的构建,这样降低学习曲线的同时也便于与现有的项目或库进行无缝集成。 Vue 的设计理念强调简洁性和实用性,使开发者可以逐步地将框架的功能集成到项目中,不管是构建小型的交互界面还是处理大型应用,Vue 均能提供强大的功能支持。这种灵活性和易用性使前端开发更加高效和灵活,也是 Vue 受到广泛欢迎的关键因素之一。

1.3 MySQL数据库

    MySQL 数据库是一个使用 SQL 作为查询语言的开源关系型数据库管理系统。这个系统一开始是 MySQL AB 公司所开发的,之后经历了 Sun Microsystems 的收购,最终成为 Oracle 公司旗下的产品。MySQL 因其出色的性能、可靠性和用户友好的特性而受到青睐,正因如此它也被广泛地应用于网站开发、数据存储解决方案和企业级软件系统中。它不但支持多种操作系统,而且还功能丰富且配置灵活,基本上都能满足从小型应用到大型数据仓库的需求,也正因如此是众多开发者和企业第一个选择的数据库解决方案。

2、数据库实体设计 

概念设计的目标是设计出反映某个组织部门信息需求的数据库系统概念模式,数据库系统的概念模式独立于数据库系统的逻辑结构、独立于数据库管理系统(DBMS)、独立于计算机系统。

概念模式的设计方法是在需求分析的基础上,用概念数据模型(例如E-R模型)表示数据及数据之间的相互联系,设计出反映用户信息需求和处理需求的数据库系统概念模式。概念设计的目标是准确描述应用领域的信息模式,支持用户的各种应用,这样既容易转换为数据库系统逻辑模式,又容易为用户理解。数据库系统概念模式是面向现实世界的数据模型,不能直接用于数据库系统的实现。在此阶段,用户可以参与和评价数据库系统的设计,从而有利于保证数据库系统的设计与用户的需求相吻合。在概念模式的设计中,E-R模型法是最常见的设计方法。本系统的E-R图如下图所示:

各实体信息的E-R图如下所示。 

 

 

 

 

 

 

  3、数据库表设计(展示部分表)    

表3-1管理员信息表

序号

列名

数据类型

说明

允许空

1

id

Int

编号

2

username

String

用户名

3

password

String

密码

4

role

String

角色

5

addtime

Date

新增时间

表3-2用户信息表

序号

列名

数据类型

说明

允许空

1

id

Int

编号

2

username

String

账户

3

password

String

密码

4

yonghu_name

String

用户姓名

5

yonghu_photo

String

头像

6

sex_types

Integer

性别

7

yonghu_phone

String

联系方式

8

yonghu_id_number

String

用户身份证号

9

yonghu_email

String

邮箱

10

yonghu_delete

Integer

假删

11

create_time

Date

创建时间

表3-3图书信息表

序号

列名

数据类型

说明

允许空

1

id

Int

编号

2

tushu_uuid_number

String

图书编号

3

tushu_name

String

图书标题

4

tushu_types

Integer

图书类型

5

tushu_photo

String

图书封面

6

tushu_zuozhe

String

图书作者

7

chubanshe_types

Integer

图书出版社

8

shujia_types

Integer

所在书架

9

tushu_number

Integer

图书数量

10

tushu_content

String

图书详情

11

insert_time

Date

发布时间

12

create_time

Date

创建时间

表3-4借阅信息表

序号

列名

数据类型

说明

允许空

1

id

Int

编号

2

tushu_id

Integer

图书

3

yonghu_id

Integer

用户

4

tushujieyue_shijian

Integer

借阅时间

5

tushujieyue_types

Integer

借阅状态

6

insert_time

Date

借阅时间

7

create_time

Date

创建时间

表3-5论坛信息表

序号

列名

数据类型

说明

允许空

1

id

Int

编号

2

forum_name

String

帖子标题

3

yonghu_id

Integer

用户

4

jiaoshi_id

Integer

教师

5

users_id

Integer

管理员

6

forum_content

String

发布内容

7

super_ids

Integer

父编号

8

forum_state_types

Integer

帖子状态

9

insert_time

Date

发帖时间

10

update_time

Date

修改时间

11

create_time

Date

创建时间

表3-6公告信息表

序号

列名

数据类型

说明

允许空

1

id

Int

编号

2

news_name

String

公告标题

3

news_types

Integer

公告类型

4

news_photo

String

公告图片

5

insert_time

Date

公告时间

6

news_content

String

公告详情

7

create_time

Date

创建时间

   4、部分关键代码实现 


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("/tushujieyue")
public class TushujieyueController {private static final Logger logger = LoggerFactory.getLogger(TushujieyueController.class);@Autowiredprivate TushujieyueService tushujieyueService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//级联表service@Autowiredprivate TushuService tushuService;@Autowiredprivate YonghuService yonghuService;/*** 后端列表*/@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"));if(params.get("orderBy")==null || params.get("orderBy")==""){params.put("orderBy","id");}PageUtils page = tushujieyueService.queryPage(params);//字典表数据转换List<TushujieyueView> list =(List<TushujieyueView>)page.getList();for(TushujieyueView 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);TushujieyueEntity tushujieyue = tushujieyueService.selectById(id);if(tushujieyue !=null){//entity转viewTushujieyueView view = new TushujieyueView();BeanUtils.copyProperties( tushujieyue , view );//把实体数据重构到view中//级联表TushuEntity tushu = tushuService.selectById(tushujieyue.getTushuId());if(tushu != null){BeanUtils.copyProperties( tushu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段view.setTushuId(tushu.getId());}//级联表YonghuEntity yonghu = yonghuService.selectById(tushujieyue.getYonghuId());if(yonghu != null){BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到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 TushujieyueEntity tushujieyue, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,tushujieyue:{}",this.getClass().getName(),tushujieyue.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");else if("用户".equals(role))tushujieyue.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));Wrapper<TushujieyueEntity> queryWrapper = new EntityWrapper<TushujieyueEntity>().eq("tushu_id", tushujieyue.getTushuId()).eq("yonghu_id", tushujieyue.getYonghuId()).eq("tushujieyue_types", tushujieyue.getTushujieyueTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());TushujieyueEntity tushujieyueEntity = tushujieyueService.selectOne(queryWrapper);if(tushujieyueEntity==null){tushujieyue.setInsertTime(new Date());tushujieyue.setCreateTime(new Date());tushujieyueService.insert(tushujieyue);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody TushujieyueEntity tushujieyue, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,tushujieyue:{}",this.getClass().getName(),tushujieyue.toString());String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("用户".equals(role))
//            tushujieyue.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));//根据字段查询是否有相同数据Wrapper<TushujieyueEntity> queryWrapper = new EntityWrapper<TushujieyueEntity>().notIn("id",tushujieyue.getId()).andNew().eq("tushu_id", tushujieyue.getTushuId()).eq("yonghu_id", tushujieyue.getYonghuId()).eq("tushujieyue_shijian", tushujieyue.getTushujieyueShijian()).eq("tushujieyue_types", tushujieyue.getTushujieyueTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());TushujieyueEntity tushujieyueEntity = tushujieyueService.selectOne(queryWrapper);if(tushujieyueEntity==null){tushujieyueService.updateById(tushujieyue);//根据id更新TushuEntity tushuEntity = tushuService.selectById(tushujieyueService.selectById(tushujieyue.getId()).getTushuId());tushuEntity.setTushuNumber(tushuEntity.getTushuNumber() + 1);tushuService.updateById(tushuEntity);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());tushujieyueService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);try {List<TushujieyueEntity> tushujieyueList = 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){//循环TushujieyueEntity tushujieyueEntity = new TushujieyueEntity();
//                            tushujieyueEntity.setTushuId(Integer.valueOf(data.get(0)));   //图书 要改的
//                            tushujieyueEntity.setYonghuId(Integer.valueOf(data.get(0)));   //用户 要改的
//                            tushujieyueEntity.setTushujieyueShijian(Integer.valueOf(data.get(0)));   //借阅时间(天) 要改的
//                            tushujieyueEntity.setTushujieyueTypes(Integer.valueOf(data.get(0)));   //借阅状态 要改的
//                            tushujieyueEntity.setInsertTime(date);//时间
//                            tushujieyueEntity.setCreateTime(date);//时间tushujieyueList.add(tushujieyueEntity);//把要查询是否重复的字段放入map中}//查询是否重复tushujieyueService.insertBatch(tushujieyueList);return R.ok();}}}}catch (Exception e){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));// 没有指定排序字段就默认id倒序if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){params.put("orderBy","id");}PageUtils page = tushujieyueService.queryPage(params);//字典表数据转换List<TushujieyueView> list =(List<TushujieyueView>)page.getList();for(TushujieyueView 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);TushujieyueEntity tushujieyue = tushujieyueService.selectById(id);if(tushujieyue !=null){//entity转viewTushujieyueView view = new TushujieyueView();BeanUtils.copyProperties( tushujieyue , view );//把实体数据重构到view中//级联表TushuEntity tushu = tushuService.selectById(tushujieyue.getTushuId());if(tushu != null){BeanUtils.copyProperties( tushu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段view.setTushuId(tushu.getId());}//级联表YonghuEntity yonghu = yonghuService.selectById(tushujieyue.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 TushujieyueEntity tushujieyue, HttpServletRequest request){logger.debug("add方法:,,Controller:{},,tushujieyue:{}",this.getClass().getName(),tushujieyue.toString());Wrapper<TushujieyueEntity> queryWrapper = new EntityWrapper<TushujieyueEntity>().eq("tushu_id", tushujieyue.getTushuId()).eq("yonghu_id", tushujieyue.getYonghuId()).eq("tushujieyue_shijian", tushujieyue.getTushujieyueShijian()).eq("tushujieyue_types", tushujieyue.getTushujieyueTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());TushujieyueEntity tushujieyueEntity = tushujieyueService.selectOne(queryWrapper);if(tushujieyueEntity==null){tushujieyue.setInsertTime(new Date());tushujieyue.setCreateTime(new Date());tushujieyueService.insert(tushujieyue);TushuEntity tushuEntity = tushuService.selectById(tushujieyue.getTushuId());tushuEntity.setTushuNumber(tushuEntity.getTushuNumber() - 1);tushuService.updateById(tushuEntity);return R.ok();}else {return R.error(511,"表中有相同数据");}}}

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("/news")
public class NewsController {private static final Logger logger = LoggerFactory.getLogger(NewsController.class);@Autowiredprivate NewsService newsService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//级联表service@Autowiredprivate YonghuService yonghuService;/*** 后端列表*/@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"));if(params.get("orderBy")==null || params.get("orderBy")==""){params.put("orderBy","id");}PageUtils page = newsService.queryPage(params);//字典表数据转换List<NewsView> list =(List<NewsView>)page.getList();for(NewsView 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);NewsEntity news = newsService.selectById(id);if(news !=null){//entity转viewNewsView view = new NewsView();BeanUtils.copyProperties( news , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody NewsEntity news, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>().eq("news_name", news.getNewsName()).eq("news_types", news.getNewsTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());NewsEntity newsEntity = newsService.selectOne(queryWrapper);if(newsEntity==null){news.setInsertTime(new Date());news.setCreateTime(new Date());newsService.insert(news);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody NewsEntity news, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");//根据字段查询是否有相同数据Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>().notIn("id",news.getId()).andNew().eq("news_name", news.getNewsName()).eq("news_types", news.getNewsTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());NewsEntity newsEntity = newsService.selectOne(queryWrapper);if("".equals(news.getNewsPhoto()) || "null".equals(news.getNewsPhoto())){news.setNewsPhoto(null);}if(newsEntity==null){newsService.updateById(news);//根据id更新return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());newsService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);try {List<NewsEntity> newsList = 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){//循环NewsEntity newsEntity = new NewsEntity();
//                            newsEntity.setNewsName(data.get(0));                    //公告标题 要改的
//                            newsEntity.setNewsTypes(Integer.valueOf(data.get(0)));   //公告类型 要改的
//                            newsEntity.setNewsPhoto("");//照片
//                            newsEntity.setInsertTime(date);//时间
//                            newsEntity.setNewsContent("");//照片
//                            newsEntity.setCreateTime(date);//时间newsList.add(newsEntity);//把要查询是否重复的字段放入map中}//查询是否重复newsService.insertBatch(newsList);return R.ok();}}}}catch (Exception e){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));// 没有指定排序字段就默认id倒序if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){params.put("orderBy","id");}PageUtils page = newsService.queryPage(params);//字典表数据转换List<NewsView> list =(List<NewsView>)page.getList();for(NewsView 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);NewsEntity news = newsService.selectById(id);if(news !=null){//entity转viewNewsView view = new NewsView();BeanUtils.copyProperties( news , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody NewsEntity news, HttpServletRequest request){logger.debug("add方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>().eq("news_name", news.getNewsName()).eq("news_types", news.getNewsTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());NewsEntity newsEntity = newsService.selectOne(queryWrapper);if(newsEntity==null){news.setInsertTime(new Date());news.setCreateTime(new Date());newsService.insert(news);return R.ok();}else {return R.error(511,"表中有相同数据");}}}

 5、系统实现 (展示部分截图)  

5.1个人中心 

 

5.2管理员管理         

 5.3用户管理 

 5.4图书出版社管理

 5.5公告类型管理

 5.6所在书架管理

 5.7图书类型管理        

 5.8论坛管理

5.9公告信息管理 

5.10图书信息管理 

 5.11借阅信息管理

 5.12轮播图管理

 

源码获取

谢谢大家点赞、收藏、关注、评论,如有需要可查看主页获取联系方式


http://www.hkcw.cn/article/mEttWtNdwD.shtml

相关文章

一个html实现数据库自定义查询

使用场景 应用上线后甲方频繁的找开发查询数据库数据&#xff0c;且没有固定的查询规律&#xff0c;产品经理也没有规划报表需求。 实现方案 后端开放自定义sql查询&#xff0c;屏蔽所有数据库的高危操作&#xff0c;将常用查询的sql放在一个html中的js中直接查询&#xff0…

[特殊字符] Unity UI 性能优化终极指南 — ScrollRect篇

ScrollRect ManualScrollRect API 我参考了官方最新文档&#xff08;基于UGUI 3.0包&#xff09;&#xff0c;加上实际性能测试经验&#xff0c;直接给你梳理&#xff1a; &#x1f3af; Unity UI 性能优化终极指南 — ScrollRect篇 &#x1f9e9; 什么是 ScrollRect&#xff…

VsCode 安装 Cline 插件并使用免费模型(例如 DeepSeek)

当前时间为 25/6/3&#xff0c;Cline 版本为 3.17.8 点击侧边栏的“扩展”图标 在搜索框中输入“Cline” 找到 Cline 插件&#xff0c;然后点击“安装” 安装完成后&#xff0c;Cline 图标会出现在 VS Code 的侧边栏中 点击 Use your own API key API Provider 选择 OpenRouter…

Spark期末基础复习

填空选择判断 第一章 一、填空题 1.Scala语言的特性包含____________、函数式编程的、____________、可扩展的、____________。 2.在Scala 数据类型层级结构的底部有两个数据类型&#xff0c;分别是____________和____________。 3.在Scala中&#xff0c;声明变量的关键字有…

【Zephyr 系列 5】定时器与低功耗控制:打造省电高效的嵌入式系统

🧠关键词:Zephyr、定时器、k_timer、PM、低功耗、STM32、RTC 📌适合人群:想实现周期任务、功耗优化、定时唤醒等功能的 MCU 工程师 ✨ 前言:省电不是选项,而是刚需 在电池供电的嵌入式设备中,功耗决定了产品寿命与可靠性。无论是蓝牙传感器、GPS 跟踪器还是 LoRa 节点…

ATR2660SGNSS L1 频段 低噪声放大器

ATR2660S是一款应用于GNSS接收机的低噪声放大器&#xff0c;芯片集成了有源偏置电路和ESD保护电路&#xff0c;核心电路部分使用两级放大器结构进一步提高功率增益。 主要特征 高增益&#xff1a; 30dB 1575.42MHz 31dB 1176.45MHz 低噪声系数&#xff1a; 1.1dB 1575.42MHz 1.…

【Spring AI 1.0.0】Spring AI 1.0.0框架快速入门(1)——Chat Client API

Spring AI框架快速入门 一、前言二、前期准备2.1 运行环境2.2 maven配置2.3 api-key申请 三、Chat Client API3.1 导入pom依赖3.2 配置application.properties文件3.3 创建 ChatClient3.3.1 使用自动配置的 ChatClient.Builder3.3.2 使用多个聊天模型 3.4 ChatClient请求3.5 Ch…

FreeRTOS的简单介绍

一、FreeRTOS介绍 FreeRTOS并不是实时操作系统&#xff0c;因为它是分时复用的 利用CubeMX快速移植 二、快速移植流程 1. 在 SYS 选项里&#xff0c;将 Debug 设为 Serial Wire &#xff0c;并且将 Timebase Source 设为 TIM2 &#xff08;其它定时器也行&#xff09;。为何…

Deepseek/cherry studio中的Latex公式复制到word中

需要将Deepseek/cherry studio中公式复制到word中&#xff0c;但是deepseek输出Latex公式&#xff0c;比如以下Latex代码段&#xff0c;需要通过Mathtype翻译才能在word中编辑。 $$\begin{aligned}H_1(k1) & H_1(k) \frac{1}{A_1} \left( Q_1 u_1(k) Q_{i1} - Q_2 u_2(k…

如何爬取google应用商店的应用分类呢?

以下是爬取Google Play商店应用包名(package name)和对应分类的完整解决方案&#xff0c;采用ScrapyPlaywright组合应对动态渲染页面&#xff0c;并处理反爬机制&#xff1a; 完整爬虫实现 1. 安装必要库 # 卸载现有安装pip uninstall playwright scrapy-playwright -y# 重新…

英福康INFICON VGC501, VGC502, VGC503 单通道、双通道和三通道测量装置

英福康INFICON VGC501, VGC502, VGC503 单通道、双通道和三通道测量装置

C++ Visual Studio 2017厂商给的源码没有.sln文件 易兆微芯片下载工具加开机动画下载。

1.先用Visual Studio 2017打开Yichip YC31xx loader.vcxproj&#xff0c;再用Visual Studio 2022打开。再保侟就有.sln文件了。 易兆微芯片下载工具加开机动画下载 ExtraDownloadFile1Info.\logo.bin|0|0|10D2000|0 MFC应用兼容CMD 在BOOL CYichipYC31xxloaderDlg::OnIni…

JsonCpp 库如何集成到Visual studio

这是用于 在 C 中解析和生成 JSON 数据 的工具包&#xff0c;适合在需要与前端、网络、配置等 JSON 格式交互的 C 项目中使用。 Json&#xff08;基于JsonCpp&#xff09; 格式全称&#xff1a;JavaScript Object Notation 格式特点&#xff1a; 与开发语言无关轻量级的数据…

sourceinsight4.0不识别.cc解决办法

options—>preferences 选择 c language, 点击右边的 file types, 添加 ;*.cc即可 重新创建工程, 不仅有.cc, 还有.cc的目录结构

RNN结构扩展与改进:从简单循环网络到时间间隔网络的技术演进

本文系统介绍 RNN 结构的常见扩展与改进方案。涵盖 简单循环神经网络&#xff08;SRN&#xff09;、双向循环神经网络&#xff08;BRNN&#xff09;、深度循环神经网络&#xff08;Deep RNN&#xff09; 等多种变体&#xff0c;解析其核心架构、技术特点及应用场景&#xff0c;…

IBM DB2分布式数据库架构

一、什么是分布式数据库架构 分布式数据库架构是现代数据库系统的重要发展方向&#xff0c;特别适合处理大规模数据、高并发访问和高可用性需求的应用场景。下面我们从原理、架构模式、关键技术、实现方式和常见产品几个方面来系统讲 1、分布式数据库的基本概念与原理 1. 什…

第十三章 Java基础-特殊处理

文章目录 1.包和final2.权限修饰符和代码块3.抽象类1.包和final 2.权限修饰符和代码块 3.抽象类

Could not get unknown property ‘mUser‘ for Credentials [username: null]

最近遇到jekins打包报错&#xff1a; Could not get unknown property mUser for Credentials [username: null] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated。 项目使用的是gradle&#xff0c;通过pipeline打docker包&#xff1b;因为ma…

核显战3A,锐龙9000G系列CPU曝光

在刚过去不久的台北国际电脑展上&#xff0c;AMD 为大家带来了 RX 9060 XT、Radeon AI PRO R 9700 显卡以及线程撕裂者系列新品。 尽管狠活儿不少&#xff0c;但这场电脑展仍然让不少同学失望而归。 因为&#xff0c;原本预期亮相锐龙 9000G 系列桌面 APU 竟没有公布半点消息。…

[yolov11改进系列]基于yolov11引入空间通道系统注意力机制SCSA的python源码+训练源码

【SCSA介绍】 1、Spatial and Channel Synergistic Attention ​ 通道和空间注意力分别为各种下游视觉任务的特征依赖性和空间结构关系提取带来了显著的改进。虽然两者的组合更有利于发挥各自的优势&#xff0c;但通道和空间注意力之间的协同作用尚未得到充分探索&#xff0c…