文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

使用SSM+Layui+Bootstrap实现汽车维保系统的示例代码

2024-04-02 19:55

关注

本项目主要实现对汽车维修厂的信息化管理功能,主要包含三个角色:管理员,维修师傅,客户。实现的主要功能包含用户管理、配置管理、汽车管理、故障管理、供应商管理、配件管理、维修订单管理、统计信息、公告管理、个人信息管理。主要业务流程:用户在系统内发起汽车维修申请定单,管理员根据情况将定单分配给维修师傅,维修师傅接受任务后开始维修,并根据情况申请配件,处理完成后由管理员生成最终支付订单结算费用,客户进入系统进行费用支付,并可以查看自己相应的维修记录和费用信息等等。

技术架构:

后台开发:SSM框架

前端技术:Layui+Jquery+Ajax

数据库:MYSQL

开发工具:IDEA /Eclipse

管理员登陆系统后的主要功能:

用户管理

配件管理

供应商管理

采购管理

车辆信息管理

故障管理

维修订单管理

统计管理

公告管理

库存管理

员工登陆系统

相应的管理模块

用户登陆系统

用户相关管理模块

以上是汽车维修管理系统的部分功能展示。

系统部分核心代码;


package com.lzm.controller.admin;
 
import com.lzm.pojo.ApplyInfo;
import com.lzm.pojo.CarInfo;
import com.lzm.pojo.OrderInfo;
import com.lzm.pojo.UserInfo;
import com.lzm.service.Interface.OrderService;
import com.lzm.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpSession;
import java.util.List;
 

@Controller
public class OrderController {
    @Autowired
    private OrderService orderService;
 
    @RequestMapping(value="/ShowHistoryOrders.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<OrderInfo>> ShowHistoryOrders(@RequestParam(value = "page") int page , int limit) {
        List<OrderInfo> orderInfos = orderService.ShowHistoryOrders(page,limit);
        System.out.println(orderInfos);
        //返回的总记录数
        int count=orderService.findHistoryOrdersPageCount();
        PageResult<List<OrderInfo>> listPageResult=new PageResult<List<OrderInfo>>("",orderInfos,0,count);
        return listPageResult;
    }
 
 
    @RequestMapping(value="/selectHistoryOrderByName.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<OrderInfo>> selectHistoryOrderByName(@RequestParam(value = "page") int page , int limit,String contact) {
        List<OrderInfo> orderInfos = orderService.selectHistoryOrderByName(contact);
        //返回的总记录数
        int count=orderInfos.size();
        PageResult<List<OrderInfo>> listPageResult=new PageResult<List<OrderInfo>>("",orderInfos,0,count);
        return listPageResult;
    }
 
 
    @RequestMapping(value="/ShowHandleOrders.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<OrderInfo>> ShowHandleOrders(@RequestParam(value = "page") int page , int limit) {
        List<OrderInfo> orderInfos = orderService.ShowHandleOrders(page,limit);
        System.out.println(orderInfos);
        //返回的总记录数
        int count=orderService.findHandleOrdersPageCount();
        PageResult<List<OrderInfo>> listPageResult=new PageResult<List<OrderInfo>>("",orderInfos,0,count);
        return listPageResult;
    }
 
 
    @RequestMapping(value="/selectHandleOrderByName.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<OrderInfo>> selectHandleOrderByName(@RequestParam(value = "page") int page , int limit,String contact) {
        List<OrderInfo> orderInfos = orderService.selectHandleOrderByName(contact);
        //返回的总记录数
        int count=orderInfos.size();
        PageResult<List<OrderInfo>> listPageResult=new PageResult<List<OrderInfo>>("",orderInfos,0,count);
        return listPageResult;
    }
 
 
 
    @RequestMapping(value="/AddOrder.action",method = RequestMethod.POST)
    @ResponseBody
    public int AddOrder(@RequestBody OrderInfo orderInfo) {
            int  a=orderService.AddOrder(orderInfo);
            return a;
    }
 
 
    @RequestMapping(value="/ShowStaffOrders.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<OrderInfo>> ShowStaffOrders(HttpSession session,@RequestParam(value = "page") int page , int limit) {
        UserInfo user = (UserInfo) session.getAttribute("user");
        String id = user.getUserid();
        List<OrderInfo> orderInfos = orderService.ShowStaffOrders(id,page,limit);
        System.out.println(orderInfos);
        //返回的总记录数
        int count=orderService.findStaffOrdersPageCount(id);
        PageResult<List<OrderInfo>> listPageResult=new PageResult<List<OrderInfo>>("",orderInfos,0,count);
        return listPageResult;
    }
 
