Skip to content

Commit b2bad4f

Browse files
committed
格式化文本,更新ReadMe
1 parent e66e6d4 commit b2bad4f

46 files changed

Lines changed: 1586 additions & 1574 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@
1010

1111
* 编辑器:IntelliJ IDEA
1212

13-
## 二、搭建
13+
## 二、介绍
1414

15-
## 三、介绍
15+
JavaWeb作业,即简单的酒店管理系统。
1616

17-
## 四、
17+
后端Java部分采用MVC形式,前端网页主要借鉴[layui](http://www.layui.com)[win10-ui](http://win10ui.yuri2.cn)
1818

19-
> 待更新..
19+
目前完成:登录;楼层,房间类型,预订单的增删改查。网页前端功能反倒是全部划分完成。
20+
21+
整体写的七七八八,用了不少第三方的jar包,虽然采用了类似Maven的结构,但是本身只是普通的JavaWeb项目。
22+
23+
数据库脚本位于`~/src/sql`目录中,导入mysql后,用IDEA打开重新配置一下JDK与Tomcat不出意外是可以直接使用的。
24+
25+
附:*Tomcat的Deployment中Application context值为/hb*
26+
27+
## 三、####
28+
29+
> 寒假将至,如有可能,将继续完善,待更新..

layui使用笔记.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,18 @@
6464
}
6565
});
6666

67-
## 3.模块名称:layer
67+
## 3.模块名称:layer
68+
69+
## 4.模块名称:form
70+
71+
* js设置radio
72+
73+
74+
$("input[name='addBed'][value='Y']").prop("checked", true); //把 是 给主动选上
75+
form.render('radio'); //重新渲染
76+
77+
* js设置下拉
78+
79+
80+
$("#orderState").val(obj.orderState); //<--需要处理
81+
form.render("select"); //重新渲染select
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.inks.hb.authinfo.controller;
2+
3+
import com.inks.hb.authinfo.pojo.AuthInfo;
4+
import com.inks.hb.authinfo.service.AuthService;
5+
import com.inks.hb.authinfo.service.AuthServiceImpl;
6+
import com.inks.hb.common.ExportExcel;
7+
8+
import javax.servlet.annotation.WebServlet;
9+
import javax.servlet.http.HttpServlet;
10+
import javax.servlet.http.HttpServletRequest;
11+
import javax.servlet.http.HttpServletResponse;
12+
import java.sql.SQLException;
13+
import java.util.ArrayList;
14+
15+
@WebServlet(name = "AuthInfoExcelServlet", value = "/AuthInfoExcelServlet")
16+
public class AuthInfoExcelServlet extends HttpServlet {
17+
protected void doPost(HttpServletRequest request, HttpServletResponse response) {
18+
this.doGet(request, response);
19+
}
20+
21+
protected void doGet(HttpServletRequest request, HttpServletResponse response) {
22+
23+
AuthService service = new AuthServiceImpl();
24+
25+
ArrayList<AuthInfo> infoArrayList = null;
26+
try {
27+
infoArrayList = service.query(1, service.queryAuthInfoNum());
28+
} catch (SQLException e) {
29+
e.printStackTrace();
30+
}
31+
32+
String[] headers = {"权限ID", "权限名称", "可读", "可写", "可改", "可删"};
33+
String fileName = "权限信息";
34+
35+
ExportExcel<AuthInfo> ee = new ExportExcel<>();
36+
ee.exportExcel(headers, infoArrayList, fileName, response);
37+
}
38+
}

src/main/java/com/inks/hb/authinfo/controller/AuthInfoServlet.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
@WebServlet(value = "/AuthInfoServlet", name = "AuthInfoServlet")
2828
public class AuthInfoServlet extends HttpServlet {
29-
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
29+
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
3030
this.doGet(request, response);
3131
}
3232

@@ -50,12 +50,12 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
5050
ArrayList<AuthInfo> list = new ArrayList<>(); //数据内容
5151

5252
//单个全局属性
53-
int authId; //权限ID
54-
String authItem = ""; //权限名称
55-
String isRead; //可读
56-
String isWrite; //可写
57-
String isChange; //可改
58-
String isDelete; //可删
53+
int authId; //权限ID
54+
String authItem = ""; //权限名称
55+
String isRead; //可读
56+
String isWrite; //可写
57+
String isChange; //可改
58+
String isDelete; //可删
5959
AuthInfo authInfo = null;
6060

