已阅读5页,还剩44页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
汽车销售网站设计与实现 详细设计与代码实现摘要:网络是现代经营和管理的重要媒介。我们手工记录汽车销售详情的时代已经过去。随着市场经济的迅速发展,面对汽车销售业严酷竞争的形势,对于加强经营管理、提高工作效率和改善服务质量成为了急待解决的问题。而解决这些问题的关键措施之一就是建立使用先进、高效的汽车销售网站系统,引进创新的经营机制,适应新形势下企业的生存和发展。关键词:经营管理; 汽车销售; 系统Abstract: The compute is modern management must medium. Before we hand car sales records of product detail is past. Long with the rapid development of market economy ,the face of the increasingly harsh competition selling cars ,strengthen operating management ,real work and improve efficiency and improve the quality of service has become the problem to be solved. To solve these establishment ,advanced and efficient use of car sales system ,the introduction of innovative management mechanism ,and adapt to the new situation of the survival and development of enterprises.Key words:management;car sales;system1 绪论1.1 课题背景,目的和意义1.1.1 课题背景随着internet的普及和电子商务的兴起,网上汽车销售是Internet电子商务在汽车销售行业发展的必然结果,这种新型的汽车销售形式,与传统4s或5s店利用线下进行销售的方式相比拥有许多优势:一是同比降低了汽车销售成本;二是利用网络作为交易平台来改变传统的交易方式,使得交易的活动不受空间和时间限制;三是销售信息的传递更迅速灵活1.1.1 课题目的和意义有了围田汽车销售网站就不需要客户到书城手工查询需要的汽车,而只需在自家的电脑前输入查询条件,快速而准确的找到汽车,大大加快了查询速度。2 可行性分析2.1 技术可行性本系统采用的是Struts1,Hibernate+Jpa规范+Spring和MySQL作为数据库开发。由于Struts1访问速度和开发效率快,采用Spring做事务管理和组件容器,再加上MySQL灵活易维护并且开发方面具有方便快捷、使用灵活的特点,以及目前的广泛实际应用,因此使用SSH+JPA+MySQL是开发javaweb平台的最佳组合,从而说明本系统在技术方面可行。硬件方面,最低配置需要2G内存和100G硬盘,CPU最低酷睿i3。2.2 操作可行性目前,大多数个人电脑都能运行本系统。该系统的安装、运行不会改变原计算机系统的默认设置和布局,再加上系统界面精简,提示信息完整,经过相关人员指导便能够方便的操作此软件。2.3 系统的技术介绍2.3.1 javascript JavaScript 是一种具有面向对象能力的、解释型的程序脚本设计语言。更具体一点,它是基于对象和事件驱动并具有相对安全性的客户端脚本语言。因为他不需要在一个语言环境下运行,而只需要支持它的浏览器即可。它的主要目的是,验证发往服务器端的数据、增加Web互动、加强用户体验度等。2.3.2 JqueryjQuery是一个可兼容多浏览器的javascript库,其核心理念是write less,do more。jQuery于2006年在美国纽约发布,此举吸引了来自世界各地的JavaScript高手加入。如今,jQuery已发展成为最流行的javascript框架。在世界前15000个访问最多的网站中,超过55%的开发者在使用jQuery。2.3.3 mysqlMySQL是一个开源数据库,它起源于瑞典ADB公司。Mysql和市面上其他数据库相比具有体积小,使用灵活,速度快,可横向集群的优势。自从阿里巴巴的去Oracle化,把数据移植到MySql中浪潮的兴起,MySql的使用越来越受大众的欢迎。2.3.4 luncenceLucene是一个由java编写的开源全文索引项目,随着网站站内索引广泛使用和hadoop大数据集群对Lucene的支持,免费、灵活、高效Lucene越来越受开发者的欢迎。Lucene先把要检索的资源集合放到本地,并使用某种特定的结构存储,称为索引,这个索引的集合称为索引库。对索引库的检索远优于数据库模糊查询。2.3.5 Jpajpa是sun公式提出一套ORM持久成规范,其本身并图示套技术。知识定义了一套数据持久层接口规范,Hibernate,Toplink等其他ORM层工具是实现了其接口规范,让开发者在用jpa开发是感觉不到底层产品的差异。其强大的注解功能更是为了解决开发人员在配置繁琐的XML文件带来的不变,所提供的开发的web项目的必选技术2.3.6 Spring Spring是一套性能非常优越的轻量级容器。它提供AOC控制反转的方式管理所有的JavaBean对象,Action对象,底层持久Service。有了Spring的管理,编程人员就再也不用在构建自己的Bean对象带来的繁琐的代码构造。2.3.7 Jmailjmail是使用java代码实现的一套邮箱规范,它对开发人员来说具有灵活、轻便的特性。用户在使用javamail发送邮箱时,只需要调用jmail的相应接口,就可以使用面向对象的方式构造邮件并发送邮件信息到指定的邮箱。2.4 系统开发平台和运行环境2.4.1系统开发平台系统的开发是在MyEclipse8.5编码Tomcat最为服务器中间件的环境下进行的。Tomcat的环境主要有以下几方面技术优势:1Tomcat不仅仅是一个Servlet容器,它也具有传统的Web服务器的功能:处理html页面。2 Tomcat也可以与其它一些软件集成起来实现更多的功能。2.4.2 操作系统操作系统:Windows 7以上版本。服务器软件:Tomcat6.0以上版本。浏览器:IE9、Fire Fox、Google Chrome。3 后台详细设计与实现围田科技汽车销售网,主要围绕需求所定义的系统结构图作依次功能模块的详细设计与实现,系统结构图如下,我主要负责编写的代码模块为:商品管理、商城用户管理和购物车这三个模块,图3-1:(1)图3-1 系统结构图3.1 商品管理3.1.1 程序描述此模块为未网站的商品管理模块,管理所有车辆信息在前端的显示信息。管理商品价格,商品展示图片,商品样式管理,商品详细信息描述。此模块把类型管理和品牌管理放在一起来说明,原因产品,品牌,类型的关联性和依耐性强,所以放在一起来做详细设计更为合适。3.1.2 程序功能后台添加商品信息后台修改商品信息按入库时间,商品名称,品牌,类型查询相应商品前端搜索框搜商品,此收索使用全文索引Lucene3.1.3 操作系统添加商品输入项: 车名:productName String 长度不能超过100品牌id:brandId Integer 类型id:typeId Integer定金:barginMoney Float 价格区间:上区间:fromSellPrice Float下区间:toSellPrice Float是否活动车型:isActivity Boolean是否最新车型:isNew Boolean首页展示图片路径:frontImageViewPath String 长度不能超过两个产品详细页轮播图片路径:viewImages Set ProductImgGroup对象属性长度不能超过200款式style:款式名称:styleName String报价:sellPrice Float库存:inventory Integer产品详细描述:descript Striing(数据库类型为Blob) 长度为text类型长度修改商品输入项: 车名:productName String 长度不能超过100品牌id:brandId Integer 类型id:typeId Integer定金:barginMoney Float 价格区间:上区间:fromSellPrice Float下区间:toSellPrice Float是否活动车型:isActivity Boolean是否最新车型:isNew Boolean首页展示图片路径:frontImageViewPath String 长度不能超过两个产品详细页轮播图片路径:viewImages Set ProductImgGroup对象 属性长度不能超过200款式style:款式名称:styleName String报价:sellPrice Float库存:inventory Integer产品详细描述:descript Striing(数据库类型为Blob) 长度为text类型长度删除商品输入项:点击删除超链接,附带产品id作为参数商品编号:productCode String 系统约束的固定长度,36位产品条件查询输入项: 车名:productName String 长度不能超过100品牌id:brandId Integer 类型id:typeId Integer入库时间,上下区间上区间:fromDate java.util.Date下区间:toDate java.util.Date全文索引产品输入项关键字:keyWord String 长度不能超过100添加品牌品牌名称:brandName Sting 长度不能超过32品牌logol图标路径:String 长度不能超过200修改品牌品牌名称:brandName Sting 长度不能超过32品牌logol图标路径:String 长度不能超过200添加类型类型名称:styleName Sting 长度不能超过32修改类型类型名称:styleName Sting 长度不能超过324.2用户模块注册用户是构成网站主体的一个重要组成部分,网站设置注册用户的目的之一在于方便3.1.4 程序出项添加产品输出向:无直接输出项,跳转到产品列表页删除产品输出项:无直接输出项,跳转到产品列表页修改产品输出项:无直接输出项,跳转到产品列表页查看产品详情输出项:产品实体:product ProductInfo实体包含其他项:款式列表:style List 评价列表:comments List查看产品列表输出项:产品分页列表:pageView PageView pageView中包含其他项:总页数:totalRcords Integer当前页:currentPage Integer每页显示最大数量:maxResult Integer 删除品牌输出项:无直接输出项,Action跳转到产品列表页修改品牌输出项:无直接输出项,Action跳转到产品列表页删除类型输出项:无直接输出项,Action跳转到产品列表页修改类型输出项:无直接输出项,Action跳转到产品列表页3.1.5 设计算法产品主键code存放,采用UUID进行加密生成/* * 返回一个不重复的字符串 * return */public static String uuid() return UUID.randomUUID().toString().replace(-, ).toUpperCase();产品图片的存储路径采用如下算法进行生成SimpleDateFormat dateformat = new SimpleDateFormat(yyyy-MM-dd);String logopathdir = /upload/product/+ dateformat.format(new Date();/构建图片保存的目录/得到图片保存目录的真实路径String logorealpathdir = request.getSession().getServletContext().getRealPath(logopathdir);File logosavedir = new File(logorealpathdir);String ext =BaseForm.getExt(imagefile); /构建文件名称String imagename = UUID.randomUUID().toString()+.+ ext;3.1.6 实体类的设计产品实体ProductInfo:Entity Searchablepublic class ProductInfo implements Serializableprivate static final long serialVersionUID = -8860864584425256200L;/* 商品编号 ,也是主键*/private String code;/* 产品名称 */private String name;/* 品牌 */private Brand brand;/* 产品简介 */private String description;/*产品亮点*/private String highlight;/* 价格区间*/private String innerSellPrice;/*定金*/private Float barginMoney;/* 是否可见 */private Boolean visible = true;/* 产品类型(大型车,中型车.) */private ProductType type;/* 上架日期 */private Date createdate = new Date();/* 人气指数 */private Integer clickcount = 1;/* 销售量 */private Integer sellcount = 0;/*是否最新车型*/private Boolean isNew=false;/*是否热销车型*/private Boolean isHot=false;/* 是否推荐(活动车型) */private Boolean isActivity=false;/* 产品样式 */private Set styles = new HashSet();/*产品首页图片展示*/private String viewImagePathFront;/*产品详细页图片组*/private Set viewImages=new HashSet();/*产品评价*/private Set comments=new HashSet();public ProductInfo() public ProductInfo(String productCode) this.code=productCode;OneToMany(cascade=CascadeType.ALL, mappedBy=product)SearchableComponentpublic Set getStyles() return styles;public void setStyles(Set styles) this.styles = styles;/* * 从样式集合中删除指定样式 * param style */public void removeProductStyle(ProductStyle style)if(this.styles.contains(style)this.styles.remove(style);style.setProduct(null);/* * 添加样式到样式集合 * param style */public void addProductStyle(ProductStyle style)if(!this.styles.contains(style)this.styles.add(style);style.setProduct(this);/* * 添加图片组到集合 * param style */public void addImageGroup(ProductImgGroup group)if(!this.viewImages.contains(group)this.viewImages.add(group);group.setProduct(this);Id SearchableIdpublic String getCode() return code;public void setCode(String code) this.code = code;Column(length=50,nullable=false)SearchableProperty(boost=2,name=productName)public String getName() return name;public void setName(String name) = name;ManyToOne(cascade=CascadeType.REFRESH)JoinColumn(name=brandid) SearchableComponentpublic Brand getBrand() return brand;public void setBrand(Brand brand) this.brand = brand;Column(nullable=false)SearchableProperty(index=Index.NO,store=Store.YES)public String getInnerSellPrice() return innerSellPrice;Transient SearchableProperty(index=Index.NO,store=Store.YES)public Integer getInventory() Integer inventory=0; for(ProductStyle style:getStyles() inventory+=style.getInventory(); return inventory; public void setInnerSellPrice(String innerSellPrice) this.innerSellPrice = innerSellPrice;Lob Column(nullable=false)SearchablePropertypublic String getDescription() return description;public void setDescription(String description) this.description = description;Column(nullable=false) SearchableProperty(index=Index.NO,store=Store.YES)public Boolean getVisible() return visible;public void setVisible(Boolean visible) this.visible = visible;ManyToOne(cascade=CascadeType.REFRESH,optional=false)JoinColumn(name=typeid) SearchableComponentpublic ProductType getType() return type;public void setType(ProductType type) this.type = type;Temporal(TemporalType.DATE) public Date getCreatedate() return createdate;public void setCreatedate(Date createdate) this.createdate = createdate;Column(nullable=false)public Integer getClickcount() return clickcount;public void setClickcount(Integer clickcount) this.clickcount = clickcount;Column(nullable=false)public Integer getSellcount() return sellcount;public void setSellcount(Integer sellcount) this.sellcount = sellcount; Columnpublic Boolean getIsNew() return isNew;public void setIsNew(Boolean isNew) this.isNew = isNew; Column SearchableProperty(store=Store.YES)public String getHighlight() return highlight;public void setHighlight(String highlight) this.highlight = highlight; Columnpublic Boolean getIsHot() return isHot;public void setIsHot(Boolean isHot) this.isHot = isHot;Columnpublic Boolean getIsActivity() return isActivity;public void setIsActivity(Boolean isActivity) this.isActivity = isActivity;Column SearchableProperty(index=Index.NO,store=Store.YES)public Float getBarginMoney() return barginMoney;public void setBarginMoney(Float barginMoney) this.barginMoney = barginMoney;Column(nullable=false) SearchableProperty(index=Index.NO,store=Store.YES)public String getViewImagePathFront() return viewImagePathFront; public void setViewImagePathFront(String viewImagePathFront) this.viewImagePathFront = viewImagePathFront;OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER, mappedBy=product)public Set getViewImages() return viewImages;OneToMany(cascade=CascadeType.ALL, mappedBy=product)public Set getComments() return comments;public void setComments(Set comments) ments = comments;public void setViewImages(Set viewImages) this.viewImages = viewImages; /获取价格区间组合后的字窜(11.4万-16万)Transientpublic String getCompSellPrice()String strs=innerSellPrice.split(;); return strs0+万-+strs1+万;/拆分价格区间成两个参数11.4;15-11.4 15public String splitSellPrice()return innerSellPrice.split(;);public void addComment(Comment comment)ments.add(comment);comment.setProduct(this);Overridepublic int hashCode() final int prime = 31;int result = 1;result = prime * result + (code = null) ? 0 : code.hashCode();return result;Overridepublic boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;final ProductInfo other = (ProductInfo) obj;if (code = null) if (other.code != null)return false; else if (!code.equals(other.code)return false;return true;产品款式实体ProductStyle:Entity Searchable(root=false)public class ProductStyle implements Serializableprivate static final long serialVersionUID = -4926119953511144279L;private String id;/* 样式的名称 */private String name;/* 销售价 (报价)*/private Float sellprice=0.0f;/*库存*/private Integer inventory=0;private ProductInfo product;public ProductStyle() public ProductStyle(String id,String name) this.id = id;=name;public ProductStyle(String name) = name;ManyToOne(cascade=CascadeType.REFRESH,optional=false)JoinColumn(name=productcode) SearchableReferencepublic ProductInfo getProduct() return product;public void setProduct(ProductInfo product) duct = product;Id Column() SearchableProperty(index=Index.NO,store=Store.YES)public String getId() return id;public void setId(String id) this.id = id;Column(length=30,nullable=false)SearchableProperty(index=Index.NO,store=Store.YES,name=styleName)public String getName() return name;public void setName(String name) = name; Column(nullable=false) SearchableProperty(index=Index.NO,store=Store.YES)public Float getSellprice() return sellprice;public void setSellprice(Float sellprice) this.sellprice = sellprice; Columnpublic Integer getInventory() return inventory;public void setInventory(Integer inventory) this.inventory = inventory;Overridepublic int hashCode() final int prime = 31;int result = 1;result = prime * result + (id = null) ? 0 : id.hashCode();return result;Overridepublic boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;final ProductStyle other = (ProductStyle) obj;if (id = null) if (other.id != null)return false; else if (!id.equals(other.id)return false;return true;产品图片组实体/* * 用户存放产品展示页图片的实体 * author Andy * */Entitypublic class ProductImgGroup implements Serializableprivate static final long serialVersionUID = -9044933716673525360L;private String id;/*小图,130px*/ private String smallImagePath; /*画廊上显示的图片,753px*/ private String midImagePath; /*放大后的图片效果900px*/ private String bigImagePath; /*图片对应产品*/ private ProductInfo product; public ProductImgGroup() public ProductImgGroup(String id) super();this.id = id; Id Column(length=36)public String getId() return id;public void setId(String id) this.id = id;Column(length=200)public String getSmallImagePath() return smallImagePath;public void setSmallImagePath(String smallImagePath) this.smallImagePath = smallImagePath;Column(length=200)public String getMidImagePath() return midImagePath;public void setMidImagePath(String midImagePath) this.midImagePath = midImagePath;Column(length=200)public String getBigImagePath() return bigImagePath;public void setBigImagePath(String bigImagePath) this.bigImagePath = bigImagePath;ManyToOne(cascade=CascadeType.REFRESH,optional=false)JoinColumn(name=productcode)public ProductInfo getProduct() return product;public void setProduct(ProductInfo product) duct = product;Overridepublic int hashCode() final int prime = 31;int result = 1;result = prime * result + (id = null) ? 0 : id.hashCode();return result;Overridepublic boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;final ProductImgGroup other = (ProductImgGroup) obj;if (id = null) if (other.id != null)return false; else if (!id.equals(other.id)return false;return true;品牌实体/*品牌*/Entity Searchable(root=false)public class Brand implements Serializableprivate static final long serialVersionUID = -4540465642606278764L;/*主键*/private Integer id;/* 品牌名称 */private String name;/* logo图片路径 如:/images/brand/2015/12/12/ooo.gif */private String logopath;public Brand() public Brand(String name, String logopath) = name;this.logopath = logopath;Id GeneratedValue SearchableProperty(index=Index.NO, store=Store.YES)public Integer getId() return id;public void setId(Integer id) this.id = id;Column(length=40, nullable=false) SearchableProperty(index=Index.NOT_ANALYZED, store=Store.YES,name=brandName)public String getName() return name;public void setName(String name) = name;Column(length=80)public String getLogopath() return logopath;public void setLogopath(String logopath) this.logopath = logopath;Overridepublic int hashCode() final int prime = 31;int result = 1;result = prime * r
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 胃癌初期症状诊断与护理策略培训
- 课程评估指南培训
- 创业小组个人介绍
- 2025-2026学年北京市房山区六级政治上册期中考试试卷及答案
- 北师大版初二道德与法治上册月考考试试题及答案
- 协议书存款和阳光存款
- 2025版癫痫常见症状及护理心得
- 太和美术馆介绍
- 固相合成载体介绍
- 2025版败血症早期症状解析及紧急处理护理培训
- 电动机的PLC控制编程实例说课稿-2025-2026学年中职专业课-电器及PLC控制技术-智能设备运行与维护-装备制造大类
- 国企改革培训课件
- 2025年中国移动室分设计优化工程师招聘面试题库及答案
- 2025-2026学年粤教花城版(2024)小学音乐一年级上册教学计划及进度表
- 医院装修工程危险源辨识与安全措施
- 荆门格林美新材料有限公司废旧锂电池及极片废料综合处理项目环评报告书
- 河南省委党校在职研究生入学考试真题及答案
- 服装搭配手册指南
- 2025至2030中国手术防粘连液经营风险与未来规模预测报告
- 水电站消防知识培训课件
- 2025年国企运维岗笔试题目及答案
评论
0/150
提交评论