基于javaweb+jsp的超市便利店管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

基于javaweb+jsp的超市便利店管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

<!-- info -->
<div class="modal fade" id="modal-info" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form>
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">公告</h4>
                </div>
                <div class="modal-body">
                    <table class="table table-striped table-hover" style="font-size: 15px;">
                        <tr>
                            <td style="width: 15%;">标题:</td>
                            <td><b id="info-noticeName"></b></td>
                        </tr>
                        <tr>
                            <td style="width: 15%;">内容:</td>
                    <if test ='supplierMan != null'>`supplier_man`,</if>
                    <if test ='supplierSex != null'>`supplier_sex`,</if>
                    <if test ='supplierTel != null'>`supplier_tel`,</if>
                    <if test ='supplierAddress != null'>`supplier_address`</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>#{id},</if>
                    <if test ='supplierName != null'>#{supplierName},</if>
                    <if test ='supplierMan != null'>#{supplierMan},</if>
                    <if test ='supplierSex != null'>#{supplierSex},</if>
                    <if test ='supplierTel != null'>#{supplierTel},</if>
                    <if test ='supplierAddress != null'>#{supplierAddress}</if>
        </trim>
    </insert>
            <div class="table-responsive">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                            <th>用户名</th>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>手机</th>
                            <th>备注</th>
                            <th>类型</th>
                        <th style="text-align: center;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${list}" var="vo">
                        <tr>
                <td>${vo.username}</td>
                <td>${vo.realName}</td>
                <td>${vo.userSex}</td>
                <td>${vo.userPhone}</td>
                <td title="${vo.userText}">

</body>
<script>
    $('#modal-delete').on('show.bs.modal', function (event) {
        let button = $(event.relatedTarget);
        let id = button.data('id');
        let modal = $(this);
        modal.find('#delete-id').val(id);
    })

    $('#modal-edit').on('show.bs.modal', function (event) {
        let button = $(event.relatedTarget);
        let id = button.data('id');
        let modal = $(this);
        $.ajax({
            url: 'supplierGet?id=' + id,
            type: "get",
            success: function (voString) {
                let vo = eval('(' + voString + ')');
                        modal.find('#edit-id').val(vo.id);
                        modal.find('#edit-supplierName').val(vo.supplierName);
                        modal.find('#edit-supplierMan').val(vo.supplierMan);
                        for (let val of "男/女".split('/')) {
                            if (val == vo.supplierSex) {
                                modal.find('#edit-supplierSex_' + vo.supplierSex).prop("checked", true);
                            <th>创建时间</th>
                        <th style="text-align: center;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${list}" var="vo">
                        <tr>
                <td>${vo.orderNo}</td>
                <td>${vo.orderName}</td>
                <td>${vo.orderCount}</td>
                <td>${vo.orderJine}</td>
                <td>${vo.orderPay}</td>
                <td>${vo.orderTime}</td>
                            <th style="text-align: center;">
                                <button class="btn btn-line btn-success btn-sm" data-id="${vo.id}"
                                        data-toggle="modal" data-target="#modal-info">详情
                                </button>
                                <button class="btn btn-line btn-success btn-sm"
                                                <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>
                                        data-id="${vo.id}"
                                        data-toggle="modal" data-target="#modal-edit">编辑
                                </button>
                                <button class="btn btn-line btn-primary btn-sm" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> data-id="${vo.id}"
                                        data-toggle="modal" data-target="#modal-delete">删除
                                </button>
                            </th>
                        </tr>

        Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        String pageNum = Util.decode(request, "pageNum");//封装分页参数
        com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", pb.getPageSize());
        List list = (List) userService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
        pb.setServlet("userList");
        pb.setSearchColumn(searchColumn);
        pb.setKeyword(keyword);
        pb.setList(list);
        request.getSession().setAttribute("pageBean", pb);
        request.getSession().setAttribute("list", pb.getList());

        response.sendRedirect("user_list.jsp");
    }
}
package com.demo.controller;

import com.demo.util.Util;
            if (end > this.totalPage) {
                //比如当前页是倒数第2页或者最后一页,也同样不符合上面这个规则
                this.end = totalPage;
                this.start = end - 5;
            }
        }
    }

    //get、set方法。
    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        let modal = $(this);
        $.ajax({
            url: 'orderGet?id=' + id,
            type: "get",
            success: function (voString) {
                let vo = eval('(' + voString + ')');
                modal.find('#info-orderNo').text(vo.orderNo);
                modal.find('#info-orderName').text(vo.orderName);
                modal.find('#info-orderCount').text(vo.orderCount);
                modal.find('#info-orderJine').text(vo.orderJine);
                modal.find('#info-orderPay').text(vo.orderPay);
                modal.find('#info-orderTime').text(vo.orderTime);
            }
        })
    })
    function editCheck() {
        //根据ID获取值
        if (document.getElementById("edit-noticeName").value.trim().length == 0) {
            alert("标题不能为空");
            return false;
        }
        if (document.getElementById("edit-noticeType").value.trim().length == 0) {
            alert("类型不能为空");
            return false;
        }
        if (document.getElementById("edit-createDate").value.trim().length == 0) {
            alert("创建时间不能为空");
            return false;
        }
        return true;
    }
</script>
</html>
<?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">
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping
public class OrderController {

    @Autowired
                            aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">增加供应商</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group hidden">
                        <label class="control-label">(hidden)</label>
                        <input type="text" class="form-control" name="action" value="add">
                    </div>
                    <div class="form-group">
                        <label for="add-supplierName" class="control-label">名称:</label>
                        <input type="text" class="form-control" name="supplierName" id="add-supplierName">
                    </div>
                    <div class="form-group">
                        <label for="add-supplierMan" class="control-label">联系人:</label>
                        <input type="text" class="form-control" name="supplierMan" id="add-supplierMan">
                    </div>
                    <div class="form-group">
                        <label class="control-label">性别:</label>
                        <input name="supplierSex" id="add-supplierSex_男" type="radio" value="" checked="checked"/><input name="supplierSex" id="add-supplierSex_女" type="radio" value=""/>

运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、商品模块、订单模块、供应商模块的增删改查管理

20220319002615

20220319002616

20220319002617

20220319002618

20220319002619

20220319002620

20220319002621

20220319002622

20220319002623

20220319002624

20220319002625

document

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值