spring boot的一个小项目小型进销存系统
项目所需的依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- 核心依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- 可以实现热部署,在IDEA上实现热部署还需一些额外的配置,请查阅资料 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>runtime</scope>
</dependency> <!-- JDBC for mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency> <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> <!-- mybatis -->
<!--mybatis-->
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency>
<!--fastJson--> <dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.12</version>
</dependency> <!--druid--> <dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.18</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency> <!--thymeleaf 新的模板引擎,比jsp要出色--> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--jdbc-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency> <!-- 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency> 还需要在配置:resources
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
application.properties:
#开发配置 #数据源配置
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/invoicingsystem?useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=123456 #Spring Data JPA配置
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jackson.serialization.indent-output=true
spring.jpa.database=mysql spring.main.allow-bean-definition-overriding=true
server.port=8080 #spring.thymeleaf.prefix=classpath:/templates/ #配置mybatis
mybatis.configuration.auto-mapping-behavior=full
mybatis.type-aliases-package=com.invoicing.entity #resources:
#static-locations: classpath:/resources/, classpath:/static/ ,classpath:/templates/
#spring.thymeleaf.prefix=classpath:/templates/
项目实体:
package com.invoicing.entity;
public class Product {
private int pid;
private String productName;
private int quantity;
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
}
package com.invoicing.entity; import java.math.BigDecimal;
import java.util.Date; public class Sale {
private int sid;
private BigDecimal price;
private int quantity;
private BigDecimal totalPrice;
private Date saleDate;
private int userId;
private int productId;
private String remarks;
private Product product;
private Users users; public int getSid() {
return sid;
} public void setSid(int sid) {
this.sid = sid;
} public BigDecimal getPrice() {
return price;
} public void setPrice(BigDecimal price) {
this.price = price;
} public int getQuantity() {
return quantity;
} public void setQuantity(int quantity) {
this.quantity = quantity;
} public BigDecimal getTotalPrice() {
return totalPrice;
} public void setTotalPrice(BigDecimal totalPrice) {
this.totalPrice = totalPrice;
} public Date getSaleDate() {
return saleDate;
} public void setSaleDate(Date saleDate) {
this.saleDate = saleDate;
} public int getUserId() {
return userId;
} public void setUserId(int userId) {
this.userId = userId;
} public int getProductId() {
return productId;
} public void setProductId(int productId) {
this.productId = productId;
} public String getRemarks() {
return remarks;
} public void setRemarks(String remarks) {
this.remarks = remarks;
} public Product getProduct() {
return product;
} public void setProduct(Product product) {
this.product = product;
} public Users getUsers() {
return users;
} public void setUsers(Users users) {
this.users = users;
}
}
package com.invoicing.entity;
public class Users {
private int uid;
private String userName;
private String password;
private String realName;
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
}
项目的Dao层:
IProductDao层 :
package com.invoicing.dao; import com.invoicing.entity.Product;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import java.util.List; @Repository("iProductDao")
public interface IProductDao { //获取所有库存中的商品
List<Product> getProductList(); //根据id获得对应的ID
Product getProduct(Integer id); //修改库存的数量
Integer updateProduct(@Param("quantity") Integer quantity,@Param("id") Integer id);
} 实现dao层的方法:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.invoicing.dao.IProductDao">
<!-- 目的:为dao接口方法提供sql语句配置 -->
<select id="getProductList" resultType="Product" >
<!-- 具体的sql -->
select * from product
</select> <!-- 目的:为dao接口方法提供sql语句配置 -->
<select id="getProduct" resultType="Product" >
<!-- 具体的sql -->
select * from product where pid=#{id}
</select> <!-- 目的:为dao接口方法提供sql语句配置 -->
<update id="updateProduct">
<!-- 具体的sql -->
update product set quantity=quantity-#{quantity} where pid=#{id}
</update>
</mapper>
ISalesDao 层:
package com.invoicing.dao; import com.invoicing.entity.Sale;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import java.util.List; @Repository("iSalesDao")
public interface ISalesDao { //添加销售记录
Integer addSale(Sale sale); /**
* 根据传过来的参数
* (if oder==1 那么获取的所有销售记录根据日期排序,
* if id==2 获取的所有销售记录销售的总数排序)
* 获取所有的销售记录
*/
List<Sale> getListSale(@Param("order") String order); }
实现dao层的方法:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.invoicing.dao.ISalesDao">
<!-- 目的:为dao接口方法提供sql语句配置 -->
<resultMap id="salelist" type="Sale">
<id column="sid" property="sid"/>
<result column="price" property="price"/>
<result column="quantity" property="quantity"/>
<result column="totalPrice" property="totalPrice"/>
<result column="saleDate" property="saleDate"/>
<association property="product" javaType="Product" column="productId">
<id column="pid" property="pid"/>
<result column="productName" property="productName"/>
<result column="quantity" property="quantity"/>
</association>
<association property="users" javaType="Users" column="userId">
<id column="uid" property="uid"/>
<result column="userName" property="userName"/>
<result column="password" property="password"/>
<result column="realName" property="realName"/>
</association>
</resultMap>
<insert id="addSale" >
<!-- 具体的sql -->
INSERT INTO sale (price,quantity,totalPrice,saleDate,userId,productId,remarks)
VALUES (#{price},#{quantity},#{totalPrice},#{saleDate},#{userId},#{productId},#{remarks})
</insert> <select id="getListSale" resultMap="salelist">
select product.pid,product.productName,users.*,sale.* from product,users,sale where sale.userId=users.uid and sale.productId=product.pid
<if test="order==0">
order by sale.saleDate desc
</if>
<if test="order ==1">
order by sale.totalPrice desc
</if>
</select> </mapper>
IUserDao 层:
package com.invoicing.dao; import com.invoicing.entity.Users;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; @Repository("iUserDao")
public interface IUserDao {
//登录
Users login(@Param("username") String username);
}
实现dao层的方法:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.invoicing.dao.IUserDao">
<!-- 目的:为dao接口方法提供sql语句配置 -->
<select id="login" resultType="Users" >
<!-- 具体的sql -->
select * from users where userName=#{username}
</select> </mapper>
service层:
IProductService :
package com.invoicing.service; import com.invoicing.entity.Product;
import org.apache.ibatis.annotations.Param; import java.util.List; public interface IProductService { //获取所有库存中的商品
List<Product> getProductList(); //根据id获得对应的ID
Product getProduct(Integer id); //修改库存的数量
Integer updateProduct( Integer quantity, Integer id);
} service层的impl实现:
package com.invoicing.service.impl; import com.invoicing.dao.IProductDao;
import com.invoicing.entity.Product;
import com.invoicing.service.IProductService;
import org.springframework.stereotype.Service; import javax.annotation.Resource;
import java.util.List; @Service("iProductService")
public class IProductServiceImpl implements IProductService { @Resource(name = "iProductDao")
private IProductDao iProductDao;
@Override
public List<Product> getProductList() {
return iProductDao.getProductList();
} @Override
public Product getProduct(Integer id) {
return iProductDao.getProduct(id);
} @Override
public Integer updateProduct(Integer quantity, Integer id) {
return iProductDao.updateProduct(quantity,id);
}
}
ISalesSerivce :
package com.invoicing.service; import com.github.pagehelper.PageInfo;
import com.invoicing.entity.Sale; public interface ISalesSerivce { //添加销售记录
Integer addSale(Sale sale); /**
* 根据传过来的参数
* (if oder==1 那么获取的所有销售记录根据日期排序,
* if id==2 获取的所有销售记录销售的总数排序)
* 获取所有的销售记录
*/
PageInfo<Sale> getListSale(String order, int pageNum, int pageSize);
}
service层的impl实现:
package com.invoicing.service.impl; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.invoicing.dao.ISalesDao;
import com.invoicing.entity.Sale;
import com.invoicing.service.ISalesSerivce;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List; @Service("iSalesSerivce")
public class ISalesSerivceImpl implements ISalesSerivce { @Resource(name = "iSalesDao")
private ISalesDao iSalesDao; @Override
public Integer addSale(Sale sale) {
return iSalesDao.addSale(sale);
} @Override
public PageInfo<Sale> getListSale(String order, int pageNum, int pageSize) {
Page<Sale> page = PageHelper.startPage(pageNum, pageSize); //进行PageHelper分页
List<Sale> listSale = iSalesDao.getListSale(order);
return page.toPageInfo();
}
}
IUserService :
package com.invoicing.service;
import com.invoicing.entity.Users;
public interface IUserService {
//登录
Users login(String username, String password);
}
service层的impl实现:
package com.invoicing.service.impl; import com.invoicing.dao.IUserDao;
import com.invoicing.entity.Users;
import com.invoicing.service.IUserService;
import org.springframework.stereotype.Service; import javax.annotation.Resource; @Service("iUserService")
public class IUserServiceImpl implements IUserService { @Resource(name = "iUserDao")
private IUserDao iUserDao; @Override
public Users login(String username, String password) {
Users login =iUserDao.login(username);
if (login!=null && login.getPassword().equals(password) ){
return login;
}
return null;
}
}
Controller层:
IProductController :
package com.invoicing.controller; import com.invoicing.entity.Product;
import com.invoicing.service.IProductService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; @Controller
public class IProductController {
@Resource(name = "iProductService")
private IProductService iProductService; //获取所有库存表的信息
@RequestMapping(value = "/getProductList", method = RequestMethod.POST)
@ResponseBody
private Object getProductList(HttpServletRequest request, HttpServletResponse response) throws IOException {
List<Product> productList = iProductService.getProductList();
return productList;
}
}
ISalesController :
package com.invoicing.controller; import com.github.pagehelper.PageInfo;
import com.invoicing.entity.Product;
import com.invoicing.entity.Sale;
import com.invoicing.entity.Users;
import com.invoicing.service.IProductService;
import com.invoicing.service.ISalesSerivce;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.Date; @Controller
public class ISalesController { @Resource(name = "iSalesSerivce")
private ISalesSerivce iSalesSerivce; @Resource(name = "iProductService")
private IProductService iProductService; @RequestMapping(value = "/addSale", method = RequestMethod.POST)
private String addSale(@RequestParam String product, String price, String quantity, String remarks, HttpServletRequest request, HttpServletResponse response) throws IOException {
System.out.println("addSale"+":///"+product+"///"+price+"///"+quantity+"///"+remarks);
double totalPrice =Double.valueOf(price)*Double.valueOf(quantity);
Sale sale = new Sale();
sale.setPrice(BigDecimal.valueOf(Integer.valueOf(price)));
sale.setProductId(Integer.valueOf(product));
sale.setQuantity(Integer.valueOf(quantity));
sale.setTotalPrice(BigDecimal.valueOf(totalPrice));
Users users=(Users)request.getSession().getAttribute("user");
sale.setUserId(users.getUid());
sale.setSaleDate(new Date());
sale.setRemarks(remarks);
//根据id获取对象
Product pquantity = iProductService.getProduct(Integer.valueOf(product)); //根据获取的对象和传过来的对象进行判断如果小于那么返回添加失败
if (pquantity.getQuantity()>=Integer.valueOf(quantity)){
Integer integer1 = iProductService.updateProduct(Integer.valueOf(quantity), Integer.valueOf(product));
//判断Product中的数据修改成功吗,如果失败更换添加失败
if (integer1>0){
Integer integer = iSalesSerivce.addSale(sale);
request.getSession().setAttribute("ByVal","sales");
//判断向Sale表中添加数据成功,成功返回云
if(integer>0){
response.setContentType("text/html; charset=UTF-8"); //转码
PrintWriter out = response.getWriter();
out.flush();
out.println("<script>");
out.println("alert('添加成功');");
out.println("</script>");
}else{
response.setContentType("text/html; charset=UTF-8"); //转码
PrintWriter out = response.getWriter();
out.flush();
out.println("<script>");
out.println("alert('添加失败');");
out.println("</script>");
}
}else {
response.setContentType("text/html; charset=UTF-8"); //转码
PrintWriter out = response.getWriter();
out.flush();
out.println("<script>");
out.println("alert('添加失败');");
out.println("</script>");
}
}else {
response.setContentType("text/html; charset=UTF-8"); //转码
PrintWriter out = response.getWriter();
out.flush();
out.println("<script>");
out.println("alert('添加失败,你输入的数量大于库存数量');");
out.println("</script>");
} return "index";
} //获取所有销售数据进行分页并进行绑定
@RequestMapping(value = "/getListSale", method = RequestMethod.POST)
@ResponseBody
private Object getListSale(String order, int pageNum, HttpServletRequest request, HttpServletResponse response) throws IOException {
System.out.println(" getListSale"+":///"+order);
int pageSize=5;
PageInfo<Sale> listSale = iSalesSerivce.getListSale(order,pageNum+1,pageSize);
for (Sale s: listSale.getList()
) {
System.out.println(s.getSid());
}
return listSale;
}
}
IUserController :
package com.invoicing.controller; import com.invoicing.entity.Users;
import com.invoicing.service.IUserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter; @Controller
public class IUserController {
@Resource(name = "iUserService")
private IUserService iUserService; //跳转到登录页面
@RequestMapping("/getLogin")
private String getLogin() {
return "login";
} //登录
@RequestMapping(value = "/login", method = RequestMethod.POST)
private String login(String username, String password, HttpServletRequest request, HttpServletResponse response) throws IOException {
System.out.println("测试:"+username+"//////"+password);
Users user = iUserService.login(username,password);
if (user!=null){
request.getSession().setAttribute("ByVal","index");
request.getSession().setAttribute("user",user);
return "index";
}else {
response.setContentType("text/html; charset=UTF-8"); //转码
PrintWriter out = response.getWriter();
out.flush();
out.println("<script>");
out.println("alert('用户名或者密码错误!');");
out.println("</script>");
}
return "login";
} //退出
@RequestMapping(value = "/out", method = RequestMethod.GET)
private String out(HttpServletRequest request, HttpServletResponse response) {
request.getSession().removeAttribute("user");
return "login";
} //跳转到主页
@RequestMapping(value = "/judgePage", method = RequestMethod.POST)
@ResponseBody
private Object judgePage(HttpServletRequest request, HttpServletResponse response) {
String byVal = request.getSession().getAttribute("ByVal").toString();
if(byVal==null){
byVal="index";
}
return byVal;
} }
页面:
index.html:
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="css/pagination.css"/>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/jquery.pagination.js"></script>
<script>
$(function () {
//判断添加成功后,是添加页码
$.ajax({
type:"POST",
url:"/judgePage",
dataType:"text",
success: function(data){
if (data=="sales"){
$("#index").hide();
$("#Products").hide();
$("#select").hide();
$("#sales").show();
}else {
$("#sales").hide();
$("#Products").hide();
$("#select").hide();
}
}
});
}) //跳转到添加销售信息的页面
function sales() {
$("#index").hide();
$("#Products").hide();
$("#select").hide();
$("#sales").show();
$("#p").remove();
//添加销售信息的页面的下拉框信息绑定
bindsales();
}
function bindsales() {
//添加销售信息的页面的下拉框信息绑定
$.ajax({
type:"POST",
url:"/getProductList",
dataType:"JSON",
success: function(data){
$("#product option:not(option:first)").remove();
$.each(data,function (i,dom) {
$("#product").append("<option value='"+dom.pid+"'>"+dom.productName+"</option>"); }) }
});
}
//跳转到展示销售信息的页面
function products() {
$("#index").hide();
$("#sales").hide();
$("#select").hide();
$("#Products").show();
$("#p").remove();
load(0);
}
//补0操作
function getzf(num){
if(parseInt(num) < 10){
num = '0'+num;
}
return num;
}
//str为传入的字符串为毫秒值
function getMyDate(str){
var oDate = new Date(str),
oYear = oDate.getFullYear(),
oMonth = oDate.getMonth()+1,
oDay = oDate.getDate(),
oHour = oDate.getHours(),
oMin = oDate.getMinutes(),
oSen = oDate.getSeconds(),
oTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) ;
//最后拼接时间为 1999-10-02 样式
return oTime;
}; //跳转到展示销售信息的的绑定
function load(pageNum) {
var order=$("[name=order]").val();
$.ajax({
type:"POST",
url:"/getListSale",
data:{"order":order,"pageNum":pageNum},
dataType:"JSON",
success: function(pageInfo){
$("#prod tr:not(tr:first)").remove();
$.each(pageInfo.list,function (i,dom) {
$("#prod").append("<tr> " +
"<td>"+dom.sid+"</td>" +
"<td>"+dom.product.productName+"</td> " +
"<td>"+dom.price+"</td> " +
"<td>"+dom.quantity+"</td> " +
"<td>"+dom.totalPrice+"</td>" +
"<td>"+getMyDate(dom.saleDate)+"</td> " +
"<td>"+dom.users.userName+" </td> " +
"</tr></tr> ");
})
$('#pagination').pagination(pageInfo.total, {
current_page : pageNum,
items_per_page : pageInfo.pageSize,
callback:load,
load_first_page : true,
prev_text : '上一页',
next_text : '下一页'
})
}
}); } //跳转到查看库存的页面
function select() {
$("#index").hide();
$("#Products").hide();
$("#select").show();
$("#sales").hide();
$("#p").remove();
bindselect()
} //查看库存的页面的下拉框绑定
function bindselect() {
$.ajax({
type:"POST",
url:"/getProductList",
dataType:"JSON",
success: function(data){
$("#selectshop option:not(option:first)").remove();
$.each(data,function (i,dom) {
$("#selectshop").append("<option value='"+dom.pid+"'>"+dom.productName+"</option>");
}) }
});
} //根据选择的信息来显示框架
function sumbit() {
var order=$("[name=shop]").val();
$.ajax({
type:"POST",
url:"/getProductList",
dataType:"JSON",
success: function(data){
$("#p").remove();
$.each(data,function (i,dom) {
if (order==dom.pid) {
$("#out").append("<h2 id='p'>该商品的库存数量是:"+dom.quantity+"</h2>")
}
}) }
});
}
</script>
</head>
<body>
<div align="center">
<div>
<table>
<tr>
<td> 欢迎:<span th:text="${session.user.userName}"></span>,<a href="/out">退出登录</a></td>
</tr>
<tr>
<td width="50px">
<a href="javaScript:;" onclick="sales()" >销售</a><br><br>
<a href="javaScript:;" onclick="products()">销售信息查询</a><br><br>
<a href="javaScript:;" onclick="select()">查看库存</a><br><br>
</td>
<td rowspan="2" >
<div style="border: #0c89de 1px solid ;width: 600px;height: 300px">
<div id="index">
<br><br><br><br><br>
<h1 align="center">欢迎使用小型进销存系统</h1>
</div>
<div id="sales" align="center">
<h2 >添加销售</h2>
<form action="/addSale" method="post" >
商品名称:<select style="width:180px;height: 25px" id="product" name="product">
<option >--请选择商品--</option>
</select><br/><br/>
销售单价:<input style="width:180px;height: 25px" type="text" name="price"><br/><br/>
销售数量:<input style="width:180px;height: 25px" type="text" name="quantity"><br/><br/>
备注: <input style="width:180px;height: 25px" type="text" name="remarks"><br/><br/>
<input type="submit" value="提交">
</form>
</div>
<div id="Products" align="center">
<br><br><br>
<span style="font-weight: bolder">销售信息查询:</span>
排序方式:<select name="order">
<option value="0">销售日期</option>
<option value="1">单笔总价</option>
</select>
<button onclick="load(0)">提交</button>
<table border="2px" id="prod">
<tr>
<th>ID</th>
<th>商品</th>
<th>单价</th>
<th>数量</th>
<th>总价</th>
<th>销售日期</th>
<th>销售员</th>
</tr>
</table>
<div class="pagination" id="pagination" align="center"></div> </div>
<div id="select" align="center">
<br><br><br>
<span style="font-weight: bolder">销售信息查询:</span>
排序方式:<select name="shop" id="selectshop">
<option value="0">--请选择商品--</option>
</select>
<button onclick="sumbit()" >提交</button>
<div id="out"> </div>
</div>
</div>
</td>
</tr>
</table>
</div>
<div> </div> </div>
</body>
</html>
login.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>登录</title>
</head>
<body>
<div align="center">
<br/>
<div align="center" style="background-color:greenyellow ;width: 600px;height: 250px">
<br/>
<div >
<h1>小型进销存系统</h1>
<form METHOD="post" ACTION="/login">
用户名:<input type="text" name="username"><br/><br/>
密码: <input type="password" name="password"><br/><br/>
<input type="submit" value="登录">
</form>
</div>
</div>
</div>
</body>
</html>
spring boot的一个小项目小型进销存系统的更多相关文章
- C# WINFORM进销存系统开发(内涵免费源码+部分实操视频讲解)
互联网的时代,电商火爆,大家都开始进行线上销售货品,那你是如何管理你的商品库存和进销问题?软积木--小敏用的是C# WINFORM进销存系统来管理我的数据,给我带来了很多便利. 它是高频需求项目,很多 ...
- openerp 经典收藏 Openerp开发进销存系统完毕总结(转载)
原文地址:http://blog.csdn.net/heartrude/article/details/9142463 Openerp开发进销存系统完毕总结 分类: 代码历程 OpenERP 工程思想 ...
- 浩瀚技术团队... 安卓智能POS移动PDA开单器 开单器 进销存系统 进销存系统
浩瀚技术团队... 智能POS移动PDA开单器 开单器 进销存系统 进销存系统 点餐 会员管理 会员管理 深度解读 手机APP移动办公到底是什么? 快速打单POS·不仅仅是快那么简单!
- [系统开发] FileMaker进销存系统
一.简介 这是我用 FileMaker 编写的进销存系统: FileMaker 是一种在欧美流行的桌面型数据库:它使用非常方便,功能也很强大,用户可以在它上面开发自己的系统: 开发时间:2008年 二 ...
- PDA手持机 移动开单进销存系统 现场出打印凭据和扫码 新的亮点
传统车销模式弊端:1.手写开单,效率低,动作慢2.现场手写开单明细不能打印,产品明细不规范3.电脑办公人员及车销人员对车上的库存情况掌握不清楚,销售人员对每种产品销售价格不清楚4.老板对员工工作的管控 ...
- Spring Boot创建一个HelloWorld项目
目录 Spring Boot 简介 微服务框架 以前使用spring开发web的方式 Spring Boot 启动器介绍 如何创建一个helloword的SpringBoot项目 Spring Boo ...
- Openerp开发进销存系统完毕总结
转自:http://blog.csdn.net/heartrude/article/details/9142463 安装Openoffice 在openoffice中安装openerp repor ...
- Openerp开发进销存系统总结
转自 :http://blog.sina.com.cn/s/blog_7cb52fa80101ngt8.html 差不多用了2个星期的闲余事件,对于openerp v7.0进行了学习和应用开发.细节总 ...
- C# 进销存系统开发框架
C/S系统开发框架-企业版 V4.0 (Enterprise Edition) 简介: http://www.csframework.com/cs-framework-4.0.htm 视频下载: 百度 ...
随机推荐
- ASP.NET Core on K8S 入门学习系列文章目录
一.关于这个系列 自从2018年底离开工作了3年的M公司加入X公司之后,开始了ASP.NET Core的实践,包括微服务架构与容器化等等.我们的实践是渐进的,当我们的微服务数量到了一定值时,发现运维工 ...
- ubuntu16.04+Opencv3.4.0安装(slam版)
本文记录ubuntu下安装opencv过程,步骤来自 opencv官网可以对照官网步骤:https://docs.opencv.org/3.4.0/d7/d9f/tutorial_linux_inst ...
- HDU_1035_水
http://acm.xidian.edu.cn/problem.php?id=1035 本来想用goto优化一下的,不知道什么情况,加了goto就wa了. #include<iostream& ...
- CCF_201503-2_数字排序
自己写个排序的cmp. #include<iostream> #include<cstdio> #include<algorithm> using namespac ...
- kendo ui - core
通过CDN 引入kendo-ui-core git地址:http://www.telerik.com/kendo-ui<link href="http://kendo.cdn.tele ...
- Go语言实现:【剑指offer】第一个只出现一次的字符位置
该题目来源于牛客网<剑指offer>专题. 在一个字符串(0<=字符串长度<=10000,全部由字母组成)中找到第一个只出现一次的字符,并返回它的位置, 如果没有则返回 -1( ...
- 使用newtonsoft完美序列化WebApi返回的ValueTuple
由于开发功能的需要,又懒得新建太多的class,所以ValueTuple是个比较好的偷懒方法,但是,由于WebApi需要返回序列化后的json,默认的序列化只能将ValueTuple定义的各个属性序列 ...
- 使用chrome控制台调试js代码
1.打开控制台(空白页签即可) 2.将控制台在独立页打开(点击控制台右上角的三个点图标,然后点击如下图中的图标) 3.创建脚本编辑页面 4.页面区域说明 5.花键+回车之行代码 6.常用命令介绍 6. ...
- Andriod you must restart adb and eclipse
今天看着视频 学习着 andriod ,启动 的时候 竟然报错 我试了N种google来的方法,都失效,现在把我的解决方法告诉大家,希望能帮到大家. 首先,我先罗列下我搜到的方法,大家也可以尝试. 1 ...
- python os和sys模块使用
python os和sys模块使用 os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 os.chdir("dirname") 改变当前脚本工作目录:相 ...