0
点赞
收藏
分享

微信扫一扫

基于javaweb+jsp的设备采购管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

酷子腿长一米八 2022-04-16 阅读 85
javamysql

基于javaweb+jsp的设备采购管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

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

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

适用

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

     * @throws IOException
     */
    @RequestMapping("noticeDelete")
    public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");
        noticeService.delete(Arrays.asList(id));
        this.redirectList(request, response);
    }

    /**
     * 编辑公告
     *
     * @param response
     * @param request
     * @throws IOException

    <!--列表-->
    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_good`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            </if>
            1=1
        </where>
        ORDER BY id ASC
        <if test="startIndex != null and pageSize != null">
            LIMIT #{startIndex},#{pageSize};
        </if>
    </select>
    <!--数量-->
    <select id="getAllCount" parameterType="java.util.Map" resultType="Integer">
        SELECT COUNT(*) FROM `t_good`
        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)*/) {//说明该用户名已存在,必须换个用户名才能注册
                request.getSession().setAttribute("alert_msg", "错误:用户名已存在!");
                request.getRequestDispatcher("register.jsp").forward(request, response);
                return;
            }
        }
        User vo = new User();
        vo.setUsername(username);
        vo.setPassword(password);
        //vo.setUserType("普通用户");//需要设置一个默认值
        userService.insert(vo);
        request.getSession().setAttribute("alert_msg", "注册成功!用户名:[" + username + "]");
        request.getRequestDispatcher("login.jsp").forward(request, response);
    }

    @RequestMapping("authLogout")
    public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");
        userService.delete(Arrays.asList(id));
        this.redirectList(request, response);
    }

    /**
     * 编辑用户
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("userEdit")
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        Map<String, Object> map = gysService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

        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) gysService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
            return false;
        }
        if (document.getElementById("wupinGuige").value.trim().length == 0) {
            alert("规格不能为空!");
            return false;
        }
        if (document.getElementById("wupinPrice").value.trim().length == 0) {
            alert("采购价不能为空!");
            return false;
        }
        return true;
    }
</script>
</html>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>用户添加</title>
    <%@ include file="include/head.jsp" %>
</head>
<body>
<div class="container-fluid">
    <ul class="nav nav-tabs">
        String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
        response.sendRedirect("notice_" + to + ".jsp");
    }

    /**
     * 根据条件查询公告的列表并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("noticeList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到列表页面
    /**
     * 获取系统当前时间并格式化为字符串
     *
     * @return
     */
    public static String getTime() {
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis());
    }
    /**
     * 判断字符串是不是中文
     *
     * @param c
     * @return
                <label class="col-sm-3 control-label">采购价:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="wupinPrice" name="wupinPrice" value="${vo.wupinPrice}">
                </div>
            </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注:</label>
            <div class="col-sm-5">
                <textarea rows="3" class="form-control" id="wupinText" name="wupinText" placeholder="请输入内容......">${vo.wupinText}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"></label>
            <div class="col-sm-5">
                <input type="submit" class="btn btn-grad btn-danger btn-sm" value="保存">
                <input type="button" class="btn btn-grad btn-default btn-sm" value="返回" onclick="javascript:history.back(-1);">
            </div>
        </div>
    </form>
</div>
     */
    @RequestMapping({"caigouGet", "caigouEditPre"})
    public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");//取出主键id
        Caigou vo = caigouService.get(id);
        request.getSession().setAttribute("vo", vo);
        String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
        response.sendRedirect("caigou_" + to + ".jsp");
    }

    /**
     * 根据条件查询采购的列表并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("caigouList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到列表页面
     *

    <!--修改-->
    <update id="doUpdate" parameterType="com.demo.vo.Caigou">
        UPDATE `t_caigou`
        <set>
                <if test ='id != null'>`id` = #{id},</if>
                <if test ='caigouName != null'>`caigou_name` = #{caigouName},</if>
                <if test ='caigouType != null'>`caigou_type` = #{caigouType},</if>
                <if test ='caigouCount != null'>`caigou_count` = #{caigouCount},</if>
                <if test ='caigouDate != null'>`caigou_date` = #{caigouDate},</if>
                <if test ='caigouText != null'>`caigou_text` = #{caigouText}</if>
        </set>
        WHERE `id` = #{id}
    </update>

    <!--获取-->
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_caigou` WHERE `id` = #{id}
    </select>

运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

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

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

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

适用

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

功能说明

登录、注册、退出、用户模块、公告模块、供应商模块、物资模块、采购模块的增删改查管理

20220319003129

20220319003130

20220319003131

20220319003132

20220319003133

20220319003134

20220319003135

20220319003136

20220319003137

20220319003138

20220319003139

20220319003140

20220319003141

document

举报

相关推荐

0 条评论