JavaWeb项目:基于JSP汽车自行车出租系统
此项目为本人的Java大作业。
前台代码;代码已经上传到github上 下载地址   Github
一、项目概况
1.1设计内容
  一个基于JSP汽车自行车出租网站,分用户和管理员两种身份。
此系统开发期间我们小组不定时地进行用户使用反馈信息收集,根据收集数据不断对系统进行优化、完善。目的是希望从使用者的角度查找系统的缺陷之处,继而使得整个系统的运行、结构更加清晰化、条理化、自动化。

1.2开发工具
  Eclipse或者Myeclipse,Java,MySQL,Redis,Html,CSS,JS。
二、详细设计
2.1网站结构

系统截图 如下:

package com.sise.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sise.po.*;
import com.sise.service.*;
import net.sf.json.JSONObject;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.IOException;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* @Author:swye
* @Description:
* @Date:Create in 13:04 2018/3/6
*/
@Controller
@RequestMapping("/common_fly")
public class Common_FlyController {
  @Autowired
  private RegistrationTableService registrationTableService;

@Autowired
  private ConsumerService consumerService;

@Autowired
  private CancelTableService cancelTableService;

@Autowired
  private ContractService contractService;

@Autowired
  private DesignerpicService designerpicService;

@Autowired
  private DepositService depositService;

@Autowired
  private HousepicService housepicService;

@Autowired
  private InspectionReportService inspectionReportService;

@RequestMapping(value = "/consumer_management_fly",method = RequestMethod.GET)
  public String goConsumer_management(@RequestParam(value = "startTime",defaultValue = "",required = false) String startTime, @RequestParam(value = "endTime",defaultValue = "",required = false) String endTime, @RequestParam(value = "sname",defaultValue = "",required = false) String sname,
                    @RequestParam(value = "provinceId",defaultValue = "0",required = false) Integer provinceId, @RequestParam(value = "cityId",defaultValue = "0",required = false) Integer cityId, Model model, @RequestParam(defaultValue = "1",required = false) Integer pageNum, HttpSession session){
    SearchContent searchContent =new SearchContent();
    System.out.println(sname);
    if (!startTime.equals(""))
      searchContent.setStartTime(Date.valueOf(startTime));
    if (!endTime.equals(""))
      searchContent.setEndTime(Date.valueOf(endTime));
    if (sname!=null)
      searchContent.setSname(sname);
    if (provinceId !=null)
      searchContent.setProvinceId(provinceId);
    if (cityId!=null)
      searchContent.setCityId(cityId);
    Employee employee = (Employee) session.getAttribute("employee");
    searchContent.setEmployee(employee);
    PageHelper.startPage(pageNum, 8);
    List<RegistrationTable> registrationTables =registrationTableService.searchRegistrationWithSearchContentByStatus(6,searchContent);
    PageInfo<RegistrationTable> pageInfo = new PageInfo<RegistrationTable>(registrationTables);
    List<Integer> days = new ArrayList<Integer>();
    for (RegistrationTable r:registrationTables){
      Integer day = calculateDate(r.getNotrackingDays());
      r.setDays(day);
    }
    List<Province> provinces = consumerService.searchAllProvince();
    model.addAttribute("provinces",provinces);
    model.addAttribute("registrationTables",registrationTables);
    model.addAttribute("pageInfo",pageInfo);
    model.addAttribute("searchContent",searchContent);
    return "common_control/consumer_management_fly";

}
  public Integer calculateDate(Date date){
    long from = date.getTime();
    long to = new Date(System.currentTimeMillis()).getTime();
    Integer days = (int) ((to - from)/(1000 * 60 * 60 * 24));
    return days;
  }

@RequestMapping(value = "/getCancelTable",method = RequestMethod.POST,produces = "text/html;charset=UTF-8")
  @ResponseBody
  public String getCancelTable(@RequestBody String str){
    JSONObject jsonObject = JSONObject.fromObject(str);
    Integer registrationId = jsonObject.getInt("registrationId");
    CancelTable cancelTable = cancelTableService.searchCancelTableByRegistrationId(registrationId);
    JSONObject jsonObject1 = new JSONObject();
    jsonObject1.put("cancelTable",cancelTable);
    return jsonObject1.toString();

}
  @RequestMapping(value = "/delCancelTable",method = RequestMethod.POST,produces = "text/html;charset=UTF-8")
  @ResponseBody
  public String delCancelTable(@RequestBody String str){
    JSONObject jsonObject = JSONObject.fromObject(str);
    Integer registrationId = jsonObject.getInt("registrationId");
    JSONObject jsonObject1 = new JSONObject();
    CancelTable cancelTable = cancelTableService.searchCancelTableByRegistrationId(registrationId);
    if(cancelTable !=null){
      try {
        delProject(registrationId);
      } catch (IOException e) {
        e.printStackTrace();
      }
    }else {
      jsonObject1.put("msg","无飞单信息!");
      return jsonObject1.toString();
    }
    cancelTableService.dropCancelTableByRegistrationId(registrationId);
    Integer result = registrationTableService.dropRegistrationTableById(registrationId);
    if (result==0){
      jsonObject1.put("msg","飞单删除失败!");
    }else {
      jsonObject1.put("msg","飞单删除成功!");
    }
    return jsonObject1.toString();

}

public void delProject(Integer registrationId) throws IOException {
   Deposit deposit = depositService.searchDepositByRegistrationId(registrationId);
   if (deposit!=null){
     depositService.dropDepositByRegistrationId(registrationId);
     Housepic housepic = housepicService.findHousepicByRegistrationId(registrationId);
     Designerpic designerpic = designerpicService.searchDesignerpicByRegistrationId(registrationId);
     Contract contract = contractService.findContractByRegistrationId(registrationId);
     if (housepic!=null){
       FileUtils.deleteDirectory(new File("D:\\ProjectUpload\\housepic\\"+registrationId));
       housepicService.dropAllHousepicFileByHouseId(housepic.getHousepicId());
       housepicService.dripHousepicById(housepic.getHousepicId());
     }
     if (designerpic!=null){
       FileUtils.deleteDirectory(new File("D:\\ProjectUpload\\designerpic\\"+registrationId));
       designerpicService.dropDesignerpicFileByDesignerpicId(designerpic.getDesignerpicId());
       designerpicService.dropDesignerpicByDesignerpicId(designerpic.getDesignerpicId());
     }
     if (contract!=null){
       FileUtils.deleteDirectory(new File("D:\\ProjectUpload\\contract\\"+registrationId));
       contractService.dropAllContractFileByContractId(contract.getContractId());
       contractService.dropContractById(contract.getContractId());
     }
   }
  }

@RequestMapping(value = "/resetCancelTable",method = RequestMethod.POST,produces = "text/html;charset=UTF-8")
  @ResponseBody
  public String resetCancelTable(@RequestBody String str){
    JSONObject jsonObject = JSONObject.fromObject(str);
    Integer registrationId = jsonObject.getInt("registrationId");
    JSONObject jsonObject1 = new JSONObject();
    CancelTable cancelTable = cancelTableService.searchCancelTableByRegistrationId(registrationId);
    if(cancelTable !=null){
     Integer setresult= resetProject(registrationId);
     cancelTableService.dropCancelTableByRegistrationId(registrationId);
      System.out.println(setresult);
     Integer column =registrationTableService.changStatusByRegistrationId(registrationId,setresult);
     if (column==0){
       jsonObject1.put("msg","操作错误!");
       return jsonObject1.toString();
     }else {
       String msg = "";
       if (setresult==1)
         msg="客户变回登记客户!";
       if (setresult==2)
         msg="客户变回意向客户!";
       if (setresult==3)
         msg="客户变回协议客户!";
       jsonObject1.put("msg","操作成功!"+msg);
       return jsonObject1.toString();
     }
    }else {
      jsonObject1.put("msg","无飞单信息!");
      return jsonObject1.toString();
    }

}

public Integer resetProject(Integer registrationId) {
    Integer result = 1;
    RegistrationTable registrationTable = registrationTableService.searchRegistrationById(registrationId);
    try {
      result = registrationTable.getDesigner().getEmployeeId();
    }catch (NullPointerException e){
      result=1;
      return 1;
    }
      result = 2;
      Deposit deposit = depositService.searchDepositByRegistrationId(registrationId);
      if (deposit!=null){
        result=3;
        /*Contract contract = contractService.findContractByRegistrationId(registrationId);
        if (contract.getStatus()==6){
          result=4;
          InspectionReport inspectionReport = inspectionReportService.searchInspectionReportByRegistrationId(registrationId);
          if (inspectionReport!=null){
            if (inspectionReport.getReportStatus()==1){
              result=5;
            }
          }
        }*/
      }
   return result;
  }

}
代码已经上传github,下载地址:https://github.com/21503882/bike-rent

