软件需求与分析大作业进度四
1、今日工作
1)完成了需求浏览的功能。
2)完成了修改需求的功能。
3)完成了基本的查询功能。
2、明日目标任务。
1)实现形式审核的功能。
成果展示:
需求浏览:
代码如下:
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@page import="java.sql.*" %> <%--导入java.sql包--%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta charset="UTF-8" /> <title>会员列表-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title> <meta name="renderer" content="webkit" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" /> <link rel="stylesheet" href="../../static/css/font.css" /> <link rel="stylesheet" href="../../static/css/weadmin.css" /> <!-- 让IE8/9支持媒体查询,从而兼容栅格 --> <!--[if lt IE 9]> <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="weadmin-nav"> <span class="layui-breadcrumb"> <a href="javascript:;">首页</a> <a href="javascript:;">浏览需求</a> <a href="javascript:;"> <cite>需求审核</cite></a> </span> <a class="layui-btn layui-btn-sm" style="margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"> <i class="layui-icon layui-icon-refresh"></i> <!-- <i class="layui-icon" style="line-height:30px">ဂ</i> --> </a> </div> <div class="weadmin-body"> <div class="layui-row"> <form class="layui-form layui-col-md12 we-search" action="./flSelect.jsp"> 查询条件: <div class="layui-inline"> <input class="layui-input" name="slsuoyin" id="sldemandname" list="source"/> <datalist id="source"> <option value="机构全称"> <option value="归口管理单位"> <option value="所在地域"> <option value="法人代表"> <option value="联系人"> <option value="机构属性"> <option value="技术需求名称"> <option value="关键字"> <option value="拟投入资金总额"> <option value="技术需求解决方式"> <option value="科技活动类型"> <option value="学科分类"> <option value="需求技术所属领域"> <option value="需求技术应用行业"> <option value="管理处室"> </datalist> </div> 查询内容: <div class="layui-inline"> <input class="layui-input" name="suoyin" id="suoyin" /> </div> <div class="layui-inline"> <label for="L_sex" class="layui-form-label">查询方式:</label> <div class="layui-input-block" id="L_sex"> <input type="radio" name="slff" value="精确查询" title="精确查询"> <input type="radio" name="slff" value="模糊查询" title="模糊查询"> </div> </div> <div class="layui-form-item"> <label for="L_sex" class="layui-form-label">形式审核:</label> <div class="layui-input-block" id="L_sex"> <input type="radio" name="slxsresult" value="1" title="通过"> <input type="radio" name="slxsresult" value="0" title="不通过"> </div> </div> <div class="layui-inline"> <label for="L_sex" class="layui-form-label">部门审核:</label> <div class="layui-input-block" id="L_sex"> <input type="radio" name="slbmresult" value="1" title="通过"> <input type="radio" name="slbmresult" value="0" title="不通过"> </div> </div> <button class="layui-btn" lay-submit="" lay-filter="sreach"> <i class="layui-icon layui-icon-search"></i> </button> </form> </div> <table class="layui-table" id="memberList"> <thead> <tr> <th> <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"> <i class="layui-icon"></i> </div> </th> <th>填报人</th> <th>机构名称</th> <th>需求名称</th> <th>形式审核</th> <th>部门审核</th> <th>操作</th> </tr> </thead> <tbody> <% try { Class.forName("com.mysql.jdbc.Driver"); //驱动程序名 String url = "jdbc:mysql://localhost:3306/xuqiuzhengji?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true"; //数据库名 String username = "root"; //数据库用户名 String password = "123456"; //数据库用户密码 Connection conn = DriverManager.getConnection(url, username, password); //连接状态 String name=request.getParameter("name"); if(conn != null){ //out.print("数据库连接成功!"); //out.print("<br />"); Statement stmt = null; ResultSet rs = null; String sql="SELECT * FROM demand"; //查询语句 stmt = conn.createStatement(); rs = stmt.executeQuery(sql); int intPageSize; //一页显示的记录数 int intRowCount; //记录的总数 int intPageCount; //总页数 int intPage; //待显示的页码 String strPage; //设置一页显示的记录数 intPageSize = 20; //取得待显示的页码 strPage = request.getParameter("page"); //判断strPage是否等于null,如果是,显示第一页数据 if (strPage == null) { intPage = 1; } else { //将字符串转换为整型 intPage = java.lang.Integer.parseInt(strPage); } if (intPage < 1) { intPage = 1; } //获取记录总数 rs.last(); intRowCount = rs.getRow(); //计算机总页数 intPageCount = (intRowCount + intPageSize - 1) / intPageSize; //调整待显示的页码 if (intPage > intPageCount) intPage = intPageCount; if (intPageCount > 0) { //将记录指针定位到待显示页的第一条记录上 rs.absolute((intPage - 1) * intPageSize + 1); } int i=0; while (i < intPageSize && !rs.isAfterLast()){ String xxstatus= rs.getString("xxstatus"); String ggstatus = rs.getString("ggstatus"); System.out.println("xxstatus "+xxstatus+" 4545w"); %> <tr data-id="1"> <td> <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id="1"> <i class="layui-icon"></i> </div> </td> <td><%=rs.getString("name") %></td> <td><%=rs.getString("oname") %></td> <td><%=rs.getString("demandname") %></td> <c:set var="xxstatus" scope="session" value="<%=xxstatus %>"/> <c:if test="${xxstatus>0}"> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-xs"><font color="yellow">已审核</font></span> <a title="查看" onclick="WeAdminEdit('查看','./showXS.jsp?id=<%=rs.getString("id")%>', 1, 600, 400)" href="javascript:;"> <i class="layui-icon layui-icon-edit"></i> </a> </td> </c:if> <c:set var="xxstatus" scope="session" value="<%=xxstatus %>"/> <c:if test="${xxstatus<1}"> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-xs"><font color="green">未审核</font></span> </td> </c:if> <c:set var="ggstatus" scope="session" value="<%=ggstatus %>"/> <c:if test="${ggstatus>0}"> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-xs"><font color="yellow">已审核</font></span> <a title="查看" onclick="WeAdminEdit('查看','./showBM.jsp?id=<%=rs.getString("id")%>', 1, 600, 400)" href="javascript:;"> <i class="layui-icon layui-icon-edit"></i> </a> </td> </c:if> <c:set var="ggstatus" scope="session" value="<%=ggstatus %>"/> <c:if test="${ggstatus<1}"> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-xs"><font color="green">未审核</font></span> </td> </c:if> <td class="td-manage"> <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用"> <i class="layui-icon layui-icon-download-circle"></i> </a> <a title="审核" onclick="WeAdminEdit('编辑','./XeditXQ.jsp?id=<%=rs.getString("id")%>', 1, 600, 400)" href="javascript:;"> <i class="layui-icon layui-icon-edit"></i> </a> <a title="编辑" onclick="WeAdminEdit('编辑','./BeditXQ.jsp?id=<%=rs.getString("id")%>', 1, 600, 400)" href="javascript:;"> <i class="layui-icon layui-icon-edit"></i> </a> <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;"> <i class="layui-icon layui-icon-delete"></i> </a> </td> </tr> <% rs.next(); i++; } //关闭连接、释放资源 rs.close(); stmt.close(); conn.close(); %> </tbody> </table> <div class="page"> <div> <a class="prev" href="AXQShow.jsp?page=<%=intPage-1%>"><<</a> <span class="current"><%=intPage%></span> <% for (int t = 1; t <= intPageCount; t++) { out.print(" <a class='num' href='AXQShow.jsp?page=" + t + "'>" + t + "</a>"); } %> <a class="next" href="AXQShow.jsp?page=<%=intPage+1%>">>></a> </div> </div> </div> <% }else{ out.print("连接失败!"); } }catch (Exception e) { //e.printStackTrace(); out.print("数据库连接异常!"); } %> <!--<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>--> <script src="../../lib/layui/layui.js" charset="utf-8"></script> <script src="../../static/js/eleDel.js" type="text/javascript" charset="utf-8"></script> </body> </html>