一,环境介绍
语言环境:Java: jdk1.8
数据库:Mysql: mysql5.7
应用服务器:Tomcat: tomcat8.5.31
开发工具:IDEA或eclipse
二,项目简介
随着计算机和网络的不断革新,世界已经进入了前所未有的电子时代。作为实用性强、应用范围广泛的会员管理系统也正在被越来越多的各类企业用于消费管理领域。然而,那些针对性强、企业理念清晰的大型超市也正发展迅速,这些大型超市应该具备一套实用便捷的会员积分管理系统来经营产品,让消费者和超市紧密联系起来。如今现有的会员管理系统已经不能充分满足超市用户的需求,用户需要更好的积分管理体系来体验丰富的管理方案,因此需要设计开发在效率、功能和技术上都有所提高的会员积分管理系统。
本文从超市会员管理的实质入手,从本质区别超市会员管理与其他商业消费的会员管理的根本区别,针对专一积分管理提出看法,希望让系统更适用于商业超市的发展。让积分制度实施在一个合适的领域内,并不是所谓的通用格式,而是一个适合超市的专属模式。因此设计开发一种适合超市使用的会员积分管理系统可以实效得解决问题,能够让超市的会员真实的感受到会员积分带来的好处。
本系统是专门设计适用于超市的会员积分管理系统。整体采用B/S架构开发,通过对系统深入细致的分析,以及对业务背景和需求的了解,结合流行成熟的Web开发技术J2EE,设计搭建双管理权限。系统的总体技术框架为JSP+Servlet+JavaBean。前台浏览器浏览,后台服务器直接连接SQL Server2000数据库。通过各客户端计算机接入会员积分的各项事务,实现积分管理的规范性和安全性。同时作为会员信息管理系统的组成部分,将来可以有很好的扩展性和通用性。
为实现上述系统功能上的目标,会员积分管理系统主要完成的功能有:
为实现上述系统功能上的目标,会员积分管理系统主要完成的功能有:
- 柜员信息的管理:包括对所有柜台柜员信息的各项设置。
- 会员信息的管理:包括对所有会员信息的管理设置。
- 会员积分管理:包括对会员积分的统计、查询等。
- 积分规则设置:对积分规则进行设定、修改等。
- 会员等级设置:包括对每个会员等级的范围进行设置管理。
- 兑换商品管理:对积分兑换的商品进行修改、兑换等各项管理。
- 兑换商品记录:记录柜员对会员每次兑换商品的操作信息。
- 兑换积分记录:记录柜员对会员每次兑换积分的操作信息。
管理员功能
1)柜员账户列表,实现对柜员账户信息的管理。
2)新增柜员账户,实现添加柜员信息。
3)兑换商品列表,实现对兑换商品信息的查看、修改、删除操作。
4)新增兑换商品,实现添加系统中兑换商品信息。
5)会员类别管理,实现对系统中会员积分等级的设置。
6)积分类别选择,实现对系统中的会员积分兑换规则设置。
7)增加积分记录,实现查看柜员为会员兑换积分的工作记录。
8)兑换积分记录,实现查看柜员为会员兑换商品的工作记录。
柜员功能
1)用户列表管理,实现对会员信息的查看、修改、删除操作。
2)新增用户管理,实现添加会员信息。
3)会员积分管理,可以查看会员的积分和级别,并按照会员消费金额兑换积分。
4)兑换商品列表,可以查看兑换商品及所需积分,并可为会员兑换商品。
5)增加积分记录,实现查看柜员为会员兑换积分的工作记录。
6)兑换积分记录,实现查看柜员为会员兑换商品的工作记录。
三,系统展示
测试在整个软件开发过程中起着至关重要的作用,软件测试对于保证一个软件的可靠性是极为重要的。测试占据整个软件生命周期的75%左右,可见它的重要性。特别是在面对一个庞大而复杂的系统,软件测试就能充分的发挥它的作用,因为伴随着测试,我们会发现软件中存在的各种各样的问题。从而,尽快地解决问题。在开发一个系统的各个阶段都不可避免地会发生这样或那样的问题,所以在每一个开发的过程中的各个阶段都要对软件进行测试,软件测试的目标是尽可能地发现软件中的错误,以便对其进行修改。
测试包括单元测试和集成测试。单元测试是把一个模块作为独立的程序单元进行测试,以保证它能够正确执行规定的功能,单元测试是编码和单元测试阶段的任务。集成测试是将已经通过彻底测试的模块组装起来,以形成一个系统或软件产品,集成测试主要使用黑盒测试法对系统进行功能测试,集成测试的主要任务是检查和排除模块接口错误。全局数据结构错误。模块中某些遗漏的错误;集成测试是系统集成阶段的任务;集成测试可分为自顶向下集成测试、自底向上集成测试、自顶向下和自底向上综合的集成测试、回归测试、测试工作能否成功,主要取决于测试案例设计是否科学合理。测试案例系指测试输入数据及其对应的输出,其设计依赖于所采用的测试方法:白盒测试与黑盒测试。
1.白盒测试:使用白盒方法导出测试案例是依据模块的编码,即模块的内部逻辑对测试者是可见的,故称为白盒测试,有时也称为玻璃盒测试。测试的目的在于用最少的测试案例,检测出最多的错误。使用白盒测试方法所导出的测试案例能保证模块中所有独立途径至少要测试一次。测试所有逻辑决策真和假两个方面。在所有循环的边界内部和边界上执行循环体。检查内部数据结构以保证其有效性。白盒测试又包含基本路径测试、条件测试、数据流测试和循环测试。
2.黑盒测试:黑盒测试集中在软件的功能需求上,黑盒测试是在程序或模块的接口级进行,而不考虑该程序的内部逻辑。黑盒测试能够用于检测程序中下列类型的错误:
(1)不正确或漏掉的功能,这往往是由于程序算法中的问题所造成;
(2)接口错误;
(3)数据结构或外部数据库存取中的错误;
(4)性能方面的问题,这类问题通常也与算法有关;
(5)初始化或结束错误。
四,核心代码展示
package com.action; /** * * 留言本 */ import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.bean.GuestBookBean; import com.bean.SystemBean; import com.util.Constant; import com.util.Filter; public class GuestBookAction extends HttpServlet { /** * Constructor of the object. */ public GuestBookAction() { super(); } /** * Destruction of the servlet. <br> */ public void destroy() { super.destroy(); // Just puts "destroy" string in log // Put your code here } /** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request,response); } /** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding(Constant.CHARACTERENCODING); response.setContentType(Constant.CONTENTTYPE); //nikename, pic, email, qq, weburl, blogurl, expressions, content String sysdir = new SystemBean().getDir(); HttpSession session = request.getSession(); String method = request.getParameter("method").trim(); GuestBookBean guestBookBean = new GuestBookBean(); if(method.equals("add")){//发表留言 String member=(String)session.getAttribute("member"); String nikename = Filter.escapeHTMLTags(request.getParameter("nikename").trim()); String face ="images/nobody.gif"; String email = Filter.escapeHTMLTags(request.getParameter("email").trim()); String qq = Filter.escapeHTMLTags(request.getParameter("qq").trim()); String weburl = Filter.escapeHTMLTags(request.getParameter("weburl").trim()); String blogurl = Filter.escapeHTMLTags(request.getParameter("blogurl").trim()); String expressions = "images/face/"+Filter.escapeHTMLTags(request.getParameter("face").trim())+".gif"; String content = Filter.escapeHTMLTags(request.getParameter("content").trim()); String ip = request.getRemoteAddr(); int guestbook=1; int flag = guestBookBean.addGuestBook(nikename, face, email, qq, weburl, blogurl, expressions, content, ip,guestbook); if(flag == 1){ request.setAttribute("message", "谢谢您的留言,请等候管理员回复!"); request.getRequestDispatcher("guestbook.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher("guestbook.jsp").forward(request, response); } } else if(method.equals("delguestbook")){//删除留言 try{ String username2 = (String)session.getAttribute("user"); if(username2 == null){ request.getRequestDispatcher("error.jsp").forward(request, response); } else{ String check[] = request.getParameterValues("checkit"); if(check == null){ request.setAttribute("message", "请选择要删除的记录!"); request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response); } else{ int id[]= new int[check.length]; for(int i = 0;i<check.length;i++){ int s = Integer.parseInt(check[i]); id[i] = s; } int flag = guestBookBean.delGuestBook(id); if(flag == Constant.SUCCESS){ request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response); } } } }catch(Exception e){ request.getRequestDispatcher("error.jsp").forward(request, response); } } else if(method.equals("replay")){//回复留言 try{ String username2 = (String)session.getAttribute("user"); if(username2 == null){ request.getRequestDispatcher("error.jsp").forward(request, response); } else{ String messageid = Filter.escapeHTMLTags(request.getParameter("id").trim()); String replay = Filter.escapeHTMLTags(request.getParameter("replay").trim()); int flag = guestBookBean.reGuestBook(Integer.parseInt(messageid), replay, username2); if(flag == Constant.SUCCESS){ request.setAttribute("message", "回复成功!"); request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response); } } }catch(Exception e){ request.getRequestDispatcher("error.jsp").forward(request, response); } } else if(method.equals("upreplay")){ try{ String username2 = (String)session.getAttribute("user"); if(username2 == null){ request.getRequestDispatcher("error.jsp").forward(request, response); } else{ String messageid = Filter.escapeHTMLTags(request.getParameter("id").trim()); String replay = Filter.escapeHTMLTags(request.getParameter("replay").trim()); int flag = guestBookBean.upReplay(Integer.parseInt(messageid), replay); if(flag == Constant.SUCCESS){ request.setAttribute("message", "修改成功!"); request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response); } } }catch(Exception e){ request.getRequestDispatcher("error.jsp").forward(request, response); } } else{ request.getRequestDispatcher("error.jsp").forward(request, response); } } /** * Initialization of the servlet. <br> * * @throws ServletException if an error occure */ public void init() throws ServletException { // Put your code here } }
package com.action; import java.io.IOException; import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.Calendar; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.bean.NewsBean; import com.bean.SystemBean; import com.util.Constant; import com.util.Filter; public class NewsServlet extends HttpServlet { /** * Constructor of the object. */ public NewsServlet() { super(); } /** * Destruction of the servlet. <br> */ public void destroy() { super.destroy(); // Just puts "destroy" string in log // Put your code here } /** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request,response); } /** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(Constant.CONTENTTYPE); request.setCharacterEncoding(Constant.CHARACTERENCODING); String sysdir = new SystemBean().getDir(); HttpSession session = request.getSession(); String date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime()); try{ String username2 = (String)session.getAttribute("user"); String method = request.getParameter("method").trim(); if(method.equals("addNews")){ String title = request.getParameter("title"); String fenlei = request.getParameter("fenlei"); String infoContent = request.getParameter("infoContent"); int flag = new NewsBean().exeUp("insert into news(title,fenlei,content,addtime,adder,visit) " + "values('"+title+"','"+fenlei+"','"+infoContent+"','"+date+"','"+username2+"','0')"); if(flag == Constant.SUCCESS){ request.getRequestDispatcher(sysdir+"/news/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher(sysdir+"/news/index.jsp").forward(request, response); } } else if(method.equals("upNews")){ String id = request.getParameter("id"); String title = request.getParameter("title"); String fenlei = request.getParameter("fenlei"); String infoContent = request.getParameter("infoContent"); int flag = new NewsBean().exeUp("update news set title='"+title+"',fenlei='"+fenlei+"',content='"+infoContent+"' where id='"+id+"'"); if(flag == Constant.SUCCESS){ request.getRequestDispatcher(sysdir+"/news/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher(sysdir+"/news/index.jsp").forward(request, response); } } else if(method.equals("delNews")){ String id = request.getParameter("id"); int flag = new NewsBean().exeUp("delete from news where id='"+id+"'"); if(flag == Constant.SUCCESS){ request.getRequestDispatcher(sysdir+"/news/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher(sysdir+"/news/index.jsp").forward(request, response); } } else if(method.equals("addPrep")){ String member=(String)session.getAttribute("member"); String sid = request.getParameter("sid"); String title = request.getParameter("title"); String rs = request.getParameter("rs"); String sj = request.getParameter("sj"); String ts = request.getParameter("ts"); String lxr = request.getParameter("lxr"); String lxfs = request.getParameter("lxfs"); new NewsBean().exeUp("update sale set dj=dj+1 where id='"+sid+"'"); int flag = new NewsBean().exeUp("insert into prep(title,rs,sj,ts,lxr,lxfs,addtime,member,zt,ddid) " + "values('"+title+"','"+rs+"','"+sj+"','"+ts+"','"+lxr+"','"+lxfs+"','"+date+"','"+member+"','未提交','0')"); if(flag == Constant.SUCCESS){ request.setAttribute("message", "预订成功,稍后本站客服人员会与您取得联系。您可以在会员中心查看您的预订记录!"); request.getRequestDispatcher("index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher("index.jsp").forward(request, response); } } else if(method.equals("upPrep")){ String member=(String)session.getAttribute("member"); String id = request.getParameter("id"); String rs = request.getParameter("rs"); String sj = request.getParameter("sj"); String ts = request.getParameter("ts"); String lxr = request.getParameter("lxr"); String lxfs = request.getParameter("lxfs"); int flag = new NewsBean().exeUp("update prep set rs='"+rs+"',sj='"+sj+"',ts='"+ts+"',lxr='"+lxr+"'," + "lxfs='"+lxfs+"' where id='"+id+"'"); if(flag == Constant.SUCCESS){ request.setAttribute("message", "操作成功!"); request.getRequestDispatcher("member/prep/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher("member/prep/index.jsp").forward(request, response); } } else if(method.equals("delPrep")){ String member=(String)session.getAttribute("member"); String id = request.getParameter("id"); int flag = new NewsBean().exeUp("delete from prep where id='"+id+"'"); if(flag == Constant.SUCCESS){ request.setAttribute("message", "操作成功!"); request.getRequestDispatcher("member/prep/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher("member/prep/index.jsp").forward(request, response); } } else if(method.equals("addDD")){ String member=(String)session.getAttribute("member"); String fkfs = request.getParameter("fkfs"); String ddid=String.valueOf(System.currentTimeMillis()); String sql="update prep set zt='已提交',ddid='"+ddid+"' where member='"+member+"' and ddid='0'"; //System.out.println(sql); NewsBean nb=new NewsBean();nb.exeUp(sql); int flag = nb.exeUp("insert into dd(ddid,member,zt,fkfs,addtime) values('"+ddid+"','"+member+"','未发货','"+fkfs+"','"+date+"')"); if(flag == Constant.SUCCESS){ request.setAttribute("message", "操作成功!"); request.getRequestDispatcher("member/prep/index.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher("member/prep/index.jsp").forward(request, response); } } else if(method.equals("fDD")){ String ddid = request.getParameter("ddid"); NewsBean nb=new NewsBean(); int flag = nb.exeUp("update dd set zt='已发货' where ddid='"+ddid+"'"); if(flag == Constant.SUCCESS){ request.setAttribute("message", "操作成功!"); request.getRequestDispatcher("admin/prep/prep.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher("admin/prep/prep.jsp").forward(request, response); } } else if(method.equals("dDD")){ String ddid = request.getParameter("ddid"); NewsBean nb=new NewsBean(); int flag = nb.exeUp("delete from dd where ddid='"+ddid+"'"); if(flag == Constant.SUCCESS){ request.setAttribute("message", "操作成功!"); request.getRequestDispatcher("admin/prep/prep.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher("admin/prep/prep.jsp").forward(request, response); } } else if(method.equals("dDD2")){ String ddid = request.getParameter("ddid"); NewsBean nb=new NewsBean(); int flag = nb.exeUp("delete from dd where ddid='"+ddid+"'"); if(flag == Constant.SUCCESS){ request.setAttribute("message", "操作成功!"); request.getRequestDispatcher("admin/prep/fh.jsp").forward(request, response); } else{ request.setAttribute("message", "系统维护中,请稍后再试!"); request.getRequestDispatcher("admin/prep/fh.jsp").forward(request, response); } } 查询统计 else if(method.equals("sDDrq")){ String year=request.getParameter("year"); String month=request.getParameter("month"); String day=request.getParameter("day"); String str=year+"-"+month+"-"+day; String sql="select * from dd where addtime like '%"+str+"%' "; request.setAttribute("sql", sql); request.getRequestDispatcher("admin/prep/s1.jsp").forward(request, response); } else if(method.equals("sDDid")){ String ddid=request.getParameter("ddid"); request.setAttribute("ddid", ddid); request.getRequestDispatcher("admin/prep/s2.jsp").forward(request, response); } else if(method.equals("sYye")){ String year=request.getParameter("year"); String month=request.getParameter("month"); String day=request.getParameter("day"); String year2=request.getParameter("year2"); String month2=request.getParameter("month2"); String day2=request.getParameter("day2"); String str=year+"-"+month+"-"+day+" "+"00:00:00"; String str2=year2+"-"+month2+"-"+day2+" "+"23:59:59"; String sql="select * from prep where addtime>'"+str+"' and addtime<'"+str2+"' order by id desc"; //String sql="select * from prep where addtime>'"+str+"' and addtime<'"+str2+"' "; request.setAttribute("sql", sql); request.getRequestDispatcher("admin/prep/s3.jsp").forward(request, response); } }catch(Exception e){ e.printStackTrace(); } } /** * Initialization of the servlet. <br> * * @throws ServletException if an error occure */ public void init() throws ServletException { // Put your code here } }
五,相关作品展示
基于Java开发、Python开发、PHP开发、C#开发等相关语言开发的实战项目
基于Nodejs、Vue等前端技术开发的前端实战项目
基于微信小程序和安卓APP应用开发的相关作品
基于51单片机等嵌入式物联网开发应用
基于各类算法实现的AI智能应用
基于大数据实现的各类数据管理和推荐系统