团队作业(五):冲刺总结(五)
项目:电子公文传输系统
今日任务
- 后端设计处理checker.java;DeleteController.java;FileController.java
- 后端设计处理CheckerController.java;DepartmentController.java;InsertAdminController.java
- 前端设计audit1.jsp;dep_add.jsp;dep.jsp;document_add.jsp;xiafa.jsp
- 数据库代码处理sqlhelper.java;CRUDHelper.java
- 前端设计document_show.jsp;document.jsp;systemuser_add.jsp
今日任务的完成情况
学号&姓名 |
任务 |
完成情况 |
20191304商苏赫 |
端设计处理checker.java;DeleteController.java |
100% |
20191314徐汇仁 |
后端设计处理CheckerController.java;DepartmentController.java |
100% |
20191323王予涵 |
前端设计audit1.jsp;dep_add.jsp;dep.jsp |
100% |
20191325施羿 |
数据库代码处理sqlhelper.java;CRUDHelper.java |
92% |
20191330雷清逸 |
前端设计document_show.jsp;document.jsp;systemuser_add.jsp |
90% |
任务片段
checker.c
public class Checker {
public int getIntAndChar(String str){
char c;
int i;
for (i = 0; i<str.length(); i++){
c = str.charAt(i);
if(!((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z'))){
break;
}
}
if(i < str.length()){
return -1;
}else{
return 0;
}
}
public int getInt(String str){
char c;
int i;
for (i = 0; i<str.length(); i++){
c = str.charAt(i);
if(!(c>='0' && c<='9')){
break;
}
}
if(i < str.length()){
return -1;
}else{
return 0;
}
}
public boolean getLawlessChar(String str){
boolean flag = false;
char c;
for(int i = 0;i < str.length();i++){
c = str.charAt(i);
switch(c){
case '<' : flag = true; break;
case '>' : flag = true; break;
case '"' : flag = true; break;
case '&' : flag = true; break;
case ' ' : flag = true; break;
}
}
return flag;
}
public String htmlspecialchars(String str) {
str = str.replaceAll("&", "&");
str = str.replaceAll("<", "<");
str = str.replaceAll(">", ">");
str = str.replaceAll("\"", """);
return str;
}
public String getUnicode(String str) {
if(str != null){
try {
return new String(str.getBytes("iso8859_1"),"gb2312");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return str;
}
}else{
return null;
}
}
public String getGb2312(String str) {
if(str != null){
try {
return new String(str.getBytes("gb2312"),"iso8859_1");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return str;
}
}else{
return null;
}
}
public String getSystemDate(){
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
return df.format(date);
}
public float getRround(float f,int precision){
int n = 1;
for(int i = 1;i <= precision;i++){
n *= 10;
}
int tem = (int)(f*n+0.5);
float ff = ((float)tem/n);
return ff;
}
}
dep.jsp
</head>
<body class="" style="overflow-y: hidden" scroll="no" resizable="false">
<div id="north" region="north" split="false" border="false"
style='height: 78px;'>
<jsp:include page="/admin/head.jsp"></jsp:include>
</div>
<div id="left-menuss" style='width: 180px;display:inline-block'>
<jsp:include page="/admin/left.jsp"></jsp:include>
</div>
<div id='main' style="background: #f7f7f7; padding: 5px;display:inline-block;border:1px solid red;float:right">
<table width="100%" class="table table-hover">
<thead>
<tr>
<td colspan="3" align="center" style="padding:5px;">学院部门管理</td>
</tr>
<tr>
<td colspan="3" style="padding:5px;"><a href="<%=path %>/admin/dep_add.jsp" class="btn btn-info">添加学院部门</a></td>
</tr>
<tr class="thead">
<td align="center">序号</td>
<td align="center">学院部门名称</td>
<td align="center">操作</td>
</tr>
</thead>
<tbody class="tbody">
<%
if(dep != null && dep.size() != 0){
for(int i = 0;i < dep.size();i++){
ArrayList alRow = (ArrayList)dep.get(i);
%>
<tr>
<td align="center"><%=i+1 %></td>
<td align="center"><%=alRow.get(1) %></td>
<td align="center"><a href="<%=path %>/DelServlet?dep=<%=alRow.get(0) %>" class="btn btn-danger">删除</a></td>
</tr>
<%}} %>
</tbody>
</table>
<div class="modal fade" style="top: 13%;" tabindex="-1" role="dialog"
id="showModal">
<div class="modal-dialog" role="document">
<div class="modal-content"></div>
</div>
</div>
</div>
</body>
sqlHelper.java
public class SqlHelper {
DBHelper sb = new DBHelper();
ArrayList al = null;
public ArrayList getAllAdmin(String id) {
String sql = "select * from admin where id!=1 and id!=" + id + " order by id desc";
String args[] = { "id", "name", "pwd", "type", "status" };
al = sb.select(sql, args);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getDep() {
String sql = "select * from dep order by id desc";
String args[] = { "id", "name" };
al = sb.select(sql, args);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getDep(String id) {
String sql = "select * from dep where id=" + id;
String args[] = { "id", "name" };
al = sb.selectRow(args, sql);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getDocument() {
String sql = "select * from document order by id desc";
String args[] = { "id", "admin", "title", "content", "mode", "dep", "dates", "lingdao", "taohong" };
al = sb.select(sql, args);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getDocument(String id) {
String sql = "select * from document where id=" + id;
String args[] = { "id", "admin", "title", "content", "mode", "dep", "dates", "lingdao", "taohong" };
al = sb.selectRow(args, sql);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getDocumentUser(String admin) {
String sql = "select * from document where admin='" + admin + "' order by id desc";
String args[] = { "id", "admin", "title", "content", "mode", "dep", "dates", "lingdao", "taohong" };
al = sb.select(sql, args);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getDocumentDep(String dep) {
String sql = "select * from document where dep='" + dep + "' order by id desc";
String args[] = { "id", "admin", "title", "content", "mode", "dep", "dates", "lingdao", "taohong" };
al = sb.select(sql, args);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getExamine() {
String sql = "select * from examine order by id desc";
String args[] = { "id", "document", "dep", "state" };
al = sb.select(sql, args);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getExamine(String id) {
String sql = "select * from examine where id=" + id;
String args[] = { "id", "document", "dep", "state" };
al = sb.selectRow(args, sql);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getExamineDocument(String document) {
String sql = "select * from examine where document=" + document + " order by id desc";
String args[] = { "id", "document", "dep", "state" };
al = sb.select(sql, args);
System.out.print("--------------" + sql);
;
return al;
}
public ArrayList getExamineDep(String dep) {
String sql = "select * from examine where dep=" + dep + " order by id desc";
String args[] = { "id", "document", "dep", "state" };
al = sb.select(sql, args);
System.out.print("--------------" + sql);
;
return al;
}
}
明日任务如下
学号&姓名 |
任务 |
20191304商苏赫 |
后端设计处理PasswordController.java LeaderController.java |
20191314徐汇仁 |
后端设计处理RemoveController.java DepartmentController.java |
20191323王予涵 |
前端设计systemuser.jsp |
20191325施羿 |
数据库代码处理 SQLConnection.java |
20191330雷清逸 |
前端设计left.jsp |
会议合照
燃尽图