停车场管理系统源代码-作为小组

main
zhangas2 6 months ago
parent fce85cc0bb
commit fa9d113cc1

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

@ -0,0 +1,74 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.aliyun.api.gateway</groupId>
<artifactId>ParkingLotManagementSystem</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>ParkingLotManagementSystem Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<junit.version>5.9.2</junit.version>
</properties>
<repositories>
<repository>
<id>Central Repository</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.26</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<!-- httpcore -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.5</version>
</dependency>
</dependencies>
<build>
<finalName>ParkingLotManagementSystem</finalName>
</build>
</project>

@ -0,0 +1,26 @@
package JDBC;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class AccountJDBC {
public AccountJDBC() {
super();
}
public Connection getConnection() throws Exception {
Class.forName("com.mysql.cj.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/parkinglot", "root", "root");
}
public void templateMethod() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("");
conn.close();
}
}

@ -0,0 +1,51 @@
package JDBC;
import pojo.IcCard;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class IcCardJDBC {
public IcCardJDBC() {
super();
}
public Connection getConnection() throws Exception {
Class.forName("com.mysql.cj.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/parkinglot", "root", "root");
}
public void templateMethod() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("");
conn.close();
}
public IcCard get_IcCardById(int id) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT *\n" +
"FROM icinformation\n" +
"WHERE user_id = ?;"
);
ps.setInt(1, id);
ResultSet rs = ps.executeQuery();
IcCard pr = null;
if(rs.next()) {
pr = new IcCard(
rs.getInt("user_id"),
rs.getString("card_number"),
rs.getString("password"),
rs.getDouble("balance")
);
}
conn.close();
return pr;
}
}

@ -0,0 +1,292 @@
package JDBC;
import pojo.ParkingRecord;
import pojo.Vehicle;
import java.sql.*;
import java.util.*;
import java.util.Date;
public class ParkingRecordJDBC {
public ParkingRecordJDBC() {
super();
}
public Connection getConnection() throws Exception {
Class.forName("com.mysql.cj.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/parkinglot", "root", "root");
}
public ParkingRecord selectLatestRecord(String car_lincense) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT *\n" +
"FROM parking_record_view\n" +
"WHERE car_license = ?\n" +
"ORDER BY start_time DESC\n" +
"LIMIT 1;");
ps.setString(1, car_lincense);
ResultSet rs = ps.executeQuery();
ParkingRecord pr = null;
if(rs.next()) {
pr = new ParkingRecord(
rs.getInt("record_id"),
rs.getInt("parking_spot_id"),
rs.getTimestamp("start_time"),
rs.getTimestamp("end_time"),
rs.getDouble("parking_fee"),
rs.getString("car_license"),
rs.getString("location")
);
}
conn.close();
return pr;
}
public void setEndTime(int record_id, Timestamp end_time) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("UPDATE parkingrecord\n" +
"SET end_time = ?\n" +
"WHERE record_id = ?;");
ps.setTimestamp(1, end_time);
ps.setInt(2, record_id);
ps.executeUpdate();
}
public void insertNewRecord(ParkingRecord newRecord) throws Exception {
Connection conn = this.getConnection();
String car_license = newRecord.getCar_license();
PreparedStatement ps = conn.prepareStatement("select *\n" +
"FROM (\n" +
" SELECT *\n" +
" FROM vehicleinformation\n" +
" WHERE car_license = ?\n" +
") vi\n" +
"INNER JOIN userinformation ui ON vi.user_id = ui.user_id\n" +
"INNER JOIN parkingspotinformation psi ON ui.parking_spot_id = psi.parking_spot_id;");
ps.setString(1, car_license);
ResultSet rs = ps.executeQuery();
rs.next();
PreparedStatement ps1 = conn.prepareStatement("INSERT INTO parkingrecord (parking_spot_id, start_time, car_license)\n" +
"VALUES (?, ?, ?);");
ps1.setInt(1, rs.getInt("parking_spot_id"));
ps1.setTimestamp(2, newRecord.getStart_time());
ps1.setString(3, car_license);
ps1.executeUpdate();
conn.close();
}
public List<ParkingRecord> selectAllRecords() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT * FROM parking_record_view ORDER BY start_time DESC");
ResultSet rs = ps.executeQuery();
List<ParkingRecord> prs = new ArrayList<>();
while(rs.next()) {
ParkingRecord pr = new ParkingRecord(
rs.getInt("record_id"),
rs.getInt("parking_spot_id"),
rs.getTimestamp("start_time"),
rs.getTimestamp("end_time"),
rs.getDouble("parking_fee"),
rs.getString("car_license"),
rs.getString("location")
);
prs.add(pr);
}
conn.close();
return prs;
}
public List<ParkingRecord> selectRecordsByCase(String car_license, String location, Timestamp startTime, Timestamp endTime) throws Exception {
Connection conn = this.getConnection();
String sql = "SELECT * FROM parking_record_view";
StringBuilder whereClause = new StringBuilder(" WHERE ");
if (car_license != null && !car_license.isEmpty()) {
whereClause.append("car_license = '").append(car_license).append("' AND ");
}
if (location != null && !location.isEmpty()) {
whereClause.append("location = '").append(location).append("' AND ");
}
// 添加时间范围条件
if (startTime != null && endTime != null) {
whereClause.append("start_time >= ? AND end_time <= ? AND ");
}
if (whereClause.toString().contains(" AND ")) {
whereClause.delete(whereClause.lastIndexOf(" AND "), whereClause.length());
}
if (!" WHERE ".equals(whereClause.toString())) {
sql += whereClause.toString();
}
sql += " ORDER BY start_time DESC";
PreparedStatement ps = conn.prepareStatement(sql);
// 设置时间范围参数
int parameterIndex = 1;
if (startTime != null && endTime != null) {
ps.setTimestamp(parameterIndex++, startTime);
ps.setTimestamp(parameterIndex, endTime);
}
ResultSet rs = ps.executeQuery();
List<ParkingRecord> prs = new ArrayList<>();
while (rs.next()) {
ParkingRecord pr = new ParkingRecord(
rs.getInt("record_id"),
rs.getInt("parking_spot_id"),
rs.getTimestamp("start_time"),
rs.getTimestamp("end_time"),
rs.getDouble("parking_fee"),
rs.getString("car_license"),
rs.getString("location")
);
prs.add(pr);
}
conn.close();
return prs;
}
public Map<String, Double> selectTopCost() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT user_name, total_parking_fees\n" +
"FROM userparkingtotalfees\n" +
"ORDER BY total_parking_fees DESC\n" +
"LIMIT 5;");
ResultSet rs = ps.executeQuery();
Map<String, Double> userParkingInfo = new LinkedHashMap<>();
while (rs.next()) {
String userName = rs.getString("user_name");
double totalParkingFees = rs.getDouble("total_parking_fees");
userParkingInfo.put(userName, totalParkingFees);
}
conn.close();
return userParkingInfo;
}
public Map<Date, Double> selectMonthIncome() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT DATE(start_time) AS date, SUM(parking_fee) AS total_income\n" +
"FROM parkingrecord\n" +
"WHERE start_time >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)\n" +
"GROUP BY DATE(start_time)\n" +
"ORDER BY DATE(start_time);");
ResultSet rs = ps.executeQuery();
Map<Date, Double> monthIncome = new LinkedHashMap<>();
while(rs.next()) {
Date date = rs.getDate("date");
Double income = rs.getDouble("total_income");
monthIncome.put(date, income);
}
conn.close();
return monthIncome;
}
public List<ParkingRecord> GetAllRecordbySpot_Id(int spot_id) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT *\n" +
"FROM parkingrecord\n" +
"WHERE parking_spot_id = ?\n" +
"ORDER BY start_time DESC;"
);
ps.setInt(1, spot_id);
ResultSet rs = ps.executeQuery();
ParkingRecord pr = null;
List<ParkingRecord> list=new ArrayList<ParkingRecord>();
while(rs.next()) {
pr = new ParkingRecord(
rs.getInt("record_id"),
rs.getInt("parking_spot_id"),
rs.getTimestamp("start_time"),
rs.getTimestamp("end_time"),
rs.getDouble("parking_fee"),
rs.getString("car_license")
);
list.add(pr);
}
conn.close();
return list;
}
public int selectUserSum() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("select COUNT(*) from parkingspotinformation");
ResultSet rs = ps.executeQuery();
int peopleSum = 0;
if(rs.next()) {
peopleSum = rs.getInt(1);
}
conn.close();
return peopleSum;
}
public int selectBusyNum() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT COUNT(*)\n" +
"FROM parkingspotinformation psi\n" +
"WHERE NOT EXISTS (\n" +
" SELECT *\n" +
" FROM parkingrecord pr\n" +
" WHERE pr.parking_spot_id = psi.parking_spot_id\n" +
" AND TIME(pr.start_time) BETWEEN '18:00:00' AND '21:00:00'\n" +
");");
ResultSet rs = ps.executeQuery();
int peopleBusy = 0;
if(rs.next()) {
peopleBusy = rs.getInt(1);
}
conn.close();
return peopleBusy;
}
public Map<Integer, Double> selectHourMins() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT\n" +
" HOUR(pr.start_time) as Hour,\n" +
" AVG(TIMESTAMPDIFF(MINUTE, pr.start_time, pr.end_time)) as AverageParkingMinutes\n" +
"FROM\n" +
" parkingrecord pr\n" +
"WHERE\n" +
" YEARWEEK(pr.start_time, 1) = YEARWEEK(CURDATE(), 1)\n" +
"GROUP BY\n" +
" Hour\n" +
"ORDER BY\n" +
" Hour;");
Map<Integer, Double> hourMins = new LinkedHashMap<>();
ResultSet rs = ps.executeQuery();
while(rs.next()) {
Integer hour = rs.getInt("Hour");
Double apm = rs.getDouble("AverageParkingMinutes");
hourMins.put(hour, apm);
}
conn.close();
return hourMins;
}
public Map<String, Double> selectLocationMins() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT\n" +
" location AS parking_location,\n" +
" AVG(TIMESTAMPDIFF(MINUTE, start_time, end_time)) AS avg_usage_time_this_week\n" +
"FROM\n" +
" parking_record_view\n" +
"WHERE\n" +
" YEARWEEK(start_time, 1) = YEARWEEK(CURDATE(), 1)\n" +
"GROUP BY\n" +
" location\n" +
"ORDER BY\n" +
" location;");
ResultSet rs = ps.executeQuery();
Map<String, Double> locationMins = new LinkedHashMap<>();
while(rs.next()) {
String location = rs.getString(1);
Double min = rs.getDouble(2);
locationMins.put(location, min);
}
conn.close();
return locationMins;
}
}

@ -0,0 +1,84 @@
package JDBC;
import pojo.ParkingRecord;
import pojo.ParkingSpot;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
public class ParkingSpotJDBC {
public ParkingSpotJDBC() {
super();
}
public Connection getConnection() throws Exception {
Class.forName("com.mysql.cj.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/parkinglot", "root", "root");
}
public void setSpotStatus(int spot_id) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("UPDATE parkingspotinformation " +
"SET occupancy_status=1 " +
"WHERE parking_spot_id=?");
ps.setInt(1, spot_id);
ps.executeUpdate();
conn.close();
}
public void resetSpotStatus(int spot_id) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("UPDATE parkingspotinformation " +
"SET occupancy_status=0 " +
"WHERE parking_spot_id=?");
ps.setInt(1, spot_id);
ps.executeUpdate();
conn.close();
}
public List<ParkingSpot> selectAllSpots() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT * FROM parkingspotinformation");
List<ParkingSpot> spots = new ArrayList<>();
ResultSet rs = ps.executeQuery();
while(rs.next()) {
ParkingSpot spot = new ParkingSpot(
rs.getInt("parking_spot_id"),
rs.getString("spot_type"),
rs.getInt("occupancy_status"),
rs.getString("location"),
rs.getDouble("fee_standard")
);
spots.add(spot);
}
conn.close();
return spots;
}
public ParkingSpot getSpot(int spot_id) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT *\n" +
"FROM parkingspotinformation\n" +
"WHERE parking_spot_id = ?\n"
);
ps.setInt(1, spot_id);
ResultSet rs = ps.executeQuery();
ParkingSpot pr = null;
while(rs.next()) {
pr = new ParkingSpot(
rs.getInt("parking_spot_id"),
rs.getString("spot_type"),
rs.getByte("occupancy_status"),
rs.getString("location"),
rs.getDouble("fee_standard")
);
}
conn.close();
return pr;
}
}

