基于ssm的共享客栈管理系统源码和论文

news2024/9/25 9:39:31

基于ssm的共享客栈管理系统源码和论文058

 开发工具:idea 
 数据库mysql5.7+
 数据库链接工具:navcat,小海豚等
  技术:ssm

摘  要

互联网发展至今,无论是其理论还是技术都已经成熟,而且它广泛参与在社会中的方方面面。它让信息都可以通过网络传播,搭配信息管理工具可以很好地为人们提供服务。针对房屋出租信息管理混乱,出错率高,信息安全性差,劳动强度大,费时费力等问题,采用共享客栈管理系统可以有效管理,使信息管理能够更加科学和规范。

共享客栈管理系统在Eclipse环境中,使用Java语言进行编码,使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务,本系统实现房屋管理,合同文件上传与下载,房屋租房与续租,房屋出租管理等功能。

总之,共享客栈管理系统集中管理信息,有着保密性强,效率高,存储空间大,成本低等诸多优点。它可以降低信息管理成本,实现信息管理计算机化。

关键词:共享客栈管理系统;Java语言;Mysql

 

package com.controller;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.annotation.IgnoreAuth;
import com.entity.ChuzhuxinxiEntity;
import com.service.ChuzhuxinxiService;
import com.service.YonghuxinxiService;
import com.utils.MPUtil;
import org.apache.commons.lang3.StringUtils;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;

import com.entity.FangwuxinxiEntity;

import com.service.FangwuxinxiService;
import com.utils.PageUtils;
import com.utils.R;

/**
 * 
 * 后端接口
 * @author
 * @email
 * @date 2021-02-05
*/
@RestController
@Controller
@RequestMapping("/fangwuxinxi")
public class FangwuxinxiController {
    private static final Logger logger = LoggerFactory.getLogger(FangwuxinxiController.class);

    @Autowired
    private FangwuxinxiService fangwuxinxiService;


