1、项目介绍
如今,随着人们生活水平不断提高,人们的生活在物质满足的基础上,更多的人将生活的重点放在追求精神享受的过程中。于此同时,Internet铺天盖地的普及,使得这样的人纷纷通过Internet的方式去寻找精神的满足。然而领养宠物正是人们现在炙手可热的一种精神寄托。对于宠物的热爱让他们的生活更加充满爱心和向往。Internet和领养宠物的两者结合,大大推动了电子商务的发展,促进了该行业的崛起。这正是二手流浪宠物领养网站诞生的缘由。该网站不仅解决了地理隔离的问题,同时也跟上了网络快速发展的脚步,实现爱宠人士足不出户的领养到心仪的爱宠。
本文研究了一个流浪宠物领养管理系统,该系统基于B/S架构模式,使用ssm框架开发设计而成。系统主要以Java语言作为开发基础,使用了jsp+ssm等技术,采用idea为开发工具,以MySql作为数据库工具。本系统分为前台模块和后台管理模块,前台模块方便用户进行的查看,后台管理模块方便管理员进行管理。本系统功能比较完善,界面友好,操作简单,方便用户的使用。
![](https://img-blog.csdnimg.cn/img_convert/7a43cb0cb8302b162584c75a8839f95c.png)
2、技术框架
运行系统:windows
编程语言:java
系统架构:B/S
后端框框:SSM( Spring+SpringMVC+Mybaits)
前端框架:JSP+jQuery+Ajax
前后端分离:否
数据库:MySQL
Maven项目:是
数据库表数量:8
运行环境:JDK8+MySQL5.6+Tomcat8.5+IntelliJ IDEA
3、演示视频
基于ssm+jsp的宠物领养管理系统
4、项目截图
![](https://img-blog.csdnimg.cn/img_convert/bff37c6c5e6caf9d47374548f29e0743.png)
![](https://img-blog.csdnimg.cn/img_convert/028d7a1cef51cf28f618dd843ba154cd.png)
![](https://img-blog.csdnimg.cn/img_convert/1a007b4dca6d2ed5092bb9d144aa7c6c.png)
![](https://img-blog.csdnimg.cn/img_convert/9187426dbd3d9419d86916b4876179fb.png)
![](https://img-blog.csdnimg.cn/img_convert/313b854db646f84d7ed22d9605545c58.png)
![](https://img-blog.csdnimg.cn/img_convert/afc1119cdd5b6f5dd75c7ad4d69b5df4.png)
![](https://img-blog.csdnimg.cn/img_convert/9c9a391013758c1b3d2e22a6a077f7be.png)
![](https://img-blog.csdnimg.cn/img_convert/d354ead6a5d9932654b32c7e38c14566.png)
![](https://img-blog.csdnimg.cn/img_convert/2ab82760804e8d44c6cd0a55fa53d5c9.png)
![](https://img-blog.csdnimg.cn/img_convert/fbb7f0bc58d802fe421abdadf322d040.png)
![](https://img-blog.csdnimg.cn/img_convert/760d65f5dec36b0b1c6776dc2f4b52a3.png)
![](https://img-blog.csdnimg.cn/img_convert/585dbfbb69359307f0d0387bfc0ca5d3.png)
![](https://img-blog.csdnimg.cn/img_convert/5d6fd724ca37e891ea45ebf268902493.png)
![](https://img-blog.csdnimg.cn/img_convert/6a53a75ad54a2f6f23f0162d66b9c16a.png)
![](https://img-blog.csdnimg.cn/img_convert/9c264612bd756c47335d445c01ef7cf5.png)
![](https://img-blog.csdnimg.cn/img_convert/755ac12bf8b08cdbf39963d0e83fc083.png)
![](https://img-blog.csdnimg.cn/img_convert/389da33fe8235a91947a38ffe0317811.png)
![](https://img-blog.csdnimg.cn/img_convert/8416794fab6585e026c5ecff37fe87ec.png)
![](https://img-blog.csdnimg.cn/img_convert/be374b35e457363602eba042a5c738fb.png)
![](https://img-blog.csdnimg.cn/img_convert/9dd2c6700633971c0f67aa1298089089.png)
5、文档截图
![](https://img-blog.csdnimg.cn/img_convert/e2947958192486704463183b1d16aadf.png)
![](https://img-blog.csdnimg.cn/img_convert/9fe18b7303a56c0c8df9526195e82fad.png)
![](https://img-blog.csdnimg.cn/img_convert/67848416b5053ad66183545a66dd5af3.png)
![](https://img-blog.csdnimg.cn/img_convert/d533f21acf94c7af552231f8d9a423cb.png)
6、代码示例
/**
* 活动管理控制器
*/
@Controller
@RequestMapping("blog")
public class BlogController {
@Autowired
private BlogService blogService;
@RequestMapping("blogs.action")
@ResponseBody
public Message getBlog(@RequestParam(value = "pn",defaultValue = "1") Integer pn){
// 引入PageHelper分页插件
// 在查询之前只需要调用,传入页码,以及每页的大小
PageHelper.startPage(pn,10);
List<Blog> blogs = blogService.getBlogs();
// startPage后面紧跟的这个查询就是一个分页查询
// 使用pageInfo包装查询后的结果,只需要将pageInfo交给页面就行了。
// 封装了详细的分页信息,包括有我们查询出来的数据,传入连续显示的页数
PageInfo page=new PageInfo(blogs,2);
return Message.success().add("pageInfo",page);
}
/**
* 这是传给前端的数据
* */
@RequestMapping("blog.action")
public String getBlogs(ModelAndView modelAndView){
List<Blog> blogs = blogService.getBlogs();
modelAndView.addObject("blogs",blogs);
return "blog";
}
/**
* 添加活动信息
* @param blog
* @return
*/
@RequestMapping("add.action")
@ResponseBody
public Message addBlog(Blog blog){
if(StringUtils.isEmpty(blog.getTitle())){
return Message.error("请填写活动标题");
}
if(StringUtils.isEmpty(blog.getActionTime())){
return Message.error("请填写活动时间");
}
if(StringUtils.isEmpty(blog.getAddress())){
return Message.error("请填写活动地址");
}
if(StringUtils.isEmpty(blog.getEvent())){
return Message.error("请填写活动介绍");
}
if(StringUtils.isEmpty(blog.getPeoples())){
return Message.error("请填写活动适合人群");
}
int i = blogService.addBlog(blog);
if(i>0){
return Message.success();
}else{
return Message.fail();
}
}
/**
* 删除活动信息
* @param id
* @return
*/
@RequestMapping("delete.action")
@ResponseBody
public Message deleteBlog(Integer id){
try {
int i = blogService.deleteBlog(id);
}catch (Exception e){
return Message.error("删除失败,该活动已经有人申请,不可删除");
}
return Message.success();
}
/**
* 更新活动信息
* @param blog
* @return
*/
@RequestMapping("edit.action")
@ResponseBody
public Message editBlog(Blog blog){
if(StringUtils.isEmpty(blog.getTitle())){
return Message.error("请填写活动标题");
}
if(StringUtils.isEmpty(blog.getActionTime())){
return Message.error("请填写活动时间");
}
if(StringUtils.isEmpty(blog.getAddress())){
return Message.error("请填写活动地址");
}
if(StringUtils.isEmpty(blog.getEvent())){
return Message.error("请填写活动介绍");
}
if(StringUtils.isEmpty(blog.getPeoples())){
return Message.error("请填写活动适合人群");
}
if(blogService.updateBlog(blog)>0){
return Message.success();
}else{
return Message.fail();
}
}
/**
* 根据id查询活动信息
* @param id
* @return
*/
@RequestMapping("findById.action")
@ResponseBody
public Message findById(Integer id){
Blog blog = blogService.findById(id);
if(blog!=null){
return Message.success().add("blog",blog);
}else{
return Message.fail();
}
}
/**
* 根据活动时间查询活动信息
* @param pn
* @param actionTime
* @return
* @throws ParseException
*/
@RequestMapping("findByTime.action")
@ResponseBody
public Message findByTime(@RequestParam(value = "pn",defaultValue = "1") Integer pn,@RequestParam("actionTime") String actionTime) throws ParseException {
PageHelper.startPage(pn,4);
List<Blog> blog= blogService.findByTime(actionTime);
if(blog!=null){
PageInfo page=new PageInfo(blog,3);
return Message.success().add("pageInfo",page);
}else{
return Message.fail();
}
}
}