Spring中的aware接口详情
235
2022-09-08
使用SSM+Layui+Bootstrap实现汽车维保系统的示例代码
本项目主要实现对汽车维修厂的信息化管理功能,主要包含三个角色:管理员,维修师傅,客户。实现的主要功能包含用户管理、配置管理、汽车管理、故障管理、供应商管理、配件管理、维修订单管理、统计信息、公告管理、个人信息管理。主要业务流程:用户在系统内发起汽车维修申请定单,管理员根据情况将定单分配给维修师傅,维修师傅接受任务后开始维修,并根据情况申请配件,处理完成后由管理员生成最终支付订单结算费用,客户进入系统进行费用支付,并可以查看自己相应的维修记录和费用信息等等。
技术架构:
后台开发: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;
/**
* @author znz
* @create 2021- 04- 03- 9:38
*/
@Controller
public class OrderController {
@Autowired
private OrderService orderService;
@RequestMapping(value="/ShowHistoryOrders.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> ShowHistoryOrders(@RequestParam(value = "page") int page , int limit) {
List
System.out.println(orderInfos);
//返回的总记录数
int count=orderService.findHistoryOrdersPageCount();
PageResult> listPageResult=new PageResult
>("",orderInfos,0,count);
return listPageResult;
}
@RequestMapping(value="/selectHistoryOrderByName.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> selectHistoryOrderByName(@RequestParam(value = "page") int page , int limit,String contact) {
List
//返回的总记录数
int count=orderInfos.size();
PageResult> listPageResult=new PageResult
>("",orderInfos,0,count);
return listPageResult;
}
@RequestMapping(value="/ShowHandleOrders.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> ShowHandleOrders(@RequestParam(value = "page") int page , int limit) {
List
System.out.println(orderInfos);
//返回的总记录数
int count=orderService.findHandleOrdersPageCount();
PageResult> listPageResult=new PageResult
>("",orderInfos,0,count);
return listPageResult;
}
@RequestMapping(value="/selectHandleOrderByName.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> selectHandleOrderByName(@RequestParam(value = "page") int page , int limit,String contact) {
List
//返回的总记录数
int count=orderInfos.size();
PageResult> listPageResult=new PageResult
>("",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> ShowStaffOrders(HttpSession session,@RequestParam(value = "page") int page , int limit) {
UserInfo user = (UserInfo) session.getAttribute("user");
String id = user.getUserid();
List
System.out.println(orderInfos);
//返回的总记录数
int count=orderService.findStaffOrdersPageCount(id);
PageResult> listPageResult=new PageResult
>("",orderInfos,0,count);
return listPageResult;
}
@RequestMapping(value="/selectStaffOrderByName.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> selectStaffOrderByName(HttpSession session,@RequestParam(value = "page") int page , int limit,String contact) {
UserInfo user = (UserInfo) session.getAttribute("user");
String id = user.getUserid();
List
//返回的总记录数
int count=orderInfos.size();
PageResult> listPageResult=new PageResult
>("",orderInfos,0,count);
return listPageResult;
}
@RequestMapping(value="/ShowClientOrders.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> ShowClientOrders(HttpSession session,@RequestParam(value = "page") int page , int limit) {
UserInfo user = (UserInfo) session.getAttribute("user");
String id = user.getUserid();
List
System.out.println(orderInfos);
//返回的总记录数
int count=orderService.findClientOrdersPageCount(id);
PageResult> listPageResult=new PageResult
>("",orderInfos,0,count);
return listPageResult;
}
@RequestMapping(value="/selectClientOrderByName.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> selectClientOrderByName(HttpSession session,@RequestParam(value = "page") int page , int limit,String contact) {
UserInfo user = (UserInfo) session.getAttribute("user");
String id = user.getUserid();
List
//返回的总记录数
int count=orderInfos.size();
PageResult> listPageResult=new PageResult
>("",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;
/**
* @author znz
* @create 2021- 03- 31- 10:10
*/
@Controller
public class PartsController {
@Autowired
private PartService partService;
@RequestMapping(value="/ShowAllParts.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> ShowAllParts(@RequestParam(value = "page") int page , int limit) {
List
System.out.println(partsInfos.toString());
//返回的总记录数
int count=partService.findPartPageCount();
PageResult> listPageResult=new PageResult
>("",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> selectPartByName(@RequestParam(value = "page") int page , int limit,String plate) {
List
//返回的总记录数
int count=partsInfos.size();
PageResult> listPageResult=new PageResult
>("",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;
/**
* @author znz
* @create 2021- 03- 31- 15:55
*/
@Controller
public class PurchaseController {
@Autowired
private PurchaseService purchaseService;
@Autowired
private PartService partService;
@RequestMapping(value="/ShowAllPurchase.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> ShowAllPurchase(@RequestParam(value = "page") int page , int limit) {
List
System.out.println(purchaseInfos.toString());
//返回的总记录数
int count=purchaseService.findPurchasePageCount();
PageResult> listPageResult=new PageResult
>("",purchaseInfos,0,count);
return listPageResult;
}
@RequestMapping(value="/selectPurchaseByPartName.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> selectPurchaseByPartName(@RequestParam(value = "page") int page , int limit, String plate) {
List
//返回的总记录数
int count=purchaseInfos.size();
PageResult> listPageResult=new PageResult
>("",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;
/**
* @author znz
* @create 2021- 03- 26- 12:11
*/
@Controller
public class UserController {
@Autowired
private UserService userService;
@Autowired
private DateConveter dateConveter;
@RequestMapping(value="/ShowAllUser.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> ShowAllUser(@RequestParam(value = "page") int page , int limit) {
List
//返回的总记录数
int count=userService.findUserPageCount();
PageResult> listPageResult=new PageResult
>("",users,0,count);
return listPageResult;
}
@RequestMapping(value="/selectUserByPhone.action",method = RequestMethod.GET)
@ResponseBody
public PageResult> selectUserByPhone(@RequestParam(value = "page") int page , int limit,String phone) {
System.out.println(phone);
List
PageResult> listPageResult=new PageResult
>("",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;
}
}
}
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~