    @Autowired
    private ChuzhuxinxiService chuzhuxinxiService;


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("Controller:"+this.getClass().getName()+",page方法");
        Object role = request.getSession().getAttribute("role");
        PageUtils page = null;
        if(role.equals("房东")){
            params.put("fd",request.getSession().getAttribute("userId"));
            page = fangwuxinxiService.queryPage(params);
        }else{
            page = fangwuxinxiService.queryPage(params);
        }
        return R.ok().put("data", page);
    }


    /**
     * 前端详情
     */
    @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        FangwuxinxiEntity fangwu = fangwuxinxiService.selectById(id);
        return R.ok().put("data", fangwu);
    }


    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        logger.debug("Controller:"+this.getClass().getName()+",info方法");
        FangwuxinxiEntity fangwuxinxi = fangwuxinxiService.selectById(id);
        if(fangwuxinxi!=null){
            return R.ok().put("data", fangwuxinxi);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody FangwuxinxiEntity fangwuxinxi, HttpServletRequest request){
        logger.debug("Controller:"+this.getClass().getName()+",save");
        Wrapper<FangwuxinxiEntity> queryWrapper = new EntityWrapper<FangwuxinxiEntity>()
            .eq("fwname", fangwuxinxi.getFwname())
            .eq("fwlx_types", fangwuxinxi.getFwlxTypes())
            .eq("fd_types", fangwuxinxi.getFdTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        FangwuxinxiEntity fangwuxinxiEntity = fangwuxinxiService.selectOne(queryWrapper);
        if("".equals(fangwuxinxi.getImgPhoto()) || "null".equals(fangwuxinxi.getImgPhoto())){
            fangwuxinxi.setImgPhoto(null);
        }
        if(fangwuxinxiEntity==null){
            fangwuxinxiService.insert(fangwuxinxi);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody FangwuxinxiEntity fangwuxinxi, HttpServletRequest request){
        logger.debug("Controller:"+this.getClass().getName()+",update");
        //根据字段查询是否有相同数据
        Wrapper<FangwuxinxiEntity> queryWrapper = new EntityWrapper<FangwuxinxiEntity>()
            .notIn("id",fangwuxinxi.getId())
            .eq("fwname", fangwuxinxi.getFwname())
            .eq("fwlx_types", fangwuxinxi.getFwlxTypes())
            .eq("fd_types", fangwuxinxi.getFdTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        FangwuxinxiEntity fangwuxinxiEntity = fangwuxinxiService.selectOne(queryWrapper);
        if("".equals(fangwuxinxi.getImgPhoto()) || "null".equals(fangwuxinxi.getImgPhoto())){
                fangwuxinxi.setImgPhoto(null);
        }
        if(fangwuxinxiEntity==null){
            fangwuxinxiService.updateById(fangwuxinxi);//根据id更新
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        logger.debug("Controller:"+this.getClass().getName()+",delete");
        fangwuxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }

    /**
    * 租房
    */
    @RequestMapping("/renting")
    public R renting(Integer id, String finishTime, HttpServletRequest request){
        if(finishTime == null){
            return R.error("租房截至日期不能为空");
        }
        Object role = request.getSession().getAttribute("role");
        if(role.equals("房东")){
            return R.error("房东是不可以租房子的哦");
        } else if(role.equals("管理员")){
            return R.error("管理员是不可以租房子的哦");
        }

        Integer userId = (Integer) request.getSession().getAttribute("userId");
        FangwuxinxiEntity fangwuxinxi = fangwuxinxiService.selectById(id);
        if(fangwuxinxi != null){
            if(fangwuxinxi.getFwstateTypes() == 2 && fangwuxinxi.getFwstateTypes() != 1){
                try {
                    fangwuxinxi.setFwstateTypes(1);
                    ChuzhuxinxiEntity chuzhuxinxi = new ChuzhuxinxiEntity();
                    chuzhuxinxi.setFdTypes(fangwuxinxi.getFdTypes());
                    chuzhuxinxi.setFwTypes(fangwuxinxi.getId());
                    chuzhuxinxi.setYhTypes(userId);
                    chuzhuxinxi.setCreateTime(new Date());
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                    chuzhuxinxi.setFinishTime(sdf.parse(finishTime));
                    chuzhuxinxiService.insert(chuzhuxinxi);
                    fangwuxinxiService.updateById(fangwuxinxi);
                } catch (ParseException e) {
                    e.printStackTrace();
                }
                return R.ok();
            }else {
                return R.error("这个房子已出租");
            }
        }
        return R.error("出现错误了哦");
    }

}

 

package com.controller;

import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;

import com.entity.HetongxinxiEntity;

import com.service.HetongxinxiService;
import com.utils.PageUtils;
import com.utils.R;

/**
 * 
 * 后端接口
 * @author
 * @email
 * @date 2021-02-05
*/
@RestController
@Controller
@RequestMapping("/hetongxinxi")
public class HetongxinxiController {
    private static final Logger logger = LoggerFactory.getLogger(HetongxinxiController.class);

    @Autowired
    private HetongxinxiService hetongxinxiService;

    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("Controller:"+this.getClass().getName()+",page方法");
        Object role = request.getSession().getAttribute("role");
        PageUtils page = null;
        if(role.equals("用户")){
            params.put("yh",request.getSession().getAttribute("userId"));
            page = hetongxinxiService.queryPage(params);
        }else{
            page = hetongxinxiService.queryPage(params);
        }
        if(role.equals("房东")){
            params.put("fd",request.getSession().getAttribute("userId"));
            page = hetongxinxiService.queryPage(params);
        }else{
            page = hetongxinxiService.queryPage(params);
        }
        return R.ok().put("data", page);
    }
    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        logger.debug("Controller:"+this.getClass().getName()+",info方法");
        HetongxinxiEntity hetongxinxi = hetongxinxiService.selectById(id);
        if(hetongxinxi!=null){
            return R.ok().put("data", hetongxinxi);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody HetongxinxiEntity hetongxinxi, HttpServletRequest request){
        logger.debug("Controller:"+this.getClass().getName()+",save");
        Wrapper<HetongxinxiEntity> queryWrapper = new EntityWrapper<HetongxinxiEntity>()
            .eq("htname", hetongxinxi.getHtname())
            .eq("fd_types", hetongxinxi.getFdTypes())
            .eq("yh_types", hetongxinxi.getYhTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        hetongxinxi.setCreateTime(new Date());
        HetongxinxiEntity hetongxinxiEntity = hetongxinxiService.selectOne(queryWrapper);
        if("".equals(hetongxinxi.getProveFile()) || "null".equals(hetongxinxi.getProveFile())){
            hetongxinxi.setProveFile(null);
        }
        if(hetongxinxiEntity==null){
            hetongxinxiService.insert(hetongxinxi);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody HetongxinxiEntity hetongxinxi, HttpServletRequest request){
        logger.debug("Controller:"+this.getClass().getName()+",update");
        //根据字段查询是否有相同数据
        Wrapper<HetongxinxiEntity> queryWrapper = new EntityWrapper<HetongxinxiEntity>()
            .notIn("id",hetongxinxi.getId())
            .eq("htname", hetongxinxi.getHtname())
            .eq("fd_types", hetongxinxi.getFdTypes())
            .eq("yh_types", hetongxinxi.getYhTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        HetongxinxiEntity hetongxinxiEntity = hetongxinxiService.selectOne(queryWrapper);
        if("".equals(hetongxinxi.getProveFile()) || "null".equals(hetongxinxi.getProveFile())){
                hetongxinxi.setProveFile(null);
        }
        if(hetongxinxiEntity==null){
            hetongxinxiService.updateById(hetongxinxi);//根据id更新
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        logger.debug("Controller:"+this.getClass().getName()+",delete");
        hetongxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/921935.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

ORB-SLAM2算法10之图像关键帧KeyFrame

文章目录 0 引言1 KeyFrame类1.1 构造函数1.2 成员函数1.3 关键帧之间共视图1.3.1 AddConnection1.3.2 UpdateBestCovisibles1.3.3 UpdateConnections1.3.4 EraseConnection1.3.5 SetBadFlag 1.4 地图点1.5 生成树 2 KeyFrame用途 0 引言 ORB-SLAM2算法7详细了解了System主类和…

机器学习实战之模型的解释性:Scikit-Learn的SHAP和LIME库详解

引言&#xff1a;机器学习模型的“黑箱”困境 机器学习模型的崛起让我们惊叹不已&#xff01;不论是预测房价、识别图片中的猫狗&#xff0c;还是推荐给你喜欢的音乐&#xff0c;这些模型都表现得非常出色。但是&#xff0c;有没有想过&#xff0c;这些模型到底是如何做出这些决…

STM32 F103C8T6学习笔记13:IIC通信—AHT10温湿度传感器模块

今日学习一下这款AHT10 温湿度传感器模块&#xff0c;给我的OLED手环添加上测温湿度的功能。 文章提供源码、测试工程下载、测试效果图。 目录 AHT10温湿度传感器&#xff1a; 特性&#xff1a; 连接方式&#xff1a; 适用场所范围&#xff1a; 程序设计&#xff1a; 设…

大模型技术实践(二)|关于Llama 2你需要知道的那些事儿

在上期文章中&#xff0c;我们简要回顾了Llama模型的概况&#xff0c;本期文章我们将详细探讨【关于Llama 2】&#xff0c;你需要知道的那些事儿。 01-Llama 2的性能有多好&#xff1f; 作为Meta新发布的SOTA开源大型语言模型&#xff0c;Llama 2是Llama模型的延续和升级。Ll…

免费的png打包plist工具CppTextu,一款把若干资源图片拼接为一张大图的免费工具

经常做游戏打包贴图的都知道&#xff0c;要把图片打包为一张或多张大图&#xff0c;要使用打包工具TexturePacker。 TexturePacker官方版可以直接导入PSD、SWF、PNG、BMP等常见的图片格式&#xff0c;主要用于网页、游戏和动画的制作&#xff0c;它可以将多个小图片汇聚成一个…

java八股文面试[java基础]——CGLIB动态代理与JDK动态代理

CGLIB CGLIB简介&#xff1a; 什么是CGLIB CGLIB是一个强大的、高性能的代码生成库。其被广泛应用于AOP框架&#xff08;Spring、dynaop&#xff09;中&#xff0c;用以提供方法拦截操作。Hibernate作为一个比较受欢迎的ORM框架&#xff0c;同样使用CGLIB来代理单端&#xff…

iPhone 15预计在A16仿生芯片上运行,性能将有何提升?

苹果最新的移动芯片A17仿生芯片无疑让人兴奋不已&#xff0c;该芯片将成为今年一些iPhone 15机型的驱动力。A17基于3nm处理器&#xff0c;这是第一款提出这一主张的移动硅&#xff0c;由于其更紧凑的尺寸&#xff0c;它有望在性能和能效方面都有所提高。今年秋天买一部A17供电的…

【Java架构-包管理工具】-Maven私服搭建-Nexus(三)

本文摘要 Maven作为Java后端使用频率非常高的一款依赖管理工具&#xff0c;在此咱们由浅入深&#xff0c;分三篇文章&#xff08;Maven基础、Maven进阶、私服搭建&#xff09;来深入学习Maven&#xff0c;此篇为开篇主要介绍Maven私服搭建-Nexus 文章目录 本文摘要1. Nexus安装…

爬虫逆向实战(二十)--某99网站登录

一、数据接口分析 主页地址&#xff1a;某99网站 1、抓包 通过抓包可以发现登录接口是AC_userlogin 2、判断是否有加密参数 请求参数是否加密&#xff1f; 通过查看“载荷”可以发现txtPassword和aws是加密参数 请求头是否加密&#xff1f; 无响应是否加密&#xff1f; 无…

Win11本地安装Ubuntu 22.04 双系统简易教程

1.制作启动U盘 首先找到一个硬盘容量不小于4G的空U盘&#xff0c;需要对其进行格式化。 然后下载Ubuntu 22.04的iso文件到本地。 Ubuntu 22.04.1 LTS 中国地区下载链接 下载 UltraISO并制作启动U盘 UltraISO的下载地址 下载免费试用版 选择安装地址&#xff0c;无脑下一步…

Error running ‘FileApp‘: Command line is too long. Shorten command line for

报错如下 Error running FileApp: Command line is too long. Shorten command line for 解决方案如下&#xff1a; 打开运行配置 点击上面&#xff0c;默认是收起来的&#xff0c;点击下&#xff0c;下面选择标注的红色的&#xff0c; 重新运行&#xff0c;可以正常启动了

首发!2025年超500万辆规模,揭榜「融合泊车」TOP10玩家

作为行泊一体赛道关键的一环&#xff0c;融合泊车&#xff08;基于全景环视超声波雷达&#xff09;及后续的高阶泊车方案再次成为行业关注的焦点。 除了部分头部车企自研之外&#xff0c;第三方供应商的市场机会也在扩大。一方面&#xff0c;泊车厂商也在拓展行泊一体方案&…

ChatGPT⼊门到精通(1):ChatGPT 是什么

⼀、直观感受 1、公司 OpenAI&#xff08;美国&#xff09; 2、官⽅⽹站 3、登录ChatGPT ![在这里插入图片描述](https://img-blog.csdnimg.cn/26901096553a4ba0a5c88c49b2601e6a.png 填⼊帐号、密码&#xff0c;点击登录。登录成功&#xff0c;如下 3、和ChatGPT对话 开始…

专题-【稀疏矩阵的三元组存储】

三元组存储表示&#xff1a; 列序递增转置法&#xff1a;

计算机竞赛 基于YOLO实现的口罩佩戴检测 - python opemcv 深度学习

文章目录 0 前言1 课题介绍2 算法原理2.1 算法简介2.2 网络架构 3 关键代码4 数据集4.1 安装4.2 打开4.3 选择yolo标注格式4.4 打标签4.5 保存 5 训练6 实现效果6.1 pyqt实现简单GUI6.3 视频识别效果6.4 摄像头实时识别 7 最后 0 前言 &#x1f525; 优质竞赛项目系列&#xf…

CSS中如何实现元素之间的间距(Margin)合并效果?

聚沙成塔每天进步一点点 ⭐ 专栏简介⭐ 外边距合并的示例&#xff1a;⭐ 如何控制外边距合并&#xff1a;⭐ 写在最后 ⭐ 专栏简介 前端入门之旅&#xff1a;探索Web开发的奇妙世界 记得点击上方或者右侧链接订阅本专栏哦 几何带你启航前端之旅 欢迎来到前端入门之旅&#xff…

sizeof和strlen的对比

文章目录 &#x1f6a9;前言&#x1f6a9;sizeof&#x1f6a9;strlen&#x1f6a9;sizeof和strlen对比 &#x1f6a9;前言 很多小白在学习中&#xff0c;经常将sizeof和strlen弄混了。本篇文章&#xff0c;小编讲解一下sizeof和strlen的区别。&#x1f937;‍♂️ &#x1f6a9…

windows查看/删除DNS缓存

一、查看DNS缓存 打开CMD&#xff0c;输入ipconfig/displaydns 二、删除DNS缓存 打开CMD,输入ipconfig/flushdns

基于ssm的水果蔬菜商城java jsp网上购物超市mysql源代码

本项目为前几天收费帮学妹做的一个项目&#xff0c;Java EE JSP项目&#xff0c;在工作环境中基本使用不到&#xff0c;但是很多学校把这个当作编程入门的项目来做&#xff0c;故分享出本项目供初学者参考。 一、项目描述 基于ssm的水果蔬菜商城 系统有2权限&#xff1a;管理…

11-Manager 和 模型Model

准备工作: 一. Manager 库: Manager: 用于管理相关操作端命令和使用相关操作端命令 (1). 安装flask-script: pip install flask-script2.0.3 (2). 在app.py中 包装 app from apps import create_app# Manager类用于管理相关操作端命令和使用相关操作端命令 from flask_scrip…