├── .classpath ├── .project ├── .settings ├── .jsdtscope ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.jdt.ui.prefs ├── org.eclipse.wst.common.component ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.jsdt.ui.superType.container └── org.eclipse.wst.jsdt.ui.superType.name ├── .tern-project ├── WebRoot ├── .project ├── Dashboard Template for Bootstrap.html ├── Dashboard Template for Bootstrap_files │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── dashboard.css │ ├── holder.min.js │ ├── ie-emulation-modes-warning.js │ ├── ie10-viewport-bug-workaround.js │ └── jquery.min.js ├── META-INF │ └── MANIFEST.MF ├── MyJsp.jsp ├── WEB-INF │ ├── classes │ │ ├── c3p0-config.xml │ │ └── pers │ │ │ └── gulo │ │ │ └── fm │ │ │ ├── dao │ │ │ ├── AdminDao.class │ │ │ ├── PassengerDao.class │ │ │ ├── UserDao.class │ │ │ ├── impl │ │ │ │ ├── AdminDaoImpl.class │ │ │ │ ├── PassengerDaoImpl.class │ │ │ │ └── UserDaoImpl.class │ │ │ └── resultSetHandler │ │ │ │ ├── AirPlaneResultSetHandler.class │ │ │ │ ├── CountResultSetHandler.class │ │ │ │ ├── FlightResultSetHandler.class │ │ │ │ ├── FloatResultSetHandler.class │ │ │ │ ├── OrderResultSetHandler.class │ │ │ │ └── UserResultSetHandler.class │ │ │ ├── domain │ │ │ ├── AirPlane.class │ │ │ ├── Flight.class │ │ │ ├── Order.class │ │ │ ├── Statistic.class │ │ │ └── User.class │ │ │ ├── exception │ │ │ └── FMException.class │ │ │ ├── service │ │ │ ├── AdminService.class │ │ │ ├── PassengerService.class │ │ │ ├── UserService.class │ │ │ └── impl │ │ │ │ ├── AdminServiceImpl.class │ │ │ │ ├── PassengerServiceImpl.class │ │ │ │ └── UserServiceImpl.class │ │ │ ├── test │ │ │ └── Main.class │ │ │ ├── utils │ │ │ ├── DaoUtils.class │ │ │ └── JDBCUtils.class │ │ │ └── web │ │ │ ├── AddAirPlaneServlet.class │ │ │ ├── AddFlightServlet.class │ │ │ ├── AddUserServlet.class │ │ │ ├── BookServlet.class │ │ │ ├── CancelServlet.class │ │ │ ├── DeleteAirPlaneServlet.class │ │ │ ├── DeleteFlightServlet.class │ │ │ ├── LoginServlet.class │ │ │ ├── LogoutServlet.class │ │ │ ├── PayServlet.class │ │ │ ├── RechargeServlet.class │ │ │ ├── UpdateFlightServlet.class │ │ │ └── UpdateUserServlet.class │ ├── lib │ │ ├── activation.jar │ │ ├── c3p0-0.9.1.2.jar │ │ ├── commons-beanutils-1.8.3.jar │ │ ├── commons-dbutils-1.4.jar │ │ ├── commons-fileupload-1.2.1.jar │ │ ├── commons-io-1.4.jar │ │ ├── commons-logging-1.1.1.jar │ │ ├── mail.jar │ │ ├── mysql-connector-java-5.1.39-bin.jar │ │ └── standard.jar │ └── web.xml ├── addAirPlane.jsp ├── addFlight.jsp ├── airPlaneManage.jsp ├── bookFlight.jsp ├── css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ └── signin.css ├── flightManage.jsp ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── index.jsp ├── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── ie-emulation-modes-warning.js │ ├── ie10-viewport-bug-workaround.js │ ├── jquery-3.0.0.min.js │ └── npm.js ├── login.jsp ├── manage.html ├── manage.jsp ├── myOrder.jsp ├── myWallet.jsp ├── orderManage.jsp ├── queryFlight.jsp ├── recharge.jsp ├── register.jsp ├── statisticManage.jsp ├── updateFlightInfo.jsp ├── updateUserInfo.jsp ├── user.jsp ├── userInfo.html └── userManage.jsp ├── flight_management.sql └── src ├── c3p0-config.xml └── pers └── gulo └── fm ├── dao ├── AdminDao.java ├── PassengerDao.java ├── UserDao.java ├── impl │ ├── AdminDaoImpl.java │ ├── PassengerDaoImpl.java │ └── UserDaoImpl.java └── resultSetHandler │ ├── AirPlaneResultSetHandler.java │ ├── CountResultSetHandler.java │ ├── FlightResultSetHandler.java │ ├── FloatResultSetHandler.java │ ├── OrderResultSetHandler.java │ └── UserResultSetHandler.java ├── domain ├── AirPlane.java ├── Flight.java ├── Order.java ├── Statistic.java └── User.java ├── exception └── FMException.java ├── service ├── AdminService.java ├── PassengerService.java ├── UserService.java └── impl │ ├── AdminServiceImpl.java │ ├── PassengerServiceImpl.java │ └── UserServiceImpl.java ├── test └── Main.java ├── utils ├── DaoUtils.java └── JDBCUtils.java └── web ├── AddAirPlaneServlet.java ├── AddFlightServlet.java ├── AddUserServlet.java ├── BookServlet.java ├── CancelServlet.java ├── DeleteAirPlaneServlet.java ├── DeleteFlightServlet.java ├── LoginServlet.java ├── LogoutServlet.java ├── PayServlet.java ├── RechargeServlet.java ├── UpdateFlightServlet.java └── UpdateUserServlet.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | flight_management 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.common.project.facet.core.builder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.jem.workbench.JavaEMFNature 36 | org.eclipse.wst.common.modulecore.ModuleCoreNature 37 | org.eclipse.wst.common.project.facet.core.nature 38 | org.eclipse.jdt.core.javanature 39 | org.eclipse.wst.jsdt.core.jsNature 40 | 41 | 42 | -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.8 8 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=false 3 | sp_cleanup.add_default_serial_version_id=true 4 | sp_cleanup.add_generated_serial_version_id=false 5 | sp_cleanup.add_missing_annotations=true 6 | sp_cleanup.add_missing_deprecated_annotations=true 7 | sp_cleanup.add_missing_methods=false 8 | sp_cleanup.add_missing_nls_tags=false 9 | sp_cleanup.add_missing_override_annotations=true 10 | sp_cleanup.add_missing_override_annotations_interface_methods=true 11 | sp_cleanup.add_serial_version_id=false 12 | sp_cleanup.always_use_blocks=true 13 | sp_cleanup.always_use_parentheses_in_expressions=false 14 | sp_cleanup.always_use_this_for_non_static_field_access=false 15 | sp_cleanup.always_use_this_for_non_static_method_access=false 16 | sp_cleanup.convert_functional_interfaces=false 17 | sp_cleanup.convert_to_enhanced_for_loop=false 18 | sp_cleanup.correct_indentation=false 19 | sp_cleanup.format_source_code=false 20 | sp_cleanup.format_source_code_changes_only=false 21 | sp_cleanup.insert_inferred_type_arguments=false 22 | sp_cleanup.make_local_variable_final=true 23 | sp_cleanup.make_parameters_final=false 24 | sp_cleanup.make_private_fields_final=true 25 | sp_cleanup.make_type_abstract_if_missing_method=false 26 | sp_cleanup.make_variable_declarations_final=false 27 | sp_cleanup.never_use_blocks=false 28 | sp_cleanup.never_use_parentheses_in_expressions=true 29 | sp_cleanup.on_save_use_additional_actions=false 30 | sp_cleanup.organize_imports=true 31 | sp_cleanup.qualify_static_field_accesses_with_declaring_class=false 32 | sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true 33 | sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true 34 | sp_cleanup.qualify_static_member_accesses_with_declaring_class=false 35 | sp_cleanup.qualify_static_method_accesses_with_declaring_class=false 36 | sp_cleanup.remove_private_constructors=true 37 | sp_cleanup.remove_redundant_type_arguments=true 38 | sp_cleanup.remove_trailing_whitespaces=false 39 | sp_cleanup.remove_trailing_whitespaces_all=true 40 | sp_cleanup.remove_trailing_whitespaces_ignore_empty=false 41 | sp_cleanup.remove_unnecessary_casts=true 42 | sp_cleanup.remove_unnecessary_nls_tags=false 43 | sp_cleanup.remove_unused_imports=false 44 | sp_cleanup.remove_unused_local_variables=false 45 | sp_cleanup.remove_unused_private_fields=true 46 | sp_cleanup.remove_unused_private_members=false 47 | sp_cleanup.remove_unused_private_methods=true 48 | sp_cleanup.remove_unused_private_types=true 49 | sp_cleanup.sort_members=false 50 | sp_cleanup.sort_members_all=false 51 | sp_cleanup.use_anonymous_class_creation=false 52 | sp_cleanup.use_blocks=false 53 | sp_cleanup.use_blocks_only_for_return_and_throw=false 54 | sp_cleanup.use_lambda=true 55 | sp_cleanup.use_parentheses_in_expressions=false 56 | sp_cleanup.use_this_for_non_static_field_access=false 57 | sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true 58 | sp_cleanup.use_this_for_non_static_method_access=false 59 | sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true 60 | sp_cleanup.use_type_arguments=false 61 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /.tern-project: -------------------------------------------------------------------------------- 1 | {"ide":{},"libs":["ecma5","browser"],"plugins":{"guess-types":{}}} -------------------------------------------------------------------------------- /WebRoot/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | WebRoot 4 | 5 | 6 | 7 | 8 | 9 | com.aptana.ide.core.unifiedBuilder 10 | 11 | 12 | 13 | 14 | 15 | com.aptana.projects.webnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /WebRoot/Dashboard Template for Bootstrap_files/dashboard.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | 11 | /* 12 | * Global add-ons 13 | */ 14 | 15 | .sub-header { 16 | padding-bottom: 10px; 17 | border-bottom: 1px solid #eee; 18 | } 19 | 20 | /* 21 | * Top navigation 22 | * Hide default border to remove 1px line. 23 | */ 24 | .navbar-fixed-top { 25 | border: 0; 26 | } 27 | 28 | /* 29 | * Sidebar 30 | */ 31 | 32 | /* Hide for mobile, show later */ 33 | .sidebar { 34 | display: none; 35 | } 36 | @media (min-width: 768px) { 37 | .sidebar { 38 | position: fixed; 39 | top: 51px; 40 | bottom: 0; 41 | left: 0; 42 | z-index: 1000; 43 | display: block; 44 | padding: 20px; 45 | overflow-x: hidden; 46 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 47 | background-color: #f5f5f5; 48 | border-right: 1px solid #eee; 49 | } 50 | } 51 | 52 | /* Sidebar navigation */ 53 | .nav-sidebar { 54 | margin-right: -21px; /* 20px padding + 1px border */ 55 | margin-bottom: 20px; 56 | margin-left: -20px; 57 | } 58 | .nav-sidebar > li > a { 59 | padding-right: 20px; 60 | padding-left: 20px; 61 | } 62 | .nav-sidebar > .active > a, 63 | .nav-sidebar > .active > a:hover, 64 | .nav-sidebar > .active > a:focus { 65 | color: #fff; 66 | background-color: #428bca; 67 | } 68 | 69 | 70 | /* 71 | * Main content 72 | */ 73 | 74 | .main { 75 | padding: 20px; 76 | } 77 | @media (min-width: 768px) { 78 | .main { 79 | padding-right: 40px; 80 | padding-left: 40px; 81 | } 82 | } 83 | .main .page-header { 84 | margin-top: 0; 85 | } 86 | 87 | 88 | /* 89 | * Placeholder dashboard ideas 90 | */ 91 | 92 | .placeholders { 93 | margin-bottom: 30px; 94 | text-align: center; 95 | } 96 | .placeholders h4 { 97 | margin-bottom: 0; 98 | } 99 | .placeholder { 100 | margin-bottom: 20px; 101 | } 102 | .placeholder img { 103 | display: inline-block; 104 | border-radius: 50%; 105 | } 106 | -------------------------------------------------------------------------------- /WebRoot/Dashboard Template for Bootstrap_files/holder.min.js: -------------------------------------------------------------------------------- 1 | 2 | 404 Not Found 3 | 4 |

404 Not Found

5 |
nginx
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /WebRoot/Dashboard Template for Bootstrap_files/ie-emulation-modes-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2014-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. 11 | (function () { 12 | 'use strict'; 13 | 14 | function emulatedIEMajorVersion() { 15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) 16 | if (groups === null) { 17 | return null 18 | } 19 | var ieVersionNum = parseInt(groups[1], 10) 20 | var ieMajorVersion = Math.floor(ieVersionNum) 21 | return ieMajorVersion 22 | } 23 | 24 | function actualNonEmulatedIEMajorVersion() { 25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. 26 | // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx 27 | // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx 28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line 29 | if (jscriptVersion === undefined) { 30 | return 11 // IE11+ not in emulation mode 31 | } 32 | if (jscriptVersion < 9) { 33 | return 8 // IE8 (or lower; haven't tested on IE<8) 34 | } 35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode 36 | } 37 | 38 | var ua = window.navigator.userAgent 39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { 40 | return // Opera, which might pretend to be IE 41 | } 42 | var emulated = emulatedIEMajorVersion() 43 | if (emulated === null) { 44 | return // Not IE 45 | } 46 | var nonEmulated = actualNonEmulatedIEMajorVersion() 47 | 48 | if (emulated !== nonEmulated) { 49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /WebRoot/Dashboard Template for Bootstrap_files/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /WebRoot/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /WebRoot/MyJsp.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/c3p0-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.mysql.jdbc.Driver 5 | jdbc:mysql:///flight_management?useSSL=true 6 | root 7 | root 8 | 9 | 10 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/AdminDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/AdminDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/PassengerDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/PassengerDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/UserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/UserDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/impl/AdminDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/impl/AdminDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/impl/PassengerDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/impl/PassengerDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/impl/UserDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/impl/UserDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/AirPlaneResultSetHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/AirPlaneResultSetHandler.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/CountResultSetHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/CountResultSetHandler.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/FlightResultSetHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/FlightResultSetHandler.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/FloatResultSetHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/FloatResultSetHandler.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/OrderResultSetHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/OrderResultSetHandler.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/UserResultSetHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/dao/resultSetHandler/UserResultSetHandler.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/domain/AirPlane.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/domain/AirPlane.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/domain/Flight.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/domain/Flight.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/domain/Order.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/domain/Order.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/domain/Statistic.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/domain/Statistic.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/domain/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/domain/User.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/exception/FMException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/exception/FMException.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/service/AdminService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/service/AdminService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/service/PassengerService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/service/PassengerService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/service/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/service/UserService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/service/impl/AdminServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/service/impl/AdminServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/service/impl/PassengerServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/service/impl/PassengerServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/service/impl/UserServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/service/impl/UserServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/test/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/test/Main.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/utils/DaoUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/utils/DaoUtils.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/utils/JDBCUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/utils/JDBCUtils.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/AddAirPlaneServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/AddAirPlaneServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/AddFlightServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/AddFlightServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/AddUserServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/AddUserServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/BookServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/BookServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/CancelServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/CancelServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/DeleteAirPlaneServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/DeleteAirPlaneServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/DeleteFlightServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/DeleteFlightServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/LoginServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/LoginServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/LogoutServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/LogoutServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/PayServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/PayServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/RechargeServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/RechargeServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/UpdateFlightServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/UpdateFlightServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/pers/gulo/fm/web/UpdateUserServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/classes/pers/gulo/fm/web/UpdateUserServlet.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/activation.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/activation.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/c3p0-0.9.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/c3p0-0.9.1.2.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/commons-beanutils-1.8.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/commons-beanutils-1.8.3.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/commons-dbutils-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/commons-dbutils-1.4.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/commons-io-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/commons-io-1.4.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/commons-logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/commons-logging-1.1.1.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/mail.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/mail.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/mysql-connector-java-5.1.39-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.39-bin.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/standard.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/WEB-INF/lib/standard.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | flight_management 4 | 5 | This is the description of my J2EE component 6 | This is the display name of my J2EE component 7 | LoginServlet 8 | pers.gulo.fm.web.LoginServlet 9 | 10 | 11 | This is the description of my J2EE component 12 | This is the display name of my J2EE component 13 | LogoutServlet 14 | pers.gulo.fm.web.LogoutServlet 15 | 16 | 17 | This is the description of my J2EE component 18 | This is the display name of my J2EE component 19 | DeleteUserSerlvet 20 | pers.gulo.fm.web.DeleteUserSerlvet 21 | 22 | 23 | This is the description of my J2EE component 24 | This is the display name of my J2EE component 25 | UpdateUserServlet 26 | pers.gulo.fm.web.UpdateUserServlet 27 | 28 | 29 | This is the description of my J2EE component 30 | This is the display name of my J2EE component 31 | UpdateFlightServlet 32 | pers.gulo.fm.web.UpdateFlightServlet 33 | 34 | 35 | This is the description of my J2EE component 36 | This is the display name of my J2EE component 37 | AddFlightServlet 38 | pers.gulo.fm.web.AddFlightServlet 39 | 40 | 41 | This is the description of my J2EE component 42 | This is the display name of my J2EE component 43 | DeleteFlightServlet 44 | pers.gulo.fm.web.DeleteFlightServlet 45 | 46 | 47 | This is the description of my J2EE component 48 | This is the display name of my J2EE component 49 | AddAirPlaneServlet 50 | pers.gulo.fm.web.AddAirPlaneServlet 51 | 52 | 53 | This is the description of my J2EE component 54 | This is the display name of my J2EE component 55 | DeleteAirPlaneServlet 56 | pers.gulo.fm.web.DeleteAirPlaneServlet 57 | 58 | 59 | This is the description of my J2EE component 60 | This is the display name of my J2EE component 61 | AddUserServlet 62 | pers.gulo.fm.web.AddUserServlet 63 | 64 | 65 | This is the description of my J2EE component 66 | This is the display name of my J2EE component 67 | RechargeServlet 68 | pers.gulo.fm.web.RechargeServlet 69 | 70 | 71 | This is the description of my J2EE component 72 | This is the display name of my J2EE component 73 | BookServlet 74 | pers.gulo.fm.web.BookServlet 75 | 76 | 77 | This is the description of my J2EE component 78 | This is the display name of my J2EE component 79 | CancelServlet 80 | pers.gulo.fm.web.CancelServlet 81 | 82 | 83 | This is the description of my J2EE component 84 | This is the display name of my J2EE component 85 | PayServlet 86 | pers.gulo.fm.web.PayServlet 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | LoginServlet 104 | /servlet/LoginServlet 105 | 106 | 107 | LogoutServlet 108 | /servlet/LogoutServlet 109 | 110 | 111 | DeleteUserSerlvet 112 | /servlet/DeleteUserSerlvet 113 | 114 | 115 | UpdateUserServlet 116 | /servlet/UpdateUserServlet 117 | 118 | 119 | UpdateFlightServlet 120 | /servlet/UpdateFlightServlet 121 | 122 | 123 | AddFlightServlet 124 | /servlet/AddFlightServlet 125 | 126 | 127 | DeleteFlightServlet 128 | /servlet/DeleteFlightServlet 129 | 130 | 131 | AddAirPlaneServlet 132 | /servlet/AddAirPlaneServlet 133 | 134 | 135 | DeleteAirPlaneServlet 136 | /servlet/DeleteAirPlaneServlet 137 | 138 | 139 | AddUserServlet 140 | /servlet/AddUserServlet 141 | 142 | 143 | RechargeServlet 144 | /servlet/RechargeServlet 145 | 146 | 147 | BookServlet 148 | /servlet/BookServlet 149 | 150 | 151 | CancelServlet 152 | /servlet/CancelServlet 153 | 154 | 155 | PayServlet 156 | /servlet/PayServlet 157 | 158 | 159 | index.html 160 | index.htm 161 | index.jsp 162 | default.html 163 | default.htm 164 | default.jsp 165 | 166 | -------------------------------------------------------------------------------- /WebRoot/addAirPlane.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.User"%> 2 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 3 | <% 4 | User user =(User)session.getAttribute("user"); 5 | if(user==null){ 6 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 7 | }else{ 8 | if(user.getType()!=1){ 9 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 10 | } 11 | } 12 | %> 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 添加新航班 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |

添加新班机

32 |
33 | 34 |
35 | 36 |
37 | 38 |
39 |
40 | 41 |
42 | 43 |
44 | 45 |
46 |
47 | 48 |
49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /WebRoot/addFlight.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.Flight"%> 2 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.AdminService"%> 4 | <%@page import="pers.gulo.fm.domain.User"%> 5 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 6 | <% 7 | User user =(User)session.getAttribute("user"); 8 | if(user==null){ 9 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 10 | }else{ 11 | if(user.getType()!=1){ 12 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 13 | } 14 | } 15 | %> 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 添加新航班 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 |

添加新航班

35 |
36 | 37 |
38 | 39 |
40 | 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 |
49 |
50 | 51 |
52 | 53 |
54 | 55 |
56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 |
64 | 65 |
66 | 67 |
68 | 69 |
70 |
71 | 72 | 73 | 74 |
75 |
76 | 77 | 78 | -------------------------------------------------------------------------------- /WebRoot/airPlaneManage.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.AirPlane"%> 2 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.AdminService"%> 4 | <%@page import="pers.gulo.fm.domain.User"%> 5 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 6 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 7 | <% 8 | User user =(User)session.getAttribute("user"); 9 | if(user==null){ 10 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 11 | }else{ 12 | if(user.getType()!=1){ 13 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 14 | } 15 | } 16 | AdminService aService=new AdminServiceImpl(); 17 | List airPlanesList=aService.listAllAirPlane(); 18 | request.setAttribute("airPlanesList", airPlanesList); 19 | request.setAttribute("airPlanesListLength", airPlanesList.size()); 20 | %> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 机票预订系统控制台 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 69 | 70 |
71 |
72 | 84 |
85 | 86 | 90 | 91 |

当前共有${airPlanesListLength}班机

92 |
93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 110 | 111 | 112 | 113 | 114 |
班机编号飞机型号班机载客量
108 | 109 |
115 | 116 |
117 |
118 |
119 |
120 | 121 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /WebRoot/bookFlight.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.service.impl.PassengerServiceImpl"%> 2 | <%@page import="pers.gulo.fm.service.PassengerService"%> 3 | <%@page import="pers.gulo.fm.domain.Flight"%> 4 | <%@page import="pers.gulo.fm.dao.impl.PassengerDaoImpl"%> 5 | <%@page import="pers.gulo.fm.dao.PassengerDao"%> 6 | <%@page import="pers.gulo.fm.domain.User"%> 7 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 8 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 9 | <% 10 | User user =(User)session.getAttribute("user"); 11 | if(user==null){ 12 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 13 | } 14 | 15 | PassengerDao pDao=new PassengerDaoImpl(); 16 | List flightList=pDao.getUnBookedFlight(user); 17 | request.setAttribute("flightList", flightList); 18 | request.setAttribute("flightListLength", flightList.size()); 19 | %> 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 机票预订系统 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 69 | 70 |
71 |
72 | 82 |
83 | 84 | 88 | 89 |

查询到如下航班信息

90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 115 | 116 | 117 | 118 | 119 |
航班编号飞机型号起始地目的地价格出发时间操作
113 | 114 |
120 | 121 |
122 | 123 |
124 |
125 | 126 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /WebRoot/css/signin.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 40px; 3 | padding-bottom: 40px; 4 | background-color: #eee; 5 | } 6 | 7 | .form-signin { 8 | max-width: 330px; 9 | padding: 15px; 10 | margin: 0 auto; 11 | } 12 | .form-signin .form-signin-heading, 13 | .form-signin .checkbox { 14 | margin-bottom: 10px; 15 | } 16 | .form-signin .checkbox { 17 | font-weight: normal; 18 | } 19 | .form-signin .form-control { 20 | position: relative; 21 | height: auto; 22 | -webkit-box-sizing: border-box; 23 | -moz-box-sizing: border-box; 24 | box-sizing: border-box; 25 | padding: 10px; 26 | font-size: 16px; 27 | } 28 | .form-signin .form-control:focus { 29 | z-index: 2; 30 | } 31 | .form-signin input[type="email"] { 32 | margin-bottom: -1px; 33 | border-bottom-right-radius: 0; 34 | border-bottom-left-radius: 0; 35 | } 36 | .form-signin input[type="password"] { 37 | margin-bottom: 10px; 38 | border-top-left-radius: 0; 39 | border-top-right-radius: 0; 40 | } 41 | -------------------------------------------------------------------------------- /WebRoot/flightManage.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.Flight"%> 2 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.AdminService"%> 4 | <%@page import="pers.gulo.fm.domain.User"%> 5 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 6 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 7 | <% 8 | User user =(User)session.getAttribute("user"); 9 | if(user==null){ 10 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 11 | }else{ 12 | if(user.getType()!=1){ 13 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 14 | } 15 | } 16 | AdminService aService=new AdminServiceImpl(); 17 | List flightList=aService.listAllFlight(); 18 | request.setAttribute("flightList", flightList); 19 | request.setAttribute("flightListLength", flightList.size()); 20 | %> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 机票预订系统控制台 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 68 | 69 |
70 |
71 | 83 |
84 | 85 | 89 | 90 |

当前共有${flightListLength}航班

91 |
92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 120 | 121 | 122 | 123 | 124 |
航班编号飞机型号航班出发地航班目的地价格起飞时间当前乘客数飞机载客量
117 | 118 | 119 |
125 | 126 |
127 |
128 |
129 |
130 | 131 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /WebRoot/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /WebRoot/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /WebRoot/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /WebRoot/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csugulo/flight_management/68f2575442f795b57af73c7180f05e5294e6e90a/WebRoot/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /WebRoot/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 4 | %> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /WebRoot/js/ie-emulation-modes-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2014-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. 11 | (function () { 12 | 'use strict'; 13 | 14 | function emulatedIEMajorVersion() { 15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) 16 | if (groups === null) { 17 | return null 18 | } 19 | var ieVersionNum = parseInt(groups[1], 10) 20 | var ieMajorVersion = Math.floor(ieVersionNum) 21 | return ieMajorVersion 22 | } 23 | 24 | function actualNonEmulatedIEMajorVersion() { 25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. 26 | // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx 27 | // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx 28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line 29 | if (jscriptVersion === undefined) { 30 | return 11 // IE11+ not in emulation mode 31 | } 32 | if (jscriptVersion < 9) { 33 | return 8 // IE8 (or lower; haven't tested on IE<8) 34 | } 35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode 36 | } 37 | 38 | var ua = window.navigator.userAgent 39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { 40 | return // Opera, which might pretend to be IE 41 | } 42 | var emulated = emulatedIEMajorVersion() 43 | if (emulated === null) { 44 | return // Not IE 45 | } 46 | var nonEmulated = actualNonEmulatedIEMajorVersion() 47 | 48 | if (emulated !== nonEmulated) { 49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /WebRoot/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /WebRoot/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /WebRoot/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 登录到航班系统 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 35 | 36 |
37 | 38 | 55 | 56 | 57 |
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /WebRoot/manage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 机票预订系统控制台 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 49 | 50 |
51 |
52 | 63 |
64 |

你好!管理员

65 | 66 | 67 |

Section title

68 |
69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 |
#HeaderHeaderHeaderHeader
1,001Loremipsumdolorsit
1,002ametconsecteturadipiscingelit
1,003IntegernecodioPraesent
1,003liberoSedcursusante
1,004dapibusdiamSednisi
1,005Nullaquissemat
1,006nibhelementumimperdietDuis
1,007sagittisipsumPraesentmauris
1,008Fuscenectellussed
1,009auguesemperportaMauris
1,010massaVestibulumlaciniaarcu
1,011egetnullaClassaptent
1,012tacitisociosquadlitora
1,013torquentperconubianostra
1,014perinceptoshimenaeosCurabitur
1,015sodalesligulainlibero
194 |
195 |
196 |
197 |
198 | 199 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /WebRoot/manage.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.User"%> 2 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 3 | <% 4 | User user =(User)session.getAttribute("user"); 5 | if(user==null){ 6 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 7 | }else{ 8 | if(user.getType()!=1){ 9 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 10 | } 11 | } 12 | %> 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 机票预订系统控制台 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 62 | 63 |
64 |
65 | 77 |
78 |

你好!${sessionScope.user.nickname}

79 | 80 | 81 | 82 |
83 |
84 | 85 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /WebRoot/myOrder.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.Order"%> 2 | <%@page import="pers.gulo.fm.service.impl.PassengerServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.PassengerService"%> 4 | <%@page import="pers.gulo.fm.domain.Flight"%> 5 | <%@page import="pers.gulo.fm.dao.impl.PassengerDaoImpl"%> 6 | <%@page import="pers.gulo.fm.dao.PassengerDao"%> 7 | <%@page import="pers.gulo.fm.domain.User"%> 8 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 9 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 10 | <% 11 | User user =(User)session.getAttribute("user"); 12 | if(user==null){ 13 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 14 | } 15 | 16 | PassengerDao pDao=new PassengerDaoImpl(); 17 | List orderList=pDao.getOrderListOfUser(user); 18 | request.setAttribute("orderList", orderList); 19 | request.setAttribute("orderListLength", orderList.size()); 20 | %> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 机票预订系统 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 70 | 71 |
72 |
73 | 83 |
84 | 85 | 89 | 90 |

你有如下条${orderListLength}条订单

91 |
92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 123 | 131 | 141 | 142 | 143 | 144 | 145 |
订单编号起始地目的地价格出发时间订单生成时间是否付款是否已取消操作
116 | 117 | 118 | 119 | 120 | 121 | 122 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 |
146 | 147 |
148 | 149 |
150 |
151 | 152 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /WebRoot/myWallet.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.User"%> 2 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | <% 5 | User user =(User)session.getAttribute("user"); 6 | if(user==null){ 7 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 8 | } 9 | 10 | 11 | request.setAttribute("user", user); 12 | 13 | %> 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 机票预订系统 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 41 | 42 | 43 | 44 | 45 | 63 | 64 |
65 |
66 | 76 |
77 | 78 | 82 | 83 |

我的钱包

84 |
85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 98 | 99 | 100 | 101 |
钱包余额操作
96 | 97 |
102 |
103 |
104 |
105 |
106 | 107 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /WebRoot/orderManage.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.Order"%> 2 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.AdminService"%> 4 | <%@page import="pers.gulo.fm.domain.User"%> 5 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 6 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 7 | <% 8 | User user =(User)session.getAttribute("user"); 9 | if(user==null){ 10 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 11 | }else{ 12 | if(user.getType()!=1){ 13 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 14 | } 15 | } 16 | AdminService aService=new AdminServiceImpl(); 17 | List orderList=aService.listAllOrder(); 18 | request.setAttribute("orderList", orderList); 19 | request.setAttribute("orderListLength", orderList.size()); 20 | %> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 机票预订系统控制台 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 68 | 69 |
70 |
71 | 83 |
84 | 85 | 89 | 90 |

当前共有${orderListLength}条订单信息

91 |
92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 124 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
订单编号班机型号用户名出发地目的地价格是否付款是否取消起飞时间订单生成时间
117 | 118 | 119 | 120 | 121 | 122 | 123 | 125 | 126 | 127 | 128 | 129 | 130 | 131 |
140 |
141 |
142 |
143 |
144 | 145 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /WebRoot/queryFlight.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.service.impl.PassengerServiceImpl"%> 2 | <%@page import="pers.gulo.fm.service.PassengerService"%> 3 | <%@page import="pers.gulo.fm.domain.Flight"%> 4 | <%@page import="pers.gulo.fm.dao.impl.PassengerDaoImpl"%> 5 | <%@page import="pers.gulo.fm.dao.PassengerDao"%> 6 | <%@page import="pers.gulo.fm.domain.User"%> 7 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 8 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 9 | <% 10 | User user =(User)session.getAttribute("user"); 11 | if(user==null){ 12 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 13 | } 14 | String start=null; 15 | String dist=null; 16 | try{ 17 | start=new String(request.getParameter("start").getBytes("ISO-8859-1"),"UTF-8"); 18 | }catch(Exception e){ 19 | } 20 | 21 | try{ 22 | dist=new String(request.getParameter("dist").getBytes("ISO-8859-1"),"UTF-8"); 23 | }catch(Exception e){ 24 | } 25 | 26 | 27 | PassengerDao pDao=new PassengerDaoImpl(); 28 | List queryflightList=pDao.findFlightByStartAndDist(start, dist); 29 | request.setAttribute("queryflightList", queryflightList); 30 | request.setAttribute("queryflightListLength", queryflightList.size()); 31 | %> 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 机票预订系统 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 81 | 82 |
83 |
84 | 94 |
95 | 96 | 100 | 101 |
102 |
103 | 104 | 105 |
106 |
107 | 108 | 109 |
110 | 111 |
112 |

查询到如下航班信息

113 |
114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 138 | 139 | 140 | 141 | 142 |
航班编号飞机型号起始地目的地价格出发时间操作
136 | 137 |
143 | 144 |
145 | 146 |
147 |
148 | 149 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /WebRoot/recharge.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.User"%> 2 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.AdminService"%> 4 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 5 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 6 | <% 7 | User user =(User)session.getAttribute("user"); 8 | if(user==null){ 9 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 10 | } 11 | %> 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 充值 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |

充值

31 |
32 | 33 | 34 |
35 | 36 |
37 | 38 | 39 |
40 |
41 | 42 | 43 |
44 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /WebRoot/register.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 用户注册 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |

用户注册

21 |
22 | 23 |
24 | 25 |
26 | 27 |
28 |
29 | 30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 | 40 |
41 |
42 | 43 |
44 | 45 |
46 | 47 |
48 |
49 | 50 |
51 |
52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /WebRoot/statisticManage.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.Statistic"%> 2 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.AdminService"%> 4 | <%@page import="pers.gulo.fm.dao.AdminDao"%> 5 | <%@page import="pers.gulo.fm.domain.User"%> 6 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 7 | <% 8 | User user =(User)session.getAttribute("user"); 9 | if(user==null){ 10 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 11 | }else{ 12 | if(user.getType()!=1){ 13 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 14 | } 15 | } 16 | 17 | AdminService aService=new AdminServiceImpl(); 18 | Statistic statistic=aService.makeStatistic(); 19 | request.setAttribute("statistic", statistic); 20 | %> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 机票预订系统控制台 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 68 | 69 |
70 |
71 | 83 |
84 |

近一周统计信息

85 |
86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |
起飞航班次数订单数营业额
${statistic.weekFlight}${statistic.weekOrder}${statistic.weekIncome}
102 |
103 | 104 |

近一月统计信息

105 |
106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 |
起飞航班次数订单数营业额
${statistic.monthFlight}${statistic.monthOrder}${statistic.monthIncome}
122 |
123 | 124 |

总统计信息

125 |
126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 |
起飞航班次数订单数营业额
${statistic.totalFlight}${statistic.totalOrder}${statistic.totalIncome}
142 |
143 |
144 |
145 |
146 | 147 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /WebRoot/updateFlightInfo.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.Flight"%> 2 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.AdminService"%> 4 | <%@page import="pers.gulo.fm.domain.User"%> 5 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 6 | <% 7 | User user =(User)session.getAttribute("user"); 8 | if(user==null){ 9 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 10 | }else{ 11 | if(user.getType()!=1){ 12 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 13 | } 14 | } 15 | int flightNo=Integer.parseInt(request.getParameter("flightNo")); 16 | AdminService aService =new AdminServiceImpl(); 17 | List flightList= aService.listAllFlight(); 18 | for(Flight flight:flightList){ 19 | if(flight.getNo()==flightNo){ 20 | request.setAttribute("flight", flight); 21 | break; 22 | } 23 | } 24 | %> 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 修改航班信息 36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 |

修改航班信息

44 |
45 |
46 | 47 |
48 | 49 | 50 |
51 |
52 | 53 |
54 | 55 |
56 | 57 |
58 |
59 | 60 |
61 | 62 |
63 | 64 | 65 |
66 |
67 | 68 |
69 | 70 |
71 | 72 | 73 |
74 |
75 | 76 |
77 | 78 |
79 | 80 |
81 |
82 | 83 |
84 | 85 |
86 | 87 |
88 |
89 | 90 | 91 |
92 |
93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /WebRoot/updateUserInfo.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.User"%> 2 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 3 | <%@page import="pers.gulo.fm.service.AdminService"%> 4 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 5 | <% 6 | User user =(User)session.getAttribute("user"); 7 | if(user==null){ 8 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 9 | }else{ 10 | if(user.getType()!=1){ 11 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 12 | } 13 | } 14 | int userNo=Integer.parseInt(request.getParameter("userNo")); 15 | AdminService aService =new AdminServiceImpl(); 16 | List userList= aService.listAllUser(); 17 | for(User u:userList){ 18 | if(u.getNo()==userNo){ 19 | request.setAttribute("user", u); 20 | break; 21 | } 22 | } 23 | %> 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 修改用户信息 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 |

修改用户信息

43 |
44 |
45 | 46 |
47 | 48 | 49 |
50 |
51 | 52 |
53 | 54 |
55 | 56 |
57 |
58 | 59 |
60 | 61 |
62 | 63 |
64 |
65 | 66 |
67 | 68 |
69 | 70 |
71 |
72 | 73 | 74 |
75 |
76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /WebRoot/user.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.domain.User"%> 2 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 3 | <% 4 | User user =(User)session.getAttribute("user"); 5 | if(user==null){ 6 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 7 | } 8 | %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 机票预订系统 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 36 | 37 | 38 | 39 | 40 | 58 | 59 |
60 |
61 | 71 |
72 |

你好!${sessionScope.user.nickname}

73 | 74 | 75 | 76 |
77 |
78 | 79 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /WebRoot/userInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 修改用户信息 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

修改用户信息

20 |
21 |
22 | 23 |
24 | 25 |
26 |
27 | 28 |
29 | 30 |
31 | 32 |
33 |
34 | 35 |
36 | 37 |
38 | 39 |
40 |
41 | 42 |
43 | 44 |
45 | 46 |
47 |
48 | 49 | 50 |
51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /WebRoot/userManage.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="pers.gulo.fm.service.impl.AdminServiceImpl"%> 2 | <%@page import="pers.gulo.fm.service.AdminService"%> 3 | <%@page import="pers.gulo.fm.dao.AdminDao"%> 4 | <%@page import="pers.gulo.fm.domain.User"%> 5 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 6 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 7 | <% 8 | User user =(User)session.getAttribute("user"); 9 | if(user==null){ 10 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 11 | }else{ 12 | if(user.getType()!=1){ 13 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 14 | } 15 | } 16 | AdminService aService=new AdminServiceImpl(); 17 | List userList =aService.listAllUser(); 18 | request.setAttribute("userList", userList); 19 | request.setAttribute("userListLength", userList.size()); 20 | %> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 机票预订系统控制台 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 68 | 69 |
70 |
71 | 83 |
84 | 85 | 89 | 90 |

当前共有${userListLength}位用户

91 |
92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 115 | 116 | 119 | 120 | 121 | 122 | 123 |
用户编号用户名用户昵称用户身份证号码用户类型用户余额操作
112 | 管理员 113 | 旅客 114 | 117 | 118 |
124 |
125 |
126 |
127 |
128 | 129 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /flight_management.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50711 6 | Source Host : localhost:3306 7 | Source Database : flight_management 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50711 11 | File Encoding : 65001 12 | 13 | Date: 2016-07-29 16:37:48 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for t_airplane 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `t_airplane`; 22 | CREATE TABLE `t_airplane` ( 23 | `A_NO` int(11) NOT NULL AUTO_INCREMENT, 24 | `A_MODEL` varchar(255) COLLATE utf8_bin NOT NULL, 25 | `A_CAPACITY` int(11) NOT NULL, 26 | PRIMARY KEY (`A_NO`) 27 | ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; 28 | 29 | -- ---------------------------- 30 | -- Records of t_airplane 31 | -- ---------------------------- 32 | INSERT INTO `t_airplane` VALUES ('1', 'Boeing 747', '366'); 33 | INSERT INTO `t_airplane` VALUES ('2', 'Airbus A380', '555'); 34 | INSERT INTO `t_airplane` VALUES ('6', 'Y20', '200'); 35 | INSERT INTO `t_airplane` VALUES ('8', 'Boeing 767', '300'); 36 | 37 | -- ---------------------------- 38 | -- Table structure for t_flight 39 | -- ---------------------------- 40 | DROP TABLE IF EXISTS `t_flight`; 41 | CREATE TABLE `t_flight` ( 42 | `F_NO` int(11) NOT NULL AUTO_INCREMENT, 43 | `F_A_NO` int(11) NOT NULL, 44 | `F_START` varchar(255) COLLATE utf8_bin NOT NULL, 45 | `F_DIST` varchar(255) COLLATE utf8_bin NOT NULL, 46 | `F_PRICE` float NOT NULL, 47 | `F_TIME` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 48 | `F_PSG_NUM` int(11) NOT NULL, 49 | PRIMARY KEY (`F_NO`), 50 | KEY `F_FK_AIRPLANE_NO` (`F_A_NO`), 51 | CONSTRAINT `F_FK_AIRPLANE_NO` FOREIGN KEY (`F_A_NO`) REFERENCES `t_airplane` (`A_NO`) 52 | ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; 53 | 54 | -- ---------------------------- 55 | -- Records of t_flight 56 | -- ---------------------------- 57 | INSERT INTO `t_flight` VALUES ('1', '1', '北京', '上海', '1101', '2016-07-11 14:11:20', '3'); 58 | INSERT INTO `t_flight` VALUES ('2', '6', '益阳', '长沙', '200', '2016-07-09 13:13:39', '1'); 59 | INSERT INTO `t_flight` VALUES ('3', '2', '纽约', '东京', '5000', '2016-07-10 22:59:11', '2'); 60 | INSERT INTO `t_flight` VALUES ('4', '6', '漓江塔', '直布罗陀', '198', '2016-07-10 01:00:27', '1'); 61 | INSERT INTO `t_flight` VALUES ('9', '8', '努巴尼', '阿努比斯神殿', '10000', '2016-07-08 22:27:50', '0'); 62 | INSERT INTO `t_flight` VALUES ('10', '6', '花村', '国王大道', '1300', '2016-07-08 22:37:49', '0'); 63 | INSERT INTO `t_flight` VALUES ('11', '2', '东京', '首尔', '5500', '2016-07-09 12:04:17', '0'); 64 | INSERT INTO `t_flight` VALUES ('12', '2', '华盛顿', '曼谷', '5200', '2016-07-10 01:00:26', '2'); 65 | 66 | -- ---------------------------- 67 | -- Table structure for t_order 68 | -- ---------------------------- 69 | DROP TABLE IF EXISTS `t_order`; 70 | CREATE TABLE `t_order` ( 71 | `O_NO` int(11) NOT NULL AUTO_INCREMENT, 72 | `O_U_NO` int(11) NOT NULL, 73 | `O_F_NO` int(11) NOT NULL, 74 | `O_IS_PAYED` int(11) NOT NULL, 75 | `O_IS_CANCELED` int(11) NOT NULL, 76 | `O_TIME` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, 77 | PRIMARY KEY (`O_NO`), 78 | KEY `O_FK_U_NO` (`O_U_NO`), 79 | KEY `O_FK_F_NO` (`O_F_NO`), 80 | CONSTRAINT `O_FK_F_NO` FOREIGN KEY (`O_F_NO`) REFERENCES `t_flight` (`F_NO`), 81 | CONSTRAINT `O_FK_U_NO` FOREIGN KEY (`O_U_NO`) REFERENCES `t_user` (`U_NO`) 82 | ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; 83 | 84 | -- ---------------------------- 85 | -- Records of t_order 86 | -- ---------------------------- 87 | INSERT INTO `t_order` VALUES ('1', '2', '1', '1', '1', '2016-07-07 13:37:32'); 88 | INSERT INTO `t_order` VALUES ('2', '2', '1', '1', '0', '2016-07-08 14:36:58'); 89 | INSERT INTO `t_order` VALUES ('3', '2', '3', '0', '0', '2016-07-08 00:45:52'); 90 | INSERT INTO `t_order` VALUES ('4', '3', '1', '0', '1', '2016-07-08 17:18:23'); 91 | INSERT INTO `t_order` VALUES ('5', '3', '2', '1', '1', '2016-07-08 22:28:13'); 92 | INSERT INTO `t_order` VALUES ('6', '3', '3', '1', '1', '2016-07-08 22:28:12'); 93 | INSERT INTO `t_order` VALUES ('7', '3', '4', '1', '1', '2016-07-08 22:28:12'); 94 | INSERT INTO `t_order` VALUES ('8', '3', '9', '1', '1', '2016-07-08 22:27:50'); 95 | INSERT INTO `t_order` VALUES ('9', '3', '10', '1', '1', '2016-07-08 22:37:49'); 96 | INSERT INTO `t_order` VALUES ('10', '3', '11', '1', '1', '2016-07-08 22:47:59'); 97 | INSERT INTO `t_order` VALUES ('11', '4', '1', '0', '1', '2016-07-09 11:58:29'); 98 | INSERT INTO `t_order` VALUES ('12', '4', '3', '1', '1', '2016-07-09 12:04:23'); 99 | INSERT INTO `t_order` VALUES ('13', '4', '11', '1', '1', '2016-07-09 12:04:17'); 100 | INSERT INTO `t_order` VALUES ('14', '4', '12', '0', '0', '2016-07-09 11:59:10'); 101 | INSERT INTO `t_order` VALUES ('15', '1', '1', '0', '0', '2016-07-09 12:02:20'); 102 | INSERT INTO `t_order` VALUES ('16', '4', '2', '0', '0', '2016-07-09 13:13:39'); 103 | INSERT INTO `t_order` VALUES ('17', '6', '3', '1', '0', '2016-07-10 01:01:29'); 104 | INSERT INTO `t_order` VALUES ('18', '6', '1', '0', '1', '2016-07-10 01:01:36'); 105 | INSERT INTO `t_order` VALUES ('19', '6', '12', '1', '0', '2016-07-10 01:01:39'); 106 | INSERT INTO `t_order` VALUES ('20', '6', '4', '0', '0', '2016-07-10 01:00:27'); 107 | INSERT INTO `t_order` VALUES ('21', '6', '3', '0', '0', '2016-07-10 22:59:12'); 108 | INSERT INTO `t_order` VALUES ('22', '9', '1', '1', '1', '2016-07-11 14:11:20'); 109 | 110 | -- ---------------------------- 111 | -- Table structure for t_user 112 | -- ---------------------------- 113 | DROP TABLE IF EXISTS `t_user`; 114 | CREATE TABLE `t_user` ( 115 | `U_NO` int(11) NOT NULL AUTO_INCREMENT, 116 | `U_USERNAME` varchar(255) COLLATE utf8_bin NOT NULL, 117 | `U_PASSWORD` varchar(255) COLLATE utf8_bin NOT NULL, 118 | `U_NICKNAME` varchar(255) COLLATE utf8_bin NOT NULL, 119 | `U_ID` varchar(255) COLLATE utf8_bin NOT NULL, 120 | `U_TYPE` int(11) NOT NULL, 121 | `U_BALANCE` float NOT NULL, 122 | PRIMARY KEY (`U_NO`), 123 | UNIQUE KEY `U_CK_USERNAME` (`U_USERNAME`), 124 | UNIQUE KEY `U_CK_ID` (`U_ID`) 125 | ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; 126 | 127 | -- ---------------------------- 128 | -- Records of t_user 129 | -- ---------------------------- 130 | INSERT INTO `t_user` VALUES ('1', 'root', 'root', '超级管理员', '430903199509210617', '1', '10000000'); 131 | INSERT INTO `t_user` VALUES ('9', 'ff', 'ff', 'ff', '43090311111111111', '0', '100000'); 132 | -------------------------------------------------------------------------------- /src/c3p0-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.mysql.jdbc.Driver 5 | jdbc:mysql:///flight_management?useSSL=true 6 | root 7 | root 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/AdminDao.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao; 2 | 3 | import java.util.List; 4 | 5 | import pers.gulo.fm.domain.AirPlane; 6 | import pers.gulo.fm.domain.Flight; 7 | import pers.gulo.fm.domain.Order; 8 | import pers.gulo.fm.domain.Statistic; 9 | import pers.gulo.fm.domain.User; 10 | import pers.gulo.fm.exception.FMException; 11 | 12 | public interface AdminDao { 13 | 14 | /** 15 | * 查询所有班机 16 | * @return 17 | */ 18 | public List queryAllAirPlane(); 19 | /** 20 | * 添加新的班机 21 | * @param airPlane 22 | */ 23 | public void insertAirPlane(AirPlane airPlane) throws FMException; 24 | 25 | /** 26 | * 删除一个班机 27 | * @param airPlane 28 | */ 29 | public void deleteAirPlane(AirPlane airPlane) throws FMException; 30 | 31 | /** 32 | * 添加新的航班 33 | * @param flight 34 | */ 35 | public void insertFlight(Flight flight) throws FMException; 36 | 37 | /** 38 | * 修改航班信息 39 | * @param flight 40 | */ 41 | public void updateFlight(Flight flight) throws FMException; 42 | 43 | /** 44 | * 查询所有旅客信息 45 | * @return 46 | */ 47 | public List queryUsers(); 48 | 49 | /** 50 | * 删除一条航班 51 | * @param flight 52 | */ 53 | public void deleteFlight(Flight flight) throws FMException; 54 | 55 | /** 56 | * 查询所有航班信息 57 | * @return 58 | */ 59 | public List queryAllFlight(); 60 | 61 | public void deleteUser(User user) throws FMException; 62 | 63 | public void updateUser(User user) throws FMException; 64 | 65 | public List queryAllOrder(); 66 | 67 | public Statistic makeStatistic(); 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/PassengerDao.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao; 2 | 3 | import java.util.List; 4 | 5 | import pers.gulo.fm.domain.Flight; 6 | import pers.gulo.fm.domain.Order; 7 | import pers.gulo.fm.domain.User; 8 | import pers.gulo.fm.exception.FMException; 9 | 10 | public interface PassengerDao { 11 | /** 12 | * 根据出发地和目的地查询航班。 13 | * @param start 14 | * @param dist 15 | * @return 返回Flight表,若发生错误返回null 16 | */ 17 | public List findFlightByStartAndDist(String start,String dist); 18 | 19 | /** 20 | * 订机票 21 | * @param user 22 | * @param flight 23 | * @throws Exception 24 | */ 25 | public void bookFlight(User user,Flight flight) throws FMException; 26 | /** 27 | * 取消订单 28 | * @param order 29 | */ 30 | public void bounce(Order order) throws FMException; 31 | /** 32 | * 用户付款 33 | * @param user 34 | * @param flight 35 | */ 36 | public void payFlight(Order order) throws FMException; 37 | /** 38 | * 获取用户的订单列表 39 | * @param user 40 | * @return 41 | */ 42 | public List getOrderListOfUser(User user); 43 | /** 44 | * 获取用户已付款的订单列表 45 | * @param user 46 | * @return 47 | */ 48 | public List getPayedOrderListOfUser(User user); 49 | /** 50 | * 获取用户未付款的订单列表 51 | * @param user 52 | * @return 53 | */ 54 | public List getUnPayedOrderListOfUser(User user); 55 | 56 | public List getUnBookedFlight(User user); 57 | 58 | public Order getOrder(Order order); 59 | } 60 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import pers.gulo.fm.domain.Flight; 7 | import pers.gulo.fm.domain.User; 8 | import pers.gulo.fm.exception.FMException; 9 | 10 | public interface UserDao { 11 | /** 12 | * 根据用户名密码检查登录,若查询到用户则返回该用户信息,若无结果返回null。 13 | * @param username 14 | * @param password 15 | * @return 16 | */ 17 | public User login(String username,String password); 18 | 19 | public void insertUser(User user) throws FMException; 20 | 21 | public void reCharge(User user, float number); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/impl/AdminDaoImpl.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.impl; 2 | 3 | import java.sql.SQLException; 4 | import java.util.ArrayList; 5 | import java.util.Date; 6 | import java.util.List; 7 | 8 | import javax.sql.DataSource; 9 | 10 | import org.apache.commons.dbutils.QueryRunner; 11 | 12 | import pers.gulo.fm.dao.AdminDao; 13 | import pers.gulo.fm.dao.resultSetHandler.AirPlaneResultSetHandler; 14 | import pers.gulo.fm.dao.resultSetHandler.CountResultSetHandler; 15 | import pers.gulo.fm.dao.resultSetHandler.FlightResultSetHandler; 16 | import pers.gulo.fm.dao.resultSetHandler.FloatResultSetHandler; 17 | import pers.gulo.fm.dao.resultSetHandler.OrderResultSetHandler; 18 | import pers.gulo.fm.dao.resultSetHandler.UserResultSetHandler; 19 | import pers.gulo.fm.domain.AirPlane; 20 | import pers.gulo.fm.domain.Flight; 21 | import pers.gulo.fm.domain.Order; 22 | import pers.gulo.fm.domain.Statistic; 23 | import pers.gulo.fm.domain.User; 24 | import pers.gulo.fm.exception.FMException; 25 | import pers.gulo.fm.utils.DaoUtils; 26 | 27 | public class AdminDaoImpl implements AdminDao{ 28 | 29 | private static final String INSERT_AIRPLANE_SQL="insert into T_AIRPLANE values (null,?,?)"; 30 | 31 | private static final String DELETE_AIRPLANE_SQL="delete from T_AIRPLANE where A_NO=?"; 32 | 33 | private static final String INSERT_FLIGHT_SQL="insert into T_FLIGHT values(null,?,?,?,?,?,0)"; 34 | 35 | private static final String UPDATE_FLIGHT_SQL="update T_FLIGHT set F_A_NO=?,F_START=?,F_DIST=?,F_PRICE=?,F_TIME=? where F_NO = ?"; 36 | 37 | private static final String QUERY_USERS="select * from T_USER"; 38 | 39 | private static final String DELETE_FLIGHT="delete from T_FLIGHT where F_NO = ?"; 40 | 41 | private static final String QUERY_ALL_FLIGHT="select * from T_FLIGHT f,T_AIRPLANE a where a.A_NO=f.F_A_NO"; 42 | 43 | private static final String QUERY_ALL_AIRPLANE="select * from T_AIRPLANE"; 44 | 45 | private static final String DELETE_USER_SQL="delete from T_USER where U_NO=?"; 46 | 47 | private static final String UPDATE_USER_SQL="update T_USER set U_NICKNAME=? ,U_ID=? where U_NO =?"; 48 | 49 | private static final String QUERY_ALL_ORDER="select * from T_ORDER o,T_USER u,T_FLIGHT f,T_AIRPLANE a where o.O_U_NO=u.U_NO and o.O_F_NO=f.F_NO and f.F_A_NO=a.A_NO"; 50 | 51 | private static final String QUERY_FLIGHT_NUM_WEEK_SQL="select count(*) from T_FLIGHT where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(F_TIME)"; 52 | 53 | private static final String QUERY_FLIGHT_NUM_MONTH_SQL="select count(*) from T_FLIGHT where DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(F_TIME)"; 54 | 55 | private static final String QUERY_FLIGHT_NUM_SQL="select count(*) from T_FLIGHT"; 56 | 57 | private static final String QUERY_ORDER_NUM_WEEK_SQL="select count(*) from T_ORDER where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(O_TIME)"; 58 | 59 | private static final String QUERY_ORDER_NUM_MONTH_SQL="select count(*) from T_ORDER where DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(O_TIME)"; 60 | 61 | private static final String QUERY_ORDER_NUM_SQL="select count(*) from T_ORDER"; 62 | 63 | private static final String QUERY_INCOME_WEEK_SQL="select sum(F_PRICE) from T_ORDER o,T_FLIGHT f where o.O_F_NO=f.F_NO and O_IS_PAYED=1 and O_IS_CANCELED=0 and DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(O_TIME)"; 64 | 65 | private static final String QUERY_INCOME_MONTH_SQL="select sum(F_PRICE) from T_ORDER o,T_FLIGHT f where o.O_F_NO=f.F_NO and O_IS_PAYED=1 and O_IS_CANCELED=0 and DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(O_TIME)"; 66 | 67 | private static final String QUERY_INCOME_SQL="select sum(F_PRICE) from T_ORDER o,T_FLIGHT f where o.O_F_NO=f.F_NO and O_IS_PAYED=1 and O_IS_CANCELED=0"; 68 | @Override 69 | public void insertAirPlane(AirPlane airPlane) throws FMException { 70 | QueryRunner runner= new QueryRunner(DaoUtils.getSource()); 71 | try { 72 | runner.update(INSERT_AIRPLANE_SQL, airPlane.getModel(),airPlane.getCapacity()); 73 | } catch (SQLException e) { 74 | // TODO Auto-generated catch block 75 | e.printStackTrace(); 76 | throw new FMException("插入信息失败!"); 77 | } 78 | } 79 | 80 | @Override 81 | public void deleteAirPlane(AirPlane airPlane) throws FMException{ 82 | QueryRunner runner= new QueryRunner(DaoUtils.getSource()); 83 | try { 84 | runner.update(DELETE_AIRPLANE_SQL,airPlane.getNo()); 85 | } catch (SQLException e) { 86 | // TODO Auto-generated catch block 87 | e.printStackTrace(); 88 | throw new FMException("外键约束!删除班机失败!"); 89 | } 90 | } 91 | 92 | @Override 93 | public void insertFlight(Flight flight) throws FMException{ 94 | QueryRunner runner= new QueryRunner(DaoUtils.getSource()); 95 | try { 96 | runner.update(INSERT_FLIGHT_SQL, flight.getAirPlane().getNo(),flight.getStart(),flight.getDist(),flight.getPrice(),flight.getTime()); 97 | System.out.println(flight); 98 | } catch (SQLException e) { 99 | // TODO Auto-generated catch block 100 | e.printStackTrace(); 101 | throw new FMException("添加航班失败! 没有该班机!"); 102 | } 103 | 104 | 105 | } 106 | 107 | @Override 108 | public void updateFlight(Flight flight) throws FMException{ 109 | QueryRunner runner =new QueryRunner(DaoUtils.getSource()); 110 | try { 111 | runner.update(UPDATE_FLIGHT_SQL,flight.getAirPlane().getNo(),flight.getStart(),flight.getDist(),flight.getPrice(),flight.getTime(),flight.getNo()); 112 | } catch (SQLException e) { 113 | // TODO Auto-generated catch block 114 | e.printStackTrace(); 115 | throw new FMException("修改航班信息失败!"); 116 | } 117 | } 118 | 119 | @Override 120 | public List queryUsers() { 121 | List users =null; 122 | QueryRunner runner= new QueryRunner(DaoUtils.getSource()); 123 | try { 124 | users= runner.query(QUERY_USERS, new UserResultSetHandler()); 125 | } catch (SQLException e) { 126 | e.printStackTrace(); 127 | } 128 | return users; 129 | } 130 | 131 | @Override 132 | public void deleteFlight(Flight flight) throws FMException { 133 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 134 | try { 135 | runner.update(DELETE_FLIGHT,flight.getNo()); 136 | } catch (SQLException e) { 137 | e.printStackTrace(); 138 | throw new FMException("外键约束,不能删除"); 139 | } 140 | } 141 | 142 | @Override 143 | public List queryAllFlight() { 144 | List flights=null; 145 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 146 | try { 147 | flights=runner.query(QUERY_ALL_FLIGHT, new FlightResultSetHandler()); 148 | } catch (SQLException e) { 149 | // TODO Auto-generated catch block 150 | e.printStackTrace(); 151 | } 152 | return flights; 153 | } 154 | 155 | @Override 156 | public List queryAllAirPlane() { 157 | List airPlanes=null; 158 | QueryRunner runner =new QueryRunner(DaoUtils.getSource()); 159 | try { 160 | airPlanes = runner.query(QUERY_ALL_AIRPLANE, new AirPlaneResultSetHandler()); 161 | } catch (SQLException e) { 162 | // TODO Auto-generated catch block 163 | e.printStackTrace(); 164 | } 165 | return airPlanes; 166 | } 167 | 168 | @Override 169 | public void deleteUser(User user) throws FMException { 170 | QueryRunner runner= new QueryRunner(DaoUtils.getSource()); 171 | try { 172 | runner.update(DELETE_USER_SQL,user.getNo()); 173 | } catch (SQLException e) { 174 | // TODO Auto-generated catch block 175 | e.printStackTrace(); 176 | throw new FMException("由于外键约束,删除失败!"); 177 | } 178 | 179 | 180 | } 181 | 182 | @Override 183 | public void updateUser(User user) throws FMException { 184 | QueryRunner runner= new QueryRunner(DaoUtils.getSource()); 185 | try { 186 | runner.update(UPDATE_USER_SQL,user.getNickname(),user.getID(),user.getNo()); 187 | } catch (SQLException e) { 188 | e.printStackTrace(); 189 | throw new FMException("修改用户信息失败!"); 190 | } 191 | } 192 | 193 | @Override 194 | public List queryAllOrder() { 195 | List orderList=null; 196 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 197 | try { 198 | orderList = runner.query(QUERY_ALL_ORDER, new OrderResultSetHandler()); 199 | } catch (SQLException e) { 200 | // TODO Auto-generated catch block 201 | e.printStackTrace(); 202 | } 203 | return orderList; 204 | } 205 | 206 | @Override 207 | public Statistic makeStatistic() { 208 | Statistic statistic=new Statistic(); 209 | QueryRunner runner= new QueryRunner(DaoUtils.getSource()); 210 | try { 211 | statistic.setWeekFlight(runner.query(QUERY_FLIGHT_NUM_WEEK_SQL, new CountResultSetHandler())); 212 | statistic.setMonthFlight(runner.query(QUERY_FLIGHT_NUM_MONTH_SQL, new CountResultSetHandler())); 213 | statistic.setTotalFlight(runner.query(QUERY_FLIGHT_NUM_SQL, new CountResultSetHandler())); 214 | 215 | statistic.setWeekOrder(runner.query(QUERY_ORDER_NUM_WEEK_SQL, new CountResultSetHandler())); 216 | statistic.setMonthOrder(runner.query(QUERY_ORDER_NUM_MONTH_SQL, new CountResultSetHandler())); 217 | statistic.setTotalOrder(runner.query(QUERY_ORDER_NUM_SQL, new CountResultSetHandler())); 218 | 219 | statistic.setWeekIncome(runner.query(QUERY_INCOME_WEEK_SQL, new FloatResultSetHandler())); 220 | statistic.setMonthIncome(runner.query(QUERY_INCOME_MONTH_SQL, new FloatResultSetHandler())); 221 | statistic.setTotalIncome(runner.query(QUERY_INCOME_SQL, new FloatResultSetHandler())); 222 | } catch (SQLException e) { 223 | // TODO Auto-generated catch block 224 | e.printStackTrace(); 225 | } 226 | return statistic; 227 | } 228 | 229 | 230 | } 231 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/impl/PassengerDaoImpl.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.impl; 2 | 3 | import java.sql.Connection; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.util.ArrayList; 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | import org.apache.commons.dbutils.QueryRunner; 12 | import org.apache.commons.dbutils.ResultSetHandler; 13 | 14 | import pers.gulo.fm.dao.PassengerDao; 15 | import pers.gulo.fm.dao.resultSetHandler.CountResultSetHandler; 16 | import pers.gulo.fm.dao.resultSetHandler.FlightResultSetHandler; 17 | import pers.gulo.fm.dao.resultSetHandler.FloatResultSetHandler; 18 | import pers.gulo.fm.dao.resultSetHandler.OrderResultSetHandler; 19 | import pers.gulo.fm.domain.Flight; 20 | import pers.gulo.fm.domain.Order; 21 | import pers.gulo.fm.domain.User; 22 | import pers.gulo.fm.exception.FMException; 23 | import pers.gulo.fm.utils.DaoUtils; 24 | 25 | public class PassengerDaoImpl implements PassengerDao { 26 | 27 | private static final String FIND_FLIGHT_SQL="select * from T_FLIGHT f,T_AIRPLANE a where f.F_A_NO=a.A_NO"; 28 | 29 | private static final String BOOK_FLIGHT_SQL="insert into T_ORDER values(null,?,?,0,0,?)"; 30 | 31 | private static final String INSERT_ORDER="insert into T_ORDER values (null,?,?,0,0,?)"; 32 | 33 | private static final String UPDATE_PSG_NUM_SQL="update T_FLIGHT set F_PSG_NUM = F_PSG_NUM + 1 where F_NO = ?"; 34 | 35 | private static final String BOUNCE_SQL="update T_ORDER set O_IS_CANCELED = 1 where O_NO = ?"; 36 | 37 | private static final String BOUNCE_PSG_NUM_SQL="update T_FLIGHT set F_PSG_NUM = F_PSG_NUM -1 where F_NO = ?"; 38 | 39 | private static final String REFUND_SQL="update T_USER set U_BALANCE = U_BALANCE + ? * (select O_IS_PAYED from T_ORDER where O_NO= ?) where U_NO = ?"; 40 | 41 | private static final String UPDATE_IS_PAYED_SQL="update T_ORDER set O_IS_PAYED = 1 where O_NO = ?"; 42 | 43 | private static final String PAY_SQL="update T_USER set U_BALANCE = U_BALANCE - ? where U_NO = ?"; 44 | 45 | private static final String GET_ORDER_LIST_SQL="select * from T_ORDER o,T_USER u,T_FLIGHT f,T_AIRPLANE a where o.O_U_NO=u.U_NO and o.O_F_NO=f.F_NO and f.F_A_NO=a.A_NO and O_U_NO = ?"; 46 | 47 | private static final String GET_PAYED_ORDER_LIST_SQL="select * from T_ORDER o,T_USER u,T_FLIGHT f,T_AIRPLANE a where o.O_U_NO=u.U_NO and o.O_F_NO=f.F_NO and f.F_A_NO=a.A_NO and O_IS_PAYED=1 and O_U_NO = ?"; 48 | 49 | private static final String GET_UNPAYED_ORDER_LIST_SQL="select * from T_ORDER o,T_USER u,T_FLIGHT f,T_AIRPLANE a where o.O_U_NO=u.U_NO and o.O_F_NO=f.F_NO and f.F_A_NO=a.A_NO and O_IS_PAYED=0 and O_U_NO = ?"; 50 | 51 | private static final String GET_UNBOOKED_FLIGHT="select * from T_FLIGHT f,T_AIRPLANE a where f.F_A_NO=a.A_NO and f.F_NO not in (select O_F_NO from T_ORDER o where o.O_U_NO = ?)"; 52 | 53 | private static final String GET_ORDER_SQL="select * from T_ORDER o,T_USER u,T_FLIGHT f,T_AIRPLANE a where o.O_U_NO=u.U_NO and o.O_F_NO=f.F_NO and f.F_A_NO=a.A_NO and O_NO = ?"; 54 | 55 | private static final String QUERY_BALANCE="select U_BALANCE from T_USER where U_NO = ?"; 56 | 57 | 58 | @Override 59 | public List findFlightByStartAndDist(String start, String dist) { 60 | List flightList=null; 61 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 62 | String SQL=new String(FIND_FLIGHT_SQL); 63 | if(start!=null&&!start.trim().equals("")){ 64 | SQL+=" and F_START='"+start.trim()+"'"; 65 | } 66 | if(dist!=null&&!dist.trim().equals("")){ 67 | SQL+=" and F_DIST='"+dist+"'"; 68 | } 69 | System.out.println(SQL); 70 | try { 71 | flightList=runner.query(SQL,new FlightResultSetHandler()); 72 | } catch (SQLException e) { 73 | // TODO Auto-generated catch block 74 | e.printStackTrace(); 75 | } 76 | return flightList; 77 | } 78 | 79 | @Override 80 | public void bookFlight(User user, Flight flight) throws FMException { 81 | QueryRunner runner =new QueryRunner(DaoUtils.getSource()); 82 | try { 83 | runner.update(BOOK_FLIGHT_SQL,user.getNo(),flight.getNo(),new Date()); 84 | runner.update(UPDATE_PSG_NUM_SQL,flight.getNo()); 85 | } catch (SQLException e) { 86 | e.printStackTrace(); 87 | throw new FMException("预订失败!"); 88 | 89 | } 90 | } 91 | 92 | @Override 93 | public void bounce(Order order) throws FMException { 94 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 95 | try { 96 | runner.update(BOUNCE_SQL, order.getNo()); 97 | runner.update(BOUNCE_PSG_NUM_SQL,order.getFlight().getNo()); 98 | if (order.getIsPayed()) { 99 | runner.update(REFUND_SQL,order.getFlight().getPrice(),order.getNo(),order.getUser().getNo()); 100 | } 101 | } catch (SQLException e) { 102 | // TODO Auto-generated catch block 103 | e.printStackTrace(); 104 | throw new FMException("退票失败!"); 105 | } 106 | 107 | } 108 | 109 | @Override 110 | public void payFlight(Order order) throws FMException{ 111 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 112 | 113 | try { 114 | Float balance = runner.query(QUERY_BALANCE, new FloatResultSetHandler(),order.getUser().getNo()); 115 | if(balance getOrderListOfUser(User user) { 128 | List orderList=null; 129 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 130 | try { 131 | orderList = runner.query(GET_ORDER_LIST_SQL, new OrderResultSetHandler() , user.getNo()); 132 | } catch (SQLException e) { 133 | // TODO Auto-generated catch block 134 | e.printStackTrace(); 135 | } 136 | return orderList; 137 | } 138 | 139 | @Override 140 | public List getPayedOrderListOfUser(User user) { 141 | List orderList=null; 142 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 143 | try { 144 | orderList = runner.query(GET_PAYED_ORDER_LIST_SQL, new OrderResultSetHandler() , user.getNo()); 145 | } catch (SQLException e) { 146 | // TODO Auto-generated catch block 147 | e.printStackTrace(); 148 | } 149 | return orderList; 150 | } 151 | @Override 152 | public List getUnPayedOrderListOfUser(User user) { 153 | List orderList=null; 154 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 155 | try { 156 | orderList = runner.query(GET_UNPAYED_ORDER_LIST_SQL, new OrderResultSetHandler() , user.getNo()); 157 | } catch (SQLException e) { 158 | // TODO Auto-generated catch block 159 | e.printStackTrace(); 160 | } 161 | return orderList; 162 | } 163 | 164 | @Override 165 | public List getUnBookedFlight(User user) { 166 | List unBookedFlightList=new ArrayList(); 167 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 168 | try { 169 | System.err.println(user.getNo()+"---------------------------"); 170 | unBookedFlightList = runner.query(GET_UNBOOKED_FLIGHT, new FlightResultSetHandler(), user.getNo()); 171 | 172 | } catch (SQLException e) { 173 | // TODO Auto-generated catch block 174 | e.printStackTrace(); 175 | } 176 | return unBookedFlightList; 177 | } 178 | @Override 179 | public Order getOrder(Order order) { 180 | QueryRunner runner=new QueryRunner(DaoUtils.getSource()); 181 | Order o=new Order(); 182 | try { 183 | List list = runner.query(GET_ORDER_SQL, new OrderResultSetHandler(),order.getNo()); 184 | o=list.get(0); 185 | } catch (SQLException e) { 186 | // TODO Auto-generated catch block 187 | e.printStackTrace(); 188 | } 189 | return o; 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/impl/UserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.impl; 2 | 3 | 4 | import java.sql.ResultSet; 5 | import java.sql.SQLException; 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | import org.apache.commons.dbutils.QueryRunner; 10 | import org.apache.commons.dbutils.ResultSetHandler; 11 | 12 | import pers.gulo.fm.dao.UserDao; 13 | import pers.gulo.fm.dao.resultSetHandler.UserResultSetHandler; 14 | import pers.gulo.fm.domain.Flight; 15 | import pers.gulo.fm.domain.User; 16 | import pers.gulo.fm.exception.FMException; 17 | import pers.gulo.fm.utils.DaoUtils; 18 | 19 | public class UserDaoImpl implements UserDao { 20 | 21 | private static final String CHECK_LOGIN_SQL="select * from T_USER where U_USERNAME=? and U_PASSWORD=?"; 22 | 23 | private static final String INSERT_USER_SQL="insert into T_USER values (null,?,?,?,?,0,0)"; 24 | 25 | private static final String RECHARGE_SQL="update T_USER set U_BALANCE =U_BALANCE + ? where U_NO=?"; 26 | 27 | @Override 28 | public User login(String username, String password) { 29 | User user=null; 30 | QueryRunner runner =new QueryRunner(DaoUtils.getSource()); 31 | try { 32 | List list=runner.query(CHECK_LOGIN_SQL,new UserResultSetHandler(), username,password); 33 | if(list!=null&&list.size()!=0) user=list.get(0); 34 | } catch (SQLException e) { 35 | // TODO Auto-generated catch block 36 | e.printStackTrace(); 37 | } 38 | return user; 39 | } 40 | 41 | @Override 42 | public void insertUser(User user) throws FMException { 43 | QueryRunner runner =new QueryRunner(DaoUtils.getSource()); 44 | try { 45 | runner.update(INSERT_USER_SQL,user.getUsername(),user.getPassword(),user.getNickname(),user.getID()); 46 | } catch (SQLException e) { 47 | // TODO Auto-generated catch block 48 | e.printStackTrace(); 49 | throw new FMException("发生错误或用户名被占用!请重新注册!"); 50 | } 51 | 52 | } 53 | 54 | @Override 55 | public void reCharge(User user, float number) { 56 | QueryRunner runner =new QueryRunner(DaoUtils.getSource()); 57 | try { 58 | runner.update(RECHARGE_SQL,number,user.getNo()); 59 | } catch (SQLException e) { 60 | // TODO Auto-generated catch block 61 | e.printStackTrace(); 62 | } 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/resultSetHandler/AirPlaneResultSetHandler.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.resultSetHandler; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import org.apache.commons.dbutils.ResultSetHandler; 9 | 10 | import pers.gulo.fm.domain.AirPlane; 11 | 12 | public class AirPlaneResultSetHandler implements ResultSetHandler>{ 13 | @Override 14 | public List handle(ResultSet rs) throws SQLException { 15 | List airPlanes =new ArrayList(); 16 | while (rs.next()) { 17 | AirPlane airPlane=new AirPlane(); 18 | airPlane.setNo(rs.getInt("A_NO")); 19 | airPlane.setModel(rs.getString("A_MODEL")); 20 | airPlane.setCapacity(rs.getInt("A_CAPACITY")); 21 | airPlanes.add(airPlane); 22 | } 23 | return airPlanes; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/resultSetHandler/CountResultSetHandler.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.resultSetHandler; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | 6 | import org.apache.commons.dbutils.ResultSetHandler; 7 | 8 | public class CountResultSetHandler implements ResultSetHandler{ 9 | 10 | @Override 11 | public Integer handle(ResultSet rs) throws SQLException { 12 | rs.next(); 13 | return rs.getInt(1); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/resultSetHandler/FlightResultSetHandler.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.resultSetHandler; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import org.apache.commons.dbutils.ResultSetHandler; 9 | 10 | import pers.gulo.fm.domain.AirPlane; 11 | import pers.gulo.fm.domain.Flight; 12 | 13 | public class FlightResultSetHandler implements ResultSetHandler>{ 14 | @Override 15 | public List handle(ResultSet rs) throws SQLException { 16 | List flightList =new ArrayList(); 17 | while(rs.next()){ 18 | Flight flight=new Flight(); 19 | flight.setNo(rs.getInt("F_NO")); 20 | flight.setStart(rs.getString("F_START")); 21 | flight.setDist(rs.getString("F_DIST")); 22 | flight.setPassengerNumber(rs.getInt("F_PSG_NUM")); 23 | flight.setPrice(rs.getFloat("F_PRICE")); 24 | flight.setTime(rs.getTimestamp("F_TIME")); 25 | AirPlane airPlane=new AirPlane(); 26 | airPlane.setNo(rs.getInt("A_NO")); 27 | airPlane.setModel(rs.getString("A_MODEL")); 28 | airPlane.setCapacity(rs.getInt("A_CAPACITY")); 29 | flight.setAirPlane(airPlane); 30 | flightList.add(flight); 31 | } 32 | return flightList; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/resultSetHandler/FloatResultSetHandler.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.resultSetHandler; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | 6 | import org.apache.commons.dbutils.ResultSetHandler; 7 | 8 | public class FloatResultSetHandler implements ResultSetHandler{ 9 | 10 | @Override 11 | public Float handle(ResultSet rs) throws SQLException { 12 | Float result=0f; 13 | while(rs.next()){ 14 | result=rs.getFloat(1); 15 | } 16 | return result; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/resultSetHandler/OrderResultSetHandler.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.resultSetHandler; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import org.apache.commons.dbutils.ResultSetHandler; 9 | 10 | import pers.gulo.fm.domain.AirPlane; 11 | import pers.gulo.fm.domain.Flight; 12 | import pers.gulo.fm.domain.Order; 13 | import pers.gulo.fm.domain.User; 14 | 15 | public class OrderResultSetHandler implements ResultSetHandler>{ 16 | 17 | @Override 18 | public List handle(ResultSet rs) throws SQLException { 19 | List orderList=new ArrayList(); 20 | while(rs.next()){ 21 | Order order=new Order(); 22 | order.setNo(rs.getInt("O_NO")); 23 | order.setTime(rs.getTimestamp("O_TIME")); 24 | order.setIsPayed(rs.getInt("O_IS_PAYED")==1); 25 | order.setIsCanceled(rs.getInt("O_IS_CANCELED")==1); 26 | 27 | Flight flight=new Flight(); 28 | flight.setNo(rs.getInt("F_NO")); 29 | flight.setStart(rs.getString("F_START")); 30 | flight.setDist(rs.getString("F_DIST")); 31 | flight.setPassengerNumber(rs.getInt("F_PSG_NUM")); 32 | flight.setPrice(rs.getFloat("F_PRICE")); 33 | flight.setTime(rs.getTimestamp("F_TIME")); 34 | AirPlane airPlane=new AirPlane(); 35 | airPlane.setNo(rs.getInt("A_NO")); 36 | airPlane.setModel(rs.getString("A_MODEL")); 37 | airPlane.setCapacity(rs.getInt("A_CAPACITY")); 38 | flight.setAirPlane(airPlane); 39 | order.setFlight(flight); 40 | 41 | User user=new User(); 42 | user.setUsername(rs.getString("U_USERNAME")); 43 | user.setPassword(rs.getString("U_PASSWORD")); 44 | user.setNo(rs.getInt("U_NO")); 45 | user.setID(rs.getString("U_ID")); 46 | user.setNickname(rs.getString("U_NICKNAME")); 47 | user.setType(rs.getInt("U_TYPE")); 48 | user.setBalance(rs.getFloat("U_BALANCE")); 49 | order.setUser(user); 50 | 51 | orderList.add(order); 52 | } 53 | return orderList; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/dao/resultSetHandler/UserResultSetHandler.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.dao.resultSetHandler; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import org.apache.commons.dbutils.ResultSetHandler; 9 | 10 | import pers.gulo.fm.domain.User; 11 | 12 | public class UserResultSetHandler implements ResultSetHandler> { 13 | @Override 14 | public List handle(ResultSet rs) throws SQLException { 15 | List userList=new ArrayList(); 16 | while(rs.next()){ 17 | User user =new User(); 18 | user.setUsername(rs.getString("U_USERNAME")); 19 | user.setPassword(rs.getString("U_PASSWORD")); 20 | user.setNo(rs.getInt("U_NO")); 21 | user.setID(rs.getString("U_ID")); 22 | user.setNickname(rs.getString("U_NICKNAME")); 23 | user.setType(rs.getInt("U_TYPE")); 24 | user.setBalance(rs.getFloat("U_BALANCE")); 25 | userList.add(user); 26 | } 27 | return userList; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/domain/AirPlane.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.domain; 2 | 3 | import java.io.Serializable; 4 | 5 | public class AirPlane implements Serializable{ 6 | private int no; 7 | private String model; 8 | private int capacity; 9 | public int getNo() { 10 | return no; 11 | } 12 | public void setNo(int no) { 13 | this.no = no; 14 | } 15 | public String getModel() { 16 | return model; 17 | } 18 | public void setModel(String model) { 19 | this.model = model; 20 | } 21 | public int getCapacity() { 22 | return capacity; 23 | } 24 | public void setCapacity(int capacity) { 25 | this.capacity = capacity; 26 | } 27 | @Override 28 | public String toString() { 29 | return "AirPlane [no=" + no + ", model=" + model + ", capacity=" 30 | + capacity + "]"; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/domain/Flight.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.domain; 2 | 3 | import java.sql.Timestamp; 4 | import java.util.Date; 5 | 6 | public class Flight { 7 | private int no; 8 | private AirPlane airPlane; 9 | private String start; 10 | private String dist; 11 | private float price; 12 | private Timestamp time; 13 | private int passengerNumber; 14 | public int getNo() { 15 | return no; 16 | } 17 | public void setNo(int no) { 18 | this.no = no; 19 | } 20 | public String getStart() { 21 | return start; 22 | } 23 | public void setStart(String start) { 24 | this.start = start; 25 | } 26 | public String getDist() { 27 | return dist; 28 | } 29 | public void setDist(String dist) { 30 | this.dist = dist; 31 | } 32 | public float getPrice() { 33 | return price; 34 | } 35 | public void setPrice(float price) { 36 | this.price = price; 37 | } 38 | public int getPassengerNumber() { 39 | return passengerNumber; 40 | } 41 | public void setPassengerNumber(int passengerNumber) { 42 | this.passengerNumber = passengerNumber; 43 | } 44 | public AirPlane getAirPlane() { 45 | return airPlane; 46 | } 47 | public void setAirPlane(AirPlane airPlane) { 48 | this.airPlane = airPlane; 49 | } 50 | public Timestamp getTime() { 51 | return time; 52 | } 53 | public void setTime(Timestamp time) { 54 | this.time = time; 55 | } 56 | @Override 57 | public String toString() { 58 | return "Flight [no=" + no + ", airPlane=" + airPlane + ", start=" 59 | + start + ", dist=" + dist + ", price=" + price + ", time=" 60 | + time + ", passengerNumber=" + passengerNumber + "]"; 61 | } 62 | 63 | 64 | 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/domain/Order.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.domain; 2 | 3 | import java.sql.Timestamp; 4 | import java.util.Date; 5 | 6 | public class Order { 7 | private int no; 8 | private User user; 9 | private Flight flight; 10 | private boolean isPayed; 11 | private boolean isCanceled; 12 | private Timestamp time; 13 | public int getNo() { 14 | return no; 15 | } 16 | public void setNo(int no) { 17 | this.no = no; 18 | } 19 | public User getUser() { 20 | return user; 21 | } 22 | public void setUser(User user) { 23 | this.user = user; 24 | } 25 | public Flight getFlight() { 26 | return flight; 27 | } 28 | public void setFlight(Flight flight) { 29 | this.flight = flight; 30 | } 31 | public boolean getIsPayed() { 32 | return isPayed; 33 | } 34 | public void setIsPayed(boolean isPayed) { 35 | this.isPayed = isPayed; 36 | } 37 | public boolean getIsCanceled() { 38 | return isCanceled; 39 | } 40 | public void setIsCanceled(boolean isCanceled) { 41 | this.isCanceled = isCanceled; 42 | } 43 | public Timestamp getTime() { 44 | return time; 45 | } 46 | public void setTime(Timestamp time) { 47 | this.time = time; 48 | } 49 | @Override 50 | public String toString() { 51 | return "Order [no=" + no + ", user=" + user + ", flight=" + flight 52 | + ", isPayed=" + isPayed + ", isCanceled=" + isCanceled 53 | + ", time=" + time + "]"; 54 | } 55 | 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/domain/Statistic.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.domain; 2 | 3 | public class Statistic { 4 | private int weekFlight; 5 | private int monthFlight; 6 | private int totalFlight; 7 | 8 | private int weekOrder; 9 | private int monthOrder; 10 | private int totalOrder; 11 | 12 | private float weekIncome; 13 | private float monthIncome; 14 | private float totalIncome; 15 | public int getWeekFlight() { 16 | return weekFlight; 17 | } 18 | public void setWeekFlight(int weekFlight) { 19 | this.weekFlight = weekFlight; 20 | } 21 | public int getMonthFlight() { 22 | return monthFlight; 23 | } 24 | public void setMonthFlight(int monthFlight) { 25 | this.monthFlight = monthFlight; 26 | } 27 | public int getTotalFlight() { 28 | return totalFlight; 29 | } 30 | public void setTotalFlight(int totalFlight) { 31 | this.totalFlight = totalFlight; 32 | } 33 | public int getWeekOrder() { 34 | return weekOrder; 35 | } 36 | public void setWeekOrder(int weekOrder) { 37 | this.weekOrder = weekOrder; 38 | } 39 | public int getMonthOrder() { 40 | return monthOrder; 41 | } 42 | public void setMonthOrder(int monthOrder) { 43 | this.monthOrder = monthOrder; 44 | } 45 | public int getTotalOrder() { 46 | return totalOrder; 47 | } 48 | public void setTotalOrder(int totalOrder) { 49 | this.totalOrder = totalOrder; 50 | } 51 | public float getWeekIncome() { 52 | return weekIncome; 53 | } 54 | public void setWeekIncome(float weekIncome) { 55 | this.weekIncome = weekIncome; 56 | } 57 | public float getMonthIncome() { 58 | return monthIncome; 59 | } 60 | public void setMonthIncome(float monthIncome) { 61 | this.monthIncome = monthIncome; 62 | } 63 | public float getTotalIncome() { 64 | return totalIncome; 65 | } 66 | public void setTotalIncome(float totalIncome) { 67 | this.totalIncome = totalIncome; 68 | } 69 | @Override 70 | public String toString() { 71 | return "Statistic [weekFlight=" + weekFlight + ", monthFlight=" 72 | + monthFlight + ", totalFlight=" + totalFlight + ", weekOrder=" 73 | + weekOrder + ", monthOrder=" + monthOrder + ", totalOrder=" 74 | + totalOrder + ", weekIncome=" + weekIncome + ", monthIncome=" 75 | + monthIncome + ", totalIncome=" + totalIncome + "]"; 76 | } 77 | 78 | 79 | 80 | 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/domain/User.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.domain; 2 | 3 | public class User { 4 | private int no; 5 | private String username; 6 | private String password; 7 | private String nickname; 8 | private String ID; 9 | private float balance; 10 | private int type; 11 | public float getBalance() { 12 | return balance; 13 | } 14 | public void setBalance(float balance) { 15 | this.balance = balance; 16 | } 17 | public int getNo() { 18 | return no; 19 | } 20 | public void setNo(int no) { 21 | this.no = no; 22 | } 23 | public String getUsername() { 24 | return username; 25 | } 26 | public void setUsername(String username) { 27 | this.username = username; 28 | } 29 | public String getPassword() { 30 | return password; 31 | } 32 | public void setPassword(String password) { 33 | this.password = password; 34 | } 35 | public String getNickname() { 36 | return nickname; 37 | } 38 | public void setNickname(String nickname) { 39 | this.nickname = nickname; 40 | } 41 | public String getID() { 42 | return ID; 43 | } 44 | public void setID(String ID) { 45 | this.ID = ID; 46 | } 47 | public int getType() { 48 | return type; 49 | } 50 | public void setType(int type) { 51 | this.type = type; 52 | } 53 | @Override 54 | public String toString() { 55 | return "User [no=" + no + ", username=" + username + ", password=" 56 | + password + ", nickname=" + nickname + ", ID=" + ID 57 | + ", balance=" + balance + ", type=" + type + "]"; 58 | } 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/exception/FMException.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.exception; 2 | 3 | public class FMException extends Exception{ 4 | public FMException(String msg) { 5 | // TODO Auto-generated constructor stub 6 | super(msg); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.service; 2 | 3 | import java.util.List; 4 | 5 | import pers.gulo.fm.domain.AirPlane; 6 | import pers.gulo.fm.domain.Flight; 7 | import pers.gulo.fm.domain.Order; 8 | import pers.gulo.fm.domain.Statistic; 9 | import pers.gulo.fm.domain.User; 10 | import pers.gulo.fm.exception.FMException; 11 | 12 | public interface AdminService{ 13 | 14 | public List listAllUser(); 15 | 16 | public void deleteUser(User user) throws FMException; 17 | 18 | public void updateUser(User user) throws FMException; 19 | 20 | public List listAllFlight(); 21 | 22 | public void updateFlight(Flight flight) throws FMException; 23 | 24 | public void addFlight(Flight flight) throws FMException; 25 | 26 | public void deleteFlight(Flight flight) throws FMException; 27 | 28 | public List listAllAirPlane(); 29 | 30 | public void addAirPlane(AirPlane airPlane) throws FMException ; 31 | 32 | public void deleteAirPlane(AirPlane airPlane) throws FMException; 33 | 34 | public List listAllOrder(); 35 | 36 | public Statistic makeStatistic(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/service/PassengerService.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.service; 2 | 3 | import java.util.List; 4 | 5 | import pers.gulo.fm.domain.Flight; 6 | import pers.gulo.fm.domain.User; 7 | 8 | public interface PassengerService { 9 | /** 10 | * 用户预订机票 11 | * @param user 12 | * @param flight 13 | */ 14 | public void bookFlight(User user,Flight flight); 15 | 16 | /** 17 | * 取消预订 18 | * @param user 19 | * @param flight 20 | */ 21 | public void cancelBook(User user,Flight flight); 22 | /** 23 | * 付款 24 | * @param user 25 | * @param flight 26 | */ 27 | public void pay(User user,Flight flight); 28 | 29 | public List listUnBookedFlight(User user); 30 | } 31 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/service/UserService.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.service; 2 | 3 | import pers.gulo.fm.domain.User; 4 | import pers.gulo.fm.exception.FMException; 5 | 6 | public interface UserService { 7 | /** 8 | * 用户登录,成功返回用户信息,失败返回null 9 | * @param username 10 | * @param password 11 | * @return 12 | */ 13 | public User login(String username,String password); 14 | 15 | public void addUser(User user) throws FMException; 16 | 17 | public void recharge(User user, float number); 18 | } 19 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/service/impl/AdminServiceImpl.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import pers.gulo.fm.dao.AdminDao; 6 | import pers.gulo.fm.dao.impl.AdminDaoImpl; 7 | import pers.gulo.fm.domain.AirPlane; 8 | import pers.gulo.fm.domain.Flight; 9 | import pers.gulo.fm.domain.Order; 10 | import pers.gulo.fm.domain.Statistic; 11 | import pers.gulo.fm.domain.User; 12 | import pers.gulo.fm.exception.FMException; 13 | import pers.gulo.fm.service.AdminService; 14 | 15 | public class AdminServiceImpl implements AdminService{ 16 | 17 | @Override 18 | public List listAllUser() { 19 | AdminDao aDao=new AdminDaoImpl(); 20 | List queryUsers = aDao.queryUsers(); 21 | return queryUsers; 22 | } 23 | 24 | public void deleteUser(User user) throws FMException{ 25 | AdminDao aDao=new AdminDaoImpl(); 26 | aDao.deleteUser(user); 27 | } 28 | 29 | @Override 30 | public void updateUser(User user) throws FMException { 31 | AdminDao aDao=new AdminDaoImpl(); 32 | aDao.updateUser(user); 33 | } 34 | 35 | @Override 36 | public List listAllFlight() { 37 | AdminDao aDao=new AdminDaoImpl(); 38 | return aDao.queryAllFlight(); 39 | 40 | } 41 | 42 | @Override 43 | public void updateFlight(Flight flight) throws FMException { 44 | AdminDao aDao=new AdminDaoImpl(); 45 | aDao.updateFlight(flight); 46 | 47 | } 48 | 49 | @Override 50 | public void addFlight(Flight flight) throws FMException { 51 | AdminDao aDao=new AdminDaoImpl(); 52 | aDao.insertFlight(flight); 53 | } 54 | 55 | @Override 56 | public void deleteFlight(Flight flight) throws FMException { 57 | AdminDao aDao=new AdminDaoImpl(); 58 | aDao.deleteFlight(flight); 59 | } 60 | 61 | @Override 62 | public List listAllAirPlane() { 63 | AdminDao aDao=new AdminDaoImpl(); 64 | 65 | List queryAllAirPlane = aDao.queryAllAirPlane(); 66 | return queryAllAirPlane; 67 | } 68 | 69 | @Override 70 | public void addAirPlane(AirPlane airPlane) throws FMException { 71 | AdminDao aDao=new AdminDaoImpl(); 72 | aDao.insertAirPlane(airPlane); 73 | } 74 | 75 | @Override 76 | public void deleteAirPlane(AirPlane airPlane) throws FMException { 77 | AdminDao aDao=new AdminDaoImpl(); 78 | aDao.deleteAirPlane(airPlane); 79 | } 80 | 81 | @Override 82 | public List listAllOrder() { 83 | AdminDao aDao=new AdminDaoImpl(); 84 | return aDao.queryAllOrder(); 85 | } 86 | 87 | @Override 88 | public Statistic makeStatistic() { 89 | AdminDao aDao=new AdminDaoImpl(); 90 | return aDao.makeStatistic(); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/service/impl/PassengerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import pers.gulo.fm.dao.PassengerDao; 6 | import pers.gulo.fm.dao.impl.PassengerDaoImpl; 7 | import pers.gulo.fm.domain.Flight; 8 | import pers.gulo.fm.domain.User; 9 | import pers.gulo.fm.service.PassengerService; 10 | 11 | public class PassengerServiceImpl implements PassengerService{ 12 | 13 | @Override 14 | public void bookFlight(User user, Flight flight) { 15 | // TODO Auto-generated method stub 16 | 17 | } 18 | 19 | @Override 20 | public void cancelBook(User user, Flight flight) { 21 | // TODO Auto-generated method stub 22 | 23 | } 24 | 25 | @Override 26 | public void pay(User user, Flight flight) { 27 | // TODO Auto-generated method stub 28 | 29 | } 30 | 31 | @Override 32 | public List listUnBookedFlight(User user) { 33 | PassengerDao pDao=new PassengerDaoImpl(); 34 | return pDao.getUnBookedFlight(user); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.service.impl; 2 | 3 | import pers.gulo.fm.dao.UserDao; 4 | import pers.gulo.fm.dao.impl.UserDaoImpl; 5 | import pers.gulo.fm.domain.User; 6 | import pers.gulo.fm.exception.FMException; 7 | import pers.gulo.fm.service.UserService; 8 | 9 | public class UserServiceImpl implements UserService{ 10 | 11 | @Override 12 | public User login(String username, String password) { 13 | UserDao uDao=new UserDaoImpl(); 14 | return uDao.login(username, password); 15 | } 16 | 17 | @Override 18 | public void addUser(User user) throws FMException { 19 | UserDao uDao=new UserDaoImpl(); 20 | uDao.insertUser(user); 21 | } 22 | 23 | @Override 24 | public void recharge(User user, float number) { 25 | UserDao uDao=new UserDaoImpl(); 26 | uDao.reCharge(user,number); 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/test/Main.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.test; 2 | 3 | import java.sql.Connection; 4 | import java.sql.ResultSet; 5 | import java.sql.SQLException; 6 | import java.sql.Timestamp; 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | import org.apache.commons.dbutils.QueryRunner; 11 | import org.apache.commons.dbutils.ResultSetHandler; 12 | 13 | import com.sun.org.apache.xpath.internal.operations.Or; 14 | 15 | import pers.gulo.fm.dao.AdminDao; 16 | import pers.gulo.fm.dao.PassengerDao; 17 | import pers.gulo.fm.dao.impl.AdminDaoImpl; 18 | import pers.gulo.fm.dao.impl.PassengerDaoImpl; 19 | import pers.gulo.fm.domain.AirPlane; 20 | import pers.gulo.fm.domain.Flight; 21 | import pers.gulo.fm.domain.Order; 22 | import pers.gulo.fm.domain.Statistic; 23 | import pers.gulo.fm.domain.User; 24 | import pers.gulo.fm.exception.FMException; 25 | import pers.gulo.fm.service.AdminService; 26 | import pers.gulo.fm.service.UserService; 27 | import pers.gulo.fm.service.impl.AdminServiceImpl; 28 | import pers.gulo.fm.service.impl.UserServiceImpl; 29 | import pers.gulo.fm.utils.DaoUtils; 30 | 31 | public class Main { 32 | public static void main(String[] args) throws SQLException { 33 | AdminDao aDao=new AdminDaoImpl(); 34 | Statistic makeStatistic = aDao.makeStatistic(); 35 | System.out.println(makeStatistic); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/utils/DaoUtils.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.utils; 2 | 3 | 4 | import java.sql.Connection; 5 | import java.sql.SQLException; 6 | 7 | import javax.sql.DataSource; 8 | 9 | import com.mchange.v2.c3p0.ComboPooledDataSource; 10 | 11 | public class DaoUtils { 12 | private static DataSource source = new ComboPooledDataSource(); 13 | private DaoUtils() { 14 | } 15 | 16 | public static DataSource getSource(){ 17 | return source; 18 | } 19 | 20 | public static Connection getConn(){ 21 | try { 22 | return source.getConnection(); 23 | } catch (SQLException e) { 24 | e.printStackTrace(); 25 | throw new RuntimeException(e); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/utils/JDBCUtils.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.utils; 2 | 3 | import java.io.FileReader; 4 | import java.sql.Connection; 5 | import java.sql.DriverManager; 6 | import java.sql.ResultSet; 7 | import java.sql.SQLException; 8 | import java.sql.Statement; 9 | import java.util.Properties; 10 | 11 | public class JDBCUtils { 12 | private static Properties prop = null; 13 | private JDBCUtils() { 14 | } 15 | static{ 16 | try{ 17 | prop = new Properties(); 18 | prop.load(new FileReader(JDBCUtils.class.getClassLoader().getResource("config.properties").getPath())); 19 | }catch (Exception e) { 20 | e.printStackTrace(); 21 | throw new RuntimeException(e); 22 | } 23 | } 24 | 25 | 26 | public static Connection getConn() throws ClassNotFoundException, SQLException{ 27 | Class.forName(prop.getProperty("driver")); 28 | 29 | return DriverManager.getConnection(prop.getProperty("url"), prop.getProperty("user"), prop.getProperty("password")); 30 | 31 | } 32 | 33 | public static void close(ResultSet rs, Statement stat,Connection conn){ 34 | if(rs!=null){ 35 | try { 36 | rs.close(); 37 | } catch (SQLException e) { 38 | e.printStackTrace(); 39 | }finally{ 40 | rs = null; 41 | } 42 | } 43 | if(stat!=null){ 44 | try { 45 | stat.close(); 46 | } catch (SQLException e) { 47 | e.printStackTrace(); 48 | }finally{ 49 | stat = null; 50 | } 51 | } 52 | if(conn!=null){ 53 | try { 54 | conn.close(); 55 | } catch (SQLException e) { 56 | e.printStackTrace(); 57 | }finally{ 58 | conn = null; 59 | } 60 | } 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/AddAirPlaneServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | import java.sql.Timestamp; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import pers.gulo.fm.domain.AirPlane; 12 | import pers.gulo.fm.domain.Flight; 13 | import pers.gulo.fm.exception.FMException; 14 | import pers.gulo.fm.service.AdminService; 15 | import pers.gulo.fm.service.impl.AdminServiceImpl; 16 | 17 | public class AddAirPlaneServlet extends HttpServlet { 18 | 19 | public void doGet(HttpServletRequest request, HttpServletResponse response) 20 | throws ServletException, IOException { 21 | request.getSession().removeAttribute("airPlaneManageMsg"); 22 | AdminService aService=new AdminServiceImpl(); 23 | AirPlane airPlane=new AirPlane(); 24 | airPlane.setModel(new String(request.getParameter("model").getBytes("ISO-8859-1"),"UTF-8")); 25 | airPlane.setCapacity(Integer.parseInt(request.getParameter("capacity"))); 26 | try { 27 | aService.addAirPlane(airPlane); 28 | } catch (FMException e) { 29 | // TODO Auto-generated catch block 30 | request.getSession().setAttribute("airPlaneManageMsg", e.getMessage()); 31 | e.printStackTrace(); 32 | }finally{ 33 | response.sendRedirect(request.getContextPath()+"/airPlaneManage.jsp"); 34 | } 35 | } 36 | 37 | public void doPost(HttpServletRequest request, HttpServletResponse response) 38 | throws ServletException, IOException { 39 | 40 | doGet(request, response); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/AddFlightServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | import java.sql.Timestamp; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import pers.gulo.fm.domain.AirPlane; 12 | import pers.gulo.fm.domain.Flight; 13 | import pers.gulo.fm.exception.FMException; 14 | import pers.gulo.fm.service.AdminService; 15 | import pers.gulo.fm.service.impl.AdminServiceImpl; 16 | 17 | public class AddFlightServlet extends HttpServlet { 18 | 19 | public void doGet(HttpServletRequest request, HttpServletResponse response) 20 | throws ServletException, IOException { 21 | request.getSession().removeAttribute("flightManageMsg"); 22 | AdminService aService=new AdminServiceImpl(); 23 | Flight flight=new Flight(); 24 | AirPlane airPlane=new AirPlane(); 25 | airPlane.setNo(Integer.parseInt(request.getParameter("aNo"))); 26 | flight.setAirPlane(airPlane); 27 | flight.setStart(new String(request.getParameter("start").getBytes("ISO-8859-1"),"UTF-8")); 28 | flight.setDist(new String(request.getParameter("dist").getBytes("ISO-8859-1"),"UTF-8")); 29 | flight.setPrice(Float.parseFloat(request.getParameter("price"))); 30 | flight.setTime(Timestamp.valueOf(request.getParameter("time"))); 31 | 32 | try { 33 | aService.addFlight(flight); 34 | } catch (FMException e) { 35 | // TODO Auto-generated catch block 36 | request.getSession().setAttribute("flightManageMsg", e.getMessage()); 37 | e.printStackTrace(); 38 | }finally{ 39 | response.sendRedirect(request.getContextPath()+"/flightManage.jsp"); 40 | } 41 | 42 | 43 | 44 | } 45 | 46 | public void doPost(HttpServletRequest request, HttpServletResponse response) 47 | throws ServletException, IOException { 48 | 49 | doGet(request, response); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/AddUserServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import pers.gulo.fm.domain.User; 11 | import pers.gulo.fm.exception.FMException; 12 | import pers.gulo.fm.service.UserService; 13 | import pers.gulo.fm.service.impl.UserServiceImpl; 14 | 15 | public class AddUserServlet extends HttpServlet { 16 | 17 | public void doGet(HttpServletRequest request, HttpServletResponse response) 18 | throws ServletException, IOException { 19 | UserService userService=new UserServiceImpl(); 20 | User user =new User(); 21 | user.setUsername(new String(request.getParameter("username").getBytes("ISO-8859-1"),"UTF-8")); 22 | user.setPassword(request.getParameter("password")); 23 | user.setNickname(new String(request.getParameter("nickname").getBytes("ISO-8859-1"),"UTF-8")); 24 | user.setID(request.getParameter("id")); 25 | try { 26 | userService.addUser(user); 27 | request.getSession().setAttribute("loginMsg", "注册成功!"); 28 | } catch (FMException e) { 29 | // TODO Auto-generated catch block 30 | request.getSession().setAttribute("loginMsg", e.getMessage()); 31 | e.printStackTrace(); 32 | }finally{ 33 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 34 | } 35 | } 36 | 37 | public void doPost(HttpServletRequest request, HttpServletResponse response) 38 | throws ServletException, IOException { 39 | 40 | doGet(request, response); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/BookServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import pers.gulo.fm.dao.PassengerDao; 11 | import pers.gulo.fm.dao.impl.PassengerDaoImpl; 12 | import pers.gulo.fm.domain.Flight; 13 | import pers.gulo.fm.domain.User; 14 | import pers.gulo.fm.exception.FMException; 15 | 16 | public class BookServlet extends HttpServlet { 17 | 18 | public void doGet(HttpServletRequest request, HttpServletResponse response) 19 | throws ServletException, IOException { 20 | User user =(User) request.getSession().getAttribute("user"); 21 | PassengerDao pDao=new PassengerDaoImpl(); 22 | int flightNo=Integer.parseInt(request.getParameter("flightNo")); 23 | Flight flight=new Flight(); 24 | flight.setNo(flightNo); 25 | try { 26 | pDao.bookFlight(user, flight); 27 | request.getSession().setAttribute("bookFlightMsg", "预订成功!"); 28 | } catch (FMException e) { 29 | request.getSession().setAttribute("bookFlightMsg", "预订失败!余票不足!"); 30 | e.printStackTrace(); 31 | }finally{ 32 | response.sendRedirect(request.getContextPath()+"/bookFlight.jsp"); 33 | } 34 | 35 | } 36 | 37 | public void doPost(HttpServletRequest request, HttpServletResponse response) 38 | throws ServletException, IOException { 39 | 40 | doGet(request, response); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/CancelServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.mail.Session; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import pers.gulo.fm.dao.PassengerDao; 12 | import pers.gulo.fm.dao.impl.PassengerDaoImpl; 13 | import pers.gulo.fm.domain.Order; 14 | import pers.gulo.fm.domain.User; 15 | import pers.gulo.fm.exception.FMException; 16 | 17 | public class CancelServlet extends HttpServlet { 18 | 19 | public void doGet(HttpServletRequest request, HttpServletResponse response) 20 | throws ServletException, IOException { 21 | int orderNo=Integer.parseInt(request.getParameter("orderNo")); 22 | PassengerDao pDao=new PassengerDaoImpl(); 23 | Order order=new Order(); 24 | order.setNo(orderNo); 25 | order=pDao.getOrder(order); 26 | try { 27 | pDao.bounce(order); 28 | User sessionUser = (User) request.getSession().getAttribute("user"); 29 | sessionUser.setBalance(sessionUser.getBalance()+order.getFlight().getPrice()); 30 | request.getSession().setAttribute("myOrderMsg", "取消订单成功!"); 31 | } catch (FMException e) { 32 | request.getSession().setAttribute("myOrderMsg", "取消订单失败!"); 33 | e.printStackTrace(); 34 | }finally{ 35 | response.sendRedirect(request.getContextPath()+"/myOrder.jsp"); 36 | } 37 | 38 | } 39 | 40 | public void doPost(HttpServletRequest request, HttpServletResponse response) 41 | throws ServletException, IOException { 42 | 43 | doGet(request, response); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/DeleteAirPlaneServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import pers.gulo.fm.dao.AdminDao; 11 | import pers.gulo.fm.dao.impl.AdminDaoImpl; 12 | import pers.gulo.fm.domain.AirPlane; 13 | import pers.gulo.fm.exception.FMException; 14 | import pers.gulo.fm.service.AdminService; 15 | import pers.gulo.fm.service.impl.AdminServiceImpl; 16 | 17 | public class DeleteAirPlaneServlet extends HttpServlet { 18 | 19 | public void doGet(HttpServletRequest request, HttpServletResponse response) 20 | throws ServletException, IOException { 21 | 22 | int no=Integer.parseInt(request.getParameter("airPlaneNo")); 23 | AirPlane airPlane=new AirPlane(); 24 | airPlane.setNo(no); 25 | 26 | AdminService aService=new AdminServiceImpl(); 27 | try { 28 | aService.deleteAirPlane(airPlane); 29 | } catch (FMException e) { 30 | // TODO Auto-generated catch block 31 | request.getSession().setAttribute("airPlaneManageMsg", e.getMessage()); 32 | e.printStackTrace(); 33 | }finally{ 34 | response.sendRedirect(request.getContextPath()+"/airPlaneManage.jsp"); 35 | } 36 | 37 | } 38 | 39 | public void doPost(HttpServletRequest request, HttpServletResponse response) 40 | throws ServletException, IOException { 41 | 42 | doGet(request, response); 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/DeleteFlightServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import pers.gulo.fm.domain.Flight; 11 | import pers.gulo.fm.exception.FMException; 12 | import pers.gulo.fm.service.AdminService; 13 | import pers.gulo.fm.service.impl.AdminServiceImpl; 14 | 15 | public class DeleteFlightServlet extends HttpServlet { 16 | 17 | public void doGet(HttpServletRequest request, HttpServletResponse response) 18 | throws ServletException, IOException { 19 | int flightNo=Integer.parseInt(request.getParameter("flightNo")); 20 | AdminService aService=new AdminServiceImpl(); 21 | Flight flight=new Flight(); 22 | flight.setNo(flightNo); 23 | try { 24 | aService.deleteFlight(flight); 25 | } catch (FMException e) { 26 | // TODO Auto-generated catch block 27 | request.getSession().setAttribute("flightManageMsg", e.getMessage()); 28 | e.printStackTrace(); 29 | }finally{ 30 | response.sendRedirect(request.getContextPath()+"/flightManage.jsp"); 31 | } 32 | 33 | 34 | } 35 | 36 | public void doPost(HttpServletRequest request, HttpServletResponse response) 37 | throws ServletException, IOException { 38 | 39 | doGet(request, response); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/LoginServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import javax.servlet.http.HttpSession; 10 | 11 | import pers.gulo.fm.domain.User; 12 | import pers.gulo.fm.service.UserService; 13 | import pers.gulo.fm.service.impl.UserServiceImpl; 14 | 15 | public class LoginServlet extends HttpServlet { 16 | 17 | public void doGet(HttpServletRequest request, HttpServletResponse response) 18 | throws ServletException, IOException { 19 | HttpSession session = request.getSession(); 20 | String username= request.getParameter("username"); 21 | String password =request.getParameter("password"); 22 | 23 | UserService uService=new UserServiceImpl(); 24 | User user = uService.login(username, password); 25 | if(user!=null){ 26 | session.setAttribute("user", user); 27 | session.removeAttribute("loginMsg"); 28 | 29 | if(user.getType()==1){ //管理员 30 | response.sendRedirect(request.getContextPath()+"/manage.jsp"); 31 | }else{ 32 | response.sendRedirect(request.getContextPath()+"/user.jsp"); 33 | } 34 | }else{ 35 | request.getSession().setAttribute("loginMsg", "用户名或密码错误!"); 36 | response.sendRedirect(request.getContextPath()+"/login.jsp"); 37 | } 38 | } 39 | 40 | public void doPost(HttpServletRequest request, HttpServletResponse response) 41 | throws ServletException, IOException { 42 | 43 | doGet(request, response); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/LogoutServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.mail.Session; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import javax.servlet.http.HttpSession; 11 | 12 | public class LogoutServlet extends HttpServlet { 13 | 14 | public void doGet(HttpServletRequest request, HttpServletResponse response) 15 | throws ServletException, IOException { 16 | HttpSession session = request.getSession(); 17 | session.removeAttribute("user"); 18 | session.removeAttribute("loginMsg"); 19 | response.sendRedirect(request.getContextPath()+"/index.jsp"); 20 | } 21 | 22 | public void doPost(HttpServletRequest request, HttpServletResponse response) 23 | throws ServletException, IOException { 24 | 25 | doGet(request, response); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/PayServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import pers.gulo.fm.dao.PassengerDao; 11 | import pers.gulo.fm.dao.impl.PassengerDaoImpl; 12 | import pers.gulo.fm.domain.Order; 13 | import pers.gulo.fm.domain.User; 14 | import pers.gulo.fm.exception.FMException; 15 | 16 | public class PayServlet extends HttpServlet { 17 | 18 | public void doGet(HttpServletRequest request, HttpServletResponse response) 19 | throws ServletException, IOException { 20 | int orderNo=Integer.parseInt(request.getParameter("orderNo")); 21 | PassengerDao pDao=new PassengerDaoImpl(); 22 | Order order=new Order(); 23 | order.setNo(orderNo); 24 | order=pDao.getOrder(order); 25 | try { 26 | pDao.payFlight(order); 27 | User sessionUser=(User) request.getSession().getAttribute("user"); 28 | sessionUser.setBalance(sessionUser.getBalance()-order.getFlight().getPrice()); 29 | request.getSession().setAttribute("myOrderMsg", "付款成功!"); 30 | 31 | } catch (FMException e) { 32 | request.getSession().setAttribute("myOrderMsg", e.getMessage()); 33 | e.printStackTrace(); 34 | }finally{ 35 | response.sendRedirect(request.getContextPath()+"/myOrder.jsp"); 36 | } 37 | } 38 | 39 | public void doPost(HttpServletRequest request, HttpServletResponse response) 40 | throws ServletException, IOException { 41 | 42 | doGet(request, response); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/RechargeServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import javax.servlet.http.HttpSession; 10 | 11 | import pers.gulo.fm.domain.User; 12 | import pers.gulo.fm.service.UserService; 13 | import pers.gulo.fm.service.impl.UserServiceImpl; 14 | 15 | public class RechargeServlet extends HttpServlet { 16 | 17 | public void doGet(HttpServletRequest request, HttpServletResponse response) 18 | throws ServletException, IOException { 19 | UserService uService=new UserServiceImpl(); 20 | User user=new User(); 21 | user.setNo(Integer.parseInt(request.getParameter("userNo"))); 22 | float number=Float.parseFloat(request.getParameter("number")); 23 | uService.recharge(user,number); 24 | User sessionUser=(User) request.getSession().getAttribute("user"); 25 | sessionUser.setBalance(sessionUser.getBalance()+number); 26 | response.sendRedirect(request.getContextPath()+"/myWallet.jsp"); 27 | request.getSession().setAttribute("myWalletMsg", "充值成功!"); 28 | 29 | } 30 | 31 | public void doPost(HttpServletRequest request, HttpServletResponse response) 32 | throws ServletException, IOException { 33 | 34 | doGet(request, response); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/UpdateFlightServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | import java.sql.Timestamp; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import pers.gulo.fm.domain.AirPlane; 12 | import pers.gulo.fm.domain.Flight; 13 | import pers.gulo.fm.exception.FMException; 14 | import pers.gulo.fm.service.AdminService; 15 | import pers.gulo.fm.service.impl.AdminServiceImpl; 16 | 17 | public class UpdateFlightServlet extends HttpServlet { 18 | 19 | public void doGet(HttpServletRequest request, HttpServletResponse response) 20 | throws ServletException, IOException { 21 | request.getSession().removeAttribute("flightManageMsg"); 22 | Flight flight=new Flight(); 23 | AirPlane airPlane=new AirPlane(); 24 | flight.setNo(Integer.parseInt(request.getParameter("no"))); 25 | airPlane.setNo(Integer.parseInt(request.getParameter("aNo"))); 26 | flight.setAirPlane(airPlane); 27 | flight.setStart(new String(request.getParameter("start").getBytes("ISO-8859-1"),"UTF-8")); 28 | flight.setDist(new String(request.getParameter("dist").getBytes("ISO-8859-1"),"UTF-8")); 29 | flight.setPrice(Float.parseFloat(request.getParameter("price"))); 30 | flight.setTime(Timestamp.valueOf(request.getParameter("time"))); 31 | 32 | AdminService aService=new AdminServiceImpl(); 33 | try { 34 | aService.updateFlight(flight); 35 | } catch (FMException e) { 36 | // TODO Auto-generated catch block 37 | request.getSession().setAttribute("flightManageMsg", e.getMessage()); 38 | e.printStackTrace(); 39 | } 40 | 41 | response.sendRedirect(request.getContextPath()+"/flightManage.jsp"); 42 | 43 | 44 | } 45 | 46 | public void doPost(HttpServletRequest request, HttpServletResponse response) 47 | throws ServletException, IOException { 48 | 49 | doGet(request, response); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/pers/gulo/fm/web/UpdateUserServlet.java: -------------------------------------------------------------------------------- 1 | package pers.gulo.fm.web; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import pers.gulo.fm.domain.User; 11 | import pers.gulo.fm.exception.FMException; 12 | import pers.gulo.fm.service.AdminService; 13 | import pers.gulo.fm.service.impl.AdminServiceImpl; 14 | 15 | public class UpdateUserServlet extends HttpServlet { 16 | 17 | public void doGet(HttpServletRequest request, HttpServletResponse response) 18 | throws ServletException, IOException { 19 | request.getSession().removeAttribute("userManageMsg"); 20 | String nickname=new String(request.getParameter("nickname").getBytes("ISO-8859-1"),"UTF-8"); 21 | String id=request.getParameter("id"); 22 | int no =Integer.parseInt(request.getParameter("no")); 23 | 24 | User user =new User(); 25 | user.setNo(no); 26 | user.setNickname(nickname); 27 | user.setID(id); 28 | 29 | AdminService aService=new AdminServiceImpl(); 30 | try { 31 | aService.updateUser(user); 32 | } catch (FMException e) { 33 | request.getSession().setAttribute("userManageMsg", e.getMessage()); 34 | e.printStackTrace(); 35 | } 36 | 37 | response.sendRedirect(request.getContextPath()+"/userManage.jsp"); 38 | 39 | } 40 | 41 | public void doPost(HttpServletRequest request, HttpServletResponse response) 42 | throws ServletException, IOException { 43 | 44 | doGet(request, response); 45 | } 46 | 47 | } 48 | --------------------------------------------------------------------------------