@ -0,0 +1,380 @@
package JDBC;
import pojo.IcCard;
import pojo.ParkingSpot;
import pojo.User;
import pojo.Vehicle;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UserJDBC {
public UserJDBC() {
super();
}
public Connection getConnection() throws Exception {
Class.forName("com.mysql.cj.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/parkinglot", "root", "root");
// return DriverManager.getConnection("jdbc:mysql://121.199.5.54:3306/parkinglot", "root", "anhengyu1");
}
public void templateMethod() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("");
conn.close();
}
public List<User> selectAllUser() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT *\n" +
"FROM userinformation");
ResultSet rs = ps.executeQuery();
List<User> userList = new ArrayList<>();
while(rs.next()) {
User u = new User(
rs.getInt("user_id"),
rs.getString("name"),
rs.getString("telephone"),
rs.getString("user_type"),
rs.getInt("parking_spot_id"),
rs.getString("address"),
rs.getString("gender")
);
userList.add(u);
}
conn.close();
return userList;
}
public List<User> selectUserByNPA(String name, int parking_spot_id, String address) throws Exception {
Connection conn = this.getConnection();
String sql = "SELECT * FROM userinformation";
StringBuilder whereClause = new StringBuilder(" WHERE ");
if (name != null && !name.isEmpty()) {
whereClause.append("name LIKE '%").append(name).append("%' AND ");
}
if (parking_spot_id!=0 && !String.valueOf(parking_spot_id).isEmpty()) {
whereClause.append("parking_spot_id = '").append(parking_spot_id).append("' AND ");
}
if (address != null && !address.isEmpty()) {
whereClause.append("address = '").append(address).append("' AND ");;
}
if (whereClause.toString().contains(" AND ")) {
whereClause.delete(whereClause.lastIndexOf(" AND "), whereClause.length());
}
if(!" WHERE ".equals(whereClause.toString())) {
sql += whereClause.toString();
}
System.out.println("sql:"+ sql);
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
List<User> userList = new ArrayList<>();
while(rs.next()) {
User u = new User(
rs.getInt("user_id"),
rs.getString("name"),
rs.getString("telephone"),
rs.getString("user_type"),
rs.getInt("parking_spot_id"),
rs.getString("address"),
rs.getString("gender")
);
userList.add(u);
}
conn.close();
return userList;
}
public List<User> SortUserByUserId() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT * FROM userinformation ORDER BY user_id");
ResultSet rs = ps.executeQuery();
List<User> userList = new ArrayList<>();
while(rs.next()) {
User u = new User(
rs.getInt("user_id"),
rs.getString("name"),
rs.getString("telephone"),
rs.getString("user_type"),
rs.getInt("parking_spot_id"),
rs.getString("address"),
rs.getString("gender")
);
userList.add(u);
}
conn.close();
return userList;
}
public List<User> SortUserByParkId() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT * FROM userinformation ORDER BY parking_spot_id");
ResultSet rs = ps.executeQuery();
List<User> userList = new ArrayList<>();
while(rs.next()) {
User u = new User(
rs.getInt("user_id"),
rs.getString("name"),
rs.getString("telephone"),
rs.getString("user_type"),
rs.getInt("parking_spot_id"),
rs.getString("address"),
rs.getString("gender")
);
userList.add(u);
}
conn.close();
return userList;
}
public List<User> SortUserByName() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT * FROM userinformation ORDER BY name");
ResultSet rs = ps.executeQuery();
List<User> userList = new ArrayList<>();
while(rs.next()) {
User u = new User(
rs.getInt("user_id"),
rs.getString("name"),
rs.getString("telephone"),
rs.getString("user_type"),
rs.getInt("parking_spot_id"),
rs.getString("address"),
rs.getString("gender")
);
userList.add(u);
}
conn.close();
return userList;
}
public Map<String, Integer> CntUserByTotalUser() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT COUNT(*) AS total_users FROM userinformation");
ResultSet rs = ps.executeQuery();
Map<String, Integer> totalUserMap = new HashMap<>();
if (rs.next()) {
int totalUsers = rs.getInt("total_users");
totalUserMap.put("total_users", totalUsers);
}
conn.close();
return totalUserMap;
}
public Map<String, Integer> CntUserByGender() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT gender, COUNT(*) AS gender_count FROM userinformation GROUP BY gender");
ResultSet rs = ps.executeQuery();
Map<String, Integer> genderCountMap = new HashMap<>();
while (rs.next()) {
String gender = rs.getString("gender");
int count = rs.getInt("gender_count");
genderCountMap.put(gender, count);
}
conn.close();
return genderCountMap;
}
public Map<String, Integer> CntUserByUserType() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT user_type, COUNT(*) AS user_count FROM userinformation GROUP BY user_type");
ResultSet rs = ps.executeQuery();
Map<String, Integer> userTypeCountMap = new HashMap<>();
while (rs.next()) {
String userType = rs.getString("user_type");
int count = rs.getInt("user_count");
userTypeCountMap.put(userType, count);
}
conn.close();
return userTypeCountMap;
}
public List<Vehicle> selectCarByUserId(int user_id) throws Exception {
Connection conn = this.getConnection();
String query = "SELECT v.car_license, v.user_id, v.brand, v.model " +
"FROM vehicleinformation v " +
"JOIN userinformation u ON v.user_id = u.user_id " +
"WHERE u.user_id = ? " +
"ORDER BY v.car_license";
PreparedStatement ps = conn.prepareStatement(query);
ps.setInt(1, user_id);
ResultSet rs = ps.executeQuery();
List<Vehicle> carlist = new ArrayList<>();
while (rs.next()) {
Vehicle car = new Vehicle(
rs.getString("car_license"),
rs.getInt("user_id"),
rs.getString("brand"),
rs.getString("model")
);
carlist.add(car);
}
conn.close();
return carlist;
}
public List<ParkingSpot> selectParkByParkId(int parkingSpotId) throws Exception {
Connection conn = this.getConnection();
String query = "SELECT p.parking_spot_id, p.spot_type, p.occupancy_status, p.location, p.fee_standard " +
"FROM userinformation u " +
"LEFT JOIN parkingspotinformation p ON u.parking_spot_id = p.parking_spot_id " +
"WHERE p.parking_spot_id = ?";
PreparedStatement ps = conn.prepareStatement(query);
ps.setInt(1,parkingSpotId);
ResultSet rs = ps.executeQuery();
List<ParkingSpot> parkingSpotList = new ArrayList<>();
while (rs.next()) {
ParkingSpot parkingSpot = new ParkingSpot(
rs.getInt("parking_spot_id"),
rs.getString("spot_type"),
rs.getByte("occupancy_status"),
rs.getString("location"),
rs.getDouble("fee_standard")
);
parkingSpotList.add(parkingSpot);
}
conn.close();
return parkingSpotList;
}
public List<IcCard> selectICByUserId(int userId) throws Exception {
Connection conn = this.getConnection();
String query = "SELECT i.user_id, i.card_number, i.password, i.balance " +
"FROM userinformation u " +
"INNER JOIN icinformation i ON u.user_id = i.user_id " +
"WHERE u.user_id = ?";
PreparedStatement ps = conn.prepareStatement(query);
ps.setInt(1, userId);
ResultSet rs = ps.executeQuery();
List<IcCard> icCardList = new ArrayList<>();
while (rs.next()) {
IcCard icCard = new IcCard(
rs.getInt("user_id"),
rs.getString("card_number"),
rs.getString("password"),
rs.getDouble("balance")
);
icCardList.add(icCard);
}
conn.close();
return icCardList;
}
public List<User> updateUser(int userId, String name, String telephone, String userType, int parkingSpotId, String address, String gender) throws Exception {
Connection conn = this.getConnection();
String query = "UPDATE userinformation " +
"SET name = ?, telephone = ?, user_type = ?, parking_spot_id = ?, address = ?, gender = ? " +
"WHERE user_id = ?";
PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, name);
ps.setString(2, telephone);
ps.setString(3, userType);
ps.setInt(4, parkingSpotId);
ps.setString(5, address);
ps.setString(6, gender);
ps.setInt(7, userId);
int updatedRows = ps.executeUpdate();
conn.close();
// 查询并返回更新后的用户信息列表
if (updatedRows > 0) {
return selectAllUser();
} else {
return new ArrayList<>(); // 如果更新失败,返回空列表
}
}
public List<User> deleteUserById(int userId) throws Exception {
Connection conn = this.getConnection();
String[] tables = {"icinformation", "userinformation", "vehicleinformation"};
for (String table : tables) {
String query = "DELETE FROM " + table + " WHERE ";
switch (table) {
case "icinformation":
query += "user_id = ?";
break;
case "userinformation":
query += "user_id = ?";
break;
case "vehicleinformation":
query += "user_id = ?";
break;
default:
break;
}
PreparedStatement ps = conn.prepareStatement(query);
ps.setInt(1, userId);
ps.executeUpdate();
}
conn.close();
return selectAllUser();
}
public User getUserById(int id) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT *\n" +
"FROM userinformation\n" +
"WHERE user_id = ?\n"
);
ps.setInt(1, id);
ResultSet rs = ps.executeQuery();
User pr = null;
if(rs.next()) {
pr = new User(
rs.getInt("user_id"),
rs.getString("name"),
rs.getString("telephone"),
rs.getString("user_type"),
rs.getInt("parking_spot_id"),
rs.getString("address"),
rs.getString("gender")
);
}
conn.close();
return pr;
}
public int update_user_Info(User user) throws Exception {
Connection conn = this.getConnection();
PreparedStatement pstmt = null;
String sql = "UPDATE userinformation SET name=?,gender=?, telephone=?, address=?WHERE user_id=?";
pstmt = conn.prepareStatement(sql);
// 设置参数
pstmt.setString(1, user.getName());
pstmt.setString(2, user.getGender());
pstmt.setString(3, user.getTelephone());
pstmt.setString(4, user.getAddress());
pstmt.setInt(5, user.getUser_id());
int count = pstmt.executeUpdate();
conn.close();
return count;
}
}

@ -0,0 +1,112 @@
package JDBC;
import pojo.Vehicle;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
public class VehicleJDBC {
public VehicleJDBC() {
super();
}
public Connection getConnection() throws Exception {
Class.forName("com.mysql.cj.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/parkinglot", "root", "root");
}
public List<Vehicle> selectAllVehicles() throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT *\n" +
"FROM vehicleuserview");
ResultSet rs = ps.executeQuery();
List<Vehicle> vehicles = new ArrayList<>();
while(rs.next()) {
Vehicle vehicle = new Vehicle(
rs.getString("car_license"),
rs.getString("name"),
rs.getString("brand"),
rs.getString("model"),
rs.getString("telephone"),
rs.getString("address")
);
vehicles.add(vehicle);
}
conn.close();
return vehicles;
}
public List<Vehicle> selectVehiclesByCase(String car_license, String brand, String model, String building) throws Exception {
Connection conn = this.getConnection();
String sql = "SELECT * FROM vehicleuserview";
StringBuilder whereClause = new StringBuilder(" WHERE ");
if (car_license != null && !car_license.isEmpty()) {
whereClause.append("car_license LIKE '%").append(car_license).append("%' AND ");
}
if (brand != null && !brand.isEmpty()) {
whereClause.append("brand = '").append(brand).append("' AND ");
}
if (model != null && !model.isEmpty()) {
whereClause.append("model = '").append(model).append("' AND ");
}
// 添加楼号模糊匹配
if (building != null && !building.isEmpty()) {
whereClause.append("address LIKE '").append(building).append("号楼%' AND ");
}
if (whereClause.toString().endsWith(" AND ")) {
whereClause.delete(whereClause.lastIndexOf(" AND "), whereClause.length());
}
if (!" WHERE ".equals(whereClause.toString())) {
sql += whereClause.toString();
}
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
List<Vehicle> vehicles = new ArrayList<>();
while (rs.next()) {
Vehicle vehicle = new Vehicle(
rs.getString("car_license"),
rs.getString("name"),
rs.getString("brand"),
rs.getString("model"),
rs.getString("telephone"),
rs.getString("address")
);
vehicles.add(vehicle);
}
conn.close();
return vehicles;
}
public Vehicle get_car_ById(int id) throws Exception {
Connection conn = this.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT *\n" +
"FROM vehicleinformation\n" +
"WHERE user_id = ?\n"
);
ps.setInt(1, id);
ResultSet rs = ps.executeQuery();
Vehicle pr = null;
while(rs.next()) {
pr = new Vehicle(
rs.getString("car_license"),
rs.getInt("user_id"),
rs.getString("brand"),
rs.getString("model")
);
}
conn.close();
return pr;
}
}

@ -0,0 +1,319 @@
package com.aliyun.api.gateway.demo.util;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
public class HttpUtils {
/**
* get
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @return
* @throws Exception
*/
public static HttpResponse doGet(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpGet request = new HttpGet(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
return httpClient.execute(request);
}
/**
* post form
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param bodys
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
Map<String, String> bodys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (bodys != null) {
List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
for (String key : bodys.keySet()) {
nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
}
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
request.setEntity(formEntity);
}
return httpClient.execute(request);
}
/**
* Post String
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
String body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (StringUtils.isNotBlank(body)) {
request.setEntity(new StringEntity(body, "utf-8"));
}
return httpClient.execute(request);
}
/**
* Post stream
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
byte[] body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (body != null) {
request.setEntity(new ByteArrayEntity(body));
}
return httpClient.execute(request);
}
/**
* Put String
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPut(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
String body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPut request = new HttpPut(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (StringUtils.isNotBlank(body)) {
request.setEntity(new StringEntity(body, "utf-8"));
}
return httpClient.execute(request);
}
/**
* Put stream
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPut(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
byte[] body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPut request = new HttpPut(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (body != null) {
request.setEntity(new ByteArrayEntity(body));
}
return httpClient.execute(request);
}
/**
* Delete
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @return
* @throws Exception
*/
public static HttpResponse doDelete(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
return httpClient.execute(request);
}
private static String buildUrl(String host, String path, Map<String, String> querys) throws
UnsupportedEncodingException {
StringBuilder sbUrl = new StringBuilder();
sbUrl.append(host);
if (!StringUtils.isBlank(path)) {
sbUrl.append(path);
}
if (null != querys) {
StringBuilder sbQuery = new StringBuilder();
for (Map.Entry<String, String> query : querys.entrySet()) {
if (0 < sbQuery.length()) {
sbQuery.append("&");
}
if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
sbQuery.append(query.getValue());
}
if (!StringUtils.isBlank(query.getKey())) {
sbQuery.append(query.getKey());
if (!StringUtils.isBlank(query.getValue())) {
sbQuery.append("=");
sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
}
}
}
if (0 < sbQuery.length()) {
sbUrl.append("?").append(sbQuery);
}
}
return sbUrl.toString();
}
private static HttpClient wrapClient(String host) {
HttpClient httpClient = new DefaultHttpClient();
if (host.startsWith("https://")) {
sslClient(httpClient);
}
return httpClient;
}
private static void sslClient(HttpClient httpClient) {
try {
SSLContext ctx = SSLContext.getInstance("TLS");
X509TrustManager tm = new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] xcs, String str) {
}
public void checkServerTrusted(X509Certificate[] xcs, String str) {
}
};
ctx.init(null, new TrustManager[]{tm}, null);
SSLSocketFactory ssf = new SSLSocketFactory(ctx);
ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
ClientConnectionManager ccm = httpClient.getConnectionManager();
SchemeRegistry registry = ccm.getSchemeRegistry();
registry.register(new Scheme("https", 443, ssf));
} catch (KeyManagementException ex) {
throw new RuntimeException(ex);
} catch (NoSuchAlgorithmException ex) {
throw new RuntimeException(ex);
}
}
}

@ -0,0 +1,14 @@
package pojo;
public class Account {
int account_id;
int user_id;
String account_type;
String account_status;
String name;
String password;
}

@ -0,0 +1,36 @@
package pojo;
public class IcCard {
int user_id;
String card_number;
String password;
double balance;
public IcCard(int user_id,String card_number,String password,double balance){
this.user_id=user_id;
this.card_number=card_number;
this.password=password;
this.balance=balance;
}
public int getUser_id() {
return user_id;
}
public String getPassword() {
return password;
}
public double getBalance() {
return balance;
}
public String getCard_number() {
return card_number;
}
}

