首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

-图书管理系统后端源码

后端 103.42KB 23 需要积分: 1
立即下载

资源介绍:

采用JavaEE编写图书管理系统
package com.hlpedu.book.service.impl; import com.hlpedu.book.bo.BorrowBookBo; import com.hlpedu.book.bo.BorrowUserBo; import com.hlpedu.book.mapper.BorrowMapper; import com.hlpedu.book.pojo.Book; import com.hlpedu.book.pojo.Borrow; import com.hlpedu.book.pojo.User; import com.hlpedu.book.service.BookService; import com.hlpedu.book.service.BorrowService; import com.hlpedu.book.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class BorrowServiceImpl implements BorrowService { @Autowired BorrowMapper borrowMapper; @Autowired BookService bookService; @Autowired UserService userService; @Override public List countBorrowBo() { List list= borrowMapper.countBorrowBo(); return list; } @Override public List countBorrowUserBo() { List list= borrowMapper.countBorrowUserBo(); return list; } // 统计借阅信息记录 @Override public int countBorrow(String uname, String bname) { return borrowMapper.countBorrow(uname,bname); } // 分页查询借阅信息 @Override public List listPageBorrow(Integer page, Integer rows, String uname, String bname) { return borrowMapper.listPageBorrow((page-1)*rows,rows,uname,bname); } // 统计归还信息记录 @Override public int countHistoryBorrow(String uname, String bname) { return borrowMapper.countHistoryBorrow(uname,bname); } // 分页查询归还信息 @Override public List listPageHistoryBorrow(Integer page, Integer size, String uname, String bname) { return borrowMapper.listPageHistoryBorrow((page-1)*size,size,uname,bname); } // 新增图书借阅信息 @Override public void saveBorrowBooks(Borrow borrow) { System.out.println(borrow.getBook().getBid()+"-----"); //图书ID,通过获得借阅图书库存 Book book = bookService.findBookById(borrow.getBook().getBid()); User user=userService.findUserById(borrow.getUser().getUid()); if (book != null){ if (book.getQuantity() > 0 && book.getQuantity() >= borrow.getQuantity()&& user.getStats()==0){ //借阅图书库存减一 book.setQuantity(book.getQuantity() - borrow.getQuantity()); bookService.updateBook(book); borrow.setBook(book); System.out.println(borrow.getUser().getUid()); // User user=userService.findUserById(borrow.getUser().getUid()); // System.out.println(borrow.getUser().getUname()); // User user = userService.findUserByUname(borrow.getUser().getUname()); borrow.setUser(user); } } //借阅图书信息入库 borrowMapper.saveBorrow(borrow); // //1.查询图书信息 // book = bookService.findBookById(book.getBid()); // //2.新增图书借阅信息 // //如果借阅数量小于等于馆藏图书的数量,则更新馆藏图书数量和借阅数量 // if(borrow.getQuantity() <= book.getQuantity()){ // //2.1 更新馆藏图书数量 =馆藏图书数量-借阅数量 // book.setQuantity(book.getQuantity()-borrow.getQuantity()); // //更新馆藏图书信息 // bookService.changStore(book); // } // //添加图书借阅信息 // borrow.setBook(book); } //归还图书 @Override public void backBooksBorrow(Integer boid) { //1.根据boid查询借阅信息 Borrow borrow = getBorrowByBoid(boid); //2.根据图书bid查询图书信息 Book book = bookService.findBookById(borrow.getBook().getBid()); //3.最终归还图书,在图书数量上加上借阅的数量 book.setQuantity(book.getQuantity()+borrow.getQuantity()); bookService.changStore(book); borrow.setStats(1);//更改借阅状态 borrowMapper.updateBorrow(borrow); } //根据boid查询借阅信息 private Borrow getBorrowByBoid(Integer boid) { return borrowMapper.findBorrowByBoid(boid); } }

资源文件列表:

BookProject.zip 大约有138个文件
  1. BookProject/.gitignore 490B
  2. BookProject/.idea/
  3. BookProject/.idea/.gitignore 184B
  4. BookProject/.idea/compiler.xml 783B
  5. BookProject/.idea/dataSources.local.xml 1.05KB
  6. BookProject/.idea/dataSources.xml 839B
  7. BookProject/.idea/dataSources/
  8. BookProject/.idea/dataSources/19d48d31-15d3-45b5-82ce-7fc11544315b.xml 43.25KB
  9. BookProject/.idea/dataSources/19d48d31-15d3-45b5-82ce-7fc11544315b/
  10. BookProject/.idea/dataSources/19d48d31-15d3-45b5-82ce-7fc11544315b/storage_v2/
  11. BookProject/.idea/dataSources/19d48d31-15d3-45b5-82ce-7fc11544315b/storage_v2/_src_/
  12. BookProject/.idea/dataSources/19d48d31-15d3-45b5-82ce-7fc11544315b/storage_v2/_src_/schema/
  13. BookProject/.idea/dataSources/19d48d31-15d3-45b5-82ce-7fc11544315b/storage_v2/_src_/schema/book.6TouAA.meta 59B
  14. BookProject/.idea/encodings.xml 267B
  15. BookProject/.idea/inspectionProfiles/
  16. BookProject/.idea/inspectionProfiles/Project_Default.xml 281B
  17. BookProject/.idea/jarRepositories.xml 1.11KB
  18. BookProject/.idea/misc.xml 541B
  19. BookProject/.idea/uiDesigner.xml 8.71KB
  20. BookProject/.idea/workspace.xml 7.5KB
  21. BookProject/pom.xml 2.43KB
  22. BookProject/src/
  23. BookProject/src/main/
  24. BookProject/src/main/java/
  25. BookProject/src/main/java/com/
  26. BookProject/src/main/java/com/hlpedu/
  27. BookProject/src/main/java/com/hlpedu/book/
  28. BookProject/src/main/java/com/hlpedu/book/aop/
  29. BookProject/src/main/java/com/hlpedu/book/aop/SystemControllerLog.java 335B
  30. BookProject/src/main/java/com/hlpedu/book/aop/SystemLogAspect.java 3.22KB
  31. BookProject/src/main/java/com/hlpedu/book/bo/
  32. BookProject/src/main/java/com/hlpedu/book/bo/BorrowBookBo.java 148B
  33. BookProject/src/main/java/com/hlpedu/book/bo/BorrowUserBo.java 150B
  34. BookProject/src/main/java/com/hlpedu/book/BookProjectApplication.java 485B
  35. BookProject/src/main/java/com/hlpedu/book/controller/
  36. BookProject/src/main/java/com/hlpedu/book/controller/BookController.java 3.79KB
  37. BookProject/src/main/java/com/hlpedu/book/controller/BorrowController.java 4.18KB
  38. BookProject/src/main/java/com/hlpedu/book/controller/CategoryController.java 3.51KB
  39. BookProject/src/main/java/com/hlpedu/book/controller/LogsContoller.java 1.11KB
  40. BookProject/src/main/java/com/hlpedu/book/controller/UserController.java 2.99KB
  41. BookProject/src/main/java/com/hlpedu/book/mapper/
  42. BookProject/src/main/java/com/hlpedu/book/mapper/BookMapper.java 1.08KB
  43. BookProject/src/main/java/com/hlpedu/book/mapper/BorrowMapper.java 2.1KB
  44. BookProject/src/main/java/com/hlpedu/book/mapper/CategoryMapper.java 1.45KB
  45. BookProject/src/main/java/com/hlpedu/book/mapper/LogsMapper.java 577B
  46. BookProject/src/main/java/com/hlpedu/book/mapper/UserMapper.java 973B
  47. BookProject/src/main/java/com/hlpedu/book/pojo/
  48. BookProject/src/main/java/com/hlpedu/book/pojo/Book.java 2.3KB
  49. BookProject/src/main/java/com/hlpedu/book/pojo/Borrow.java 1.2KB
  50. BookProject/src/main/java/com/hlpedu/book/pojo/Category.java 1.37KB
  51. BookProject/src/main/java/com/hlpedu/book/pojo/Logs.java 1.41KB
  52. BookProject/src/main/java/com/hlpedu/book/pojo/User.java 1.24KB
  53. BookProject/src/main/java/com/hlpedu/book/service/
  54. BookProject/src/main/java/com/hlpedu/book/service/BookService.java 527B
  55. BookProject/src/main/java/com/hlpedu/book/service/BorrowService.java 701B
  56. BookProject/src/main/java/com/hlpedu/book/service/CategoryService.java 541B
  57. BookProject/src/main/java/com/hlpedu/book/service/impl/
  58. BookProject/src/main/java/com/hlpedu/book/service/impl/BookServiceImpl.java 1.6KB
  59. BookProject/src/main/java/com/hlpedu/book/service/impl/BorrowServiceImpl.java 4.34KB
  60. BookProject/src/main/java/com/hlpedu/book/service/impl/CategoryServiceImpl.java 1.83KB
  61. BookProject/src/main/java/com/hlpedu/book/service/impl/LogsServiceImpl.java 891B
  62. BookProject/src/main/java/com/hlpedu/book/service/impl/UserServiceImpl.java 1.65KB
  63. BookProject/src/main/java/com/hlpedu/book/service/LogsService.java 346B
  64. BookProject/src/main/java/com/hlpedu/book/service/UserService.java 494B
  65. BookProject/src/main/java/com/hlpedu/book/tools/
  66. BookProject/src/main/java/com/hlpedu/book/tools/config/
  67. BookProject/src/main/java/com/hlpedu/book/tools/config/Knife4jConfig.java 3.1KB
  68. BookProject/src/main/java/com/hlpedu/book/tools/result/
  69. BookProject/src/main/java/com/hlpedu/book/tools/result/GlobalResultClass.java 3.28KB
  70. BookProject/src/main/java/com/hlpedu/book/tools/result/ResultCodeEnum.java 718B
  71. BookProject/src/main/java/com/hlpedu/book/utils/
  72. BookProject/src/main/resources/
  73. BookProject/src/main/resources/application.yml 579B
  74. BookProject/src/main/resources/mappers/
  75. BookProject/src/main/resources/mappers/BookMapper.xml 3.07KB
  76. BookProject/src/main/resources/mappers/BorrowMapper.xml 4.03KB
  77. BookProject/src/main/resources/mappers/CategoryMapper.xml 2.67KB
  78. BookProject/src/main/resources/mappers/LogsMapper.xml 975B
  79. BookProject/src/main/resources/mappers/UserMapper.xml 1.77KB
  80. BookProject/src/test/
  81. BookProject/src/test/java/
  82. BookProject/target/
  83. BookProject/target/classes/
  84. BookProject/target/classes/application.yml 579B
  85. BookProject/target/classes/com/
  86. BookProject/target/classes/com/hlpedu/
  87. BookProject/target/classes/com/hlpedu/book/
  88. BookProject/target/classes/com/hlpedu/book/aop/
  89. BookProject/target/classes/com/hlpedu/book/aop/SystemControllerLog.class 545B
  90. BookProject/target/classes/com/hlpedu/book/aop/SystemLogAspect.class 4.03KB
  91. BookProject/target/classes/com/hlpedu/book/bo/
  92. BookProject/target/classes/com/hlpedu/book/bo/BorrowBookBo.class 1.96KB
  93. BookProject/target/classes/com/hlpedu/book/bo/BorrowUserBo.class 1.96KB
  94. BookProject/target/classes/com/hlpedu/book/BookProjectApplication.class 842B
  95. BookProject/target/classes/com/hlpedu/book/controller/
  96. BookProject/target/classes/com/hlpedu/book/controller/BookController.class 5.51KB
  97. BookProject/target/classes/com/hlpedu/book/controller/BorrowController.class 4.77KB
  98. BookProject/target/classes/com/hlpedu/book/controller/CategoryController.class 4.64KB
  99. BookProject/target/classes/com/hlpedu/book/controller/LogsContoller.class 2KB
  100. BookProject/target/classes/com/hlpedu/book/controller/UserController.class 4.1KB
  101. BookProject/target/classes/com/hlpedu/book/mapper/
  102. BookProject/target/classes/com/hlpedu/book/mapper/BookMapper.class 1.49KB
  103. BookProject/target/classes/com/hlpedu/book/mapper/BorrowMapper.class 1.4KB
  104. BookProject/target/classes/com/hlpedu/book/mapper/CategoryMapper.class 1.01KB
  105. BookProject/target/classes/com/hlpedu/book/mapper/LogsMapper.class 839B
  106. BookProject/target/classes/com/hlpedu/book/mapper/UserMapper.class 1.2KB
  107. BookProject/target/classes/com/hlpedu/book/pojo/
  108. BookProject/target/classes/com/hlpedu/book/pojo/Book.class 7.96KB
  109. BookProject/target/classes/com/hlpedu/book/pojo/Borrow.class 5.06KB
  110. BookProject/target/classes/com/hlpedu/book/pojo/Category.class 4.99KB
  111. BookProject/target/classes/com/hlpedu/book/pojo/Logs.class 5.04KB
  112. BookProject/target/classes/com/hlpedu/book/pojo/User.class 5.43KB
  113. BookProject/target/classes/com/hlpedu/book/service/
  114. BookProject/target/classes/com/hlpedu/book/service/BookService.class 1.08KB
  115. BookProject/target/classes/com/hlpedu/book/service/BorrowService.class 1013B
  116. BookProject/target/classes/com/hlpedu/book/service/CategoryService.class 907B
  117. BookProject/target/classes/com/hlpedu/book/service/impl/
  118. BookProject/target/classes/com/hlpedu/book/service/impl/BookServiceImpl.class 2.64KB
  119. BookProject/target/classes/com/hlpedu/book/service/impl/BorrowServiceImpl.class 4.57KB
  120. BookProject/target/classes/com/hlpedu/book/service/impl/CategoryServiceImpl.class 2.56KB
  121. BookProject/target/classes/com/hlpedu/book/service/impl/LogsServiceImpl.class 1.52KB
  122. BookProject/target/classes/com/hlpedu/book/service/impl/UserServiceImpl.class 2.44KB
  123. BookProject/target/classes/com/hlpedu/book/service/LogsService.class 577B
  124. BookProject/target/classes/com/hlpedu/book/service/UserService.class 873B
  125. BookProject/target/classes/com/hlpedu/book/tools/
  126. BookProject/target/classes/com/hlpedu/book/tools/config/
  127. BookProject/target/classes/com/hlpedu/book/tools/config/Knife4jConfig.class 3.79KB
  128. BookProject/target/classes/com/hlpedu/book/tools/result/
  129. BookProject/target/classes/com/hlpedu/book/tools/result/GlobalResultClass.class 5.39KB
  130. BookProject/target/classes/com/hlpedu/book/tools/result/ResultCodeEnum.class 2.15KB
  131. BookProject/target/classes/mappers/
  132. BookProject/target/classes/mappers/BookMapper.xml 3.07KB
  133. BookProject/target/classes/mappers/BorrowMapper.xml 4.03KB
  134. BookProject/target/classes/mappers/CategoryMapper.xml 2.67KB
  135. BookProject/target/classes/mappers/LogsMapper.xml 975B
  136. BookProject/target/classes/mappers/UserMapper.xml 1.77KB
  137. BookProject/target/generated-sources/
  138. BookProject/target/generated-sources/annotations/
0评论
提交 加载更多评论
其他资源 Discuz淘宝客网站模板,迪恩淘宝客购物风格商业版模板
Discuz淘宝客网站模板,迪恩淘宝客购物风格商业版模板。 版本支持:discuzx3.0版本,discuzx3.1版本,discuzx3.2版本。 包括网站首页,论坛首页,论坛列表页,论坛内容页,论坛瀑布流,频道列表页,频道内容页(支持多个)。 模板论坛首页,列表页,内容页,以及文章页面数据采用DIY数据读取, 方便新手老手运营以及后期维护,时尚大气简洁。模板添加了不少处动画效果,增加用户体验和粘度。 模板有很多细节都有体现,同时对官方模板文件结构和功能位置做了更为优化的设计处理,
AD实验图及参考资料.zip
AD实验图及参考资料.zip
苹果CMS广告插件,提升网站广告质量,苹果CMS防投诉广告插件,确保广告合规性避免投诉问题
苹果cms防投诉广告插件,防止被恶意投诉 只允许蜘蛛访问原内容,其他访客直接显示广告
个人使用资源,请忽略www
个人
QtTreePropertyBrowser -Qt5
qtpropertybrowser Qt5 sources
onnx2ncnnGUI
onnx转ncnn可视化软件
onnx2ncnnGUI
一些好用的桌面时钟,自留
一些好用的桌面时钟,自留
交换机自动化获取诊断信息(H3C)
​ 当前文件夹中除去介绍文件共有3个文件一个文件夹 “capture.txt”文件用于存放从交换机获取到的数据 “diagnostic.txt”文件用于直接参考代码 “diagnostic.py”文件作为自动化获取巡检信息的代码 “diagnosis”文件夹则用于存取从交换机下载的诊断信息文件 代码修改     USERNAME = "h3c"  # 交换机登录用户     PASSWORD = "huawei@123"  # 交换机登录密码     # 添加你的交换机IP地址     hosts = ["172.16.1.1"]  # 替换为你实际的交换机IP 通过修改代码的122、123、127行将交换机信息修改为想要获取诊断信息的账号密码和IP print("诊断收集中,需等待40秒...") # 输入确认并等待40秒 ssh_shell.send('y\n') # 输入 'y' 并回车确认保存诊断信息 time.sleep(1) # 使用动态生成的文件名保存到交换机 ssh_shell.send(f"flash:/{self.diagnostic_file}\n")