基于idea-SSM的手机进销存管理系统设计与实现(javaweb-php-asp.netC#-j2ee)包含仓库管理-出库管理-入库管理

0、效果展示

 

 

1、概述

 

本系统是一个手机进销存管理系统,可以实现手机经销商的进货、销售、库存管理等各项业务的信息化管理。本系统使用servlet技术和SQL Server 数据库开发跨平台的应用程序。

本文对系统设计与开发的全过程作了详细的阐述。第一章绪论,主要介绍了概述、系统的基本功能及实现方式和本毕业设计的主要工作。第二章相关技术及理论研究,主要阐述了完成系统开发所涉及到的基础理论知识和相关技术。第三章到第六章详细记录了整个系统开发过程,包括系统的分析、设计和具体实现。第七章是软件测试。

The system is a mobile inventory management system, dealers can purchase mobile phones, sales, inventory management and other business information management. The system uses servlet technology and SQL Server  database development cross-platform applications.

In this paper, system design and development made the whole process in detail. The first chapter, introduces the overview of the basic functions of the system and implementation methods and the main work of the graduation project Chapter related technical and theoretical research, mainly on the completion of system development involved the basic theory and related technologies. Chapter to Chapter VI of detailed records of the entire system development process, including system analysis, design and implementation. Chapter VII is a software testing.

手机进销存管理系统是一个典型的数据库开发应用程序,由登录、基础信息管理模块、入库信息管理模块、出库信息管理模块、库存信息管理模块、系统维护模块等部分组成,规划系统功能模块如下:

管理员用户与操作员用户通过相同的登录入口进入系统,用户登录时需提供合法的用户名与密码,并选择系统用户类型。

通过身份验证的用户进入管理系统桌面,执行系统后台管理功能,未通过身份验证的用户无法使用此系统后台管理功能。

登录用户可保留服务端登录状态,登录用户可保留客户端登录状态,并记录上次使用系统的用户名。

该模块主要包括手机品牌信息资料、手机类型信息资料。

(1) 手机品牌信息资料

卖场手机信息,需要记录手机品牌并可以实现添加修改删除和查询操作。

(2) 手机类型信息资料

手机类别的管理,可以知道是行货,水货,其他并可以实现添加修改删除和查询操作。

进货商信息管理

手机进货商的信息管理,可以添加删除进货商。

该模块主要包括采购入库信息、销售退货信息录入和修改、领用还回信息录入和修改、借出还入信息录入和修改、其他进货信息录入和修改、当月进货和上月进货的查看。

该块主要包括销售相关信息信息查询、删除,修改。

该模块主要包括库存信息查询、库存信息的设置、销售订单的校验、库存不足的预警。

  • 系统维护模块

该模块主要包括权限管理、权限设置、用户管理、用户设置、更改密码、系统初始化(注销)。

2、搭建环境

 

本文以实现一个手机进销存管理系统为目标,从环境搭建到编码实现全过程讲述

我们使用javaweb、J2EE来构建手机进销存管理系统,环境使用最新版jdk和tomcat,配合mysql数据库

开发工具使用idea(也可以使用eclipse),数据库管理工具使用Navicat Premium 

开发框架使用JavaBean Servlet MVC结构;

没有使用SSH(Struts+Spring+Hibernate)或SSM(Spring+SpringMVC+MyBatis),这两个框架我们在别的项目中再介绍开发过程

 

在项目中会引入My97DatePicker作为前端日期时间选择工具,使用fckeditor作为富媒体编辑器(也可以使用百度的ueditor)

 

 

使用DWR(Direct Web Remoting)用于改善web页面与Java类交互,实现远程服务器端AJAX读取登录数据。

使用JSTL(Java server pages standarded tag library,即JSP标准标签库),此库是由JCP(Java community Proces)所制定的标准规范,它主要提供给Java Web开发人员一个标准通用的标签库,并由Apache的Jakarta小组来维护。开发人员可以利用这些标签取代JSP页面上的Java代码,从而提高程序的可读性,降低程序的维护难度。

 

3、数据表结构

 

表3.1 主要数据项的定义

数据项

编号

数据项名称

简述

类型及宽度

取值范围

1

产品编号

识别产品的编号

int(5)

实整型

2

产品名称

识别产品的名字标识

varchar(20)

汉字

3

操作类型编号

识别操作类型的编号

int(5)

实整型

4

操作类型名称

识别操作类型的名字标识

varchar(20)

汉字

5

预警信息编号

识别预警信息的编号

int(5)

实整型

6

预警信息名称

识别预警信息的名称标识

varchar(10)

汉字

7

权限编号

识别管理员权限的编号

int(5)

实整型

8

权限名称

识别管理员权限的名称标识

varchar(20)

汉字

9

单位编号

单位部门的编号

int(5)

实整型

10

单位名称

识别单位的名称标识

varchar(20)

汉字

11

产品类别编号

识别产品类别的编号

int(5)

实整型

12

产品类别名称

识别产品类别的名称标识

varchar(20)

汉字

13

管理员编号

识别管理员的编号

Varchar(10)

按规则生成字符

14

管理员名称

识别管理员的名称标识

Varchar(20)

字符型

15

账号

管理员登录系统用的账号

Varchar(20)

字符型

16

密码

管理员登录系统用的密码

Varchar(20)

字符型

 

​4、后端代码示例

 

package jxc.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import jxc.dao.BaseDao;
import jxc.dao.BillDao;
import jxc.dao.PricesDao;
import jxc.dao.ProductDao;
import jxc.entity.Bill;
import jxc.entity.Prices;
import jxc.entity.Product;

public class addBill extends HttpServlet {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html;charset=utf-8");
		response.setCharacterEncoding("utf-8");
		request.setCharacterEncoding("utf-8");

		String date = request.getParameter("firstinput");// 不能为空
		String depotid = request.getParameter("depotid");// 不能为空
		String inoutid = request.getParameter("inoutid");// 不能为空
		String productid = request.getParameter("productid");// 不能为空
		String count = request.getParameter("count");// 不能为空
		String price = request.getParameter("price");// 不能为空

		String receiver = request.getParameter("receiver");// 能为空
		String shipper = request.getParameter("shipper");// 能为空
		String remark = request.getParameter("remark");// 能为空

		if (date != null && depotid != null && inoutid != null
				&& productid != null && count != null && price != null) {
			Bill b = new Bill();
			BillDao bd = new BillDao();

			b.setProductid(Integer.parseInt(productid));
			b.setCount(Integer.parseInt(count));
			b.setDepotid(Integer.parseInt(depotid));
			b.setPrice(Integer.parseInt(price));
			b.setShipper(shipper);
			b.setReceiver(receiver);
			b.setDate(date);
			b.setInoutid(Integer.parseInt(inoutid));
			b.setRemark(remark);
			
			
			BaseDao basedao = new BaseDao();
			// 判断是进货还是销售
			if (Integer.parseInt(inoutid) > 0 && Integer.parseInt(inoutid) <= 7) {
				// 进货
				String sql = "update Product set count=count+? where id=?";
				String[] param = { count, productid };
				int number1 = basedao.executeSQL(sql, param);// 更新
				if (number1 > 0 && Integer.parseInt(inoutid) == 1) {
					PricesDao pd = new PricesDao();
					Prices prices = new Prices();
					int pricefuhao = -Integer.parseInt(price); // 负数 以便减法
					prices.setPricesnumber(Integer.parseInt(count)
									* pricefuhao);
					
					pd.addPrice(prices);  //这里添加钱的变化量
				}
				
				bd.addBill(b); //这里添加发货单
				
				response.sendRedirect("Put.jsp?id=0&good=1");
			} else if (Integer.parseInt(inoutid) > 7) {
				// 销售
				ProductDao pd = new ProductDao();
				Product p = pd.findProductOfId(Integer.parseInt(productid));

				if (Integer.parseInt(count) <= p.getCount()) {
					String sql = "update Product set count=count-? where id=?";
					String[] param = { count, productid };
					int number1 = basedao.executeSQL(sql, param);

					if (number1 > 0
							&& (Integer.parseInt(inoutid) == 8 || Integer
									.parseInt(inoutid) == 14)) {
						PricesDao pdao = new PricesDao();
						Prices prices = new Prices(); // 不用负号
						prices.setPricesnumber(Integer.parseInt(count)
								* Integer.parseInt(price));
						pdao.addPrice(prices);//这里添加钱的变化量
					}
					
					bd.addBill(b); //这里添加发货单
					
					response.sendRedirect("Put.jsp?id=1&good=1");
				} else {
					response.sendRedirect("Put.jsp?error=1"); // 数量不够
				}

			}
		} else {
			response.sendRedirect("Put.jsp");
		}

	}

}

 

