基于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等均可配置运行

适用

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

        return true;
    }
    //编辑表单提交之前进行检查,如果return false,则不允许提交
    function editCheck() {
        //根据ID获取值
        if (document.getElementById("edit-username").value.trim().length == 0) {
            alert("用户名不能为空");
            return false;
        }
        if (document.getElementById("edit-password").value.trim().length == 0) {
            alert("密码不能为空");
            return false;
        }
        if (document.getElementById("edit-realName").value.trim().length == 0) {
            alert("姓名不能为空");
            return false;
        }
        if (document.getElementById("edit-userPhone").value.trim().length == 0) {
                        <tr>
                            <td style="width: 15%;">备注:</td>
                            <td><b id="info-dinggouText"></b></td>
                        </tr>
                    </table>
                    <br>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-grad btn-success" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- edit -->
<div class="modal fade" id="modal-edit" tabindex="-1" role="dialog"
        if (totalRecord % pageSize == 0) {
            //说明整除,正好每页显示pageSize条数据,没有多余一页要显示少于pageSize条数据的
            this.totalPage = totalRecord / pageSize;
        } else {
            //不整除,就要在加一页,来显示多余的数据。
            this.totalPage = totalRecord / pageSize + 1;
        }
        //开始索引
        this.startIndex = (pageNum - 1) * pageSize;
        //显示5页,这里自己可以设置,想显示几页就自己通过下面算法修改
        this.start = 1;
        this.end = 5;
        //显示页数的算法
        if (totalPage <= 5) {
            //总页数都小于5,那么end就为总页数的值了。
            this.end = this.totalPage;
        } else {
            //总页数大于5,那么就要根据当前是第几页,来判断start和end为多少了,
            this.start = pageNum - 2;
            this.end = pageNum + 2;
            if (start < 0) {
                //比如当前页是第1页,或者第2页,那么就不如和这个规则,
                this.start = 1;
                this.end = 5;
            }
            if (end > this.totalPage) {
                //比如当前页是倒数第2页或者最后一页,也同样不符合上面这个规则
    }

    @RequestMapping("authRegister")
    public void register(HttpServletResponse response, HttpServletRequest request) throws IOException, ServletException {
        String username = Util.decode(request, "username");
        String password = Util.decode(request, "password");
        System.out.println("username=" + username);
        System.out.println("password=" + password);

        Map<String, Object> params = new HashMap();
        params.put("searchColumn", "username");//使用`username`字段进行模糊查询
        params.put("keyword", username);
        params.put("startIndex", 0);
        params.put("pageSize", Long.MAX_VALUE);
        List<User> list = (List<User>) userService.list(params).get("list");
        for (User user : list) {
            if (user.getUsername().equals(username) /*&& user.getPassword().equals(password)*/) {//说明该用户名已存在,必须换个用户名才能注册
            </form>
        </div>
    </div>
</div>

</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);
    }

    /**
     * 编辑公告
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("noticeEdit")
    public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Notice vo = new Notice();
        vo.setId(Long.valueOf(Util.decode(request, "id")));
        vo.setNoticeName(Util.decode(request, "noticeName"));
        vo.setNoticeText(Util.decode(request, "noticeText"));
        vo.setNoticeType(Util.decode(request, "noticeType"));
        vo.setCreateDate(Util.decode(request, "createDate"));
        noticeService.update(vo);
        this.redirectList(request, response);
    }

    /**
     * 获取公告的详细信息(详情页面与编辑页面要显示该公告的详情)并跳转回页面
     *
     * @param response
        //  这三条语句都可以关闭浏览器的缓冲区,但是由于浏览器的版本不同,对这三条语句的支持也不同
        //  因此,为了保险起见,建议同时使用这三条语句来关闭浏览器的缓冲区
        response.setHeader("ragma", "No-cache");
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);
        //  设置图形验证码的长和宽(图形的大小)
        int width = 90, height = 20;
        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        Graphics g = image.getGraphics();//  获得用于输出文字的Graphics对象
        Random random = new Random();
        g.setColor(getRandomColor(180, 250));// 随机设置要填充的颜色
        g.fillRect(0, 0, width, height);//  填充图形背景
        //  设置初始字体
        g.setFont(new Font("Times New Roman", Font.ITALIC, height));
        g.setColor(getRandomColor(120, 180));// 随机设置字体颜色
        //  用于保存最后随机生成的验证码
        StringBuilder validationCode = new StringBuilder();
    <!--数量-->
    <select id="getAllCount" parameterType="java.util.Map" resultType="Integer">
        SELECT COUNT(*) FROM `t_good`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            </if>
            1=1
        </where>
    </select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">
    <!-- 配置数据源 -->
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
            <br>
            <a href="#" style="font-size: 24px;color: #269abc;text-decoration: none;padding-left: 140px;">登录</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="register.jsp" style="font-size: 24px;color:black ;text-decoration: none;">注册</a>
            <br>
            <br>
            <div class="form-group" style="margin-top: 20px;">
                <label for="username" class="col-sm-3 control-label">账号</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="username" name="username" placeholder="请输入您的账号" >
                </div>
            </div>
            <div class="form-group">
                <label for="password" class="col-sm-3 control-label">密码</label>
                <div class="col-sm-7">
                    <input type="password" class="form-control" id="password" name="password" placeholder="请输入您的密码" >
                </div>
            </div>
			
            <div class="form-group">
                <label for="password" class="col-sm-3 control-label">验证码</label>
                <div class="col-sm-7 form-inline">
                    <input type="text" id="validationCode" name="validationCode"
                           style="width: 81px;height: 34px;padding: 6px 12px;font-size: 14px;border-radius: 4px;color: black;"
                           placeholder="验证码">
                    <img id="img_validation_code" src="authValidationCode" onclick="refresh()" style="height: 30px;width: 135px;"/>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- 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>

运行环境

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…均可修改

适用

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

功能说明

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

20220319001022

20220319001023

20220319001024

20220319001025

20220319001026

20220319001027

20220319001028

20220319001029

20220319001030

document

  • 0
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值