大家好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发运行环境
- 框架:ssm
- JDK版本:JDK1.8
- 服务器:tomcat7
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:eclipse/myeclipse/idea
- Maven包:Maven3.3.9
- 浏览器:谷歌浏览器
源码下载地址:
https://download.csdn.net/download/m0_46388260/89287785
论文目录
【如需全文请按文末获取联系】
一、项目简介
汽车售后服务管理系统在Eclipse环境中,使用Java语言进行编码,使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务,本系统管理员管理员工,管理材料,管理材料出入库订单,管理公告以及维修类型信息。员工对材料进行入库,出库,管理维修预约信息。用户新增维修预约信息,查看维修进度,查看材料信息,查看公告。
二、系统设计
2.1软件功能模块设计
在前面分析的管理员功能的基础上,进行接下来的设计工作,最终展示设计的管理员结构图(见下图)。管理员管理员工,管理材料,管理材料出入库订单,管理公告以及维修类型信息。
在前面分析的员工功能的基础上,进行接下来的设计工作,最终展示设计的员工结构图(见下图)。员工对材料进行入库,出库,管理维修预约信息。
在前面分析的用户功能的基础上,进行接下来的设计工作,最终展示设计的用户结构图(见下图)。用户新增维修预约信息,查看维修进度,查看材料信息,查看公告。
2.2数据库设计
(1)下图是材料实体和其具备的属性。
(2)下图是管理员实体和其具备的属性。
(3)下图是维修预约实体和其具备的属性。
(5)下图为上述各实体间相互之间的关系。
三、系统项目部分截图
3.1管理员功能实现
员工管理
管理员进入指定功能操作区之后可以管理员工信息。其页面见下图。管理员可以增删改查员工资料。
材料管理
管理员进入指定功能操作区之后可以管理材料信息。其页面见下图。管理员增删改查材料信息,材料信息包括材料数量,单价,材料种类等信息。
出入库订单管理
管理员进入指定功能操作区之后可以管理材料出入库订单信息。其页面见下图。管理员在本页面可以对材料进行入库或出库操作,可以查看材料出入库订单详情信息,可以批量删除材料的出入库订单信息。
3.2员工功能实现
维修预约管理
员工进入指定功能操作区之后可以管理维修预约信息。其页面见下图。员工查看维修预约信息,修改维修进度信息。
材料入库
员工进入指定功能操作区之后可以登记材料入库信息。其页面见下图。员工选择入库的材料,登记订单名,登记材料入库的数量,最后提交即可。
3.3用户功能实现
材料查看
用户进入指定功能操作区之后可以查看材料。其页面见下图。用户查看材料的价格,材料的数量,材料的图片以及材料的详情信息。
维修预约管理
用户进入指定功能操作区之后可以管理维修预约信息。其页面见下图。用户新增维修预约信息,修改维修预约信息,查看维修进度信息。
四、部分核心代码
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.GoodsEntity;
import com.entity.InOutOrderListEntity;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
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.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.InOutOrderEntity;
import com.entity.view.InOutOrderView;
import com.utils.PageUtils;
import com.utils.R;
/**
* 出入库订单
* 后端接口
* @author
* @email
* @date
*/
@RestController
@Controller
@RequestMapping("/inOutOrder")
public class InOutOrderController {
private static final Logger logger = LoggerFactory.getLogger(InOutOrderController.class);
@Autowired
private InOutOrderService inOutOrderService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
// 商品表
@Autowired
private GoodsService goodsService;
//订单详情表
@Autowired
private InOutOrderListService inOutOrderListService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = inOutOrderService.queryPage(params);
//字典表数据转换
List<InOutOrderView> list =(List<InOutOrderView>)page.getList();
for(InOutOrderView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
InOutOrderEntity inOutOrder = inOutOrderService.selectById(id);
if(inOutOrder !=null){
//entity转view
InOutOrderView view = new InOutOrderView();
BeanUtils.copyProperties( inOutOrder , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody InOutOrderEntity inOutOrder, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,inOutOrder:{}",this.getClass().getName(),inOutOrder.toString());
Wrapper<InOutOrderEntity> queryWrapper = new EntityWrapper<InOutOrderEntity>()
.eq("order_name", inOutOrder.getOrderName())
.eq("caozuo_name", inOutOrder.getCaozuoName())
.eq("caozuo_table", inOutOrder.getCaozuoTable())
.eq("order_types", inOutOrder.getOrderTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
InOutOrderEntity inOutOrderEntity = inOutOrderService.selectOne(queryWrapper);
if(inOutOrderEntity==null){
inOutOrder.setInsertTime(new Date());
inOutOrder.setCreateTime(new Date());
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// inOutOrder.set
// }
inOutOrderService.insert(inOutOrder);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody InOutOrderEntity inOutOrder, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,inOutOrder:{}",this.getClass().getName(),inOutOrder.toString());
//根据字段查询是否有相同数据
Wrapper<InOutOrderEntity> queryWrapper = new EntityWrapper<InOutOrderEntity>()
.notIn("id",inOutOrder.getId())
.eq("order_name", inOutOrder.getOrderName())
.eq("caozuo_name", inOutOrder.getCaozuoName())
.eq("caozuo_table", inOutOrder.getCaozuoTable())
.eq("order_types", inOutOrder.getOrderTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
InOutOrderEntity inOutOrderEntity = inOutOrderService.selectOne(queryWrapper);
if(inOutOrderEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// inOutOrder.set
// }
inOutOrderService.updateById(inOutOrder);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 出库
*/
@RequestMapping("/outOrder")
public R outGoods(@RequestBody Map<String, Object> params,HttpServletRequest request){
logger.debug("outGoods方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
Map<String, Integer> map = (Map<String, Integer>) params.get("map");
String orderName = String.valueOf(params.get("orderName"));
InOutOrderEntity one = inOutOrderService.selectOne(new EntityWrapper<InOutOrderEntity>().eq("order_name", orderName));
if(one != null){
return R.error(orderName+"的订单名已经被使用");
}
Set<String> ids = map.keySet();
List<GoodsEntity> list = goodsService.selectList(new EntityWrapper<GoodsEntity>().in("id", ids));
Date date = new Date();
for(GoodsEntity g:list){
Integer shiyongnumber = map.get(String.valueOf(g.getId()));
if(g.getGoodsNumber()==null || shiyongnumber == null){
return R.error(g.getGoodsName()+"的库存数量为空或者出库数量为空");
}else if(g.getGoodsNumber()-shiyongnumber<0){
return R.error(g.getGoodsName()+"的出库数量:"+shiyongnumber+"不能大于库存数量"+g.getGoodsNumber());
}else{
//正常出库
g.setGoodsNumber(g.getGoodsNumber()-shiyongnumber);
}
}
//修改库存
goodsService.updateBatchById(list);
//新增订单
InOutOrderEntity inOutOrderEntity = new InOutOrderEntity();
inOutOrderEntity.setCreateTime(date);
inOutOrderEntity.setInsertTime(date);
inOutOrderEntity.setCaozuoName(String.valueOf(request.getSession().getAttribute("username")));
inOutOrderEntity.setCaozuoTable(String.valueOf(request.getSession().getAttribute("tableName")));
inOutOrderEntity.setOrderTypes(1);//设置订单为出库
inOutOrderEntity.setOrderName(orderName);
inOutOrderService.insert(inOutOrderEntity);
if(inOutOrderEntity.getId()!=null){
//新增订单详情
List<InOutOrderListEntity> inOutOrderListEntityList = new ArrayList<>();
for(String i:ids){
InOutOrderListEntity inOutOrderListEntity = new InOutOrderListEntity();
inOutOrderListEntity.setCreateTime(date);
inOutOrderListEntity.setGoodsId(Integer.valueOf(i));
inOutOrderListEntity.setInOutOrderId(inOutOrderEntity.getId());
inOutOrderListEntity.setOrderNumber(map.get(i));
inOutOrderListEntityList.add(inOutOrderListEntity);
}
if(inOutOrderListEntityList != null && inOutOrderListEntityList.size()>0){
inOutOrderListService.insertBatch(inOutOrderListEntityList);
return R.ok();
}
}else{
return R.error("新增订单失败");
}
return R.ok();
}
/**
* 入库
*/
@RequestMapping("/inOrder")
public R inGoods(@RequestBody Map<String, Object> params,HttpServletRequest request){
logger.debug("inGoods方法:,,Controller:{},,map:{}",this.getClass().getName(),JSONObject.toJSONString(params));
Map<String, Integer> map = (Map<String, Integer>) params.get("map");
String orderName = String.valueOf(params.get("orderName"));
InOutOrderEntity one = inOutOrderService.selectOne(new EntityWrapper<InOutOrderEntity>().eq("order_name", orderName));
if(one != null){
return R.error(orderName+"的订单名已经被使用");
}
Set<String> ids = map.keySet();
List<GoodsEntity> list = goodsService.selectList(new EntityWrapper<GoodsEntity>().in("id", ids));
Date date = new Date();
for(GoodsEntity g:list){
Integer rukunumber = map.get(String.valueOf(g.getId()));
Integer oldGoodsNumber = g.getGoodsNumber();
if(rukunumber == null){
return R.error(g.getGoodsName()+"的入库数量为空");
}else if( oldGoodsNumber== null || oldGoodsNumber == 0){
g.setGoodsNumber(rukunumber);
}else{
g.setGoodsNumber(oldGoodsNumber+rukunumber);
}
}
//修改库存
goodsService.updateBatchById(list);
//新增订单
InOutOrderEntity inOutOrderEntity = new InOutOrderEntity();
inOutOrderEntity.setCreateTime(date);
inOutOrderEntity.setInsertTime(date);
inOutOrderEntity.setCaozuoName(String.valueOf(request.getSession().getAttribute("username")));
inOutOrderEntity.setCaozuoTable(String.valueOf(request.getSession().getAttribute("tableName")));
inOutOrderEntity.setOrderTypes(2);//设置订单为入库
inOutOrderEntity.setOrderName(orderName);
inOutOrderService.insert(inOutOrderEntity);
if(inOutOrderEntity.getId()!=null){
//新增订单详情
List<InOutOrderListEntity> inOutOrderListEntityList = new ArrayList<>();
for(String i:ids){
InOutOrderListEntity inOutOrderListEntity = new InOutOrderListEntity();
inOutOrderListEntity.setCreateTime(date);
inOutOrderListEntity.setGoodsId(Integer.parseInt(i));
inOutOrderListEntity.setInOutOrderId(inOutOrderEntity.getId());
inOutOrderListEntity.setOrderNumber(map.get(i));
inOutOrderListEntityList.add(inOutOrderListEntity);
}
if(inOutOrderListEntityList != null && inOutOrderListEntityList.size()>0){
inOutOrderListService.insertBatch(inOutOrderListEntityList);
return R.ok();
}
}else{
return R.error("新增订单失败");
}
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<InOutOrderEntity> list = inOutOrderService.selectList(new EntityWrapper<InOutOrderEntity>().in("id", ids));
inOutOrderService.deleteBatchIds(Arrays.asList(ids));
List<Integer> inOutOrderIds = new ArrayList<>();
for(InOutOrderEntity order:list){
inOutOrderIds.add(order.getId());
}
if(inOutOrderIds != null && inOutOrderIds.size()>0){
inOutOrderListService.delete(new EntityWrapper<InOutOrderListEntity>().in("in_out_order_id", inOutOrderIds));
}
return R.ok();
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微信联系我。