JSP汽车自行车出租系统相关推荐

  1. jsp公共自行车租赁系统

    本系统采用了Browser/Server体系结构,JSP(Java Server Page)作为前台开发工具,MySQL作为后台数据库进行开发.最终系统实现的主要功能包括系统管理员部分的修改登录密码. ...

  2. java计算机毕业设计基于ssm的汽车租赁出租系统(源代码+数据库+Lw文档)

    项目介绍 随着社会的发展,计算机的优势和普及使得汽车租赁系统的开发成为必需.汽车租赁系统主要是借助计算机对汽车租赁信息等信息进行管理.减少管理员的工作,同时也方便广大用户对个人所需汽车租赁信息的及时查 ...

  3. 自行车出租系统难题记录4

    1.如何保存查询条件,点预订时将查询条件的日期传过去. 在servlet放到request中,则页面可以${变量名}取到日期值.查询条件加个value.预订的超链接上加上参数即可. 2.棘手问题:给定 ...

  4. javaweb JAVA JSP自行车租赁系统(租赁系统)自行车租赁 汽车租赁 电车租赁系统 租借系统

    javaweb JAVA JSP自行车租赁系统(租赁系统)自行车租赁 汽车租赁 电车租赁系统 租借系统 protected void doGet(HttpServletRequest req, Htt ...

  5. javaweb JAVA JSP汽车配件销售系统jsp配件销售网站 (jsp电子商务系统,购物商城)在线购物案例

    JSP汽车配件销售系统jsp配件销售网站 (jsp电子商务系统,购物商城)在线购物案例 大家好,很高兴和大家分享Java项目和经验.不管同学们是出于什么需求.都希望各位计算机专业的同学有一个提高. 本 ...

  6. 基于javaweb的公寓房屋出租系统(java+ssm+jsp+easyui+echarts+mysql)

    基于javaweb的公寓房屋出租系统(java+ssm+jsp+easyui+echarts+mysql) 运行环境 Java≥8.MySQL≥5.7.Tomcat≥8 开发工具 eclipse/id ...

  7. 基于jsp+servlet的房屋出租系统

    项目名称 房屋出租系统 编程语言 Java语言 主要技术 jsp+servlet 开发工具 eclipse 服务器 tomcat 7.0及以上 数据库 MySQL5.5/5.7/8.0 +C3P0连接 ...

  8. java自行车租凭系统项目包_基于jsp的自行车租赁-JavaEE实现自行车租赁 - java项目源码...

    基于jsp+servlet+pojo+mysql实现一个javaee/javaweb的自行车租赁, 该项目可用各类java课程设计大作业中, 自行车租赁的系统架构分为前后台两部分, 最终实现在线上进行 ...

  9. java 汽车售票_基于jsp的长途汽车售票系统-JavaEE实现长途汽车售票系统 - java项目源码...

    基于jsp+servlet+pojo+mysql实现一个javaee/javaweb的长途汽车售票系统, 该项目可用各类java课程设计大作业中, 长途汽车售票系统的系统架构分为前后台两部分, 最终实 ...

最新文章

  1. Spring security获取当前用户
  2. pandas读取csv文件,变换文件格式,并转换成numpy数组,取出数据
  3. 九种破解Xp登录密码方法
  4. JavaScript高级day02-PM【原型链的属性问题、探索instanceof、原型面试题】
  5. python3键盘事件_python+selenium3 鼠标事件和键盘事件
  6. matlab绘制路线图_绘制国际水域路线图
  7. Lowest Common Multiple Plus ——ACM
  8. linux 计划任务格式,linux crontab 定时任务格式和使用方法2019-01-13
  9. [Android]PhoneGap源码分析——白名单
  10. python文件夹,文件监听工具(pyinotify,watchdog)
  11. 如何利用数据挖掘结束单身
  12. Python纯代码pdf批量快速转换成ppt
  13. SAP中计划策略的后台配置框架分析解读
  14. 百度离线地图-加载地图(一)
  15. 修改Android手机的分辨率和屏幕密度
  16. python ddos攻击器
  17. mybatis-plus 属性为空时判断问题
  18. 163vip邮箱登录,163邮箱怎么登陆?如何登录163vip邮箱?
  19. 公司名称怎么申请专利
  20. vue渲染大量数据优化_vue大数据表格卡顿问题的完美解决方案

热门文章

  1. 用python在树莓派上播放MP3/MP4
  2. TIA博途V16上载程序后,在线无法监控程序,监控图标灰色,时间戳不一样如何解决?
  3. openSession和getCurrentSession
  4. E - 18岁生日(20)
  5. Echarts中series、option、component究竟是啥?
  6. HTTP协议Header选项解读
  7. STM32F103ZET6点亮板载LED灯
  8. 过山车之星 Planet Coaster Mac
  9. 计算机怎么传输信息,局域网信息怎么传输
  10. Android个性闹钟——摇摇醒