@ -0,0 +1,105 @@
package pojo;
import java.sql.Time;
import java.sql.Timestamp;
public class ParkingRecord {
int record_id;
int spot_id;
Timestamp start_time;
Timestamp end_time;
double parking_fee;
String car_license;
String location;
public ParkingRecord(int record_id, int spot_id, Timestamp start_time, Timestamp end_time, double parking_fee, String car_license) {
this.record_id = record_id;
this.spot_id = spot_id;
this.start_time = start_time;
this.end_time = end_time;
this.parking_fee = parking_fee;
this.car_license = car_license;
}
public ParkingRecord(int record_id, int spot_id, Timestamp start_time, Timestamp end_time, double parking_fee, String car_license, String location) {
this.record_id = record_id;
this.spot_id = spot_id;
this.start_time = start_time;
this.end_time = end_time;
this.parking_fee = parking_fee;
this.car_license = car_license;
this.location = location;
}
public ParkingRecord(int record_id, int spot_id, Timestamp start_time, double parking_fee, String car_license) {
this.record_id = record_id;
this.spot_id = spot_id;
this.start_time = start_time;
this.parking_fee = parking_fee;
this.car_license = car_license;
}
public ParkingRecord(Timestamp start_time, String car_license) {
this.start_time = start_time;
this.car_license = car_license;
}
public int getRecord_id() {
return record_id;
}
public void setRecord_id(int record_id) {
this.record_id = record_id;
}
public int getSpot_id() {
return spot_id;
}
public void setSpot_id(int spot_id) {
this.spot_id = spot_id;
}
public Timestamp getStart_time() {
return start_time;
}
public void setStart_time(Timestamp start_time) {
this.start_time = start_time;
}
public Timestamp getEnd_time() {
return end_time;
}
public void setEnd_time(Timestamp end_time) {
this.end_time = end_time;
}
public double getParking_fee() {
return parking_fee;
}
public void setParking_fee(double parking_fee) {
this.parking_fee = parking_fee;
}
public String getCar_license() {
return car_license;
}
public void setCar_license(String car_license) {
this.car_license = car_license;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
}

@ -0,0 +1,60 @@
package pojo;
public class ParkingSpot {
int spot_id;
String spot_type;
int occupancy_status;
String location;
double fee_standard;
public ParkingSpot(int spot_id, String spot_type, int occupancy_status, String location, double fee_standard) {
this.spot_id = spot_id;
this.spot_type = spot_type;
this.occupancy_status = occupancy_status;
this.location = location;
this.fee_standard = fee_standard;
}
public int getSpot_id() {
return spot_id;
}
public void setSpot_id(int spot_id) {
this.spot_id = spot_id;
}
public String getSpot_type() {
return spot_type;
}
public void setSpot_type(String spot_type) {
this.spot_type = spot_type;
}
public int getOccupancy_status() {
return occupancy_status;
}
public void setOccupancy_status(int occupancy_status) {
this.occupancy_status = occupancy_status;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public double getFee_standard() {
return fee_standard;
}
public void setFee_standard(double fee_standard) {
this.fee_standard = fee_standard;
}
}

@ -0,0 +1,79 @@
package pojo;
public class User {
int user_id;
String name;
String telephone;
String user_type;
int spot_id;
String address;
String gender;
public User(int user_id,String name,String telephone,String user_type,int spot_id,String address,String gender){
this.user_id=user_id;
this.name=name;
this.telephone=telephone;
this.user_type=user_type;
this.spot_id=spot_id;
this.address=address;
this.gender=gender;
}
public int getUser_id() {
return user_id;
}
public void setUser_id(int user_id) {
this.user_id = user_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getUser_type() {
return user_type;
}
public void setUser_type(String user_type) {
this.user_type = user_type;
}
public int getSpot_id() {
return spot_id;
}
public void setSpot_id(int spot_id) {
this.spot_id = spot_id;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
}

@ -0,0 +1,86 @@
package pojo;
public class Vehicle {
String car_license;
String username;
String brand;
String model;
int user_id;
String telephone;
String address;
public Vehicle(String car_license,int user_id, String brand, String model) {
this.car_license = car_license;
this.brand = brand;
this.model = model;
this.user_id = user_id;
}
public int getUser_id() {
return user_id;
}
public void setUser_id(int user_id) {
this.user_id = user_id;
}
public Vehicle(String car_license, String username, String brand, String model, String telephone, String address) {
this.car_license = car_license;
this.username = username;
this.brand = brand;
this.model = model;
this.telephone = telephone;
this.address = address;
}
public String getCar_license() {
return car_license;
}
public void setCar_license(String car_license) {
this.car_license = car_license;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}

@ -0,0 +1,14 @@
package service;
import JDBC.IcCardJDBC;
import pojo.IcCard;
public class IcCardService {
IcCardJDBC db = new IcCardJDBC();
public IcCard get_IcCardById(int id) throws Exception {
return db.get_IcCardById(id);
}
}

@ -0,0 +1,63 @@
package service;
import JDBC.ParkingRecordJDBC;
import pojo.ParkingRecord;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class ParkingRecordService {
ParkingRecordJDBC db = new ParkingRecordJDBC();
public ParkingRecord getLatestRecord(String car_license) throws Exception {
return db.selectLatestRecord(car_license);
}
public void updateEndTime(int record_id, Timestamp end_time) throws Exception {
db.setEndTime(record_id, end_time);
}
public void addNewRecord(ParkingRecord newRecord) throws Exception {
db.insertNewRecord(newRecord);
}
public List<ParkingRecord> getAllRecords() throws Exception {
return db.selectAllRecords();
}
public List<ParkingRecord> getRecordsByCase(String car_license, String location, Timestamp startTime, Timestamp endTime) throws Exception {
return db.selectRecordsByCase(car_license, location, startTime, endTime);
}
public Map<String, Double> getTopCost() throws Exception {
return db.selectTopCost();
}
public Map<Date, Double> getMonthIncome() throws Exception {
return db.selectMonthIncome();
}
public List<ParkingRecord> GetAllRecordbySpot_Id(int spot_id) throws Exception {
return db.GetAllRecordbySpot_Id(spot_id);
}
public int getBusyNum() throws Exception {
return db.selectBusyNum();
}
public int getUserSum() throws Exception {
return db.selectUserSum();
}
public Map<Integer, Double> getHourMins() throws Exception {
return db.selectHourMins();
}
public Map<String, Double> getLocationMins() throws Exception {
return db.selectLocationMins();
}
}

@ -0,0 +1,28 @@
package service;
import JDBC.ParkingSpotJDBC;
import pojo.ParkingSpot;
import java.util.List;
public class ParkingSpotService {
ParkingSpotJDBC db = new ParkingSpotJDBC();
public void occupySpot(int spot_id) throws Exception {
db.setSpotStatus(spot_id);
}
public void releaseSpot(int spot_id) throws Exception {
db.resetSpotStatus(spot_id);
}
public List<ParkingSpot> getAllSpots() throws Exception {
return db.selectAllSpots();
}
public ParkingSpot getParkingSpot(int spot_id) throws Exception {
return db.getSpot(spot_id);
}
}

@ -0,0 +1,75 @@
package service;
import JDBC.UserJDBC;
import pojo.IcCard;
import pojo.ParkingSpot;
import pojo.User;
import pojo.Vehicle;
import java.util.List;
import java.util.Map;
public class UserService {
UserJDBC db = new UserJDBC();
public List<User> getAllUser() throws Exception {
return db.selectAllUser();
}
public List<User> getUserByNPA(String name, int parking_spot_id, String address) throws Exception {
return db.selectUserByNPA(name,parking_spot_id, address);
}
public List<User> OrderUserByUserId() throws Exception {
return db.SortUserByUserId();
}
public List<User> OrderUserByParkId() throws Exception {
return db.SortUserByParkId();
}
public List<User> OrderUserByName() throws Exception {
return db.SortUserByName();
}
public Map<String, Integer> CntUserBytotalUser() throws Exception {
return db.CntUserByTotalUser();
}
public Map<String, Integer> CntUserByGender() throws Exception {
return db.CntUserByGender();
}
public Map<String, Integer> CntUserByUserType() throws Exception {
return db.CntUserByUserType();
}
public List<Vehicle> selectCarByUserId(int user_id) throws Exception {
return db.selectCarByUserId(user_id);
}
public List<ParkingSpot> selectParkByParkId(int parkingSpotId) throws Exception {
return db.selectParkByParkId(parkingSpotId);
}
public List<IcCard> selectICByUserId(int userId) throws Exception {
return db.selectICByUserId(userId);
}
public List<User> updateUser(int userId, String name, String telephone, String userType, int parkingSpotId, String address, String gender) throws Exception {
return db.updateUser(userId,name,telephone,userType,parkingSpotId,address,gender);
}
public List<User> deleteUser(int userId) throws Exception {
return db.deleteUserById(userId);
}
public User getUserbyId(int id) throws Exception {
return db.getUserById(id);
}
public int updateUser(User user) throws Exception {
return db.update_user_Info(user);
}
}

@ -0,0 +1,22 @@
package service;
import JDBC.VehicleJDBC;
import pojo.Vehicle;
import java.util.List;
public class VehicleService {
VehicleJDBC db = new VehicleJDBC();
public List<Vehicle> getAllVehicles() throws Exception {
return db.selectAllVehicles();
}
public List<Vehicle> getVehiclesByCase(String car_license, String brand, String model, String building) throws Exception {
return db.selectVehiclesByCase(car_license, brand, model, building);
}
public Vehicle get_car_ById(int id) throws Exception {
return db.get_car_ById(id);
}
}

@ -0,0 +1,44 @@
package web.IcCardRelated;
import pojo.IcCard;
import pojo.ParkingRecord;
import pojo.User;
import service.IcCardService;
import service.ParkingRecordService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;
@WebServlet("/main/get_IC")
public class get_IC extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session=request.getSession();
User user=(User)session.getAttribute("user");
IcCardService service=new IcCardService();
ParkingRecordService recordService=new ParkingRecordService();
try {
List<ParkingRecord> record=recordService.GetAllRecordbySpot_Id(user.getSpot_id());
IcCard card=service.get_IcCardById(user.getUser_id());
session.setAttribute("Ic-card",card);
session.setAttribute("spot_record",record);
} catch (Exception e) {
throw new RuntimeException(e);
}
request.getRequestDispatcher("/main/user/Ic-card.jsp").forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -0,0 +1,109 @@
package web.ParkingRecordRelated;
import pojo.ParkingRecord;
import pojo.Vehicle;
import service.ParkingRecordService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@WebServlet(urlPatterns = "/main/admin/Records")
public class SelectParkingRecordServlet extends HttpServlet {
ParkingRecordService service = new ParkingRecordService();
public void addAttribute(HttpServletRequest req) throws Exception {
Map<String, Double> topCost = service.getTopCost();
Map<Date, Double> monthIncome = service.getMonthIncome();
int peopleBusy = service.getBusyNum();
int peopleSum = service.getUserSum();
Map<Integer, Double> hourMins = service.getHourMins();
req.setAttribute("monthIncome", monthIncome);
req.setAttribute("topCost", topCost);
req.setAttribute("peopleBusy", peopleBusy);
req.setAttribute("peopleSum", peopleSum);
req.setAttribute("hourMins", hourMins);
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
List<ParkingRecord> parkingRecords = null;
try {
parkingRecords = service.getAllRecords();
} catch (Exception e) {
throw new RuntimeException(e);
}
try {
addAttribute(req);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("parkingRecords", parkingRecords);
req.getRequestDispatcher("/main/admin/adminRecord.jsp").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
String car_license = req.getParameter("car_license");
String location = req.getParameter("location");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date start_date = null;
try {
start_date = parseDateParameter(req.getParameter("start_time"), dateFormat);
} catch (ParseException e) {
throw new RuntimeException(e);
}
Date end_date = null;
try {
end_date = parseDateParameter(req.getParameter("end_time"), dateFormat);
} catch (ParseException e) {
throw new RuntimeException(e);
}
Timestamp start_time = convertToTimestamp(start_date);
Timestamp end_time = convertToTimestamp(end_date);
List<ParkingRecord> parkingRecords = null;
try {
parkingRecords = service.getRecordsByCase(car_license, location, start_time, end_time);
} catch (Exception e) {
throw new RuntimeException(e);
}
try {
addAttribute(req);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("parkingRecords", parkingRecords);
req.getRequestDispatcher("/main/admin/adminRecord.jsp").forward(req, resp);
}
private Date parseDateParameter(String parameter, SimpleDateFormat dateFormat) throws ParseException {
if (parameter != null && !parameter.isEmpty()) {
return dateFormat.parse(parameter);
}
return null;
}
private Timestamp convertToTimestamp(Date date) {
if (date != null) {
return new Timestamp(date.getTime());
}
return null;
}
}

@ -0,0 +1,54 @@
package web.ParkingRecordRelated;
import pojo.ParkingRecord;
import service.ParkingRecordService;
import service.ParkingSpotService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Timestamp;
@WebServlet(urlPatterns = "/main/admin/adminUpdateRecord")
public class UpdateRecordServlet extends HttpServlet {
ParkingRecordService service = new ParkingRecordService();
ParkingSpotService service1 = new ParkingSpotService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String car_license = req.getParameter("plate");
// 查找时间最近的car_license的记录
try {
ParkingRecord latestParkingRecord = service.getLatestRecord(car_license);
if(latestParkingRecord != null && latestParkingRecord.getEnd_time() == null) {
// 如果end_time == null, 更新该记录的end_time, 扣费
int spot_id = latestParkingRecord.getSpot_id();
service.updateEndTime(latestParkingRecord.getRecord_id(), new Timestamp(System.currentTimeMillis()));
// 扣费
service1.releaseSpot(spot_id);
}
else {
// 如果end_time != null, 插入一条新的记录
ParkingRecord newRecord = new ParkingRecord(
new Timestamp(System.currentTimeMillis()),
car_license
);
service.addNewRecord(newRecord);
latestParkingRecord = service.getLatestRecord(car_license);
int spot_id = latestParkingRecord.getSpot_id();
service1.occupySpot(spot_id);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
req.getRequestDispatcher("/main/admin/adminMain.jsp").forward(req, resp);
}
}

@ -0,0 +1,41 @@
package web.ParkingRecordRelated;
import pojo.ParkingRecord;
import pojo.User;
import service.ParkingRecordService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;
@WebServlet("/main/get_record")
public class get_record extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = (HttpSession) request.getSession();
User user=(User)request.getSession().getAttribute("user");
ParkingRecordService record_service=new ParkingRecordService();
try {
List<ParkingRecord> record=record_service.GetAllRecordbySpot_Id(user.getSpot_id());
session.setAttribute("spot_record",record);
} catch (Exception e) {
throw new RuntimeException(e);
}
request.getRequestDispatcher("/main/user/parking_record.jsp").forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -0,0 +1,81 @@
package web.ParkingRecordRelated;
import pojo.ParkingRecord;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@WebServlet("/main/sort_record")
public class sort_record extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/*<option value="st"></option>
<option value="et"></option>
<option value="fee"></option>
<option value="license"></option>*/
Comparator<ParkingRecord> byStartTime = new Comparator<ParkingRecord>() {
@Override
public int compare(ParkingRecord r1, ParkingRecord r2) {
if((r1.getStart_time()).before(r2.getStart_time()))
return 1;
else return -1;}
};
Comparator<ParkingRecord> byEndTime = new Comparator<ParkingRecord>() {
@Override
public int compare(ParkingRecord r1, ParkingRecord r2) {
if((r1.getEnd_time()).before(r2.getEnd_time()))
return 1;
else return -1;// 假设 getStartTime 返回的是 Comparable 类型
}
};
Comparator<ParkingRecord> byParkingFee = new Comparator<ParkingRecord>() {
@Override
public int compare(ParkingRecord r1, ParkingRecord r2) {
if(r1.getParking_fee()>(r2.getParking_fee()))
return 1;
else return -1;// 假设 getStartTime 返回的是 Comparable 类型
}
};
String type=request.getParameter("type");
String way=request.getParameter("order");
HttpSession session=request.getSession();
List<ParkingRecord> list=(List<ParkingRecord>) session.getAttribute("spot_record");
if(type.equals("st"))
{
Collections.sort(list, byStartTime);
if(way.equals("asc"))
Collections.reverse(list);
}
else if(type.equals("et"))
{
Collections.sort(list, byEndTime);
if(way.equals("asc"))
Collections.reverse(list);
}else if(type.equals("fee"))
{
Collections.sort(list, byParkingFee);
if(way.equals("desc"))
{
Collections.reverse(list);
}
}
session.setAttribute("spot_record",list);
request.getRequestDispatcher(request.getParameter("path")).forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -0,0 +1,31 @@
package web.ParkingSpotRelated;
import pojo.ParkingSpot;
import service.ParkingSpotService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@WebServlet(urlPatterns = "/main/admin/Spots")
public class SpotStatusServlet extends HttpServlet {
ParkingSpotService service = new ParkingSpotService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
List<ParkingSpot> parkingSpots = null;
try {
parkingSpots = service.getAllSpots();
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("parkingSpots", parkingSpots);
req.getRequestDispatcher("/main/admin/adminSpots.jsp").forward(req, resp);
}
}

@ -0,0 +1,38 @@
package web.ParkingSpotRelated;
import pojo.ParkingSpot;
import pojo.User;
import service.ParkingSpotService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@WebServlet("/main/get_spot")
public class get_spot extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = (HttpSession) request.getSession();
User user=(User)request.getSession().getAttribute("user");
ParkingSpotService spot_service=new ParkingSpotService();
try {
ParkingSpot spot= spot_service.getParkingSpot(user.getSpot_id());
session.setAttribute("spot",spot);
} catch (Exception e) {
throw new RuntimeException(e);
}
request.getRequestDispatcher("/main/user/parking_spot.jsp").forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -0,0 +1,37 @@
package web.UserRelated;
import pojo.Vehicle;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(urlPatterns = "/main/admin/CarInfo")
public class CarServlet extends HttpServlet {
UserService service = new UserService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
int user_id= Integer.parseInt(req.getParameter("user_id"));
List<Vehicle> carlist=null;
try {
carlist=service.selectCarByUserId(user_id);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("carlist",carlist);
req.getRequestDispatcher("/main/UserToInfo/CarInfo.jsp?").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req,resp);
}
}

@ -0,0 +1,37 @@
package web.UserRelated;
import pojo.IcCard;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(urlPatterns = "/main/admin/ICInfo")
public class ICServlet extends HttpServlet {
UserService service = new UserService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
int user_id= Integer.parseInt(req.getParameter("user_id"));
List<IcCard> IClist=null;
try {
IClist=service.selectICByUserId(user_id);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("IClist",IClist);
req.getRequestDispatcher("/main/UserToInfo/ICInfo.jsp?").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req,resp);
}
}

@ -0,0 +1,70 @@
package web.UserRelated;
import pojo.User;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@WebServlet(urlPatterns = "/main/admin/UserOrder")
public class OrderUserServlet extends HttpServlet {
UserService service = new UserService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
String choice=req.getParameter("statistic");
Map<String, Integer> mp = null;
try {
if(choice!=null){
if(choice.equals("totalUsers")){
mp = service.CntUserBytotalUser();
}
else if(choice.equals("gender")){
mp = service.CntUserByGender();
}
else{
mp = service.CntUserByUserType();
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("mp", mp);
req.getRequestDispatcher("/main/admin/adminUser.jsp?count=1").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
String choice=req.getParameter("sort");
List<User> userList = null;
try {
if(choice!=null){
if(choice.equals("userId")){
userList = service.OrderUserByUserId();
}
else if(choice.equals("parking_spot_id")){
userList = service.OrderUserByParkId();
}
else{
userList = service.OrderUserByName();
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("users", userList);
req.getRequestDispatcher("/main/admin/adminUser.jsp").forward(req, resp);
}
}

@ -0,0 +1,37 @@
package web.UserRelated;
import pojo.ParkingSpot;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(urlPatterns = "/main/admin/ParkInfo")
public class ParkServlet extends HttpServlet {
UserService service = new UserService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
int parking_spot_id= Integer.parseInt(req.getParameter("parking_spot_id"));
List<ParkingSpot> parklist=null;
try {
parklist=service.selectParkByParkId(parking_spot_id);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("parklist",parklist);
req.getRequestDispatcher("/main/UserToInfo/parkInfo.jsp?").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req,resp);
}
}

@ -0,0 +1,45 @@
package web.UserRelated;
import pojo.User;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(urlPatterns = "/main/admin/UpdateServlet")
public class UpdateServlet extends HttpServlet {
UserService service = new UserService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
int user_id= Integer.parseInt(req.getParameter("user_id"));
String name=req.getParameter("name");
String telephone=req.getParameter("telephone");
String user_type=req.getParameter("user_type");
int parking_spot_id= Integer.parseInt(req.getParameter("parking_spot_id"));
String address=req.getParameter("address");
String gender=req.getParameter("gender");
List<User> userlist=null;
try {
userlist=service.updateUser(user_id,name,telephone,user_type,parking_spot_id,address,gender);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("users",userlist);
req.getRequestDispatcher("/main/admin/adminUser.jsp?").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req,resp);
}
}

@ -0,0 +1,37 @@
package web.UserRelated;
import pojo.User;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(urlPatterns = "/main/admin/deleteServlet")
public class deleteServlet extends HttpServlet {
UserService service = new UserService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
int user_id= Integer.parseInt(req.getParameter("user_id"));
List<User> userlist=null;
try {
userlist=service.deleteUser(user_id);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("users",userlist);
req.getRequestDispatcher("/main/admin/adminUser.jsp?").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req,resp);
}
}

@ -0,0 +1,28 @@
package web.UserRelated;
import pojo.User;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@WebServlet("/main/get_user")
public class get_user extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = (HttpSession) request.getSession();
User user=(User)request.getSession().getAttribute("user");
request.getRequestDispatcher("/main/user/user-Info.jsp").forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -0,0 +1,34 @@
package web.UserRelated;
import pojo.User;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/login")
public class login extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
UserService service=new UserService();
User user= null;
try {
user = service.getUserbyId(1);
} catch (Exception e) {
throw new RuntimeException(e);
}
request.getSession().setAttribute("user",user);
request.getRequestDispatcher("/main/user/user-Info.jsp").forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -0,0 +1,58 @@
package web.UserRelated;
import pojo.User;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(urlPatterns = "/main/admin/User")
public class selectUserServlet extends HttpServlet {
UserService service = new UserService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
List<User> userList = null;
try {
userList = service.getAllUser();
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("users", userList);
req.getRequestDispatcher("/main/admin/adminUser.jsp").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
String name = req.getParameter("name");
String parkingSpotIdParam = req.getParameter("parking_spot_id");
int parking_spot_id = 0; // 默认值
if (parkingSpotIdParam != null && !parkingSpotIdParam.isEmpty()) {
try {
parking_spot_id = Integer.parseInt(parkingSpotIdParam);
} catch (NumberFormatException e) {
}
}
String address = req.getParameter("address");
List<User> userList = null;
try {
userList = service.getUserByNPA(name,parking_spot_id, address);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("users", userList);
req.getRequestDispatcher("/main/admin/adminUser.jsp").forward(req, resp);
}
}

@ -0,0 +1,41 @@
package web.UserRelated;
import pojo.User;
import service.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/main/update_user_Info")
public class update_user_Info extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("Utf-8");
User user=(User)request.getSession().getAttribute("user");
user.setAddress(request.getParameter("address"));
user.setGender(request.getParameter("gender"));
user.setName(request.getParameter("name"));
System.out.println(request.getParameter("phone"));
user.setTelephone(request.getParameter("phone"));
UserService service=new UserService();
System.out.println(user.getTelephone());
try {
service.updateUser(user);
} catch (Exception e) {
throw new RuntimeException(e);
}
request.getSession().setAttribute("user",user);
request.getRequestDispatcher("/main/user/user-Info.jsp").forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request,response);
}
}

@ -0,0 +1,142 @@
package web.VehicleRelated;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONException;
import com.alibaba.fastjson2.JSONObject;
import com.aliyun.api.gateway.demo.util.HttpUtils;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import static org.apache.commons.codec.binary.Base64.encodeBase64;
@WebServlet(urlPatterns = "/main/recoPlate")
public class RecoPlateServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doGet(req, resp);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 从请求中获取图像数据
String imageData = request.getParameter("image");
JSONObject res = apiRequest(imageData);
boolean success = res.getBoolean("success");
String txt = res.getJSONArray("plates").getJSONObject(0).getString("txt");
if(success && txt.length() == 7) {
response.setContentType("text/plain; charset=UTF-8");
PrintWriter out = response.getWriter();
String urlToSendBack = request.getContextPath() + "/main/admin/adminUpdateRecord?plate=" + txt; // 构造返回的URL
out.print(urlToSendBack); // 写入URL到响应体
out.flush(); // 清空输出流,完成响应
}
}
public static JSONObject getParam(int type, String dataValue) {
JSONObject obj = new JSONObject();
try {
obj.put("dataType", type);
obj.put("dataValue", dataValue);
} catch (JSONException e) {
e.printStackTrace();
}
return obj;
}
public static JSONObject apiRequest(String imgBase64){
String host = "https://ocrcp.market.alicloudapi.com";//
String path = "/rest/160601/ocr/ocr_vehicle_plate.json";
String appcode = "9a887597dbf04dc1a2f26ceee6227f5a";
// String imgFile = "/ParkingLotManagementSystem/static/images/vehicle_plate.png";
Boolean is_old_format = false;//如果文档的输入中含有inputs字段设置为True 否则设置为False
//请根据线上文档修改configure字段
JSONObject configObj = new JSONObject();
configObj.put("multi_crop", true);
String config_str = configObj.toString();
// configObj.put("min_size", 5);
//String config_str = "";
String method = "POST";
Map<String, String> headers = new HashMap<String, String>();
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + appcode);
Map<String, String> querys = new HashMap<String, String>();
// 对图像进行base64编码
// String imgBase64 = "";
// try {
// File file = new File(imgFile);
// byte[] content = new byte[(int) file.length()];
// FileInputStream finputstream = new FileInputStream(file);
// finputstream.read(content);
// finputstream.close();
// imgBase64 = new String(encodeBase64(content));
// } catch (IOException e) {
// e.printStackTrace();
// return;
// }
// 拼装请求body的json字符串
JSONObject requestObj = new JSONObject();
try {
if(is_old_format) {
JSONObject obj = new JSONObject();
obj.put("image", getParam(50, imgBase64));
if(config_str.length() > 0) {
obj.put("configure", getParam(50, config_str));
}
JSONArray inputArray = new JSONArray();
inputArray.add(obj);
requestObj.put("inputs", inputArray);
}else{
requestObj.put("image", imgBase64);
if(config_str.length() > 0) {
requestObj.put("configure", config_str);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
String bodys = requestObj.toString();
JSONObject res_obj = new JSONObject();
try {
/**
* :
* HttpUtils
* https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
*
*
*
* https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
*/
HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
int stat = response.getStatusLine().getStatusCode();
if(stat != 200){
System.out.println("Http code: " + stat);
System.out.println("http header error msg: "+ response.getFirstHeader("X-Ca-Error-Message"));
System.out.println("Http body error msg:" + EntityUtils.toString(response.getEntity()));
return null;
}
String res = EntityUtils.toString(response.getEntity());
res_obj = JSON.parseObject(res);
} catch (Exception e) {
e.printStackTrace();
}
return res_obj;
}
}

@ -0,0 +1,46 @@
package web.VehicleRelated;
import pojo.Vehicle;
import service.VehicleService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(urlPatterns = "/main/admin/Vehicles")
public class SelectVehicleServlet extends HttpServlet {
VehicleService service = new VehicleService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
List<Vehicle> vehicles = null;
try {
vehicles = service.getAllVehicles();
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("vehicles", vehicles);
req.getRequestDispatcher("/main/admin/adminVehicle.jsp").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
String car_license = req.getParameter("car_license");
String brand = req.getParameter("brand");
String model = req.getParameter("model");
String building = req.getParameter("buildnum");
List<Vehicle> vehicles = null;
try {
vehicles = service.getVehiclesByCase(car_license, brand, model, building);
} catch (Exception e) {
throw new RuntimeException(e);
}
req.setAttribute("vehicles", vehicles);
req.getRequestDispatcher("/main/admin/adminVehicle.jsp").forward(req, resp);
}
}

@ -0,0 +1,35 @@
package web.VehicleRelated;
import pojo.User;
import pojo.Vehicle;
import service.VehicleService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@WebServlet("/main/get_car_Info")
public class get_car_Info extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session=request.getSession();
VehicleService service=new VehicleService();
User user=(User)session.getAttribute("user");
try {
Vehicle car=service.get_car_ById(user.getUser_id());
session.setAttribute("car",car);
} catch (Exception e) {
throw new RuntimeException(e);
}
request.getRequestDispatcher("/main/user/car-Info.jsp").forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -0,0 +1,7 @@
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
</web-app>

@ -0,0 +1,97 @@
<%@ page import="java.util.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/enterScanStyle.css">
</head>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/mall/AllTask"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="<%=request.getContextPath()%>">山东科技大学 作为小组停车场管理系统 <span>门禁系统</span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
</div>
</div>
</div>
</div>
<div class="container">
<div class="tasks-content">
<div id="title">
<span>请将车牌对准摄像头进行识别</span>
<p style="font-size: 20px;">正在识别中...</p>
</div>
<div id="contentHolder">
<video id="video" autoplay></video>
<canvas style="display:none;" id="canvas"></canvas>
<img id="imgXX" src="" />
</div>
</div>
</div>
</body>
</html>
<script>
const cvs = document.getElementById('canvas')
const video = document.getElementById('video')
cvs.width = video.width = 1000;
cvs.height = video.height = 600;
const {width, height} = cvs
const ctx = cvs.getContext('2d')
const constraints = {
video: {
width,
height
}
}
navigator.mediaDevices.getUserMedia({
video: {
width,
height
}
}).then((stream) => {
video.srcObject = stream
video.onloadedmetadata = () => video.play()
})
video.addEventListener('loadeddata', function() {
setInterval(function() {
// 将当前视频帧绘制到画布上
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
// 将图像数据发送到 Servlet
const dataURL = canvas.toDataURL('image/png');
sendDataToServlet(dataURL);
}, 2000); // 0.5s 进行一次识别
});
function sendDataToServlet(dataURL) {
// 创建 XMLHttpRequest 对象
const xhr = new XMLHttpRequest();
// 定义处理响应的函数
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
// 假设URL在响应体中返回
let url = xhr.responseText; // 这里获取到的是Servlet响应的内容即URL
if(url.trim() !== "") { // 检查URL是否不为空
window.location.href = url; // 跳转到该URL
}
} else {
console.error('Failed to save image on server.');
}
}
};
// 发送 POST 请求到 Servlet
xhr.open('POST', '/ParkingLotManagementSystem/main/recoPlate', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8');
xhr.send('image=' + encodeURIComponent(dataURL));
}
</script>

@ -0,0 +1,120 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Vehicle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/vehicleStyle.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <!-- 引入 Chart.js -->
<style>
.pageConfig{
margin-top: 1%;
width: 100%;
display: flex;
cursor: pointer;
/*border: 2px solid #126bff;*/
}
.pageConfigUp{
width: 100%;
cursor: pointer;
/*border: 2px solid #126bff;*/
/*margin-bottom: 1%;*/
/*margin-top: 1%;*/
/*box-shadow: 0 0 0 2px #f0f0f0;*/
border-radius: 8px;
text-align: center; /* 让内容水平居中 */
font-family: Arial, sans-serif;
}
.publishButton {
font-size: 24px; /* 设置字体大小 */
display: inline-block; /* 让按钮元素作为块级元素显示 */
padding: 10px 20px; /* 设定按钮内边距 */
border: 2px solid #fff; /* 按钮边框 */
border-radius: 5px; /* 圆角 */
text-decoration: none; /* 去除链接下划线 */
/*color: #333; !* 文字颜色 *!*/
margin-top: 1%; /* 上边距约为页面高度的 30% */
margin-bottom: 1%; /* 下边距约为页面高度的 30% */
background-color: #3fb643;
color: #fff; /* 设置文字颜色为白色 */.
}
.publishButton:hover {
background-color: #333; /* 鼠标悬停时背景颜色 */
color: #fff; /* 鼠标悬停时文字颜色 */
}
</style>
</head>
<%
request.setCharacterEncoding("UTF-8");
List<Vehicle> carlist=null;
carlist = (List<Vehicle>) request.getAttribute("carlist");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/mall/AllTask"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=request.getSession().getAttribute("username")%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="tasks-content">
<%
if (carlist != null) {
%>
<table class="vehicle-table">
<tr style="color:#087DCE;">
<th style="font-weight: bold;">车牌号</th>
<th style="font-weight: bold;">用户ID</th>
<th style="font-weight: bold;">品牌</th>
<th style="font-weight: bold;">型号</th>
</tr>
<%
}
%>
<%
if (carlist != null) {
for(Vehicle car: carlist) {
%>
<tr>
<th><%=car.getCar_license()%></th>
<th><%=car.getUser_id()%></th>
<th><%=car.getBrand()%></th>
<th><%=car.getModel()%></th>
</tr>
<%
}
}
%>
</table>
</div>
</div>
</body>
</html>

@ -0,0 +1,123 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Vehicle" %>
<%@ page import="pojo.ParkingSpot" %>
<%@ page import="pojo.IcCard" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/vehicleStyle.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <!-- 引入 Chart.js -->
<style>
.pageConfig{
margin-top: 1%;
width: 100%;
display: flex;
cursor: pointer;
/*border: 2px solid #126bff;*/
}
.pageConfigUp{
width: 100%;
cursor: pointer;
/*border: 2px solid #126bff;*/
/*margin-bottom: 1%;*/
/*margin-top: 1%;*/
/*box-shadow: 0 0 0 2px #f0f0f0;*/
border-radius: 8px;
text-align: center; /* 让内容水平居中 */
font-family: Arial, sans-serif;
}
.publishButton {
font-size: 24px; /* 设置字体大小 */
display: inline-block; /* 让按钮元素作为块级元素显示 */
padding: 10px 20px; /* 设定按钮内边距 */
border: 2px solid #fff; /* 按钮边框 */
border-radius: 5px; /* 圆角 */
text-decoration: none; /* 去除链接下划线 */
/*color: #333; !* 文字颜色 *!*/
margin-top: 1%; /* 上边距约为页面高度的 30% */
margin-bottom: 1%; /* 下边距约为页面高度的 30% */
background-color: #3fb643;
color: #fff; /* 设置文字颜色为白色 */.
}
.publishButton:hover {
background-color: #333; /* 鼠标悬停时背景颜色 */
color: #fff; /* 鼠标悬停时文字颜色 */
}
</style>
</head>
<%
request.setCharacterEncoding("UTF-8");
List<IcCard> IClist=null;
IClist = (List<IcCard>) request.getAttribute("IClist");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/mall/AllTask"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=request.getSession().getAttribute("username")%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="tasks-content">
<%
if (IClist != null) {
%>
<table class="vehicle-table">
<tr style="color:#087DCE;">
<th style="font-weight: bold;">用户ID</th>
<th style="font-weight: bold;">卡号</th>
<th style="font-weight: bold;">密码</th>
<th style="font-weight: bold;">余额</th>
</tr>
<%
}
%>
<%
if (IClist != null) {
for(IcCard ic: IClist) {
%>
<tr>
<th><%=ic.getUser_id()%></th>
<th><%=ic.getCard_number()%></th>
<th><%=ic.getPassword()%></th>
<th><%=ic.getBalance()%></th>
</tr>
<%
}
}
%>
</table>
</div>
</div>
</body>
</html>

@ -0,0 +1,124 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Vehicle" %>
<%@ page import="pojo.ParkingSpot" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/vehicleStyle.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <!-- 引入 Chart.js -->
<style>
.pageConfig{
margin-top: 1%;
width: 100%;
display: flex;
cursor: pointer;
/*border: 2px solid #126bff;*/
}
.pageConfigUp{
width: 100%;
cursor: pointer;
/*border: 2px solid #126bff;*/
/*margin-bottom: 1%;*/
/*margin-top: 1%;*/
/*box-shadow: 0 0 0 2px #f0f0f0;*/
border-radius: 8px;
text-align: center; /* 让内容水平居中 */
font-family: Arial, sans-serif;
}
.publishButton {
font-size: 24px; /* 设置字体大小 */
display: inline-block; /* 让按钮元素作为块级元素显示 */
padding: 10px 20px; /* 设定按钮内边距 */
border: 2px solid #fff; /* 按钮边框 */
border-radius: 5px; /* 圆角 */
text-decoration: none; /* 去除链接下划线 */
/*color: #333; !* 文字颜色 *!*/
margin-top: 1%; /* 上边距约为页面高度的 30% */
margin-bottom: 1%; /* 下边距约为页面高度的 30% */
background-color: #3fb643;
color: #fff; /* 设置文字颜色为白色 */.
}
.publishButton:hover {
background-color: #333; /* 鼠标悬停时背景颜色 */
color: #fff; /* 鼠标悬停时文字颜色 */
}
</style>
</head>
<%
request.setCharacterEncoding("UTF-8");
List<ParkingSpot> parklist=null;
parklist = (List<ParkingSpot>) request.getAttribute("parklist");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/mall/AllTask"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=request.getSession().getAttribute("username")%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="tasks-content">
<%
if (parklist != null) {
%>
<table class="vehicle-table">
<tr style="color:#087DCE;">
<th style="font-weight: bold;">车位ID</th>
<th style="font-weight: bold;">车位类型</th>
<th style="font-weight: bold;">占用情况</th>
<th style="font-weight: bold;">位置</th>
<th style="font-weight: bold;">收费标准</th>
</tr>
<%
}
%>
<%
if (parklist != null) {
for(ParkingSpot p: parklist) {
%>
<tr>
<th><%=p.getSpot_id()%></th>
<th><%=p.getSpot_type()%></th>
<th><%=p.getOccupancy_status()%></th>
<th><%=p.getLocation()%></th>
<th><%=p.getFee_standard()%></th>
</tr>
<%
}
}
%>
</table>
</div>
</div>
</body>
</html>

@ -0,0 +1,179 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Vehicle" %>
<%@ page import="pojo.ParkingSpot" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/vehicleStyle.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <!-- 引入 Chart.js -->
<style>
.pageConfig{
margin-top: 1%;
width: 100%;
display: flex;
cursor: pointer;
/*border: 2px solid #126bff;*/
}
.pageConfigUp{
width: 100%;
cursor: pointer;
/*border: 2px solid #126bff;*/
/*margin-bottom: 1%;*/
/*margin-top: 1%;*/
/*box-shadow: 0 0 0 2px #f0f0f0;*/
border-radius: 8px;
text-align: center; /* 让内容水平居中 */
font-family: Arial, sans-serif;
}
.publishButton {
font-size: 24px; /* 设置字体大小 */
display: inline-block; /* 让按钮元素作为块级元素显示 */
padding: 10px 20px; /* 设定按钮内边距 */
border: 2px solid #fff; /* 按钮边框 */
border-radius: 5px; /* 圆角 */
text-decoration: none; /* 去除链接下划线 */
/*color: #333; !* 文字颜色 *!*/
margin-top: 1%; /* 上边距约为页面高度的 30% */
margin-bottom: 1%; /* 下边距约为页面高度的 30% */
background-color: #3fb643;
color: #fff; /* 设置文字颜色为白色 */.
}
.publishButton:hover {
background-color: #333; /* 鼠标悬停时背景颜色 */
color: #fff; /* 鼠标悬停时文字颜色 */
}
.container1 {
width: 50%;
margin: 50px auto;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin-top: 1%;
}
h1 {
text-align: center;
color: #333;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 8px;
color: #555;
/*text-align: center;*/
}
input[type="text"],
input[type="number"],
input[type="file"],
textarea {
width: calc(100% - 20px);
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 15px;
}
input[type="submit"],
.returnButton {
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #4caf50;
color: #fff;
text-decoration: none;
cursor: pointer;
text-align: center;
}
input[type="submit"]:hover,
.returnButton:hover {
background-color: #45a049;
}
.returnButton {
margin-top: 10px;
background-color: #087dce;
}
</style>
</head>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/mall/AllTask"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=request.getSession().getAttribute("username")%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="tasks-content">
<div class="container1">
<%
int user_id= Integer.parseInt(request.getParameter("user_id"));
int parking_spot_id= Integer.parseInt(request.getParameter("parking_spot_id"));
%>
<h1>修改用户信息</h1>
<form action="<%=request.getContextPath()%>/main/admin/UpdateServlet?user_id=<%=user_id%>" method="post" accept-charset="UTF-8">
<label for="user_id">用户ID:</label>
<input type="text" id="user_id" name="user_id" value="<%=user_id%>" readonly>
<label for="name">姓名:</label>
<input type="text" id="name" name="name">
<label for="telephone">手机号:</label>
<input type="text" id="telephone" name="telephone">
<label for="user_type">用户类型:</label>
<input type="text" id="user_type" name="user_type">
<label for="parking_spot_id">停车场ID:</label>
<input type="text" id="parking_spot_id" name="parking_spot_id" value="<%=parking_spot_id%>" readonly>
<label for="address">地址:</label>
<input type="text" id="address" name="address">
<label for="gender">性别:</label>
<input type="text" id="gender" name="gender">
<input type="submit" value="提交">
<a href="<%=request.getContextPath()%>/main/admin/User" class="returnButton">返回</a>
</form>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,40 @@
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
</head>
<%
request.setCharacterEncoding("UTF-8");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="#"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="<%=request.getContextPath()%>">山东科技大学 作为小组停车场管理系统 <span style="font-size: 20px;">门禁系统</span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="tasks-content">
<div class="center" style="font-size: 50px;margin-top: 25%;">
您好,<%=request.getParameter("plate")%>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,339 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.ParkingRecord" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/vehicleStyle.css">
<script src="<%=request.getContextPath()%>/static/js/echarts.js"></script>
</head>
<%
request.setCharacterEncoding("UTF-8");
List<ParkingRecord> parkingRecords = (List<ParkingRecord>) request.getAttribute("parkingRecords");
%>
<script>
function toggleContent(content) {
event.preventDefault(); // Prevent the default anchor behavior
// Define the content sections and buttons
const allRecords = document.getElementById('all-records'); // Assuming you have an element for all records
const data = document.getElementById('data-section'); // Assuming you have an element for data or stats
const allButton = document.getElementById('all'); // Button for all records
const dataButton = document.getElementById('data'); // Button for data
// Toggle visibility and styles based on the content argument
if (content === 'all') {
// Set styles for buttons
allButton.style.backgroundColor = '#087DCE';
allButton.style.color = 'white';
dataButton.style.backgroundColor = 'white';
dataButton.style.color = 'black';
// Set display for content sections
allRecords.style.display = 'block'; // Show all records
data.style.display = 'none'; // Hide data
} else if (content === 'data') {
// Set styles for buttons
allButton.style.backgroundColor = 'white';
allButton.style.color = 'black';
dataButton.style.backgroundColor = '#087DCE';
dataButton.style.color = 'white';
// Set display for content sections
allRecords.style.display = 'none'; // Hide all records
data.style.display = 'flex'; // Show data
}
}
</script>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="#"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="<%=request.getContextPath()%>">山东科技大学 作为小组停车场管理系统 <span style="font-size: 20px;">管理员端</span></a>
</div>
<div class="top-bar-btn">
<%-- <a class="top-bar-tag" href="<%=request.getContextPath()%>/mall/AllTask">任务广场</a>--%>
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<%-- <span><%=request.getSession().getAttribute("username")%></span>--%>
<%-- <div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>--%>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="tasks-content">
<div class="choose-area">
<a id="all" href="#" onclick="toggleContent('all')">所有记录</a>
<a id="data" href="#" onclick="toggleContent('data')">统计信息</a>
</div>
<div id="all-records">
<form id="vehicle-form" action="<%=request.getContextPath()%>/main/admin/Records" method="post">
<input type="text" name="car_license" placeholder="请输入车牌号">
<input type="text" name="location" placeholder="请输入停车位置">
<input type="date" name="start_time" placeholder="起始时间">
<input type="date" name="end_time" placeholder="结束时间">
<input type="submit" value="搜索">
</form>
<table class="vehicle-table">
<tr style="color:#087DCE;">
<th style="font-weight: bold;">车位号</th>
<th style="font-weight: bold;">位置</th>
<th style="font-weight: bold;">车牌号</th>
<th style="font-weight: bold;">开始时间</th>
<th style="font-weight: bold;">结束时间</th>
<th style="font-weight: bold;">停车费用</th>
</tr>
<%
for(ParkingRecord record: parkingRecords) {
%>
<tr>
<th><%=record.getSpot_id()%></th>
<th><%=record.getLocation()%></th>
<th><%=record.getCar_license()%></th>
<th><%=record.getStart_time()%></th>
<th><%=record.getEnd_time()==null?'-':record.getEnd_time()%></th>
<th><%=(Double)record.getParking_fee() == null?'-':record.getParking_fee()%></th>
</tr>
<%
}
%>
</table>
</div>
<div id="data-section" style="display: none">
<div class="data-row">
<div id="top"></div>
<div id="chart1"></div>
</div>
<div class="data-row">
<div id="line-chart"></div>
<div id="user-pic"></div>
</div>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
var topChart = echarts.init(document.getElementById('top'));
var userNames = [];
var parkingFees = [];
<%
Map<String, Double> userParkingInfo = (Map<String, Double>) request.getAttribute("topCost");
for (Map.Entry<String, Double> entry : userParkingInfo.entrySet()) {
String userName = entry.getKey();
Double totalParkingFees = entry.getValue();
%>
userNames.push('<%= userName %>'); // 将用户名添加到数组
parkingFees.push('<%= totalParkingFees %>'); // 将停车费用添加到数组
<%}%>
topChart.setOption({
title: {
text: '停车费总额最高前5名',
left: 'center'
},
tooltip: {},
xAxis: {
data: userNames
},
yAxis: {},
series: [
{
name: '消费',
type: 'bar',
data: parkingFees
}
]
});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var chartDom = document.getElementById('line-chart');
var myChart = echarts.init(chartDom);
var option;
let dates = [];
let data = [];
<%
Map<Date, Double> monthIncome = (Map<Date, Double>) request.getAttribute("monthIncome");
for (Map.Entry<Date, Double> entry : monthIncome.entrySet()) {
Date date = entry.getKey();
Double Fees = entry.getValue();
%>
var formattedDate = new Date('<%= date %>').toLocaleDateString();
console.log("date: " + formattedDate);
console.log("fee: " + <%= Fees %>);
dates.push(formattedDate); // 将格式化后的日期字符串添加到数组
data.push(<%= Fees %>);
<%
}
%>
option = {
tooltip: {
trigger: 'axis',
position: function (pt) {
return [pt[0], '10%'];
}
},
title: {
left: 'center',
text: '近一个月停车费收入情况'
},
toolbox: {
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: dates
},
yAxis: {
type: 'value',
boundaryGap: [0, '100%']
},
dataZoom: [
{
type: 'inside',
start: 0,
end: 10
},
{
start: 0,
end: 10
}
],
series: [
{
name: '消费总额',
type: 'line',
symbol: 'none',
sampling: 'lttb',
itemStyle: {
color: '#087DCE'
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#6da0cc'
},
{
offset: 1,
color: '#087DCE'
}
])
},
data: data
}
]
};
option && myChart.setOption(option);
});
</script>
<script>
<%
int peopleBusy = (int) request.getAttribute("peopleBusy");
int peopleSum = (int) request.getAttribute("peopleSum");
%>
var chartDom = document.getElementById('user-pic');
var myChart = echarts.init(chartDom);
var option;
option = {
title: {
text: '业主画像',
subtext: '根据停车时间推断业主的工作压力',
left: 'center'
},
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical',
left: 'left'
},
series: [
{
name: '业主',
type: 'pie',
radius: '50%',
data: [
{ value: <%=peopleBusy%>, name: '压力较大' },
{ value: <%=peopleSum - peopleBusy%>, name: '正常业主' },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
option && myChart.setOption(option);
</script>
<script>
var chartDom = document.getElementById('chart1');
var myChart = echarts.init(chartDom);
var option;
var xAxisData = [];
var data1 = [];
<%
Map<Integer, Double> hm = (Map<Integer, Double>) request.getAttribute("hourMins");
for (Map.Entry<Integer, Double> entry : hm.entrySet()) {
Integer hour = entry.getKey();
Double mins = entry.getValue();
%>
xAxisData.push(<%=hour%>);
data1.push(<%=mins%>);
<%
}
%>
option = {
title: {
text: '不同时段的平均停车时间',
left: 'center'
},
xAxis: {
data: xAxisData
},
yAxis: {},
series: [
{
name: '分钟',
type: 'bar',
data: data1
}
]
}
option && myChart.setOption(option);
</script>

@ -0,0 +1,413 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.ParkingSpot" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/parkingLotStyle.css">
</head>
<%
request.setCharacterEncoding("UTF-8");
List<ParkingSpot> spots = (List<ParkingSpot>) request.getAttribute("parkingSpots");
%>
<script>
function fillContent(location, spot_type, occupancy_status, fee_standard) {
const targetDiv = document.getElementById(location);
const carImg = targetDiv.querySelector('.car-img img');
const occupancyStatus = targetDiv.querySelector('.occupancy_status');
if (occupancy_status === 1) {
carImg.src = "/ParkingLotManagementSystem/static/images/full.png";
occupancyStatus.textContent = "使用情况: 已占用";
} else {
carImg.src = "/ParkingLotManagementSystem/static/images/empty.png";
occupancyStatus.textContent = "使用情况: 空闲";
}
const locationSpan = targetDiv.querySelector('.location');
const spotTypeSpan = targetDiv.querySelector('.spot_type');
const feeStandardSpan = targetDiv.querySelector('.fee_standard');
locationSpan.textContent = '车位: ' + location;
spotTypeSpan.textContent = '车位类型: ' + spot_type;
feeStandardSpan.textContent = '收费标准:' + fee_standard + '¥/小时';
}
document.addEventListener('DOMContentLoaded', function() {
<%
for(ParkingSpot spot : spots) {
%>
fillContent('<%= spot.getLocation() %>', '<%= spot.getSpot_type() %>', <%= spot.getOccupancy_status() %>, '<%= spot.getFee_standard() %>');
<%
}
%>
});
</script>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="#"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="<%=request.getContextPath()%>">山东科技大学 作为小组停车场管理系统 <span style="font-size: 20px;">管理员端</span></a>
</div>
<div class="top-bar-btn">
<%-- <a class="top-bar-tag" href="<%=request.getContextPath()%>/mall/AllTask">任务广场</a>--%>
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<%-- <span><%=request.getSession().getAttribute("username")%></span>--%>
<%-- <div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>--%>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="main-content">
<div class="block">
<div class="car-area" id="A1">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="A2">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="A3">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="A4">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="A5">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="A6">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
</div>
<div class="block">
<div class="car-area" id="B1">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="B2">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="B3">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="B4">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="B5">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="B6">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
</div>
<div class="block">
<div class="car-area" id="C1">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="C2">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="C3">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="C4">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="C5">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="C6">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
</div>
<div class="block">
<div class="car-area" id="D1">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="D2">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="D3">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="D4">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="D5">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="D6">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
</div>
<div class="block">
<div class="car-area" id="E1">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="E2">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="E3">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="E4">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="E5">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="E6">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
</div>
<div class="block">
<div class="car-area" id="F1">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="F2">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="F3">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="F4">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="F5">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
<div class="car-area" id="F6">
<div class="car-img">
<img src="/ParkingLotManagementSystem/static/images/none.png" alt="">
<span class="location">车位:</span>
<span class="spot_type">车位类型:</span>
<span class="occupancy_status">使用情况:</span>
<span class="fee_standard">收费标准:- ¥/小时</span>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<script>
</script>

@ -0,0 +1,235 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/vehicleStyle.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <!-- 引入 Chart.js -->
<style>
.pageConfig{
margin-top: 1%;
width: 100%;
display: flex;
cursor: pointer;
/*border: 2px solid #126bff;*/
}
.pageConfigUp{
width: 100%;
cursor: pointer;
/*border: 2px solid #126bff;*/
/*margin-bottom: 1%;*/
/*margin-top: 1%;*/
/*box-shadow: 0 0 0 2px #f0f0f0;*/
border-radius: 8px;
text-align: center; /* 让内容水平居中 */
font-family: Arial, sans-serif;
}
.publishButton {
font-size: 24px; /* 设置字体大小 */
display: inline-block; /* 让按钮元素作为块级元素显示 */
padding: 10px 20px; /* 设定按钮内边距 */
border: 2px solid #fff; /* 按钮边框 */
border-radius: 5px; /* 圆角 */
text-decoration: none; /* 去除链接下划线 */
/*color: #333; !* 文字颜色 *!*/
margin-top: 1%; /* 上边距约为页面高度的 30% */
margin-bottom: 1%; /* 下边距约为页面高度的 30% */
background-color: #3fb643;
color: #fff; /* 设置文字颜色为白色 */.
}
.publishButton:hover {
background-color: #333; /* 鼠标悬停时背景颜色 */
color: #fff; /* 鼠标悬停时文字颜色 */
}
</style>
</head>
<%
request.setCharacterEncoding("UTF-8");
Map<String, Integer> dataMap=null;
List<User> userList=null;
if(request.getParameter("count")!=null){
dataMap= (Map<String, Integer>) request.getAttribute("mp");
}
else{
userList = (List<User>) request.getAttribute("users");
}
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/mall/AllTask"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span style="font-size: 20px;">管理员端</span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=request.getSession().getAttribute("username")%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="tasks-content">
<%-- <div class="pageConfigUp">--%>
<%-- <a href="publishTask.jsp" class="publishButton"> 添加新用户</a>--%>
<%-- </div>--%>
<form id="vehicle-form1" action="<%=request.getContextPath()%>/main/admin/User" method="post">
<input type="text" name="name" placeholder="请输入用户姓名">
<input type="text" name="parking_spot_id" placeholder="车位号">
<input type="text" name="address" placeholder="家庭地址">
<input type="submit" value="搜索">
</form>
<form id="vehicle-form2" action="<%=request.getContextPath()%>/main/admin/UserOrder" method="post">
<label for="sort">选择排序方式:</label>
<select id="sort" name="sort">
<option value="userId">按照用户ID排序</option>
<option value="parking_spot_id">按照停车位ID排序</option>
<option value="name">按照姓名排序</option>
</select>
<input type="submit" value="提交">
</form>
<form id="vehicle-form3" action="<%=request.getContextPath()%>/main/admin/UserOrder" method="get">
<label for="statistic">选择统计信息:</label>
<select id="statistic" name="statistic">
<option value="totalUsers">用户总数</option>
<option value="gender">按性别统计用户数量</option>
<option value="userType">按类型统计用户数量</option>
</select>
<input type="submit" value="提交">
</form>
<%
if (userList != null) {
%>
<table class="vehicle-table">
<tr style="color:#087DCE;">
<th style="font-weight: bold;">用户ID</th>
<th style="font-weight: bold;">姓名</th>
<th style="font-weight: bold;">手机号</th>
<th style="font-weight: bold;">用户类型</th>
<th style="font-weight: bold;">停车场ID</th>
<th style="font-weight: bold;">家庭地址</th>
<th style="font-weight: bold;">性别</th>
<th style="font-weight: bold;">车辆详细信息</th>
<th style="font-weight: bold;">车位详细信息</th>
<th style="font-weight: bold;">IC卡详细信息</th>
<th style="font-weight: bold;">修改用户信息</th>
<th style="font-weight: bold;">删除用户</th>
</tr>
<%
}
%>
<%
if (userList != null) {
for(User u: userList) {
%>
<tr>
<th><%=u.getUser_id()%></th>
<th><%=u.getName()%></th>
<th><%=u.getTelephone()%></th>
<th><%=u.getUser_type()%></th>
<th><%=u.getSpot_id()%></th>
<th><%=u.getAddress()%></th>
<th><%=u.getGender()%></th>
<th><a href="<%=request.getContextPath()%>/main/admin/CarInfo?user_id=<%=u.getUser_id()%>">查看 <span style="font-size: 16px;font-weight: bold;"></span> </a></th>
<th><a href="<%=request.getContextPath()%>/main/admin/ParkInfo?parking_spot_id=<%=u.getSpot_id()%>">查看 <span style="font-size: 16px;font-weight: bold;"></span> </a></th>
<th><a href="<%=request.getContextPath()%>/main/admin/ICInfo?user_id=<%=u.getUser_id()%>">查看 <span style="font-size: 16px;font-weight: bold;"></span> </a></th>
<th><a href="<%=request.getContextPath()%>/main/UserToInfo/updateUser.jsp?user_id=<%=u.getUser_id()%>&parking_spot_id=<%=u.getSpot_id()%>">修改 <span style="font-size: 16px;font-weight: bold;"></span> </a></th>
<th><a href="<%=request.getContextPath()%>/main/admin/deleteServlet?user_id=<%=u.getUser_id()%>&parking_spot_id=<%=u.getSpot_id()%>">删除 <span style="font-size: 16px;font-weight: bold;"></span> </a></th>
</tr>
<%
}
}
%>
</table>
<canvas id="myChart" width="400" height="400"></canvas> <!-- 用于显示图表的 Canvas 元素 -->
<%
// 从 request 中获取 Map 数据
if (dataMap != null) {
List<String> labelsList = new ArrayList<>(dataMap.keySet());
List<Integer> valuesList = new ArrayList<>(dataMap.values());
// 生成 JavaScript 数组的字符串表示
StringBuilder labelsArray = new StringBuilder("[");
for (int i = 0; i < labelsList.size(); i++) {
labelsArray.append("\"").append(labelsList.get(i)).append("\"");
if (i != labelsList.size() - 1) {
labelsArray.append(",");
}
}
labelsArray.append("]");
StringBuilder valuesArray = new StringBuilder("[");
for (int i = 0; i < valuesList.size(); i++) {
valuesArray.append(valuesList.get(i));
if (i != valuesList.size() - 1) {
valuesArray.append(",");
}
}
valuesArray.append("]");
%>
<script>
const labels = <%= labelsArray.toString() %>; // 将 labels 转换为 JavaScript 数组
const values = <%= valuesArray.toString() %>; // 将 values 转换为 JavaScript 数组
const ctx = document.getElementById('myChart').getContext('2d');
new Chart(ctx, {
type: 'bar',
data: {
labels: labels,
datasets: [{
label: '数据',
data: values,
backgroundColor: 'rgba(54, 162, 235, 0.5)',
borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<%
}
%>
</div>
</div>
</body>
</html>

@ -0,0 +1,73 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.Vehicle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/vehicleStyle.css">
</head>
<%
request.setCharacterEncoding("UTF-8");
List<Vehicle> vehicles = (List<Vehicle>) request.getAttribute("vehicles");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="#"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="<%=request.getContextPath()%>">山东科技大学 作为小组停车场管理系统 <span style="font-size: 20px;">管理员端</span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<%-- <span><%=request.getSession().getAttribute("username")%></span>--%>
<%-- <div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>--%>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
</div>
<div class="tasks-content">
<form id="vehicle-form" action="<%=request.getContextPath()%>/main/admin/Vehicles" method="post">
<input type="text" name="car_license" placeholder="请输入车牌号">
<input type="text" name="brand" placeholder="请输入品牌">
<input type="text" name="model" placeholder="请输入型号">
<input type="text" name="buildnum" placeholder="楼号">
<input type="submit" value="搜索">
</form>
<table class="vehicle-table">
<tr style="color:#087DCE;">
<th style="font-weight: bold;">车牌号</th>
<th style="font-weight: bold;">品牌</th>
<th style="font-weight: bold;">型号</th>
<th style="font-weight: bold;">业主</th>
<th style="font-weight: bold;">联系方式</th>
<th style="font-weight: bold;">地址</th>
</tr>
<%
for(Vehicle vehicle: vehicles) {
%>
<tr>
<th><%=vehicle.getCar_license()%></th>
<th><%=vehicle.getBrand()%></th>
<th><%=vehicle.getModel()%></th>
<th><%=vehicle.getUsername()%></th>
<th><%=vehicle.getTelephone()%></th>
<th><%=vehicle.getAddress()%></th>
</tr>
<%
}
%>
</table>
</div>
</div>
</body>
</html>

@ -0,0 +1,130 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/IC-Info.css">
</head>
<script>
function sortRecords() {
// 获取选定的排序字段和顺序
var sortField = document.getElementById("sortField").value;
var sortOrder = document.getElementById("sortOrder").value;
// 构建带有参数的URL
var contextPath = "<%=request.getContextPath()%>";
var url = contextPath + "/main/sort_record?type=" + sortField + "&order=" + sortOrder+"&path="+"/main/user/Ic-card.jsp";
// 导航到新的URL
window.location.href = url;
}
</script>
<%
session=request.getSession();
User user=(User)session.getAttribute("user");
IcCard card=(IcCard) session.getAttribute("Ic-card");
List<ParkingRecord>record=(List<ParkingRecord>) session.getAttribute("spot_record");
request.setCharacterEncoding("UTF-8");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/main/user/user-Info.jsp"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=user.getName()%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_user">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_spot">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_record">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_car_Info">车辆信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_IC">IC卡信息</a>
</div>
<div class="tasks-content">
<table>
<tr>
<th>卡号</th>
<td><%=card.getCard_number()%></td>
</tr>
<tr>
<th>余额</th>
<td>
<%=card.getBalance()%>
</td>
</tr>
</table>
<div class="sort-bar" style="display:flex;">
<thead>
<tr>
<th>
排序基准
<select id="sortField">
<option value="st">开始时间</option>
<option value="fee">停车费用</option>
</select>
</th>
<th>
排序方式
<select id="sortOrder">
<option value="asc">升序</option>
<option value="desc">降序</option>
</select>
</th>
</tr>
</thead>
<div class="sort" onclick="sortRecords()">确认</div>
</div>
<table id="userTable">
<thead>
<tr>
<th>记录号</th>
<th>开始时间</th>
<th>消费</th>
</tr>
</thead>
<tbody>
<%
int currentPage=1;
if(request.getParameter("page")!=null){
currentPage=Integer.parseInt(request.getParameter("page"));
}
for (int i=10*(currentPage-1);i<Math.min(record.size(),10*(currentPage-1)+10);i++) {
ParkingRecord re= record.get(i);
%>
<tr>
<td><%= i+1 %></td>
<td><%= re.getStart_time() %></td>
<td><%= re.getParking_fee() %></td>
</tr>
<% } %>
</tbody>
</table>
<div >
<div class="pageConfig">
<a style="margin-left: 32%" href="<%=request.getContextPath()%>/main/user/parking_record.jsp?page=1">首页</a>
<a href="<%=request.getContextPath()%>/main/user/Ic-card.jsp?page=<%=(currentPage > 1) ? (currentPage - 1) : 1 %>">上一页</a>
<a href="<%=request.getContextPath()%>/main/user/Ic-card.jsp?page=<%=currentPage%>">当前:<%=currentPage%>/<%=record.size()/10+1%></a>
<a href="<%=request.getContextPath()%>/main/user/Ic-card.jsp?page=<%= Math.min(currentPage + 1,record.size()/10+1) %>">下一页</a>
<a href="<%=request.getContextPath()%>/main/user/Ic-card.jsp?page=<%=record.size()/10+1%>">尾页</a>
</div></div>
</div>
</div>
</body>
</html>

@ -0,0 +1,68 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="pojo.ParkingSpot" %>
<%@ page import="pojo.ParkingRecord" %>
<%@ page import="pojo.Vehicle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/car-Info.css">
</head>
<%
session=request.getSession();
User user=(User)session.getAttribute("user");
Vehicle car=(Vehicle) session.getAttribute("car");
request.setCharacterEncoding("UTF-8");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/main/user/user-Info.jsp"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=user.getName()%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_user">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_spot">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_record">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_car_Info">车辆信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_IC">IC卡信息</a>
</div>
<div class="tasks-content">
<table>
<tr>
<th>车牌</th>
<td><%=car.getCar_license()%></td>
</tr>
<tr>
<th>车类别</th>
<td>
<%=car.getBrand()%>
</td>
</tr>
<tr>
<th>车型</th>
<td><%=car.getModel()%></td>
</tr>
</table>
</div>
</div>
</body>
</html>

@ -0,0 +1,125 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="pojo.ParkingSpot" %>
<%@ page import="pojo.ParkingRecord" %>
<%@ page import="service.ParkingRecordService" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/spot-record.css">
</head>
<%
session=request.getSession();
User user=(User)session.getAttribute("user");
ParkingSpot spot=(ParkingSpot) session.getAttribute("spot");
List<ParkingRecord>record=(List<ParkingRecord>) session.getAttribute("spot_record");
request.setCharacterEncoding("UTF-8");
%>
<script>
function sortRecords() {
// 获取选定的排序字段和顺序
var sortField = document.getElementById("sortField").value;
var sortOrder = document.getElementById("sortOrder").value;
// 构建带有参数的URL
var contextPath = "<%=request.getContextPath()%>";
var url = contextPath + "/main/sort_record?type=" + sortField + "&order=" + sortOrder+"&path="+"/main/user/parking_record.jsp";
// 导航到新的URL
window.location.href = url;
}
</script>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/main/user/user-Info.jsp"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=user.getName()%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_user">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_spot">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_record">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_car_Info">车辆信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_IC">IC卡信息</a>
</div>
<div class="tasks-content">
<div class="sort-bar" style="display:flex;">
<thead>
<tr>
<th>
排序基准
<select id="sortField">
<option value="st">开始时间</option>
<option value="et">结束时间</option>
<option value="fee">停车费用</option>
<option value="license">车牌号</option>
</select>
</th>
<th>
排序方式
<select id="sortOrder">
<option value="asc">升序</option>
<option value="desc">降序</option>
</select>
</th>
</tr>
</thead>
<div class="sort" onclick="sortRecords()">确认</div>
</div>
<table id="userTable">
<thead>
<tr>
<th>记录号</th>
<th>开始时间</th>
<th>结束时间</th>
<th>车牌号</th>
<th>消费</th>
</tr>
</thead>
<tbody>
<%
int currentPage=1;
if(request.getParameter("page")!=null){
currentPage=Integer.parseInt(request.getParameter("page"));
}
for (int i=10*(currentPage-1);i<Math.min(record.size(),10*(currentPage-1)+10);i++) {
ParkingRecord re= record.get(i);
%>
<tr>
<td><%= i+1 %></td>
<td><%= re.getStart_time() %></td>
<td><%= re.getEnd_time() %></td>
<td><%= re.getCar_license() %></td>
<td><%= re.getParking_fee() %></td>
</tr>
<% } %>
</tbody>
</table>
<div>
<div class="pageConfig">
<a style="margin-left: 32%" href="<%=request.getContextPath()%>/main/user/parking_record.jsp?page=1">首页</a>
<a href="<%=request.getContextPath()%>/main/user/parking_record.jsp?page=<%=(currentPage > 1) ? (currentPage - 1) : 1 %>">上一页</a>
<a href="<%=request.getContextPath()%>/main/user/parking_record.jsp?page=<%=currentPage%>">当前:<%=currentPage%>/<%=record.size()/10+1%></a>
<a href="<%=request.getContextPath()%>/main/user/parking_record.jsp?page=<%= Math.min(currentPage + 1,record.size()/10+1) %>">下一页</a>
<a href="<%=request.getContextPath()%>/main/user/parking_record.jsp?page=<%=record.size()/10+1%>">尾页</a>
</div> </div>
</div>
</div>
</body>
</html>

@ -0,0 +1,80 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="pojo.ParkingSpot" %>
<%@ page import="pojo.ParkingRecord" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/parking-spot.css">
</head>
<%
session=request.getSession();
User user=(User)session.getAttribute("user");
ParkingSpot spot=(ParkingSpot) session.getAttribute("spot");
List<ParkingRecord>record=(List<ParkingRecord>) session.getAttribute("spot_record");
request.setCharacterEncoding("UTF-8");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/main/user/user-Info.jsp"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=user.getName()%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_user">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_spot">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_record">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_car_Info">车辆信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_IC">IC卡信息</a>
</div>
<div class="tasks-content">
<table>
<tr>
<th>车位类型</th>
<td><%=spot.getSpot_type()%></td>
</tr>
<tr>
<th>车位占用情况</th>
<td>
<div style="display:flex;">
<%if(spot.getOccupancy_status()==0){%>
<div class="round"></div>
<div class="status" style="color:#44e544">空闲</div>
<%}else{%>
<div class="round" style="background-color: red"></div>
<div class="status" style="color: red">被占用</div>
<%}%>
</div>
</td>
</tr>
<tr>
<th>车位地址</th>
<td><%=spot.getLocation()%></td>
</tr>
<tr>
<th>车位费用</th>
<td><%=spot.getFee_standard()%></td>
</tr>
</table>
</div>
</div>
</body>
</html>

@ -0,0 +1,70 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/update-user-Info.css">
</head>
<%
session=request.getSession();
User user=(User)session.getAttribute("user");
request.setCharacterEncoding("UTF-8");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/main/user/user-Info.jsp"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=user.getName()%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_user">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_spot">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_record">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_car_Info">车辆信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_IC">IC卡信息</a>
</div>
<div class="tasks-content">
<form action="<%=request.getContextPath()%>/main/update_user_Info" method="post">
<table>
<tr>
<th>姓名</th>
<td><input type="text" name="name" value="<%=user.getName()%>" /></td>
</tr>
<tr>
<th>性别</th>
<td><input type="text" name="gender" value="<%=user.getGender()%>" /></td>
</tr>
<tr>
<th>电话号码</th>
<td><input type="text" name="phone" value="<%=user.getTelephone()%>" /></td>
</tr>
<tr>
<th>住址</th>
<td><input type="text" name="address" value="<%=user.getAddress()%>" /></td>
</tr>
<tr>
<th>车位号</th>
<td><input type="text" name="parkingSpot" value="<%=user.getSpot_id()%>" /></td>
</tr>
</table>
<input type="submit" value="提交" />
</form>
</div>
</div>
</body>
</html>

@ -0,0 +1,70 @@
<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>管理员</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/user-Info.css">
</head>
<%
session=request.getSession();
User user=(User)session.getAttribute("user");
request.setCharacterEncoding("UTF-8");
%>
<body>
<div class="top-bar">
<div class="top-bar-logo">
<a href="<%=request.getContextPath()%>/main/user/user-Info.jsp"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
<a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></span></a>
</div>
<div class="top-bar-btn">
</div>
<div class="top-bar-right">
<div class="drop-menu">
<div class="top-bar-account">
<span><%=user.getName()%></span>
<div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="side-bar">
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_user">用户信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_spot">车位情况</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_record">停车记录</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_car_Info">车辆信息</a>
<a class="side-bar-button" href="<%=request.getContextPath()%>/main/get_IC">IC卡信息</a>
</div>
<div class="tasks-content">
<table>
<tr>
<th>姓名</th>
<td><%=user.getName()%></td>
</tr>
<tr>
<th>性别</th>
<td><%=user.getGender()%></td>
</tr>
<tr>
<th>电话号码</th>
<td><%=user.getTelephone()%></td>
</tr>
<tr>
<th>住址</th>
<td><%=user.getAddress()%></td>
</tr>
<tr>
<th>车位号</th>
<td><%=user.getSpot_id()%></td>
</tr>
</table>
<div class="update-Info" onclick="window.location.href='<%=request.getContextPath()%>/main/user/update-Info.jsp'">更新</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,43 @@
table{
border-collapse: collapse;
width: 60%;
border: 1px solid black; /* 添加边框 */
}
th, td {
border: 1px solid black; /* 添加边框 */
padding: 8px;
text-align: left;
}
tr {
height: 50px;
width: 70px;
}
a {
width: 130px;
padding: 10px;
text-decoration: none;
color: black;
}
.sort:hover {
cursor: pointer;
}
.sort {
width: 50px;
background-color: white;
margin-left: 20px;
text-align: center;
border-radius: 8px;
box-shadow: 0 0 2px;
}
.sort-bar {
margin: 10px;
}
.pageConfig{
width: 100%;
display: flex;
cursor: pointer;
margin:auto;
/*border: 2px solid #126bff;*/
}

@ -0,0 +1,13 @@
table {
border-collapse: collapse;
width: 50%;
}
th, td {
border: 1px solid black; /* 添加边框 */
padding: 8px;
text-align: left;
}
tr {
height: 70px;
width: 70px;
}

@ -0,0 +1,14 @@
#contentHolder video{
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
#title {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
#title span {
font-size: 50px;
}

@ -0,0 +1,263 @@
a {
text-decoration: none;
color:black;
}
html, body {
height: 100%;
font-weight: 1;
background-color: rgb(244,245,247);
}
body {
display: flex;
flex-direction: column;
}
.container {
display: flex;
height: 90%;
flex-direction: row;
}
.side-bar {
flex: 0 0 10%;
display: flex;
flex-direction: column;
align-items: center;
background-color: white;
z-index: 1;
}
.tasks-content {
width: 100%;
height: auto;
display: flex;
flex-direction: column;
align-items: center;
}
.top-bar {
display: flex;
flex-direction: row;
height: 10%;
align-items: flex-end;
background-color: white;
z-index: 2;
box-shadow: 0px 5px 5px -5px rgba(0, 0, 0, 0.5);
}
.side-bar-button {
display: block;
width: 80%;
padding: 10px;
margin: 5px 0;
text-align: center;
color: black;
text-decoration: none;
background-color: white;
}
.side-bar-button:hover {
background-color: #087DCE;
color: white;
transition: 0.3s ease;
}
div {
/*border: 2px solid black;*/
}
#logo {
height: 100%;
}
#logo-text {
font-size: 30px;
position: relative;
bottom: 35%;
color:black;
}
#logo-text span {
font-size: 20px;
}
.top-bar-btn {
flex-direction: row;
height: 50%;
align-items: flex-end;
margin-left: 30px;
}
.top-bar-tag:hover {
color:#087DCE;
border-bottom: 1px solid #087DCE;
transition: 0.5s ease;
}
.top-bar-tag {
width:10%;
height: 100%;
color:black;
margin-right: 20px;
font-size: 26px;
}
.top-bar-logo {
height: 100%;
}
#empty-logo {
width: 25%;
}
.task-area {
width:80%;
height: 200px;
margin-left: 10px;
margin-top: 50px;
display: flex;
flex-direction: row;
background-color: white;
border-radius: 8px;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.5);
transition: 0.3s ease;
}
.task-area:hover {
transform: translateY(-5px); /* 鼠标悬停时向上浮动 */
}
.task-cover img {
height: 100%;
box-shadow: 0 0 10px rgba(187, 186, 186, 0.3); /* 这里的 rgba() 中的最后一个参数表示透明度 */
}
.task-description {
flex:1;
width: auto;
display: flex;
flex-direction: column;
margin-left: 10px;
}
a.task-button {
width: 10%;
padding: 10px;
border-radius: 8px;
float: right;
text-decoration: none;
color:black;
background-color: rgb(255, 245, 247);
text-align: center;
margin-right: 10px;
box-shadow: 0 0 5px rgb(0, 0, 0);
}
a.task-button:hover {
background-color:#087DCE;
color: white;
transition: 0.3s ease;
}
.progress {
width: 60%;
height: 20px;
background-color: #dadada;
border-radius: 4px;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
margin-top: 20px;
margin-left: auto;
margin-right: 20px;
}
.progress-bar {
height: 100%;
line-height: 20px;
color: #fff;
text-align: center;
background-color: #087DCE;
border-radius: 4px;
transition: width 0.3s ease-in-out;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
position: relative;
}
.progress-text {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
}
.task-top-bar {
display: flex;
flex-direction: row;
}
.top-bar-right {
display: flex;
flex:1;
height: 100%;
}
.top-bar-account {
display: flex;
margin-left:auto;
margin-right: 40px;
height: 100%;
align-items: center;
}
.drop-menu {
width: 130px;
color:black;
border-bottom: 1px solid darkgray;
margin-top: auto;
margin-left: auto;
margin-right: 50px;
}
.top-bar-account{
width: 100%;
height: 45px;
line-height: 45px;
text-align: center;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
}
.top-bar-account:hover{
overflow: visible;
background-color: #087DCE;
color: white;
z-index: 999;
cursor: pointer;
transition: 0.5s ease;
}
.drop{
background-color: white;
text-align: center;
width: 100%;
height: 45px;
line-height: 45px;
}
.drop a {
color:black;
}
.drop:hover{
background: #087DCE;
cursor: pointer;
}
.drop:hover a {
color:white;
}
.up-area {
width: 80%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
#teach-video {
margin-top: 10px;
}
.video-title {
margin-top: 20px;
}
.video-title-text {
font-size:22px;
font-weight: 2;
}
.down-area {
width: 80%;
height: auto;
display: flex;
justify-content: center;
}
.illustrate-text {
margin: 20px;
padding: 10px;
width: 60%;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.illustrate-text p {
margin-left: 30px;
margin-right: 30px;
}

@ -0,0 +1,59 @@
body {
font-family: Arial, sans-serif;
}
.vertical-text {
writing-mode: vertical-rl;
text-orientation: mixed;
border: 1px solid black; /* 添加边框 */
display: inline-block;
padding: 10px;
margin-right: 20px;
}
table {
border-collapse: collapse;
width: 50%;
}
th, td {
border: 1px solid black; /* 添加边框 */
padding: 8px;
text-align: left;
}
tr {
height: 70px;
width: 70px;
}
.update-Info:hover {
cursor: pointer;
color: blue;
}
.update-Info {
height: 55px;
width: 164px;
background-color: white;
text-align: center;
line-height: 52px;
margin-top: 30px;
border-radius: 30px;
box-shadow: 0 0 10px #4a4747;
}
.round {
margin-top: 4px;
width: 15px;
height: 15px;
background-color: #44e544;
border-radius: 10px;
}
.status {
margin-left: 10px;
}
.scrollable-textbox {
overflow-y: scroll; /* 启用垂直滚动条 */
border: 1px solid #ccc; /* 文本框的边框 */
padding: 8px; /* 文本框内部的填充 */
white-space: pre-wrap; /* 保留空白符和换行符 */
width: 530px;
height: 200px;
resize: none; /* 禁止调整大小 */
}

@ -0,0 +1,52 @@
.main-content {
width: 65%;
height: auto;
display: flex;
flex-direction: column;
align-items: center;
flex-wrap: wrap;
}
.block {
width: 40%;
height: 30%;
margin: 3%;
display: flex;
flex-wrap: wrap;
border: 5px double black;
}
.car-area {
border: 1px solid;
width: 30%;
height: 45%;
margin: 1%;
display: flex;
flex-direction: column;
}
.car-img {
display: flex;
flex-direction: column;
font-size: 14px;
box-shadow: 0 0 8px rgb(0, 0, 0);
overflow: hidden;
}
.car-img img {
height: 113px;
width: 128px;
}
.car-img:hover {
overflow: visible;
cursor: pointer;
transition: 0.3s ease;
z-index: 2;
}
.car-img span{
background-color: #087DCE;
color: white;
}

@ -0,0 +1,52 @@
.scrollable-textbox {
overflow-y: scroll; /* 启用垂直滚动条 */
border: 1px solid #ccc; /* 文本框的边框 */
padding: 8px; /* 文本框内部的填充 */
white-space: pre-wrap; /* 保留空白符和换行符 */
width: 530px;
height: 200px;
resize: none; /* 禁止调整大小 */
}
.pageConfig{
margin:auto;
width: 100%;
display: flex;
cursor: pointer;
/*border: 2px solid #126bff;*/
}
a {
width: 130px;
padding: 10px;
text-decoration: none;
color: black;
}
table{
border-collapse: collapse;
width: 60%;
border: 1px solid black; /* 添加边框 */
}
th, td {
border: 1px solid black; /* 添加边框 */
padding: 8px;
text-align: left;
}
tr {
height: 50px;
width: 70px;
}
.sort:hover {
cursor: pointer;
}
.sort {
width: 50px;
background-color: white;
margin-left: 20px;
text-align: center;
border-radius: 8px;
box-shadow: 0 0 2px;
}
.sort-bar {
margin: 10px;
}

@ -0,0 +1,58 @@
body {
font-family: Arial, sans-serif;
}
.vertical-text {
writing-mode: vertical-rl;
text-orientation: mixed;
border: 1px solid black; /* 添加边框 */
display: inline-block;
padding: 10px;
margin-right: 20px;
}
table {
border-collapse: collapse;
width: 100%;
}
th, td {
border: 1px solid black; /* 添加边框 */
padding: 8px;
text-align: left;
}
tr {
height: 70px;
width: 70px;
}
.update-Info:hover {
cursor: pointer;
color: blue;
}
.update-Info {
height: 55px;
width: 164px;
background-color: white;
text-align: center;
line-height: 52px;
margin-top: 30px;
border-radius: 30px;
box-shadow: 0 0 10px #4a4747;
}
form {
width: 550px;
}
input[type="submit"] {
height: 55px;
width: 164px;
background-color: white;
text-align: center;
line-height: 52px;
margin-top: 30px;
border-radius: 30px;
box-shadow: 0 0 10px #4a4747;
margin-left: 227px;
}
input[type="submit"]:hover {
cursor: pointer;
color: blue;
}

@ -0,0 +1,39 @@
body {
font-family: Arial, sans-serif;
}
.vertical-text {
writing-mode: vertical-rl;
text-orientation: mixed;
border: 1px solid black; /* 添加边框 */
display: inline-block;
padding: 10px;
margin-right: 20px;
}
table {
border-collapse: collapse;
width: 50%;
}
th, td {
border: 1px solid black; /* 添加边框 */
padding: 8px;
text-align: left;
}
tr {
height: 70px;
width: 70px;
}
.update-Info:hover {
cursor: pointer;
color: blue;
}
.update-Info {
height: 55px;
width: 164px;
background-color: white;
text-align: center;
line-height: 52px;
margin-top: 30px;
border-radius: 30px;
box-shadow: 0 0 10px #4a4747;
}

@ -0,0 +1,159 @@
.vehicle-table {
width: 90%;
font-weight: 1;
font-size: 20px;
border-collapse: collapse;
border: 1px solid rgb(145, 145, 145);
background-color: white;
}
.vehicle-table th {
border: 1px solid #dadada;
padding: 8px;
font-weight: 1;
height: 65px;
}
.vehicle-table th a{
display: block;
height: 100%;
width: 100%;
}
.vehicle-table th a:hover{
background-color: #087DCE;
color:white;
transition: 0.3s ease;
}
.vehicle-table tr:hover {
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
transition: 0.3s ease;
}
#vehicle-form {
width: 90%;
background-color: white;
display: flex;
flex-direction: row;
margin-top:1%;
}
#vehicle-form input[type='text'] {
height: 50px;
font-size: 20px;
margin-right: 4%;
}
#vehicle-form input[type='submit'] {
height: 50px;
background-color: #087DCE;
color:white;
font-size: 20px;
width: 100px;
border-radius: 15px;
}
#vehicle-form input[type='submit']:hover {
cursor: pointer;
filter:brightness(110%);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
transition: 0.3s ease;
}
#vehicle-form input[type='date'] {
margin-left: 4%;
margin-right: 4%;
}
.choose-area {
height: 4%;
display: flex;
justify-content: center;
}
.choose-area a {
height: 100%;
font-size: 28px;
margin-left: 10px;
margin-right: 10px;
background-color: white;
padding: 6px;
/* border-radius: 1px; */
}
.choose-area a:hover {
background-color: #087DCE;
color:white;
transition: 0.3s ease;
}
#all-records {
width: 100%;
height: 100%;
margin-left: 10%;
}
#data-section {
width: 100%;
flex-direction: column;
margin-top: 2%;
}
.data-row {
width: 100%;
height: 50%;
display: flex;
flex-direction: row;
}
#top {
height: 300px;
width: 750px;
margin: 10px;
box-shadow: 0 0 5px rgb(0, 0, 0);
background-color: white;
}
#top:hover {
transform: scale(1.1);
transition: 0.3s ease;
}
#line-chart {
height: 350px;
width: 1200px;
margin: 10px;
background-color: white;
box-shadow: 0 0 5px rgb(0, 0, 0);
}
#line-chart:hover {
transform: scale(1.1);
transition: 0.3s ease;
}
#user-pic {
height: 350px;
width: 425px;
margin: 10px;
background-color: white;
box-shadow: 0 0 5px rgb(0, 0, 0);
}
#user-pic:hover {
transform: scale(1.1);
transition: 0.3s ease;
}
#chart1 {
height: 300px;
width: 750px;
margin: 10px;
box-shadow: 0 0 5px rgb(0, 0, 0);
background-color: white;
margin-left: 7%;
}
#chart1:hover {
transform: scale(1.1);
transition: 0.3s ease;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Loading…
Cancel
Save