    @RequestMapping(value="/selectStaffOrderByName.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<OrderInfo>> selectStaffOrderByName(HttpSession session,@RequestParam(value = "page") int page , int limit,String contact) {
        UserInfo user = (UserInfo) session.getAttribute("user");
        String id = user.getUserid();
        List<OrderInfo> orderInfos = orderService.selectStaffOrderByName(id,contact);
        //返回的总记录数
        int count=orderInfos.size();
        PageResult<List<OrderInfo>> listPageResult=new PageResult<List<OrderInfo>>("",orderInfos,0,count);
        return listPageResult;
    }
 
 
    @RequestMapping(value="/ShowClientOrders.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<OrderInfo>> ShowClientOrders(HttpSession session,@RequestParam(value = "page") int page , int limit) {
        UserInfo user = (UserInfo) session.getAttribute("user");
       String  id = user.getUserid();
        List<OrderInfo> orderInfos = orderService.ShowClientOrders(id,page,limit);
        System.out.println(orderInfos);
        //返回的总记录数
        int count=orderService.findClientOrdersPageCount(id);
        PageResult<List<OrderInfo>> listPageResult=new PageResult<List<OrderInfo>>("",orderInfos,0,count);
        return listPageResult;
    }
 
    @RequestMapping(value="/selectClientOrderByName.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<OrderInfo>> selectClientOrderByName(HttpSession session,@RequestParam(value = "page") int page , int limit,String contact) {
        UserInfo user = (UserInfo) session.getAttribute("user");
        String id = user.getUserid();
        List<OrderInfo> orderInfos = orderService.selectClientOrderByName(id,contact);
        //返回的总记录数
        int count=orderInfos.size();
        PageResult<List<OrderInfo>> listPageResult=new PageResult<List<OrderInfo>>("",orderInfos,0,count);
        return listPageResult;
    }
}

package com.lzm.controller.admin;
 
import com.lzm.pojo.CarInfo;
import com.lzm.pojo.PartsInfo;
import com.lzm.pojo.UserInfo;
import com.lzm.service.Interface.PartService;
import com.lzm.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 

@Controller
public class PartsController {
    @Autowired
    private PartService partService;
 
 
    @RequestMapping(value="/ShowAllParts.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<PartsInfo>>    ShowAllParts(@RequestParam(value = "page") int page , int limit) {
        List<PartsInfo> partsInfos = partService.selectAllPart(page,limit);
        System.out.println(partsInfos.toString());
        //返回的总记录数
        int count=partService.findPartPageCount();
        PageResult<List<PartsInfo>> listPageResult=new PageResult<List<PartsInfo>>("",partsInfos,0,count);
        return listPageResult;
 
    }
 
 
    @RequestMapping(value="/updatePart.action",method = RequestMethod.POST)
    @ResponseBody
    public int updateCar( @RequestBody PartsInfo  partsInfo) {
        int i = partService.updatePart(partsInfo);
        return i;
    }
 
    @RequestMapping(value="/selectPartByName.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<PartsInfo>> selectPartByName(@RequestParam(value = "page") int page , int limit,String plate) {
        List<PartsInfo> partsInfos = partService.selectPartByName(plate);
        //返回的总记录数
        int count=partsInfos.size();
        PageResult<List<PartsInfo>> listPageResult=new PageResult<List<PartsInfo>>("",partsInfos,0,count);
        return listPageResult;
    }
 
 
    //根据ID删除车辆
    @RequestMapping(value="/deletePart.action",method = RequestMethod.GET)
    @ResponseBody
    public int deletePart(int id) {
        int a=partService.deletePartByID(id);
        return a;
    }
 
 
    @RequestMapping(value="/AddPart.action",method = RequestMethod.POST)
    @ResponseBody
    public int AddPart(@RequestBody PartsInfo partsInfo) {
            int  a=partService.addPart(partsInfo);
            return a;
    }
}

package com.lzm.controller.admin;
 
import com.lzm.pojo.CarInfo;
import com.lzm.pojo.PartsInfo;
import com.lzm.pojo.PurchaseInfo;
import com.lzm.pojo.UserInfo;
import com.lzm.service.Interface.PartService;
import com.lzm.service.Interface.PurchaseService;
import com.lzm.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 

@Controller
public class PurchaseController {
    @Autowired
    private PurchaseService purchaseService;
    @Autowired
    private PartService partService;
 
