基于ssm+jsp的宠物领养管理系统,流浪宠物领养管理系统,源码+数据库+论文,适合课程设计、毕业设计

1、项目介绍

如今,随着人们生活水平不断提高,人们的生活在物质满足的基础上,更多的人将生活的重点放在追求精神享受的过程中。于此同时,Internet铺天盖地的普及,使得这样的人纷纷通过Internet的方式去寻找精神的满足。然而领养宠物正是人们现在炙手可热的一种精神寄托。对于宠物的热爱让他们的生活更加充满爱心和向往。Internet和领养宠物的两者结合,大大推动了电子商务的发展,促进了该行业的崛起。这正是二手流浪宠物领养网站诞生的缘由。该网站不仅解决了地理隔离的问题,同时也跟上了网络快速发展的脚步,实现爱宠人士足不出户的领养到心仪的爱宠。

本文研究了一个流浪宠物领养管理系统,该系统基于B/S架构模式,使用ssm框架开发设计而成。系统主要以Java语言作为开发基础,使用了jsp+ssm等技术,采用idea为开发工具,以MySql作为数据库工具。本系统分为前台模块和后台管理模块,前台模块方便用户进行的查看,后台管理模块方便管理员进行管理。本系统功能比较完善,界面友好,操作简单,方便用户的使用。

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、项目截图

5、文档截图

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();
        }

    }

}

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

java源码集合

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值