5、前端代码示例

 

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="jxc.dao.LaiDanDao"%>
<%@page import="jxc.entity.LaiDan"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    <title>来 往单位</title>
<link rel="stylesheet" type="text/css" href="<%=path %>/css/base.css" />
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body leftmargin="2" topmargin="9" background='<%=path %>/images/allbg.gif'>
   <%
     String s = request.getParameter("s");
    LaiDanDao ldd = new  LaiDanDao();
     if(s.equals("list")){
    List<LaiDan> list = ldd.laidanall();
       %>
       <a href="laidan.jsp?s=add">添加</a>
         <table>
     <tr>
       <td>序号</td>
       <td>单位名称</td>
       <td>单位电话</td>
       <td>单位邮箱</td>
       <td>单位备注</td>
        <td>操作</td>
     </tr>
      <%
        if(list==null){
           %>
            <tr>
              <td>没有数据</td>
            </tr>
           <%
        }else{
       %>
      <%
      int i = 0;
         for(LaiDan ld : list){
         i++;
             %>
          <tr>
       <td><%=i %></td>
       <td><%=ld.getLaidanname() %></td>
       <td><%=ld.getLaidantel() %></td>
       <td><%=ld.getLaidanemail() %></td>
       <td><%=ld.getLaidanbeizhu() %></td>
       <td><a href="servlet/laiDan?p=shan&id=<%=ld.getLaidanId() %>">删除</a></td>
     </tr>
             <%
         }}
       %>
   
   </table>
   
       <%
     }else if(s.equals("add")){
         %>
          <form action="servlet/laiDan?p=add" method="post">
          <table>
            <tr>
              <td>单位名称</td>
              <td><input value="" name="laidanname"/></td>
            </tr>
            <tr>
              <td>单位电话</td>
              <td><input value="" name="laidantel"/></td>
            </tr>
            <tr>
              <td></td>
              <td></td>
            </tr>
            <tr>
              <td>单位邮箱</td>
              <td><input value="" name="laidanemail"/></td>
            </tr>
            <tr>
              <td>单位备注</td>
              <td><input value="" name="laidanremark"/></td>
            </tr>
            <tr>
              <td colspan="2"><input value="添加" type="submit" name="tian"/></td>
          </table>
          </form>
         <%     }
         else if(s.equals("xiu")){
         Integer id = Integer.parseInt(request.getParameter("id"));
           LaiDan ld = ldd.laidan(id);
           %>
           <form action="servlet/laiDanp=xiu" method="post">
           <input value="<%=ld.getLaidanId() %>" type="hidden" name="laidanid"/>
          <table>
            <tr>
              <td>单位名称</td>
              <td><input value="<%=ld.getLaidanname() %>" type="text" name="laidanname"/></td>
            </tr>
            <tr>
              <td>单位电话</td>
              <td><input value="<%=ld.getLaidantel() %>"  type="text" name="laidantel"/></td>
            </tr>
            <tr>
              <td></td>
              <td></td>
            </tr>
            <tr>
              <td>单位邮箱</td>
              <td><input value="<%=ld.getLaidanemail() %>" type="text" name="laidanemail"/></td>
            </tr>
            <tr>
              <td>单位备注</td>
              <td><input value="<%=ld.getLaidanbeizhu() %>" type="text" name="laidanremark"/></td>
            </tr>
            <tr>
              <td colspan="2"><input value="修改" type="submit" name="tian"/></td>
          </table>
          </form>
           <%
         }
    %>
    
  </body>
</html>

 

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

计算机程序设计开发

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值