基于SSM汽车交易系统的设计与实现
摘要
电子商务的兴起不仅仅是带来了更多的就业行业。同样也给我们的生活带来了丰富多彩的变化。多姿多彩的世界带来了美好的生活,行业的发展也是形形色色的离不开技术的发展。作为时代进步的发展方面,信息技术至始至终都是成就行业发展的重要秘密。不论何种行业,大到国家、企业,小到团体、个人都在多方位的结合信息化技术来改变生活,疫情时期我们每个人运用的信息化扫码,通过简单的设置就能够看到所到过的地方,这就是技术的力量。汽车销售系统就是为了能够及时有效的进行将汽车推荐给更多需要的消费者。
本文主要还是以SSM汽车销售管理的设计和实现为主要的考虑内容,为了能够考虑到信息安全性和汽车销售系统的数据访问程度,本此设计就采用了MYSQL数据库。另外,做为汽车销售系统来说后面可能对系统进行必要的功能维护,所以在设计初期就采用了B/S的设计模式,就是为了能够在服务器更新完了就不用再客户端再做什么更新。同时,为了能够满足功能需求也就采用了JS语言。
关键词: MYSQL数据库 B/S设计模式 JS技术
系统实现展示
作为汽车销售管理系统,其实它本质上就是一个电子商务的网站,那么我们需要一个。整洁的布局、完整的功能和优美的动画。最上面以网站的名称命名通过一副风景画儿来显示出网站的主题,其次下面的导航菜单也是将各种功能清晰的罗列出来。对于导航菜单的下边一行,我们为了能够将网站的公告信息更清楚地展示出来,所以这样做的理由是更加醒目地可以让用户看到网站的公告。如下所示:
首页
新闻信息
用户注册
后台功能界面
注册用户管理界面
功能需求分析
本网站主要还是为了宣传和销售汽车进行研发的, 根据前后台功能不同,大致可以分为两部分。前台主要是面对用户使用,其功能不用多说。肯定会有首页、汽车信息和新闻信息、当然还有登录和注册这都不用说的。后台主要功能包括系统用户管理、注册用户管理、新闻数据管理、变幻图管理、付款管理、汽车管理和在线预定管理以及汽车统计等信息。
总体建设
建设一个用的畅快的用的舒服的系统就是为了工作人员和消费者能够在繁重的工作和学习中体会到一丝的轻松。大家每天都在和网络打交道,所以一个好的网站系统的重要性就由此体现。这就需要强大的技术来支撑。如果想要系统好用,那么以下几条原则还是要看一下的:
实用性:我们建设系统,是真金白银的掏钱,就不能搞些虚的,实用!实用!实用!重要的事情说三遍。如果不实用,一切都是浮云。
先进性:建设系统不能把那些快要淘汰的设备和技术都拿来用,用就用最先进的,建就建最好的,先进是建设的一切前提。这样就可以使系统在日新月异的网络变化中可以多用几年,减少很多的更新和维护的成本。
安全性:安全大于天,信息时代每个人的信息都非常的重要,所以信息一定要安全。如果系统安全性很差,这会让用户很没有安全感的。而且隐患也非常的大。如果不法分子窃取信息进行诈骗,那后果不堪设想。
稳定性:系统一定要稳定,不要三天两头的修来修去,这大大影响了使用者的心情和工作学习的效率。
可行性分析
网络上开源社区的技术发布也是存在着多种多样的技术展现形式。本系统设计主要是针对此次毕业设计而进行的,所以网站采用了B/S的浏览模式。在经济可行性分析上面,本网站只要一台电脑就可以进行开发。其语言的选择和数据库的选择都使用开源且免费的。另外在项目的部署上也无需再花其他费用,所以在经济上是非常可行的。在经济可行性分析上面,系统设计初期就首先考虑到这一点,所以我们所使用的第三方插件、开发语言以及数据库系统都是网上可以免费找到的。更甚至于一些大厂的语言核心技术都有详细的介绍使用,所以说在经济上完全是可行的。
操作可行性一般分为开发前的分析和开发后的分析,所谓开发前的分析就是说要判断一下,开发者开发这个系统是否可行,包括经济方面也包括技术方面。看看开发者的能力是否胜任这份工作,开发者所投入的成本是否可以维持到系统正常开发完成并投入使用。另一个就是说系统开发出来可操作性是不是够高。用户使用起来是不是顺手,会不会很繁琐,是否符合用户的使用习惯。本系统所使用的技术都是本人学习多年的技术,而且本系统开发也不需要投入太多的金钱,一台笔记本电脑足以,所以在开发方面的操作是完全可行的。另外本系统操作简单,功能模块都做了说明,只要会浏览网站的用户都能使用,所以在这方面的操作也是可行的。
部分代码
package com.controller;
import java.io.File;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.PrintWriter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import com.entity.Zaixianyuding;
import com.server.ZaixianyudingServer;
import com.util.PageBean;
import net.sf.json.JSONObject;
import com.util.db;
import java.sql.SQLException;
import java.sql.*;
@Controller
public class ZaixianyudingController {
@Resource
private ZaixianyudingServer zaixianyudingService;
@RequestMapping("addZaixianyuding.do")
public String addZaixianyuding(HttpServletRequest request,Zaixianyuding zaixianyuding,HttpSession session) throws SQLException{
Timestamp time=new Timestamp(System.currentTimeMillis());
zaixianyuding.setAddtime(time.toString().substring(0, 19));
zaixianyudingService.add(zaixianyuding);
db dbo = new db();
//kuabiaogaizhi
session.setAttribute("backxx", "添加成功");
session.setAttribute("backurl", request.getHeader("Referer"));
//session.setAttribute("backurl", "zaixianyudingList.do");
return "redirect:postback.jsp";
//return "redirect:zaixianyudingList.do";
}
// 处理编辑
@RequestMapping("doUpdateZaixianyuding.do")
public String doUpdateZaixianyuding(int id,ModelMap map,Zaixianyuding zaixianyuding){
zaixianyuding=zaixianyudingService.getById(id);
map.put("zaixianyuding", zaixianyuding);
return "zaixianyuding_updt";
}
// 后台详细
@RequestMapping("zaixianyudingDetail.do")
public String zaixianyudingDetail(int id,ModelMap map,Zaixianyuding zaixianyuding){
zaixianyuding=zaixianyudingService.getById(id);
map.put("zaixianyuding", zaixianyuding);
return "zaixianyuding_detail";
}
// 前台详细
@RequestMapping("zxydDetail.do")
public String zxydDetail(int id,ModelMap map,Zaixianyuding zaixianyuding){
zaixianyuding=zaixianyudingService.getById(id);
map.put("zaixianyuding", zaixianyuding);
return "zaixianyudingdetail";
}
//
@RequestMapping("updateZaixianyuding.do")
public String updateZaixianyuding(int id,ModelMap map,Zaixianyuding zaixianyuding,HttpServletRequest request,HttpSession session){
zaixianyudingService.update(zaixianyuding);
session.setAttribute("backxx", "修改成功");
session.setAttribute("backurl", request.getHeader("Referer"));
return "redirect:postback.jsp";
//String url = request.getHeader("Referer");
//return "redirect:"+url;
//return "redirect:zaixianyudingList.do";
}
// 分页查询
@RequestMapping("zaixianyudingList.do")
public String zaixianyudingList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Zaixianyuding zaixianyuding, String yudingbianhao, String cheliangbianhao, String cheliangpinpai, String chexing, String qudongfangshi, String yanse, String pailiang, String jiage, String yudingshuliang1,String yudingshuliang2, String zongjine, String yudingren, String issh){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
pmap.put("issh", "否");
if(yudingbianhao==null||yudingbianhao.equals("")){pmap.put("yudingbianhao", null);}else{pmap.put("yudingbianhao", yudingbianhao);}
if(cheliangbianhao==null||cheliangbianhao.equals("")){pmap.put("cheliangbianhao", null);}else{pmap.put("cheliangbianhao", cheliangbianhao);}
if(cheliangpinpai==null||cheliangpinpai.equals("")){pmap.put("cheliangpinpai", null);}else{pmap.put("cheliangpinpai", cheliangpinpai);}
if(chexing==null||chexing.equals("")){pmap.put("chexing", null);}else{pmap.put("chexing", chexing);}
if(qudongfangshi==null||qudongfangshi.equals("")){pmap.put("qudongfangshi", null);}else{pmap.put("qudongfangshi", qudongfangshi);}
if(yanse==null||yanse.equals("")){pmap.put("yanse", null);}else{pmap.put("yanse", yanse);}
if(pailiang==null||pailiang.equals("")){pmap.put("pailiang", null);}else{pmap.put("pailiang", pailiang);}
if(jiage==null||jiage.equals("")){pmap.put("jiage", null);}else{pmap.put("jiage", jiage);}
if(yudingshuliang1==null||yudingshuliang1.equals("")){pmap.put("yudingshuliang1", null);}else{pmap.put("yudingshuliang1", yudingshuliang1);}
if(yudingshuliang2==null||yudingshuliang2.equals("")){pmap.put("yudingshuliang2", null);}else{pmap.put("yudingshuliang2", yudingshuliang2);}
if(zongjine==null||zongjine.equals("")){pmap.put("zongjine", null);}else{pmap.put("zongjine", zongjine);}
if(yudingren==null||yudingren.equals("")){pmap.put("yudingren", null);}else{pmap.put("yudingren", yudingren);}
int total=zaixianyudingService.getCount(pmap);
pageBean.setTotal(total);
List<Zaixianyuding> list=zaixianyudingService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "zaixianyuding_list";
}
@RequestMapping("zaixianyudingList2.do")
public String zaixianyudingList2(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Zaixianyuding zaixianyuding, String yudingbianhao, String cheliangbianhao, String cheliangpinpai, String chexing, String qudongfangshi, String yanse, String pailiang, String jiage, String yudingshuliang1,String yudingshuliang2, String zongjine, String yudingren, String issh,HttpServletRequest request){
/*if(session.getAttribute("user")==null){
return "login";
}*/
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
pmap.put("issh", "否");
pmap.put("yudingren", (String)request.getSession().getAttribute("username"));
if(yudingbianhao==null||yudingbianhao.equals("")){pmap.put("yudingbianhao", null);}else{pmap.put("yudingbianhao", yudingbianhao);}
if(cheliangbianhao==null||cheliangbianhao.equals("")){pmap.put("cheliangbianhao", null);}else{pmap.put("cheliangbianhao", cheliangbianhao);}
if(cheliangpinpai==null||cheliangpinpai.equals("")){pmap.put("cheliangpinpai", null);}else{pmap.put("cheliangpinpai", cheliangpinpai);}
if(chexing==null||chexing.equals("")){pmap.put("chexing", null);}else{pmap.put("chexing", chexing);}
if(qudongfangshi==null||qudongfangshi.equals("")){pmap.put("qudongfangshi", null);}else{pmap.put("qudongfangshi", qudongfangshi);}
if(yanse==null||yanse.equals("")){pmap.put("yanse", null);}else{pmap.put("yanse", yanse);}
if(pailiang==null||pailiang.equals("")){pmap.put("pailiang", null);}else{pmap.put("pailiang", pailiang);}
if(jiage==null||jiage.equals("")){pmap.put("jiage", null);}else{pmap.put("jiage", jiage);}
if(yudingshuliang1==null||yudingshuliang1.equals("")){pmap.put("yudingshuliang1", null);}else{pmap.put("yudingshuliang1", yudingshuliang1);}
if(yudingshuliang2==null||yudingshuliang2.equals("")){pmap.put("yudingshuliang2", null);}else{pmap.put("yudingshuliang2", yudingshuliang2);}
if(zongjine==null||zongjine.equals("")){pmap.put("zongjine", null);}else{pmap.put("zongjine", zongjine);}
int total=zaixianyudingService.getCount(pmap);
pageBean.setTotal(total);
List<Zaixianyuding> list=zaixianyudingService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "zaixianyuding_list2";
}
@RequestMapping("zxydList.do")
public String zxydList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Zaixianyuding zaixianyuding, String yudingbianhao, String cheliangbianhao, String cheliangpinpai, String chexing, String qudongfangshi, String yanse, String pailiang, String jiage, String yudingshuliang1,String yudingshuliang2, String zongjine, String yudingren, String issh){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
if(yudingbianhao==null||yudingbianhao.equals("")){pmap.put("yudingbianhao", null);}else{pmap.put("yudingbianhao", yudingbianhao);}
if(cheliangbianhao==null||cheliangbianhao.equals("")){pmap.put("cheliangbianhao", null);}else{pmap.put("cheliangbianhao", cheliangbianhao);}
if(cheliangpinpai==null||cheliangpinpai.equals("")){pmap.put("cheliangpinpai", null);}else{pmap.put("cheliangpinpai", cheliangpinpai);}
if(chexing==null||chexing.equals("")){pmap.put("chexing", null);}else{pmap.put("chexing", chexing);}
if(qudongfangshi==null||qudongfangshi.equals("")){pmap.put("qudongfangshi", null);}else{pmap.put("qudongfangshi", qudongfangshi);}
if(yanse==null||yanse.equals("")){pmap.put("yanse", null);}else{pmap.put("yanse", yanse);}
if(pailiang==null||pailiang.equals("")){pmap.put("pailiang", null);}else{pmap.put("pailiang", pailiang);}
if(jiage==null||jiage.equals("")){pmap.put("jiage", null);}else{pmap.put("jiage", jiage);}
if(yudingshuliang1==null||yudingshuliang1.equals("")){pmap.put("yudingshuliang1", null);}else{pmap.put("yudingshuliang1", yudingshuliang1);}
if(yudingshuliang2==null||yudingshuliang2.equals("")){pmap.put("yudingshuliang2", null);}else{pmap.put("yudingshuliang2", yudingshuliang2);}
if(zongjine==null||zongjine.equals("")){pmap.put("zongjine", null);}else{pmap.put("zongjine", zongjine);}
if(yudingren==null||yudingren.equals("")){pmap.put("yudingren", null);}else{pmap.put("yudingren", yudingren);}
int total=zaixianyudingService.getCount(pmap);
pageBean.setTotal(total);
List<Zaixianyuding> list=zaixianyudingService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "zaixianyudinglist";
}
@RequestMapping("zxydListtp.do")
public String zxydListtp(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Zaixianyuding zaixianyuding, String yudingbianhao, String cheliangbianhao, String cheliangpinpai, String chexing, String qudongfangshi, String yanse, String pailiang, String jiage, String yudingshuliang1,String yudingshuliang2, String zongjine, String yudingren, String issh){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
if(yudingbianhao==null||yudingbianhao.equals("")){pmap.put("yudingbianhao", null);}else{pmap.put("yudingbianhao", yudingbianhao);}
if(cheliangbianhao==null||cheliangbianhao.equals("")){pmap.put("cheliangbianhao", null);}else{pmap.put("cheliangbianhao", cheliangbianhao);}
if(cheliangpinpai==null||cheliangpinpai.equals("")){pmap.put("cheliangpinpai", null);}else{pmap.put("cheliangpinpai", cheliangpinpai);}
if(chexing==null||chexing.equals("")){pmap.put("chexing", null);}else{pmap.put("chexing", chexing);}
if(qudongfangshi==null||qudongfangshi.equals("")){pmap.put("qudongfangshi", null);}else{pmap.put("qudongfangshi", qudongfangshi);}
if(yanse==null||yanse.equals("")){pmap.put("yanse", null);}else{pmap.put("yanse", yanse);}
if(pailiang==null||pailiang.equals("")){pmap.put("pailiang", null);}else{pmap.put("pailiang", pailiang);}
if(jiage==null||jiage.equals("")){pmap.put("jiage", null);}else{pmap.put("jiage", jiage);}
if(yudingshuliang1==null||yudingshuliang1.equals("")){pmap.put("yudingshuliang1", null);}else{pmap.put("yudingshuliang1", yudingshuliang1);}
if(yudingshuliang2==null||yudingshuliang2.equals("")){pmap.put("yudingshuliang2", null);}else{pmap.put("yudingshuliang2", yudingshuliang2);}
if(zongjine==null||zongjine.equals("")){pmap.put("zongjine", null);}else{pmap.put("zongjine", zongjine);}
if(yudingren==null||yudingren.equals("")){pmap.put("yudingren", null);}else{pmap.put("yudingren", yudingren);}
int total=zaixianyudingService.getCount(pmap);
pageBean.setTotal(total);
List<Zaixianyuding> list=zaixianyudingService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "zaixianyudinglisttp";
}
@RequestMapping("deleteZaixianyuding.do")
public String deleteZaixianyuding(int id,HttpServletRequest request){
zaixianyudingService.delete(id);
String url = request.getHeader("Referer");
return "redirect:"+url;
//return "redirect:zaixianyudingList.do";
}
}