作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
本系统包括普通用户和管理员两种角色;
用户角色包含以下功能:
用户信息管理,查看车辆信息,维修记录查看等功能。
管理员角色包含以下功能:
查看用户信息,车辆信息查询,故障信息查询,维修订单查询,添加汽车维修订单,零件管理,查看房客等功能。
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7/8.0版本均可;
6.是否Maven项目:否;
1. 后端:Spring+SpringMVC+Mybatis
2. 前端:HTML+CSS+JavaScript+jQuery
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中spring-mybatis.xml配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入localhost:8080/ 登录;
- package com.controller;
-
- import java.util.List;
-
- import javax.annotation.Resource;
- import javax.servlet.http.HttpSession;
-
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
-
- import com.dao.CarInfoDao;
- import com.entity.CarInfo;
- import com.service.CarInfoService;
- import com.service.PersonalInfoService;
- import com.util.Result;
-
- @Controller
- @RequestMapping("/carinfo")
- public class CarInfoController {
- @Resource
- private CarInfoService cs;
-
- @RequestMapping("/add.do")
- @ResponseBody
- public Result execute(String user_id,
- String plate,
- String brand,
- String model,
- String color,
- String price,
- String date,
- String remark){
- System.out.println("进入controller");
- Result rs=cs.addCarInfo(user_id, plate, brand, model, color, price, date, remark);
- System.out.println(rs.toString());
- return rs;
- }
-
-
- @RequestMapping("/show.do")
- @ResponseBody
- public Result show(String user_id){
- System.out.println("user_id="+user_id);
- Result rs=cs.showCarInfo(user_id);
- System.out.println(rs.toString());
- return rs;
- }
-
- @RequestMapping("/showone.do")
- @ResponseBody
- public Result showOneCar(String id){
- System.out.println("进入controller");
- Result rs=cs.showOneCar(id);
- System.out.println(rs.toString());
- return rs;
- }
-
- @RequestMapping("/showAll.do")
- @ResponseBody
- public Result showAllCar() {
- Result rs=cs.showAllCar();
- System.out.println(rs.toString());
- return rs;
- }
-
- @RequestMapping("/search.do")
- @ResponseBody
- public Result searchCar(String type,String keywords){
- System.out.println("进入controller/search.do");
- Result rs=cs.searchCar(type, keywords);
- return rs;
- }
-
- @RequestMapping("/delete.do")
- @ResponseBody
- public Result delete(String id){
- System.out.println("进入controller");
- Result rs=cs.delCarInfo(id);
- System.out.println(rs.toString());
- return rs;
- }
-
- @RequestMapping("/update.do")
- @ResponseBody
- public Result update(String id, String plate, String brand, String model, String color, String price,
- String date, String remark) {
- System.out.println("进入controller");
- Result rs=cs.updateCarInfo(id, plate, brand, model, color, price, date, remark);
- System.out.println(rs.toString());
- return rs;
- }
- }
- package com.controller;
-
- import javax.annotation.Resource;
-
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
-
- import com.service.CarInfoService;
- import com.service.OrderInfoService;
- import com.util.Result;
-
- @Controller
- @RequestMapping("/orderinfo")
- public class OrderInfoController {
- @Resource
- private OrderInfoService os;
-
- @RequestMapping("/add.do")
- @ResponseBody
- public Result addOrderInfo(String user_id, String user_name, String plate, String trouble_code,String trouble_name, String contact,
- String contact_way, String remark) {
- System.out.println("进入OrderInfoController/add.do");
- Result rs=os.addOrderInfo(user_id, user_name, plate, trouble_code,trouble_name, contact, contact_way, remark);
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/showAll.do")
- @ResponseBody
- public Result findAllOrder() {
- System.out.println("进入OrderInfoController/showAll.do");
- Result rs=os.findAllOrder();
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/delete.do")
- @ResponseBody
- public Result delOrderInfo(String id) {
- System.out.println("进入OrderInfoController/delete.do");
- Result rs=os.delOrderInfo(id);
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/change.do")
- @ResponseBody
- public Result changStatus(String id) {
- System.out.println("进入OrderInfoController/change.do");
- Result rs=os.changStatus(id);
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/show.do")
- @ResponseBody
- public Result findOrder(String user_id) {
- System.out.println("进入OrderInfoController/show.do");
- Result rs=os.findOrder(user_id);
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/sort.do")
- @ResponseBody
- public Result findBySort() {
- System.out.println("进入OrderInfoController/sort.do");
- Result rs=os.findBySort();
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/deal.do")
- @ResponseBody
- public Result findDealOrder(){
- System.out.println("进入OrderInfoController/deal.do");
- Result rs=os.findDealOrder();
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/undeal.do")
- @ResponseBody
- public Result findUndealOrder(){
- System.out.println("进入OrderInfoController/undeal.do");
- Result rs=os.findUndealOrder();
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/searchorder.do")
- @ResponseBody
- public Result searchOrderInfo(String type, String keywords) {
- System.out.println("进入OrderInfoController/search.do");
- Result rs=os.searchOrderInfo(type, keywords);
- System.out.println(rs);
- return rs;
- }
- }
- package com.controller;
-
- import javax.annotation.Resource;
-
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
-
- import com.entity.User;
- import com.service.UserService;
- import com.util.Result;
-
- @Controller
- @RequestMapping("/user")
- public class UserController {
- @Resource
- private UserService us;
-
- @RequestMapping("/login.do")
- @ResponseBody
- public Result execute(String name,String password){
- Result rs=us.login(name, password);
- System.out.println(name);
- System.out.println(rs.toString());
- return rs;
- }
- @RequestMapping("/changepwd.do")
- @ResponseBody
- public Result changePwd(String user_id, String mpass, String newpass) {
- Result rs=us.changePwd(user_id, mpass, newpass);
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/show.do")
- @ResponseBody
- public Result userList() {
- Result rs=us.userList();
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/add.do")
- @ResponseBody
- public Result addUser(String name, String password, Integer type){
- Result rs=us.addUser(name, password, type);
- System.out.println(rs);
- return rs;
- }
-
- @RequestMapping("/change.do")
- @ResponseBody
- public Result changeStatus(String id){
- Result rs=us.changeStatus(id);
- System.out.println(rs);
- return rs;
- }
- }
- package com.controller;
-
- import javax.annotation.Resource;
-
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
-
- import com.service.OrderInfoService;
- import com.service.VisitorService;
- import com.util.Result;
- @Controller
- @RequestMapping("/visitor")
- public class VisitorController {
- @Resource
- private VisitorService vs;
-
- @RequestMapping("/show.do")
- @ResponseBody
- public Result visitorList() {
- System.out.println("进入VisitorController/show.do");
- Result rs=vs.visitorList();
- System.out.println(rs);
- return rs;
- }
- }
- package com.controller;
-
- import javax.annotation.Resource;
-
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
-
- import com.service.CarInfoService;
- import com.service.TroubleInfoService;
- import com.util.Result;
-
- @Controller
- @RequestMapping("/troubleinfo")
- public class TroubleInfoController {
- @Resource
- private TroubleInfoService ts;
-
- @RequestMapping("/add.do")
- @ResponseBody
- public Result addTroubleInfo(String trouble_code, String trouble_name, String trouble_remark) {
- System.out.println("进入TroubleInfoController/add.do");
- Result rs= ts.addTroubleInfo(trouble_code, trouble_name, trouble_remark);
- System.out.println(rs.toString());
- return rs;
- }
-
-
- @RequestMapping("/show.do")
- @ResponseBody
- public Result troubleList() {
- System.out.println("进入TroubleInfoController/show.do");
- Result rs=ts.troubleList();
- System.out.println(rs.toString());
- return rs;
- }
-
- @RequestMapping("/change.do")
- @ResponseBody
- public Result changStatus(String id) {
- System.out.println("进入TroubleInfoController/change.do");
- Result rs=ts.changStatus(id);
- System.out.println(rs.toString());
- return rs;
- }
- }
如果也想学习本系统,下面领取。关注并回复:150ssm