6161
try {

src/main/java/com/inks/hb/authinfo/dao/AuthInfoDao.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public ArrayList<AuthInfo> query(int start, int length) throws SQLException {
8989

9090
String sql = "select * from authInfo limit ?, ?;";
9191
PreparedStatement pstmt = conn.prepareStatement(sql);
92-
pstmt.setInt(1, start - 1); //减一,详见声明部分
92+
pstmt.setInt(1, start - 1);
9393
pstmt.setInt(2, length);
9494
ResultSet rs = pstmt.executeQuery();
9595

src/main/java/com/inks/hb/authinfo/pojo/AuthInfo.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33

44
/**
55
* AuthInfo对象对应数据库中的authInfo表,主键为authID。
6-
* -------------
7-
* 提供了3个构造器,分别为:
8-
* 1. 无参构造器
9-
* 2. 不含权限ID的构造器
10-
* 3. 全构造器
11-
* -------------
12-
* 提供正常的get、set方法;
13-
* -------------
14-
* 提供重载后的toString()方法;
156
*/
167
public class AuthInfo {
178

@@ -27,40 +18,10 @@ public class AuthInfo {
2718

2819
private String isDelete; //可删
2920

30-
/**
31-
* 无参构造器
32-
*
33-
*/
3421
public AuthInfo() {
3522
super();
3623
}
3724

38-
/**
39-
* 不含ID的构造器
40-
*
41-
* @param authItem 权限名称
42-
* @param isRead 可读
43-
* @param isWrite 可写
44-
* @param isChange 可改
45-
* @param isDelete 可删
46-
*/
47-
public AuthInfo(String authItem, String isRead, String isWrite, String isChange, String isDelete) {
48-
this.authItem = authItem;
49-
this.isRead = isRead;
50-
this.isWrite = isWrite;
51-
this.isChange = isChange;
52-
this.isDelete = isDelete;
53-
}
54-
55-
/**
56-
* 全构造器
57-
* @param authId 权限ID
58-
* @param authItem 权限名称
59-
* @param isRead 可读
60-
* @param isWrite 可写
61-
* @param isChange 可改
62-
* @param isDelete 可删
63-
*/
6425
public AuthInfo(int authId, String authItem, String isRead, String isWrite, String isChange, String isDelete) {
6526
this.authId = authId;
6627
this.authItem = authItem;

src/main/java/com/inks/hb/common/CommonFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* 过滤器,拦截所有请求。
1212
* 仅当session中包含登录成功后的登录名后才放行请求
1313
*/
14-
@WebFilter(value = "/*",filterName = "CommonFilter") //拦截所有请求
14+
@WebFilter(value = "/*", filterName = "CommonFilter") //拦截所有请求
1515
public class CommonFilter implements Filter {
1616
public void destroy() {
1717
}
@@ -60,7 +60,7 @@ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain
6060
DBUtil.close();
6161
}
6262

63-
public void init(FilterConfig config) {
63+
public void init(FilterConfig config) {
6464

6565
}
6666

src/main/java/com/inks/hb/common/ExitSystemServlet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
import javax.servlet.annotation.WebServlet;
44
import javax.servlet.http.*;
5+
56
/**
67
* 作用 退出系统时 清除session
7-
*
88
*/
99
@WebServlet(value = "/ExitSystemServlet", name = "ExitSystemServlet")
1010
public class ExitSystemServlet extends HttpServlet {
11-
protected void doPost(HttpServletRequest request, HttpServletResponse response) {
11+
protected void doPost(HttpServletRequest request, HttpServletResponse response) {
1212
this.doGet(request, response);
1313
}
1414

15-
protected void doGet(HttpServletRequest request, HttpServletResponse response) {
15+
protected void doGet(HttpServletRequest request, HttpServletResponse response) {
1616

1717
HttpSession session = request.getSession();
1818

src/main/java/com/inks/hb/common/ExportExcel.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public void exportExcel(String[] headers, Collection<T> dataset, String fileName
6868

6969
/**
7070
* 方法说明: 指定路径下生成EXCEL文件
71-
*
7271
*/
7372
public void getExportedFile(XSSFWorkbook workbook, String name, HttpServletResponse response) throws Exception {
7473
BufferedOutputStream fos = null;

src/main/java/com/inks/hb/common/PojotoGson.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
/**
66
* 抽象出一个统一的toJson类
77
* 最主要用途是包装ArrayList的各个pojo对象
8-
*
98
*/
109
public class PojotoGson {
1110

0 commit comments

Comments
 (0)