    @RequestMapping(value="/ShowAllPurchase.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<PurchaseInfo>> ShowAllPurchase(@RequestParam(value = "page") int page , int limit) {
        List<PurchaseInfo> purchaseInfos = purchaseService.selectAllPurchase(page,limit);
        System.out.println(purchaseInfos.toString());
        //返回的总记录数
        int count=purchaseService.findPurchasePageCount();
        PageResult<List<PurchaseInfo>> listPageResult=new PageResult<List<PurchaseInfo>>("",purchaseInfos,0,count);
        return listPageResult;
 
    }
 
    @RequestMapping(value="/selectPurchaseByPartName.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<PurchaseInfo>> selectPurchaseByPartName(@RequestParam(value = "page") int page , int limit, String plate) {
        List<PurchaseInfo> purchaseInfos = purchaseService.selectPurchaseByPartName(plate);
        //返回的总记录数
        int count=purchaseInfos.size();
        PageResult<List<PurchaseInfo>> listPageResult=new PageResult<List<PurchaseInfo>>("",purchaseInfos,0,count);
        return listPageResult;
    }
 
    @RequestMapping(value="/AddPurchase.action",method = RequestMethod.POST)
    @ResponseBody
    public int addPurchase(@RequestBody PurchaseInfo purchaseInfo) {
        int  a=purchaseService.addPurchase(purchaseInfo);
            return a;
 
    }
}

package com.lzm.controller.admin;
 
import com.lzm.conversion.DateConveter;
import com.lzm.pojo.UserInfo;
import com.lzm.service.Interface.UserService;
import com.lzm.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpSession;
import java.util.List;
 

@Controller
public class UserController {
    @Autowired
    private UserService userService;
    @Autowired
    private DateConveter dateConveter;
 
    @RequestMapping(value="/ShowAllUser.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<UserInfo>> ShowAllUser(@RequestParam(value = "page") int page , int limit) {
        List<UserInfo> users = userService.selectAllUser(page,limit);
        //返回的总记录数
        int count=userService.findUserPageCount();
        PageResult<List<UserInfo>> listPageResult=new PageResult<List<UserInfo>>("",users,0,count);
        return listPageResult;
 
    }
 
    @RequestMapping(value="/selectUserByPhone.action",method = RequestMethod.GET)
    @ResponseBody
    public PageResult<List<UserInfo>> selectUserByPhone(@RequestParam(value = "page") int page , int limit,String phone) {
 
        System.out.println(phone);
        List<UserInfo> users = userService.selectUserByPhone(phone);
        PageResult<List<UserInfo>> listPageResult=new PageResult<List<UserInfo>>("",users,0,1);
        return listPageResult;
    }
 
    @RequestMapping(value="/updateUser.action",method = RequestMethod.POST)
    @ResponseBody
    public UserInfo updateUser(HttpSession session, @RequestBody UserInfo user) {
 
        //判断密码是否改变
        int a=userService.isChangePasswod(user);
        if (a==0)
        {
            user=userService.updateUser(user);
            UserInfo user1 = (UserInfo) session.getAttribute("user");
            if (user.getId()==user1.getId())
            {
                session.setAttribute("user",user1);
            }
            return user;
        }else {
            String    password= DigestUtils.md5DigestAsHex(user.getPassword().getBytes());
            user.setPassword(password);
            user=userService.updateUser(user);
            UserInfo user1 = (UserInfo) session.getAttribute("user");
            if (user.getId()==user1.getId())
            {
                session.setAttribute("user",user1);
            }
            return user;
        }
    }
 
    //根据ID删除用户
    @RequestMapping(value="/deleteUser.action",method = RequestMethod.GET)
    @ResponseBody
    public int deleteUser(int id) {
        int a=userService.deleteUserByID(id);
        return a;
    }
 
 
    @RequestMapping(value="/AddUser.action",method = RequestMethod.POST)
    @ResponseBody
    public int AddUser(@RequestBody UserInfo user) {
        if (userService.selectUserByPhone(user.getPhone()).size()>0)
        {
            return 2;
        }else
        {
            //2:手机号重复  1:添加成功
            String    password= DigestUtils.md5DigestAsHex(user.getPassword().getBytes());
            int  a=userService.addUser(user);
            return a;
        }
    }
}

到此这篇关于使用SSM+Layui+Bootstrap实现汽车维保系统的示例代码的文章就介绍到这了,更多相关SSM+Layui+Bootstrap汽车维保系统内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