├── .gitignore ├── .settings ├── org.eclipse.wst.jsdt.ui.superType.name ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.buildship.core.prefs ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.jdt.core.prefs ├── org.eclipse.wst.common.component └── .jsdtscope ├── WebContent ├── META-INF │ └── MANIFEST.MF ├── javascript │ ├── main.js │ ├── user.js │ ├── goods.js │ ├── staff.js │ └── room.js ├── css │ ├── usertype.css │ ├── index.css │ ├── checkin.css │ ├── goods.css │ ├── fee.css │ ├── staff.css │ ├── user.css │ ├── main.css │ └── room.css ├── jsp │ ├── fee.jsp │ ├── main.jsp │ ├── usertype.jsp │ ├── user.jsp │ ├── goods.jsp │ ├── checkin.jsp │ ├── staff.jsp │ └── room.jsp ├── index.jsp └── WEB-INF │ └── web.xml ├── bin ├── main │ ├── Library.class │ ├── com │ │ └── lzf │ │ │ ├── util │ │ │ ├── Test.class │ │ │ └── AipOpticalCharacterRecognition.class │ │ │ ├── dao │ │ │ ├── IDaoFee.class │ │ │ ├── IDaoRoom.class │ │ │ ├── IDaoGoods.class │ │ │ ├── IDaoIndex.class │ │ │ ├── IDaoCheckIn.class │ │ │ ├── IDaoUserType.class │ │ │ └── mapper │ │ │ │ ├── DaoFee.xml │ │ │ │ ├── DaoUserType.xml │ │ │ │ ├── DaoGoods.xml │ │ │ │ ├── DaoCheckIn.xml │ │ │ │ ├── DaoIndex.xml │ │ │ │ └── DaoRoom.xml │ │ │ ├── entity │ │ │ ├── Fee.class │ │ │ ├── Goods.class │ │ │ ├── Room.class │ │ │ ├── User.class │ │ │ └── UserType.class │ │ │ ├── web │ │ │ ├── ControlFee.class │ │ │ ├── ControlGoods.class │ │ │ ├── ControlIndex.class │ │ │ ├── ControlRoom.class │ │ │ ├── ControlCheckIn.class │ │ │ ├── ControlUserType.class │ │ │ └── mobile │ │ │ │ ├── ControlUser.class │ │ │ │ ├── DtoPackaging.class │ │ │ │ ├── ControlUserRoom.class │ │ │ │ └── ControlMobileGoods.class │ │ │ └── service │ │ │ ├── IServiceFee.class │ │ │ ├── IServiceGoods.class │ │ │ ├── IServiceIndex.class │ │ │ ├── IServiceRoom.class │ │ │ ├── IServiceCheckIn.class │ │ │ ├── IServiceUserType.class │ │ │ └── impl │ │ │ ├── ServiceFee.class │ │ │ ├── ServiceRoom.class │ │ │ ├── ServiceCheckIn.class │ │ │ ├── ServiceGoods.class │ │ │ ├── ServiceIndex.class │ │ │ └── ServiceUserType.class │ ├── jdbc.properties │ ├── logback.xml │ ├── mybatis-config.xml │ ├── spring-service.xml │ ├── log4j.properties │ ├── spring-dao.xml │ └── spring-web.xml ├── test │ └── LibraryTest.class └── default │ ├── jdbc.properties │ ├── logback.xml │ ├── mybatis-config.xml │ ├── log4j.properties │ ├── spring-service.xml │ ├── spring-dao.xml │ └── spring-web.xml ├── Hotel check-in system.jpg ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src ├── main │ ├── java │ │ ├── Library.java │ │ └── com │ │ │ └── lzf │ │ │ ├── service │ │ │ ├── IServiceCheckIn.java │ │ │ ├── IServiceGoods.java │ │ │ ├── IServiceUserType.java │ │ │ ├── IServiceFee.java │ │ │ ├── IServiceRoom.java │ │ │ ├── IServiceIndex.java │ │ │ └── impl │ │ │ │ ├── ServiceCheckIn.java │ │ │ │ ├── ServiceFee.java │ │ │ │ ├── ServiceUserType.java │ │ │ │ ├── ServiceGoods.java │ │ │ │ ├── ServiceIndex.java │ │ │ │ └── ServiceRoom.java │ │ │ ├── dao │ │ │ ├── IDaoUserType.java │ │ │ ├── IDaoGoods.java │ │ │ ├── IDaoFee.java │ │ │ ├── IDaoRoom.java │ │ │ ├── IDaoCheckIn.java │ │ │ ├── mapper │ │ │ │ ├── DaoFee.xml │ │ │ │ ├── DaoUserType.xml │ │ │ │ ├── DaoGoods.xml │ │ │ │ ├── DaoCheckIn.xml │ │ │ │ ├── DaoIndex.xml │ │ │ │ └── DaoRoom.xml │ │ │ └── IDaoIndex.java │ │ │ ├── util │ │ │ ├── Test.java │ │ │ └── AipOpticalCharacterRecognition.java │ │ │ ├── web │ │ │ ├── ControlFee.java │ │ │ ├── mobile │ │ │ │ ├── DtoPackaging.java │ │ │ │ ├── ControlMobileGoods.java │ │ │ │ ├── ControlUser.java │ │ │ │ └── ControlUserRoom.java │ │ │ ├── ControlUserType.java │ │ │ ├── ControlGoods.java │ │ │ ├── ControlCheckIn.java │ │ │ ├── ControlRoom.java │ │ │ └── ControlIndex.java │ │ │ └── entity │ │ │ ├── UserType.java │ │ │ ├── Goods.java │ │ │ ├── Fee.java │ │ │ ├── User.java │ │ │ └── Room.java │ └── resources │ │ ├── jdbc.properties │ │ ├── logback.xml │ │ ├── mybatis-config.xml │ │ ├── spring-service.xml │ │ ├── log4j.properties │ │ ├── spring-dao.xml │ │ └── spring-web.xml └── test │ └── java │ └── LibraryTest.java ├── 备注 ├── settings.gradle ├── .project ├── .classpath ├── logs └── ssm.log ├── gradlew.bat ├── gradlew └── HotelCheck-inSystem.sql /.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /bin/main/Library.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/Library.class -------------------------------------------------------------------------------- /Hotel check-in system.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/Hotel check-in system.jpg -------------------------------------------------------------------------------- /bin/test/LibraryTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/test/LibraryTest.class -------------------------------------------------------------------------------- /bin/main/com/lzf/util/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/util/Test.class -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/IDaoFee.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/dao/IDaoFee.class -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/IDaoRoom.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/dao/IDaoRoom.class -------------------------------------------------------------------------------- /bin/main/com/lzf/entity/Fee.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/entity/Fee.class -------------------------------------------------------------------------------- /bin/main/com/lzf/entity/Goods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/entity/Goods.class -------------------------------------------------------------------------------- /bin/main/com/lzf/entity/Room.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/entity/Room.class -------------------------------------------------------------------------------- /bin/main/com/lzf/entity/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/entity/User.class -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/IDaoGoods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/dao/IDaoGoods.class -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/IDaoIndex.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/dao/IDaoIndex.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/ControlFee.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/ControlFee.class -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/IDaoCheckIn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/dao/IDaoCheckIn.class -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/IDaoUserType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/dao/IDaoUserType.class -------------------------------------------------------------------------------- /bin/main/com/lzf/entity/UserType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/entity/UserType.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/ControlGoods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/ControlGoods.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/ControlIndex.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/ControlIndex.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/ControlRoom.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/ControlRoom.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/IServiceFee.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/IServiceFee.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/ControlCheckIn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/ControlCheckIn.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/ControlUserType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/ControlUserType.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/IServiceGoods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/IServiceGoods.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/IServiceIndex.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/IServiceIndex.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/IServiceRoom.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/IServiceRoom.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/mobile/ControlUser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/mobile/ControlUser.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/IServiceCheckIn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/IServiceCheckIn.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/IServiceUserType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/IServiceUserType.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/impl/ServiceFee.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/impl/ServiceFee.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/impl/ServiceRoom.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/impl/ServiceRoom.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/mobile/DtoPackaging.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/mobile/DtoPackaging.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/impl/ServiceCheckIn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/impl/ServiceCheckIn.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/impl/ServiceGoods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/impl/ServiceGoods.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/impl/ServiceIndex.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/impl/ServiceIndex.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/mobile/ControlUserRoom.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/mobile/ControlUserRoom.class -------------------------------------------------------------------------------- /bin/main/com/lzf/service/impl/ServiceUserType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/service/impl/ServiceUserType.class -------------------------------------------------------------------------------- /bin/main/com/lzf/web/mobile/ControlMobileGoods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/web/mobile/ControlMobileGoods.class -------------------------------------------------------------------------------- /bin/main/com/lzf/util/AipOpticalCharacterRecognition.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MJCoderMJCoder/HotelCheck-inSystem-Server-/HEAD/bin/main/com/lzf/util/AipOpticalCharacterRecognition.class -------------------------------------------------------------------------------- /bin/default/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driver=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://localhost:3306/hotel_check-in_system?useUnicode=true&characterEncoding=utf8 3 | jdbc.username=root 4 | jdbc.password=MJCoder -------------------------------------------------------------------------------- /bin/main/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driver=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://localhost:3306/hotel_check-in_system?useUnicode=true&characterEncoding=utf8 3 | jdbc.username=MJCoder 4 | jdbc.password=MJCoder598157378mysql -------------------------------------------------------------------------------- /src/main/java/Library.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This Java source file was generated by the Gradle 'init' task. 3 | */ 4 | public class Library { 5 | public boolean someLibraryMethod() { 6 | return true; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driver=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://localhost:3306/hotel_check-in_system?useUnicode=true&characterEncoding=utf8 3 | jdbc.username=MJCoder 4 | jdbc.password=MJCoder598157378mysql -------------------------------------------------------------------------------- /WebContent/javascript/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | $(document).ready(function() { 5 | // 菜单栏响应事件 6 | $("ul a").click(function() { 7 | $this = $(this); 8 | $("ul a").removeClass("active"); 9 | $this.addClass("active"); 10 | }); 11 | }); -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip 6 | -------------------------------------------------------------------------------- /备注: -------------------------------------------------------------------------------- 1 | 酒店自助入住系统: 2 | 房间里的必须物品:食物、矿泉水、方便面(各项对应的价格)。 3 | 房间信息:名称、价格、几人间、状态(空、预订、入住)。 4 | 房间(多对一)旅客。 5 | 用户、旅客信息:身份证信息。 6 | 用户类型:(大于0是旅客)旅客类型:普通、会员。(小于0是管理员)管理员类型:超级管理员。 7 | 收费信息管理。 8 | 9 | 10 | 房间: 11 | 额外服务: 12 | 员工:管理员信息管理、管理员类型管理 13 | 旅客:旅客信息管理、旅客类型管理 14 | 收费信息管理:统计。 15 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/IServiceCheckIn.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service; 5 | 6 | import java.util.List; 7 | 8 | import com.lzf.entity.Room; 9 | 10 | /** 11 | * @author MJCoder 12 | * 13 | */ 14 | public interface IServiceCheckIn { 15 | List select(String name, String identity); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/IDaoUserType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.dao; 5 | 6 | import java.util.List; 7 | 8 | import com.lzf.entity.UserType; 9 | 10 | /** 11 | * @author MJCoder 12 | * 13 | */ 14 | public interface IDaoUserType { 15 | List selectUser(); 16 | 17 | List selectAdmin(); 18 | 19 | int insert(UserType userType); 20 | } 21 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/IServiceGoods.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service; 5 | 6 | import java.util.List; 7 | 8 | import com.lzf.entity.Goods; 9 | 10 | /** 11 | * @author MJCoder 12 | * 13 | */ 14 | public interface IServiceGoods { 15 | int insert(Goods goods); 16 | 17 | List select(); 18 | 19 | int update(Goods goods); 20 | 21 | int delete(int id); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/IServiceUserType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service; 5 | 6 | import java.util.List; 7 | 8 | import com.lzf.entity.UserType; 9 | 10 | /** 11 | * @author MJCoder 12 | * 13 | */ 14 | public interface IServiceUserType { 15 | 16 | List selectUser(); 17 | 18 | List selectAdmin(); 19 | 20 | int insert(UserType userType); 21 | } 22 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user guide at https://docs.gradle.org/4.5.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = 'HotelCheck-inSystem' 11 | -------------------------------------------------------------------------------- /src/test/java/LibraryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This Java source file was generated by the Gradle 'init' task. 3 | */ 4 | import org.junit.Test; 5 | import static org.junit.Assert.*; 6 | 7 | public class LibraryTest { 8 | @Test public void testSomeLibraryMethod() { 9 | Library classUnderTest = new Library(); 10 | assertTrue("someLibraryMethod should return 'true'", classUnderTest.someLibraryMethod()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/IDaoGoods.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.dao; 5 | 6 | import java.util.List; 7 | 8 | import com.lzf.entity.Goods; 9 | import com.lzf.entity.Room; 10 | 11 | /** 12 | * @author MJCoder 13 | * 14 | */ 15 | public interface IDaoGoods { 16 | 17 | int insert(Goods goods); 18 | 19 | List select(); 20 | 21 | int update(Goods goods); 22 | 23 | int delete(int id); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/IServiceFee.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service; 5 | 6 | import java.util.List; 7 | 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import com.lzf.entity.Fee; 11 | 12 | /** 13 | * @author MJCoder 14 | * 15 | */ 16 | public interface IServiceFee { 17 | 18 | List select(); 19 | 20 | float selectSum(); 21 | 22 | int insert(float fee, String memo); 23 | } 24 | -------------------------------------------------------------------------------- /WebContent/css/usertype.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | margin: 0; 6 | background-color: #f1f1f1; 7 | } 8 | 9 | /* 右边的表单 */ 10 | .right { 11 | text-align: center; 12 | width: 50%; 13 | float: right; 14 | } 15 | 16 | .right div { 17 | padding: 10px; 18 | } 19 | /* 左边的表单 */ 20 | .left { 21 | text-align: center; 22 | width: 50%; 23 | float: left; 24 | } 25 | 26 | .left div { 27 | padding: 10px; 28 | } -------------------------------------------------------------------------------- /WebContent/css/index.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | background-color: #f1f1f1; 6 | } 7 | 8 | .title { 9 | width: 100%; 10 | text-align: center; 11 | } 12 | 13 | .form { 14 | width: 100%; 15 | text-align: center; 16 | } 17 | 18 | .value { 19 | width: 10%; 20 | display: inline-block; 21 | } 22 | 23 | span { 24 | width: 7%; 25 | display: inline-block; 26 | } 27 | 28 | #login { 29 | width: 7%; 30 | } -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/IDaoFee.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.dao; 5 | 6 | import java.sql.Timestamp; 7 | import java.util.List; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | 11 | import com.lzf.entity.Fee; 12 | 13 | /** 14 | * @author MJCoder 15 | * 16 | */ 17 | public interface IDaoFee { 18 | List select(); 19 | 20 | float selectSum(); 21 | 22 | int insert(@Param(value = "fee") float fee, @Param(value = "memo") String memo); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/IServiceRoom.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service; 5 | 6 | import java.util.List; 7 | 8 | import com.lzf.entity.Room; 9 | 10 | /** 11 | * @author MJCoder 12 | * 13 | */ 14 | public interface IServiceRoom { 15 | int insert(Room room); 16 | 17 | List select(); 18 | 19 | int update(Room room); 20 | 21 | int delete(int id); 22 | 23 | List selectVacantRoom(); 24 | 25 | List selectUserRoom(int userId); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/IServiceIndex.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service; 5 | 6 | import java.util.List; 7 | 8 | import com.lzf.entity.User; 9 | 10 | /** 11 | * 业务层 12 | * 13 | * @author MJCoder 14 | * 15 | */ 16 | public interface IServiceIndex { 17 | User login(String identity, String password, int type); 18 | 19 | List select(int type); 20 | 21 | int insert(User user); 22 | 23 | int update(User user); 24 | 25 | int delete(int id); 26 | } 27 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /bin/main/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/util/Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.util; 5 | 6 | /** 7 | * @author MJCoder 8 | * 9 | */ 10 | public class Test { 11 | 12 | /** 13 | * 14 | */ 15 | public Test() { 16 | // TODO Auto-generated constructor stub 17 | } 18 | 19 | /** 20 | * @param args 21 | */ 22 | public static void main(String[] args) { 23 | // TODO Auto-generated method stub 24 | System.out.println(AipOpticalCharacterRecognition.aipOcrIdCard("G:/PHB/lpq.jpg").toString()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /bin/default/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/IDaoRoom.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.dao; 5 | 6 | import java.util.List; 7 | 8 | import com.lzf.entity.Room; 9 | import com.lzf.entity.User; 10 | 11 | /** 12 | * @author MJCoder 13 | * 14 | */ 15 | public interface IDaoRoom { 16 | int insert(Room room); 17 | 18 | List select(); 19 | 20 | User selectUser(int id); 21 | 22 | int update(Room room); 23 | 24 | int delete(int id); 25 | 26 | List selectVacantRoom(); 27 | 28 | List selectUserRoom(int userId); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/IDaoCheckIn.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.dao; 5 | 6 | import java.util.List; 7 | 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import com.lzf.entity.Room; 11 | 12 | /** 13 | * @author MJCoder 14 | * 15 | */ 16 | public interface IDaoCheckIn { 17 | List select(@Param(value = "name") String name, @Param(value = "identity") String identity); 18 | 19 | int update(@Param(value = "name") String name, @Param(value = "identity") String identity, 20 | @Param(value = "id") int id); 21 | } 22 | -------------------------------------------------------------------------------- /WebContent/css/checkin.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | margin: 0; 6 | background-color: #f1f1f1; 7 | } 8 | 9 | .title { 10 | width: 100%; 11 | padding: 10px; 12 | text-align: center; 13 | } 14 | 15 | form { 16 | width: 100%; 17 | padding: 10px; 18 | text-align: center; 19 | display: block; 20 | } 21 | 22 | /* 房间信息标题(短文、长文) */ 23 | .small { 24 | display: inline-block; 25 | width: 9%; 26 | text-align: center; 27 | } 28 | 29 | .medium { 30 | display: inline-block; 31 | width: 19%; 32 | text-align: center; 33 | } -------------------------------------------------------------------------------- /WebContent/css/goods.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | margin: 0; 6 | background-color: #f1f1f1; 7 | } 8 | 9 | /* 右边的表单 */ 10 | .right { 11 | text-align: center; 12 | width: 30%; 13 | float: right; 14 | } 15 | 16 | .right div { 17 | padding: 10px; 18 | } 19 | 20 | /* 左边的顶部标题 */ 21 | .left { 22 | text-align: center; 23 | width: 70%; 24 | float: left; 25 | } 26 | 27 | .small { 28 | display: inline-block; 29 | width: 20%; 30 | text-align: center; 31 | } 32 | 33 | .content { 34 | width: 100%; 35 | padding: 10px; 36 | } -------------------------------------------------------------------------------- /WebContent/css/fee.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | margin: 0; 6 | background-color: #f1f1f1; 7 | } 8 | /* 标题 */ 9 | .title { 10 | width: 100%; 11 | padding-left: 10px; 12 | } 13 | 14 | .small { 15 | display: inline-block; 16 | width: 19%; 17 | text-align: center; 18 | } 19 | 20 | .medium { 21 | display: inline-block; 22 | width: 38%; 23 | text-align: center; 24 | } 25 | /* 内容 */ 26 | .content { 27 | width: 100%; 28 | padding: 10px; 29 | } 30 | /* 底部总计 */ 31 | .bottom { 32 | width: 100%; 33 | padding: 10px; 34 | font-weight: bold; 35 | } -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /bin/main/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /bin/default/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /WebContent/css/staff.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | margin: 0; 6 | background-color: #f1f1f1; 7 | } 8 | 9 | form { 10 | text-align: center; 11 | padding: 10px; 12 | } 13 | /* 顶部表单 */ 14 | form div { 15 | display: inline-block; 16 | width: 18%; 17 | text-align: center; 18 | } 19 | /*顶部添加房间 */ 20 | #add { 21 | width: 50%; 22 | } 23 | /* 标题 */ 24 | .title { 25 | width: 100%; 26 | padding-left: 10px; 27 | } 28 | 29 | .small { 30 | display: inline-block; 31 | width: 16%; 32 | text-align: center; 33 | } 34 | /* 内容 */ 35 | .content { 36 | width: 100%; 37 | padding: 10px; 38 | } -------------------------------------------------------------------------------- /WebContent/javascript/user.js: -------------------------------------------------------------------------------- 1 | /** 2 | * window.location.reload();//刷新当前页面. 3 | * parent.location.reload()刷新父亲对象(用于框架)--需在iframe框架内使用 4 | * opener.location.reload()刷新父窗口对象(用于单开窗口 5 | * 6 | * top.location.reload()刷新最顶端对象(用于多开窗口) 7 | * 8 | */ 9 | $(document).ready(function() { 10 | $(".modify").click(function() { 11 | var parent = $(this).parent().parent() 12 | $.post("../controller/update", { 13 | id : parent.find("i").text(), 14 | type : parent.find("select").val(), 15 | password : parent.find("#password").val(), 16 | }, function(data, status) { 17 | alert("数据: " + data + "\n状态: " + status); 18 | }); 19 | }); 20 | }); -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/mapper/DaoFee.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 14 | 15 | 16 | insert 17 | into fee (fee, memo)values 18 | (#{fee},#{memo}) 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/mapper/DaoFee.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 14 | 15 | 16 | insert 17 | into fee (fee, memo)values 18 | (#{fee},#{memo}) 19 | 20 | -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/mapper/DaoUserType.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 15 | 16 | insert 17 | into user_type (type, memo) values (#{type}, #{memo}) 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/mapper/DaoUserType.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 15 | 16 | insert 17 | into user_type (type, memo) values (#{type}, #{memo}) 18 | 19 | -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/mapper/DaoGoods.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 12 | 13 | insert 14 | into goods (name, price) values (#{name}, #{price}) 15 | 16 | 17 | update goods set price=#{price} where id=#{id} 18 | 19 | 20 | delete from goods where id = #{id} 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/mapper/DaoGoods.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 12 | 13 | insert 14 | into goods (name, price) values (#{name}, #{price}) 15 | 16 | 17 | update goods set price=#{price} where id=#{id} 18 | 19 | 20 | delete from goods where id = #{id} 21 | 22 | -------------------------------------------------------------------------------- /WebContent/css/user.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | margin: 0; 6 | background-color: #f1f1f1; 7 | } 8 | 9 | form { 10 | text-align: center; 11 | padding: 10px; 12 | } 13 | /* 顶部表单 */ 14 | form div { 15 | display: inline-block; 16 | width: 18%; 17 | text-align: center; 18 | } 19 | /*顶部添加房间 */ 20 | #add { 21 | width: 50%; 22 | } 23 | /* 标题 */ 24 | .title { 25 | width: 100%; 26 | padding-left: 10px; 27 | } 28 | 29 | .small { 30 | display: inline-block; 31 | width: 16%; 32 | text-align: center; 33 | } 34 | /* 内容 */ 35 | .content { 36 | width: 100%; 37 | padding: 10px; 38 | } 39 | 40 | #password { 41 | background-color: #f1f1f1; 42 | border-width: 0; 43 | width: 100%; 44 | text-align: center; 45 | } -------------------------------------------------------------------------------- /bin/default/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO,Console,File 2 | #定义日志输出目的地为控制台 3 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 4 | log4j.appender.Console.Target=System.out 5 | #可以灵活地指定日志输出格式,下面一行是指定具体的格式 6 | log4j.appender.Console.layout = org.apache.log4j.PatternLayout 7 | log4j.appender.Console.layout.ConversionPattern=[%c] - %m%n 8 | 9 | #文件大小到达指定尺寸的时候产生一个新的文件 10 | log4j.appender.File = org.apache.log4j.RollingFileAppender 11 | #指定输出目录 12 | log4j.appender.File.File = logs/ssm.log 13 | #定义文件最大大小 14 | log4j.appender.File.MaxFileSize = 10MB 15 | # 输出所以日志,如果换成DEBUG表示输出DEBUG以上级别日志 16 | log4j.appender.File.Threshold = ALL 17 | log4j.appender.File.layout = org.apache.log4j.PatternLayout 18 | log4j.appender.File.layout.ConversionPattern =[%p] [%d{yyyy-MM-dd HH\:mm\:ss}][%c]%m%n 19 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/IDaoIndex.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.dao; 5 | 6 | import java.util.List; 7 | 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import com.lzf.entity.Goods; 11 | import com.lzf.entity.User; 12 | 13 | /** 14 | * *持久层 15 | * 16 | * org.apache.ibatis.annotations.Param 17 | * 有两个或以上的参数,一定要给方法的参数添加@Param("")注解,不然mybatis识别不了。注解的参数会自动封装成map集合,括号内即为键。 18 | * 只有一个参数,可以不用加 @Param注解,当然加了也无所谓。 19 | * 20 | * @author MJCoder 21 | * 22 | */ 23 | public interface IDaoIndex { 24 | User login(@Param(value = "identity") String identity, @Param(value = "password") String password, 25 | @Param(value = "type") int type); 26 | 27 | List select(int type); 28 | 29 | int insert(User user); 30 | 31 | int update(User user); 32 | 33 | int delete(int id); 34 | } 35 | -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/mapper/DaoCheckIn.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 22 | 23 | 24 | update room set status=1, user=(select 25 | id from user 26 | where name = #{name} and 27 | identity =#{identity}) where 28 | id=#{id} 29 | 30 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/mapper/DaoCheckIn.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 22 | 23 | 24 | update room set status=1, user=(select 25 | id from user 26 | where name = #{name} and 27 | identity =#{identity}) where 28 | id=#{id} 29 | 30 | -------------------------------------------------------------------------------- /WebContent/javascript/goods.js: -------------------------------------------------------------------------------- 1 | /** 2 | * window.location.reload();//刷新当前页面. 3 | * parent.location.reload()刷新父亲对象(用于框架)--需在iframe框架内使用 4 | * opener.location.reload()刷新父窗口对象(用于单开窗口 5 | * 6 | * top.location.reload()刷新最顶端对象(用于多开窗口) 7 | * 8 | */ 9 | $(document).ready( 10 | function() { 11 | $(".modify").click(function() { 12 | var parent = $(this).parent().parent() 13 | $.post("../goods/update", { 14 | id : parent.find("i").text(), 15 | price : parent.find("#price").val(), 16 | }, function(data, status) { 17 | alert("数据: " + data + "\n状态: " + status); 18 | }); 19 | }); 20 | $(".delete").click( 21 | function() { 22 | var parent = $(this).parent().parent() 23 | $.get("../goods/delete?id=" + parent.find("i").text(), 24 | function(data, status) { 25 | parent.remove(); 26 | alert("数据: " + data + "\n状态: " + status) 27 | }); 28 | }); 29 | }); -------------------------------------------------------------------------------- /WebContent/css/main.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | height: 100%; 6 | margin: 0; 7 | background-color: #f1f1f1; 8 | } 9 | 10 | .top { 11 | width: 100%; 12 | text-align: center; 13 | height: 2%; 14 | padding: 10px; 15 | } 16 | 17 | ul { 18 | list-style-type: none; 19 | margin: 0; 20 | padding: 0; 21 | width: 9%; 22 | background-color: #f1f1f1; 23 | position: fixed; 24 | height: 100%; 25 | overflow: auto; 26 | text-align: center; 27 | } 28 | 29 | li a { 30 | display: block; 31 | color: #000; 32 | padding: 10px 16px; 33 | text-decoration: none; 34 | } 35 | 36 | li a.active { 37 | background-color: #4CAF50; 38 | color: white; 39 | } 40 | 41 | li a:hover { 42 | background-color: #555; 43 | color: white; 44 | } 45 | 46 | iframe { 47 | width: 90%; 48 | height: 91%; 49 | margin: 0; 50 | padding: 0; 51 | overflow: auto; 52 | border-width: 0px; 53 | float: right; 54 | } -------------------------------------------------------------------------------- /WebContent/javascript/staff.js: -------------------------------------------------------------------------------- 1 | /** 2 | * window.location.reload();//刷新当前页面. 3 | * parent.location.reload()刷新父亲对象(用于框架)--需在iframe框架内使用 4 | * opener.location.reload()刷新父窗口对象(用于单开窗口 5 | * 6 | * top.location.reload()刷新最顶端对象(用于多开窗口) 7 | * 8 | */ 9 | $(document).ready( 10 | function() { 11 | $(".modify").click(function() { 12 | var parent = $(this).parent().parent() 13 | $.post("../controller/update", { 14 | id : parent.find("i").text(), 15 | type : parent.find("select").val(), 16 | password : parent.find("#password").val(), 17 | }, function(data, status) { 18 | alert("数据: " + data + "\n状态: " + status); 19 | }); 20 | }); 21 | $(".delete").click( 22 | function() { 23 | var parent = $(this).parent().parent() 24 | $.get("../controller/delete?id=" 25 | + parent.find("i").text(), function(data, 26 | status) { 27 | parent.remove(); 28 | alert("数据: " + data + "\n状态: " + status) 29 | }); 30 | }); 31 | }); -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/impl/ServiceCheckIn.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service.impl; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.lzf.dao.IDaoCheckIn; 12 | import com.lzf.entity.Room; 13 | import com.lzf.service.IServiceCheckIn; 14 | 15 | /** 16 | * @author MJCoder 17 | * 18 | */ 19 | @Service 20 | public class ServiceCheckIn implements IServiceCheckIn { 21 | 22 | @Autowired 23 | private IDaoCheckIn daoCheckIn; 24 | 25 | /** 26 | * 27 | */ 28 | public ServiceCheckIn() { 29 | // TODO Auto-generated constructor stub 30 | } 31 | 32 | @Override 33 | public List select(String name, String identity) { 34 | // TODO Auto-generated method stub 35 | List rooms = daoCheckIn.select(name, identity); 36 | for (Room room : rooms) { 37 | daoCheckIn.update(name, identity, room.getId()); 38 | } 39 | return rooms; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /WebContent/javascript/room.js: -------------------------------------------------------------------------------- 1 | /** 2 | * window.location.reload();//刷新当前页面. 3 | * parent.location.reload()刷新父亲对象(用于框架)--需在iframe框架内使用 4 | * opener.location.reload()刷新父窗口对象(用于单开窗口 5 | * 6 | * top.location.reload()刷新最顶端对象(用于多开窗口) 7 | * 8 | */ 9 | $(document).ready( 10 | function() { 11 | $(".modify").click(function() { 12 | var parent = $(this).parent().parent() 13 | $.post("../room/update", { 14 | id : parent.find("i").text(), 15 | price : parent.find("#price").val(), 16 | fewHuman : parent.find("#fewHuman").val(), 17 | status : parent.find("#status").val(), 18 | type : parent.find("#type").val(), 19 | }, function(data, status) { 20 | alert("数据: " + data + "\n状态: " + status); 21 | }); 22 | }); 23 | $(".delete").click( 24 | function() { 25 | var parent = $(this).parent().parent() 26 | $.get("../room/delete?id=" + parent.find("i").text(), 27 | function(data, status) { 28 | parent.remove(); 29 | alert("数据: " + data + "\n状态: " + status) 30 | }); 31 | }); 32 | }); -------------------------------------------------------------------------------- /WebContent/css/room.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | html, body { 4 | width: 100%; 5 | margin: 0; 6 | background-color: #f1f1f1; 7 | } 8 | 9 | .top { 10 | width: 100%; 11 | text-align: center; 12 | padding: 10px; 13 | } 14 | /* 顶部标题(短文、长文) */ 15 | .small { 16 | display: inline-block; 17 | width: 6%; 18 | text-align: center; 19 | } 20 | 21 | .medium { 22 | display: inline-block; 23 | width: 13%; 24 | text-align: center; 25 | } 26 | /* 底部 */ 27 | .bottom { 28 | width: 100%; 29 | text-align: center; 30 | padding: 30px; 31 | } 32 | /* 底部表单 */ 33 | #addForm form div { 34 | display: inline-block; 35 | width: 18%; 36 | } 37 | /* 底部表单的input */ 38 | .value { 39 | width: 60%; 40 | display: inline-block; 41 | } 42 | /* 底部表单的span标签 */ 43 | #addForm form div span { 44 | width: 30%; 45 | display: inline-block; 46 | } 47 | /* 底部添加房间 */ 48 | #add { 49 | width: 50%; 50 | } 51 | /* 中简单内容 :房间信息*/ 52 | .content { 53 | width: 100%; 54 | text-align: center; 55 | padding: 10px; 56 | } 57 | 58 | #status { 59 | width: 90%; 60 | display: inline-block; 61 | } -------------------------------------------------------------------------------- /WebContent/jsp/fee.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | 9 | 11 | 收费信息管理 12 | 13 | 14 |
15 |
16 |

17 |

费用

18 |

物品描述

19 |

交易时间

20 |
21 | 22 |
23 | ${fee.id } ${fee.fee } 24 | ${fee.memo } ${fee.timestamp } 25 |
26 |
27 |

28 | 总计:${sum } 29 |

30 | 31 | -------------------------------------------------------------------------------- /WebContent/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | 8 | 10 | 酒店自助入住系统-PC桌面端 11 | 12 | 13 |
14 |
15 |

酒店自助入住系统

16 |

PC桌面端

17 |
18 |
19 |
20 |
22 |
23 | 身份证号: 25 |
26 |
27 |
28 | 密码:
30 |
31 |

32 |

${errorMsg }

33 |
34 |
35 | 36 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/ControlFee.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web; 5 | 6 | import java.util.List; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | 15 | import com.lzf.entity.Fee; 16 | import com.lzf.entity.Goods; 17 | import com.lzf.service.IServiceFee; 18 | 19 | /** 20 | * @author MJCoder 21 | * 22 | */ 23 | @Controller 24 | @RequestMapping("fee") // url:/模块/资源/{id}/细分 /seckill/list 25 | public class ControlFee { 26 | 27 | @Autowired 28 | private IServiceFee serviceFee; 29 | 30 | /** 31 | * 32 | */ 33 | public ControlFee() { 34 | // TODO Auto-generated constructor stub 35 | } 36 | 37 | @RequestMapping(value = "select", method = RequestMethod.GET) 38 | private Object select(HttpServletRequest request) { 39 | List fees = serviceFee.select(); 40 | float sum = serviceFee.selectSum(); 41 | request.setAttribute("fees", fees); 42 | request.setAttribute("sum", sum); 43 | return "jsp/fee"; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | HotelCheck-inSystem 4 | Project HotelCheck-inSystem created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.buildship.core.gradleprojectbuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.jdt.core.javanature 31 | org.eclipse.wst.common.project.facet.core.nature 32 | org.eclipse.wst.common.modulecore.ModuleCoreNature 33 | org.eclipse.jem.workbench.JavaEMFNature 34 | org.eclipse.buildship.core.gradleprojectnature 35 | org.eclipse.wst.jsdt.core.jsNature 36 | 37 | 38 | -------------------------------------------------------------------------------- /bin/main/spring-service.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /bin/default/spring-service.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/resources/spring-service.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/mapper/DaoIndex.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 18 | 28 | 29 | insert 30 | into user (name, identity, type, password) values 31 | (#{name},#{identity},#{type},#{password}) 32 | 33 | 34 | update user set type=#{type}, password=#{password} 35 | where id=#{id} 36 | 37 | 38 | delete from user where id = #{id} 39 | 40 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/mapper/DaoIndex.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 18 | 28 | 29 | insert 30 | into user (name, identity, type, password) values 31 | (#{name},#{identity},#{type},#{password}) 32 | 33 | 34 | update user set type=#{type}, password=#{password} 35 | where id=#{id} 36 | 37 | 38 | delete from user where id = #{id} 39 | 40 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/impl/ServiceFee.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service.impl; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.lzf.dao.IDaoFee; 12 | import com.lzf.entity.Fee; 13 | import com.lzf.service.IServiceFee; 14 | 15 | /** 16 | * @author MJCoder 17 | * 18 | */ 19 | @Service 20 | public class ServiceFee implements IServiceFee { 21 | 22 | @Autowired 23 | private IDaoFee daoFee; 24 | 25 | /** 26 | * 27 | */ 28 | public ServiceFee() { 29 | // TODO Auto-generated constructor stub 30 | } 31 | 32 | @Override 33 | public List select() { 34 | // TODO Auto-generated method stub 35 | return daoFee.select(); 36 | } 37 | 38 | @Override 39 | public float selectSum() { 40 | // TODO Auto-generated method stub 41 | float sum = 0.0f; 42 | try { 43 | sum = daoFee.selectSum(); 44 | } catch (Exception e) { 45 | // TODO: handle exception 46 | } 47 | return sum; 48 | } 49 | 50 | @Override 51 | public int insert(float fee, String memo) { 52 | // TODO Auto-generated method stub 53 | int temp = -6003; 54 | try { 55 | temp = daoFee.insert(fee, memo); 56 | } catch (Exception e) { 57 | // TODO: handle exception 58 | e.printStackTrace(); 59 | } 60 | return temp; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/impl/ServiceUserType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service.impl; 5 | 6 | import java.util.List; 7 | 8 | import javax.annotation.Resource; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import com.lzf.dao.IDaoUserType; 14 | import com.lzf.entity.UserType; 15 | import com.lzf.service.IServiceUserType; 16 | 17 | /** 18 | * @author MJCoder 19 | * 20 | */ 21 | @Service 22 | public class ServiceUserType implements IServiceUserType { 23 | 24 | @Autowired 25 | private IDaoUserType daoUserType; 26 | 27 | /** 28 | * 29 | */ 30 | public ServiceUserType() { 31 | // TODO Auto-generated constructor stub 32 | } 33 | 34 | @Override 35 | public int insert(UserType userType) { 36 | // TODO Auto-generated method stub 37 | int temp = -6003; 38 | try { 39 | System.out.println(userType); 40 | temp = daoUserType.insert(userType); 41 | } catch (Exception e) { 42 | // TODO: handle exception 43 | e.printStackTrace(); 44 | } 45 | return temp; 46 | } 47 | 48 | @Override 49 | public List selectUser() { 50 | // TODO Auto-generated method stub 51 | return daoUserType.selectUser(); 52 | } 53 | 54 | @Override 55 | public List selectAdmin() { 56 | // TODO Auto-generated method stub 57 | return daoUserType.selectAdmin(); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /bin/main/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO,Console,File 2 | #定义日志输出目的地为控制台 3 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 4 | log4j.appender.Console.Target=System.out 5 | #可以灵活地指定日志输出格式,下面一行是指定具体的格式 6 | log4j.appender.Console.layout = org.apache.log4j.PatternLayout 7 | log4j.appender.Console.layout.ConversionPattern=[%c] - %m%n 8 | 9 | #文件大小到达指定尺寸的时候产生一个新的文件 10 | log4j.appender.File = org.apache.log4j.RollingFileAppender 11 | #指定输出目录 12 | log4j.appender.File.File = logs/ssm.log 13 | #定义文件最大大小 14 | log4j.appender.File.MaxFileSize = 10MB 15 | # 输出所以日志,如果换成DEBUG表示输出DEBUG以上级别日志 16 | log4j.appender.File.Threshold = ALL 17 | log4j.appender.File.layout = org.apache.log4j.PatternLayout 18 | log4j.appender.File.layout.ConversionPattern =[%p] [%d{yyyy-MM-dd HH\:mm\:ss}][%c]%m%n 19 | 20 | 21 | 22 | #可以设置级别:debug>info>error 23 | #debug:显示debug、info、error 24 | #info:显示info、error 25 | #error:只error 26 | #log4j.rootLogger=debug,appender1 27 | #log4j.rootLogger=info,appender1 28 | #log4j.rootLogger=error,appender1 29 | #输出到控制台 30 | #log4j.appender.appender1=org.apache.log4j.ConsoleAppender 31 | #样式为TTCCLayout 32 | #log4j.appender.appender1.layout=org.apache.log4j.PatternLayout 33 | #自定义样式 34 | # %r 时间 0 35 | # %t 方法名 main 36 | # %p 优先级 DEBUG/INFO/ERROR 37 | # %c 所属类的全名(包括包名) 38 | # %l 发生的位置,在某个类的某行 39 | # %m 输出代码中指定的讯息,如log(message)中的message 40 | # %n 输出一个换行 41 | #log4j.appender.appender1.layout.ConversionPattern=[%d{yy/MM/dd HH:mm:ss:SSS}][%t][%p] -%l %m%n -------------------------------------------------------------------------------- /.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 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO,Console,File 2 | #定义日志输出目的地为控制台 3 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 4 | log4j.appender.Console.Target=System.out 5 | #可以灵活地指定日志输出格式,下面一行是指定具体的格式 6 | log4j.appender.Console.layout = org.apache.log4j.PatternLayout 7 | log4j.appender.Console.layout.ConversionPattern=[%c] - %m%n 8 | 9 | #文件大小到达指定尺寸的时候产生一个新的文件 10 | log4j.appender.File = org.apache.log4j.RollingFileAppender 11 | #指定输出目录 12 | log4j.appender.File.File = logs/ssm.log 13 | #定义文件最大大小 14 | log4j.appender.File.MaxFileSize = 10MB 15 | # 输出所以日志,如果换成DEBUG表示输出DEBUG以上级别日志 16 | log4j.appender.File.Threshold = ALL 17 | log4j.appender.File.layout = org.apache.log4j.PatternLayout 18 | log4j.appender.File.layout.ConversionPattern =[%p] [%d{yyyy-MM-dd HH\:mm\:ss}][%c]%m%n 19 | 20 | 21 | 22 | #可以设置级别:debug>info>error 23 | #debug:显示debug、info、error 24 | #info:显示info、error 25 | #error:只error 26 | #log4j.rootLogger=debug,appender1 27 | #log4j.rootLogger=info,appender1 28 | #log4j.rootLogger=error,appender1 29 | #输出到控制台 30 | #log4j.appender.appender1=org.apache.log4j.ConsoleAppender 31 | #样式为TTCCLayout 32 | #log4j.appender.appender1.layout=org.apache.log4j.PatternLayout 33 | #自定义样式 34 | # %r 时间 0 35 | # %t 方法名 main 36 | # %p 优先级 DEBUG/INFO/ERROR 37 | # %c 所属类的全名(包括包名) 38 | # %l 发生的位置,在某个类的某行 39 | # %m 输出代码中指定的讯息,如log(message)中的message 40 | # %n 输出一个换行 41 | #log4j.appender.appender1.layout.ConversionPattern=[%d{yy/MM/dd HH:mm:ss:SSS}][%t][%p] -%l %m%n -------------------------------------------------------------------------------- /WebContent/jsp/main.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | 8 | 10 | 酒店自助入住系统-PC桌面端 11 | 12 | 13 |
${user.memo }:${user.name }
14 |
15 | 33 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /WebContent/jsp/usertype.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 类型管理 11 | 12 | 13 |
14 |
15 |
17 |
18 | 类型名称: ${errorMsgUser } 21 |
22 |
23 |
24 |

用户类型

25 |
26 | 27 |
${user.memo }
28 |
29 |
30 |
31 |
32 |
34 |
35 | 岗位名称: ${errorMsgAdmin } 38 |
39 |
40 |
41 |

员工岗位

42 |
43 | 44 |
${admin.memo }
45 |
46 |
47 | 48 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/entity/UserType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.entity; 5 | 6 | /** 7 | * @author MJCoder 8 | * 9 | */ 10 | public class UserType { 11 | private int id; 12 | private int type; // 用户类型:(大于0是旅客)旅客类型:普通、会员。(小于0是管理员)管理员类型:超级管理员 13 | private String memo; 14 | 15 | /** 16 | * 17 | */ 18 | public UserType() { 19 | // TODO Auto-generated constructor stub 20 | } 21 | 22 | /** 23 | * @param id 24 | * @param type 25 | * @param memo 26 | */ 27 | public UserType(int id, int type, String memo) { 28 | this.id = id; 29 | this.type = type; 30 | this.memo = memo; 31 | } 32 | 33 | /** 34 | * @return the id 35 | */ 36 | public int getId() { 37 | return id; 38 | } 39 | 40 | /** 41 | * @param id 42 | * the id to set 43 | */ 44 | public void setId(int id) { 45 | this.id = id; 46 | } 47 | 48 | /** 49 | * @return the type 50 | */ 51 | public int getType() { 52 | return type; 53 | } 54 | 55 | /** 56 | * @param type 57 | * the type to set 58 | */ 59 | public void setType(int type) { 60 | this.type = type; 61 | } 62 | 63 | /** 64 | * @return the memo 65 | */ 66 | public String getMemo() { 67 | return memo; 68 | } 69 | 70 | /** 71 | * @param memo 72 | * the memo to set 73 | */ 74 | public void setMemo(String memo) { 75 | this.memo = memo; 76 | } 77 | 78 | /* 79 | * (non-Javadoc) 80 | * 81 | * @see java.lang.Object#toString() 82 | */ 83 | @Override 84 | public String toString() { 85 | return "UserType [id=" + id + ", type=" + type + ", memo=" + memo + "]"; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/entity/Goods.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.entity; 5 | 6 | /** 7 | * @author MJCoder 8 | * 9 | * 房间里的必须物品:食物、矿泉水、方便面(各项对应的价格)。 10 | */ 11 | public class Goods { 12 | private int id; 13 | private String name; 14 | private float price; 15 | 16 | /** 17 | * 18 | */ 19 | public Goods() { 20 | // TODO Auto-generated constructor stub 21 | } 22 | 23 | /** 24 | * @param id 25 | * @param name 26 | * @param price 27 | */ 28 | public Goods(int id, String name, float price) { 29 | this.id = id; 30 | this.name = name; 31 | this.price = price; 32 | } 33 | 34 | /** 35 | * @return the id 36 | */ 37 | public int getId() { 38 | return id; 39 | } 40 | 41 | /** 42 | * @param id 43 | * the id to set 44 | */ 45 | public void setId(int id) { 46 | this.id = id; 47 | } 48 | 49 | /** 50 | * @return the name 51 | */ 52 | public String getName() { 53 | return name; 54 | } 55 | 56 | /** 57 | * @param name 58 | * the name to set 59 | */ 60 | public void setName(String name) { 61 | this.name = name; 62 | } 63 | 64 | /** 65 | * @return the price 66 | */ 67 | public float getPrice() { 68 | return price; 69 | } 70 | 71 | /** 72 | * @param price 73 | * the price to set 74 | */ 75 | public void setPrice(float price) { 76 | this.price = price; 77 | } 78 | 79 | /* 80 | * (non-Javadoc) 81 | * 82 | * @see java.lang.Object#toString() 83 | */ 84 | @Override 85 | public String toString() { 86 | return "Goods [id=" + id + ", name=" + name + ", price=" + price + "]"; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/mobile/DtoPackaging.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web.mobile; 5 | 6 | /** 7 | * 实体包装类 8 | * 9 | * @author MJCoder 10 | * 11 | */ 12 | public class DtoPackaging { 13 | private boolean success;// 是否成功标志 14 | 15 | private String describe;// 返回的详细信息描述 16 | 17 | private Object data;// 成功时返回的数据 18 | 19 | /** 20 | * @param success 21 | * @param describe 22 | * @param data 23 | */ 24 | public DtoPackaging(boolean success, String describe, Object data) { 25 | this.success = success; 26 | this.describe = describe; 27 | this.data = data; 28 | } 29 | 30 | /** 31 | * @return the success 32 | */ 33 | public boolean isSuccess() { 34 | return success; 35 | } 36 | 37 | /** 38 | * @param success 39 | * the success to set 40 | */ 41 | public void setSuccess(boolean success) { 42 | this.success = success; 43 | } 44 | 45 | /** 46 | * @return the describe 47 | */ 48 | public String getDescribe() { 49 | return describe; 50 | } 51 | 52 | /** 53 | * @param describe 54 | * the describe to set 55 | */ 56 | public void setDescribe(String describe) { 57 | this.describe = describe; 58 | } 59 | 60 | /** 61 | * @return the data 62 | */ 63 | public Object getData() { 64 | return data; 65 | } 66 | 67 | /** 68 | * @param data 69 | * the data to set 70 | */ 71 | public void setData(Object data) { 72 | this.data = data; 73 | } 74 | 75 | /* 76 | * (non-Javadoc) 77 | * 78 | * @see java.lang.Object#toString() 79 | */ 80 | @Override 81 | public String toString() { 82 | return "Packaging [success=" + success + ", describe=" + describe + ", data=" + data + "]"; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/impl/ServiceGoods.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service.impl; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.lzf.dao.IDaoGoods; 12 | import com.lzf.entity.Goods; 13 | import com.lzf.service.IServiceGoods; 14 | 15 | /** 16 | * @author MJCoder 17 | * 18 | */ 19 | @Service 20 | public class ServiceGoods implements IServiceGoods { 21 | 22 | @Autowired 23 | private IDaoGoods daoGoods; 24 | 25 | /** 26 | * 27 | */ 28 | public ServiceGoods() { 29 | // TODO Auto-generated constructor stub 30 | } 31 | 32 | @Override 33 | public List select() { 34 | // TODO Auto-generated method stub 35 | return daoGoods.select(); 36 | } 37 | 38 | @Override 39 | public int insert(Goods goods) { 40 | // TODO Auto-generated method stub 41 | int temp = -6003; 42 | try { 43 | temp = daoGoods.insert(goods); 44 | } catch (Exception e) { 45 | // TODO: handle exception 46 | e.printStackTrace(); 47 | } 48 | return temp; 49 | } 50 | 51 | @Override 52 | public int update(Goods goods) { 53 | // TODO Auto-generated method stub 54 | int temp = -6003; 55 | try { 56 | temp = daoGoods.update(goods); 57 | } catch (Exception e) { 58 | // TODO: handle exception 59 | e.printStackTrace(); 60 | } 61 | return temp; 62 | } 63 | 64 | @Override 65 | public int delete(int id) { 66 | // TODO Auto-generated method stub 67 | int temp = -6003; 68 | try { 69 | temp = daoGoods.delete(id); 70 | } catch (Exception e) { 71 | // TODO: handle exception 72 | e.printStackTrace(); 73 | } 74 | return temp; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /WebContent/jsp/user.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | 9 | 11 | 用户管理 12 | 13 | 14 |
15 |
16 |

17 |

姓名

18 |

身份证号

19 |

类型

20 |

密码

21 |

操作

22 |
23 | 24 |
25 | ${user.id } ${user.name } 26 | ${user.identity } 27 | 37 | 39 | 41 |
42 |
43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /logs/ssm.log: -------------------------------------------------------------------------------- 1 | [INFO] [2018-04-20 21:10:57][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 2 | [INFO] [2018-04-21 08:34:53][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 3 | [INFO] [2018-04-21 08:35:33][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 4 | [INFO] [2018-04-21 08:37:08][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 5 | [INFO] [2018-04-21 08:37:23][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 6 | [INFO] [2018-04-21 08:41:26][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 7 | [INFO] [2018-04-21 08:42:37][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 8 | [INFO] [2018-04-21 09:15:09][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 9 | [INFO] [2018-04-21 09:15:55][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 10 | [INFO] [2018-04-21 09:16:53][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 11 | [INFO] [2018-04-21 09:18:15][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 12 | [INFO] [2018-04-21 09:18:42][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 13 | [INFO] [2018-04-21 09:24:33][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 14 | [INFO] [2018-04-21 09:30:15][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 15 | [INFO] [2018-06-21 19:55:30][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 16 | [INFO] [2018-06-21 20:51:11][com.baidu.aip.client.BaseClient]get access_token success. current state: STATE_AIP_AUTH_OK 17 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/impl/ServiceIndex.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service.impl; 5 | 6 | import java.util.List; 7 | 8 | import javax.annotation.Resource; 9 | 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.lzf.dao.IDaoIndex; 13 | import com.lzf.entity.User; 14 | import com.lzf.service.IServiceIndex; 15 | 16 | /** 17 | * @author MJCoder 18 | * 19 | */ 20 | @Service 21 | public class ServiceIndex implements IServiceIndex { 22 | 23 | // 注入dao@Autowired 24 | @Resource 25 | private IDaoIndex daoIndex; 26 | 27 | /** 28 | * 29 | */ 30 | public ServiceIndex() { 31 | // TODO Auto-generated constructor stub 32 | } 33 | 34 | @Override 35 | public User login(String identity, String password, int type) { 36 | // TODO Auto-generated method stub 37 | return daoIndex.login(identity, password, type); 38 | } 39 | 40 | @Override 41 | public List select(int type) { 42 | // TODO Auto-generated method stub 43 | return daoIndex.select(type); 44 | } 45 | 46 | @Override 47 | public int insert(User user) { 48 | // TODO Auto-generated method stub 49 | int temp = -6003; 50 | try { 51 | temp = daoIndex.insert(user); 52 | } catch (Exception e) { 53 | // TODO: handle exception 54 | e.printStackTrace(); 55 | } 56 | return temp; 57 | } 58 | 59 | @Override 60 | public int update(User user) { 61 | // TODO Auto-generated method stub 62 | int temp = -6003; 63 | try { 64 | temp = daoIndex.update(user); 65 | } catch (Exception e) { 66 | // TODO: handle exception 67 | e.printStackTrace(); 68 | } 69 | return temp; 70 | } 71 | 72 | @Override 73 | public int delete(int id) { 74 | // TODO Auto-generated method stub 75 | int temp = -6003; 76 | try { 77 | temp = daoIndex.delete(id); 78 | } catch (Exception e) { 79 | // TODO: handle exception 80 | e.printStackTrace(); 81 | } 82 | return temp; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /bin/main/com/lzf/dao/mapper/DaoRoom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | insert 9 | into room (name, price, 10 | few_human, 11 | status, type) 12 | values (#{name}, 13 | #{price}, #{fewHuman}, 14 | #{status}, 15 | #{type}) 16 | 17 | 23 | 30 | 31 | update room set price=#{price}, 32 | few_human=#{fewHuman}, status=#{status}, 33 | user=#{userId}, 34 | checkin_time=#{checkinTime}, type=#{type}, 35 | checkout_time=#{checkoutTime} 36 | where id=#{id} 37 | 38 | 39 | delete from room where id = #{id} 40 | 41 | 50 | 59 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/dao/mapper/DaoRoom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | insert 9 | into room (name, price, 10 | few_human, 11 | status, type) 12 | values (#{name}, 13 | #{price}, #{fewHuman}, 14 | #{status}, 15 | #{type}) 16 | 17 | 23 | 30 | 31 | update room set price=#{price}, 32 | few_human=#{fewHuman}, status=#{status}, 33 | user=#{userId}, 34 | checkin_time=#{checkinTime}, type=#{type}, 35 | checkout_time=#{checkoutTime} 36 | where id=#{id} 37 | 38 | 39 | delete from room where id = #{id} 40 | 41 | 50 | 59 | -------------------------------------------------------------------------------- /WebContent/jsp/goods.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | 9 | 11 | 服务管理 12 | 13 | 14 |
15 |
16 |

17 |

名称

18 |

价格

19 |

操作

20 |
21 | 22 |
23 | ${good.id } ${good.name } 24 | 29 |
30 |
31 |
32 |
33 |
34 |
酒店提供的额外服务
35 |
37 |
38 | 名称: 40 |
41 |
42 | 价格: 44 |
45 |
46 | 47 |
48 |

${errorMsg }

49 |
50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/mobile/ControlMobileGoods.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web.mobile; 5 | 6 | import java.util.List; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import com.lzf.entity.Goods; 17 | import com.lzf.service.IServiceFee; 18 | import com.lzf.service.IServiceGoods; 19 | 20 | /** 21 | * @author MJCoder 22 | * 23 | */ 24 | @Controller 25 | @RequestMapping("mGoods") 26 | public class ControlMobileGoods { 27 | 28 | @Autowired 29 | private IServiceGoods serviceGoods; 30 | @Autowired 31 | private IServiceFee serviceFee; 32 | 33 | /** 34 | * 35 | */ 36 | public ControlMobileGoods() { 37 | // TODO Auto-generated constructor stub 38 | } 39 | 40 | /** 41 | * 查询所有商品 42 | * 43 | * @param request 44 | * @return 45 | */ 46 | @RequestMapping(value = "select", method = RequestMethod.GET) 47 | @ResponseBody 48 | private Object select(HttpServletRequest request) { 49 | List goods = serviceGoods.select(); 50 | DtoPackaging dtoPackaging = null; 51 | if (goods != null) { 52 | dtoPackaging = new DtoPackaging(true, "找到额外服务", goods); 53 | } else { 54 | dtoPackaging = new DtoPackaging(false, "未找到额外服务", null); 55 | } 56 | return dtoPackaging; 57 | } 58 | 59 | @RequestMapping(value = "fee", method = RequestMethod.GET) 60 | @ResponseBody 61 | private Object fee(HttpServletRequest request) { 62 | String fee = request.getParameter("fee"); 63 | String memo = request.getParameter("memo"); 64 | int temp = serviceFee.insert(Float.parseFloat(fee), memo); 65 | DtoPackaging dtoPackaging = null; 66 | if (temp != -6003) { 67 | dtoPackaging = new DtoPackaging(true, "购买成功", null); 68 | } else { 69 | dtoPackaging = new DtoPackaging(false, "购买失败", null); 70 | } 71 | return dtoPackaging; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /WebContent/jsp/checkin.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 身份证识别-登记入住 11 | 12 | 13 |
14 |
15 |

身份证识别-登记入住

16 |
17 | 18 |
20 | 23 | 24 | 25 | 26 |

${errorMsg }

27 |
28 | 29 |
30 |

31 |

房间

32 |

价格

33 |

几人间

34 |

状态

35 |

用户

36 |

入住时间

37 |

类型

38 |
39 |
40 | 41 |
42 | ${room.id } ${room.name } 43 | ${room.price } ${room.fewHuman } 44 | 45 | 46 | 47 | 48 | 预订入住 49 | 50 | 51 | 暂停使用 52 | 53 | ${user } ${room.checkinTime } 54 | ${room.type } 55 |
56 |
57 | 58 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/entity/Fee.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.entity; 5 | 6 | import java.sql.Timestamp; 7 | 8 | /** 9 | * @author MJCoder 10 | * 11 | * 收费信息管理??? 12 | */ 13 | public class Fee { 14 | private int id; 15 | private float fee; // 费用 16 | private String memo; // 描述:方便面+水+spa 17 | private Timestamp timestamp; 18 | 19 | /** 20 | * 21 | */ 22 | public Fee() { 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | /** 27 | * @param id 28 | * @param fee 29 | * @param memo 30 | * @param timestamp 31 | */ 32 | public Fee(int id, float fee, String memo, Timestamp timestamp) { 33 | this.id = id; 34 | this.fee = fee; 35 | this.memo = memo; 36 | this.timestamp = timestamp; 37 | } 38 | 39 | /** 40 | * @return the id 41 | */ 42 | public int getId() { 43 | return id; 44 | } 45 | 46 | /** 47 | * @param id 48 | * the id to set 49 | */ 50 | public void setId(int id) { 51 | this.id = id; 52 | } 53 | 54 | /** 55 | * @return the fee 56 | */ 57 | public float getFee() { 58 | return fee; 59 | } 60 | 61 | /** 62 | * @param fee 63 | * the fee to set 64 | */ 65 | public void setFee(float fee) { 66 | this.fee = fee; 67 | } 68 | 69 | /** 70 | * @return the memo 71 | */ 72 | public String getMemo() { 73 | return memo; 74 | } 75 | 76 | /** 77 | * @param memo 78 | * the memo to set 79 | */ 80 | public void setMemo(String memo) { 81 | this.memo = memo; 82 | } 83 | 84 | /** 85 | * @return the timestamp 86 | */ 87 | public Timestamp getTimestamp() { 88 | return timestamp; 89 | } 90 | 91 | /** 92 | * @param timestamp 93 | * the timestamp to set 94 | */ 95 | public void setTimestamp(Timestamp timestamp) { 96 | this.timestamp = timestamp; 97 | } 98 | 99 | /* 100 | * (non-Javadoc) 101 | * 102 | * @see java.lang.Object#toString() 103 | */ 104 | @Override 105 | public String toString() { 106 | return "Fee [id=" + id + ", fee=" + fee + ", memo=" + memo + ", timestamp=" + timestamp + "]"; 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/util/AipOpticalCharacterRecognition.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.util; 5 | 6 | import java.util.HashMap; 7 | 8 | import org.json.JSONObject; 9 | 10 | import com.baidu.aip.ocr.AipOcr; 11 | 12 | /** 13 | * @author MJCoder 14 | * 15 | * AipOcr是Optical Character Recognition的Java客户端,为使用Optical Character 16 | * Recognition的开发人员提供了一系列的交互方法。初始化完成后建议单例使用,避免重复获取access_token。 17 | */ 18 | public final class AipOpticalCharacterRecognition { 19 | // 设置APPID/AK/SK 20 | private static final String APP_ID = "11133618"; 21 | private static final String API_KEY = "cXx3nfnZGVZESp1FKiLEan9x"; 22 | private static final String SECRET_KEY = "QD30CiV2fyCnkFCpLmFICy0nkjtTk4zH"; 23 | private static AipOcr client; 24 | 25 | private static AipOcr getAipOcrInstance() { 26 | if (client == null) { 27 | // 初始化一个AipOcr 28 | client = new AipOcr(APP_ID, API_KEY, SECRET_KEY); 29 | // 可选:设置网络连接参数 30 | client.setConnectionTimeoutInMillis(2000); 31 | client.setSocketTimeoutInMillis(60000); 32 | 33 | // 可选:设置代理服务器地址, http和socket二选一,或者均不设置 34 | // client.setHttpProxy("proxy_host", proxy_port); // 设置http代理 35 | // client.setSocketProxy("proxy_host", proxy_port); // 设置socket代理 36 | 37 | // 可选:设置log4j日志输出格式,若不设置,则使用默认配置 38 | // 也可以直接通过jvm启动参数设置此环境变量 39 | // System.setProperty("aip.log4j.conf", "path/to/your/log4j.properties"); 40 | } 41 | return client; 42 | } 43 | 44 | /** 45 | * 用户向服务请求识别身份证,身份证识别包括正面和背面。 46 | * 47 | * @param client 48 | */ 49 | public static JSONObject aipOcrIdCard(String path) { 50 | // 传入可选参数调用接口 51 | HashMap options = new HashMap(); 52 | // 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:true:检测朝向;false:不检测朝向。 53 | options.put("detect_direction", "true"); 54 | // 是否开启身份证风险类型(身份证复印件、临时身份证、身份证翻拍、修改过的身份证)功能,默认不开启,即:false。可选值:true-开启;false-不开启 55 | options.put("detect_risk", "false"); 56 | 57 | String idCardSide = "front"; // front:身份证含照片的一面;back:身份证带国徽的一面 58 | 59 | /** 60 | * 参数path为本地图片路径 61 | * 62 | * image_status normal-识别正常; reversed_side-未摆正身份证 ; non_idcard-上传的图片中不包含身份证; 63 | * blurred-身份证模糊 ; over_exposure-身份证关键字段反光或过曝 ; unknown-未知状态; 64 | */ 65 | 66 | JSONObject res = getAipOcrInstance().idcard(path, idCardSide, options); 67 | // System.out.println("响应内容:\n" + res.toString(2)); 68 | return res; 69 | 70 | // 参数为本地图片二进制数组 71 | // byte[] file = readImageFile(image); 72 | // res = client.idcard(file, idCardSide, options); 73 | // System.out.println(res.toString(2)); 74 | 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/ControlUserType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web; 5 | 6 | import java.util.List; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | 15 | import com.lzf.entity.Room; 16 | import com.lzf.entity.UserType; 17 | import com.lzf.service.IServiceUserType; 18 | 19 | /** 20 | * @author MJCoder 21 | * 22 | */ 23 | @Controller 24 | @RequestMapping("userType") 25 | public class ControlUserType { 26 | 27 | @Autowired 28 | private IServiceUserType serviceUserType; 29 | 30 | /** 31 | * 32 | */ 33 | public ControlUserType() { 34 | // TODO Auto-generated constructor stub 35 | } 36 | 37 | @RequestMapping(value = "select", method = RequestMethod.GET) 38 | private Object select(HttpServletRequest request) { 39 | List users = serviceUserType.selectUser(); 40 | List admins = serviceUserType.selectAdmin(); 41 | request.setAttribute("users", users); 42 | request.setAttribute("admins", admins); 43 | return "jsp/usertype"; 44 | } 45 | 46 | @RequestMapping(value = "insertAdmin", method = RequestMethod.POST) 47 | private Object insertAdmin(HttpServletRequest request) { 48 | String memo = request.getParameter("memo"); 49 | int result = serviceUserType.insert(new UserType(0, -1, memo)); 50 | List users = serviceUserType.selectUser(); 51 | List admins = serviceUserType.selectAdmin(); 52 | request.setAttribute("memoAdmin", memo); 53 | request.setAttribute("users", users); 54 | request.setAttribute("admins", admins); 55 | if (result == -6003) { 56 | request.setAttribute("errorMsgAdmin", "添加失败"); 57 | } else { 58 | request.setAttribute("errorMsgAdmin", "添加成功"); 59 | } 60 | return "jsp/usertype"; 61 | } 62 | 63 | @RequestMapping(value = "insertUser", method = RequestMethod.POST) 64 | private Object insertUser(HttpServletRequest request) { 65 | String memo = request.getParameter("memo"); 66 | int result = serviceUserType.insert(new UserType(0, 1, memo)); 67 | List users = serviceUserType.selectUser(); 68 | List admins = serviceUserType.selectAdmin(); 69 | request.setAttribute("memoUser", memo); 70 | request.setAttribute("users", users); 71 | request.setAttribute("admins", admins); 72 | if (result == -6003) { 73 | request.setAttribute("errorMsgUser", "添加失败"); 74 | } else { 75 | request.setAttribute("errorMsgUser", "添加成功"); 76 | } 77 | return "jsp/usertype"; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /bin/default/spring-dao.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 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 | -------------------------------------------------------------------------------- /bin/main/spring-dao.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 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 | -------------------------------------------------------------------------------- /src/main/resources/spring-dao.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 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 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/mobile/ControlUser.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web.mobile; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import com.lzf.entity.User; 15 | import com.lzf.service.IServiceIndex; 16 | 17 | /** 18 | * @author MJCoder 19 | * 20 | */ 21 | @Controller 22 | @RequestMapping("user") 23 | public class ControlUser { 24 | 25 | @Autowired 26 | private IServiceIndex serviceIndex; 27 | 28 | /** 29 | * 30 | */ 31 | public ControlUser() { 32 | // TODO Auto-generated constructor stub 33 | } 34 | 35 | /** 36 | * 注册 37 | * 38 | * @param request 39 | * @return 40 | */ 41 | @RequestMapping(value = "register", method = RequestMethod.POST) 42 | @ResponseBody 43 | private Object register(HttpServletRequest request) { 44 | String name = request.getParameter("name"); 45 | String identity = request.getParameter("identity"); 46 | String password = request.getParameter("password"); 47 | int result = serviceIndex.insert(new User(0, name, identity, password, 15, null)); 48 | DtoPackaging dtoPackaging = null; 49 | if (result == -6003) { 50 | dtoPackaging = new DtoPackaging(false, "注册失败", null); 51 | } else { 52 | User user = serviceIndex.login(identity, password, 1); 53 | if (user == null) { 54 | user = serviceIndex.login(identity, password, -1); 55 | } 56 | dtoPackaging = new DtoPackaging(true, "注册成功", user); 57 | } 58 | return dtoPackaging; 59 | } 60 | 61 | /** 62 | * 登录 63 | * 64 | * @param request 65 | * @return 66 | */ 67 | @RequestMapping(value = "login", method = RequestMethod.POST) 68 | @ResponseBody 69 | private Object login(HttpServletRequest request) { 70 | String identity = request.getParameter("identity"); 71 | String password = request.getParameter("password"); 72 | System.out.println(identity + ";" + password); 73 | DtoPackaging dtoPackaging = null; 74 | User user = serviceIndex.login(identity, password, 1); 75 | if (user == null) { 76 | user = serviceIndex.login(identity, password, -1); 77 | if (user == null) { 78 | dtoPackaging = new DtoPackaging(false, "登录失败", null); 79 | } else { 80 | dtoPackaging = new DtoPackaging(true, "登录成功", user); 81 | } 82 | } else { 83 | dtoPackaging = new DtoPackaging(true, "登录成功", user); 84 | } 85 | return dtoPackaging; 86 | } 87 | 88 | @RequestMapping(value = "test", method = RequestMethod.GET) 89 | @ResponseBody 90 | private Object test() { 91 | return new DtoPackaging(false, "测试", null); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/ControlGoods.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web; 5 | 6 | import java.util.List; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import com.lzf.entity.Goods; 17 | import com.lzf.entity.Room; 18 | import com.lzf.service.IServiceGoods; 19 | 20 | /** 21 | * @author MJCoder 22 | * 23 | */ 24 | @Controller 25 | @RequestMapping("goods") 26 | public class ControlGoods { 27 | 28 | @Autowired 29 | private IServiceGoods serviceGoods; 30 | 31 | /** 32 | * 33 | */ 34 | public ControlGoods() { 35 | // TODO Auto-generated constructor stub 36 | } 37 | 38 | @RequestMapping(value = "select", method = RequestMethod.GET) 39 | private Object select(HttpServletRequest request) { 40 | List goods = serviceGoods.select(); 41 | request.setAttribute("goods", goods); 42 | return "jsp/goods"; 43 | } 44 | 45 | @RequestMapping(value = "insert", method = RequestMethod.POST) 46 | private Object insert(HttpServletRequest request) { 47 | String name = request.getParameter("name"); 48 | String price = request.getParameter("price"); 49 | int insert = serviceGoods.insert(new Goods(0, name, Float.parseFloat(price))); 50 | List goods = serviceGoods.select(); 51 | request.setAttribute("goods", goods); 52 | request.setAttribute("name", name); 53 | request.setAttribute("price", price); 54 | if (insert == -6003) { 55 | request.setAttribute("errorMsg", "添加失败"); 56 | } else { 57 | request.setAttribute("errorMsg", "添加成功"); 58 | } 59 | return "jsp/goods"; 60 | } 61 | 62 | @RequestMapping(value = "update", method = RequestMethod.POST) 63 | @ResponseBody 64 | private Object update(HttpServletRequest request) { 65 | String id = request.getParameter("id"); 66 | String price = request.getParameter("price"); 67 | String errorMsg = ""; 68 | if (serviceGoods.update(new Goods(Integer.parseInt(id), null, Float.parseFloat(price))) == -6003) { 69 | errorMsg = "修改失败"; 70 | } else { 71 | errorMsg = "修改成功"; 72 | } 73 | return errorMsg; 74 | } 75 | 76 | // @RequestMapping(value = "sysConfigs") 77 | // @ResponseBody // 返回json 78 | @RequestMapping(value = "delete", method = RequestMethod.GET) 79 | @ResponseBody 80 | private Object delete(HttpServletRequest request) { 81 | String id = request.getParameter("id"); 82 | int result = serviceGoods.delete(Integer.parseInt(id)); 83 | String errorMsg = ""; 84 | if (result == -6003) { 85 | errorMsg = "删除失败"; 86 | } else { 87 | errorMsg = "删除成功"; 88 | } 89 | return errorMsg; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/ControlCheckIn.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web; 5 | 6 | import java.io.File; 7 | import java.util.List; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | 11 | import org.json.JSONObject; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RequestMethod; 16 | import org.springframework.web.multipart.MultipartFile; 17 | 18 | import com.lzf.entity.Room; 19 | import com.lzf.service.IServiceCheckIn; 20 | import com.lzf.util.AipOpticalCharacterRecognition; 21 | 22 | /** 23 | * @author MJCoder 24 | * 25 | */ 26 | @Controller 27 | @RequestMapping("checkin") 28 | public class ControlCheckIn { 29 | 30 | @Autowired 31 | private IServiceCheckIn serviceCheckIn; 32 | 33 | /** 34 | * 35 | */ 36 | public ControlCheckIn() { 37 | // TODO Auto-generated constructor stub 38 | } 39 | 40 | @RequestMapping(value = "aipOcrIdCard", method = RequestMethod.POST) 41 | private Object aipOcrIdCard(MultipartFile file, HttpServletRequest request) { 42 | // String path = request.getParameter("path"); 43 | try { 44 | String path = request.getServletContext().getRealPath("upload"); // uploads文件夹位置 45 | String fileName = file.getOriginalFilename(); // 原始名称 46 | File dir = new File(path, fileName);// 新文件名 47 | if (!dir.exists()) { // 如果目标文件所在的目录不存在,则创建父目录 48 | dir.mkdirs(); 49 | } 50 | System.out.println(dir.getAbsolutePath()); 51 | file.transferTo(dir); // 将内存中的数据写入磁盘 52 | 53 | JSONObject resp = AipOpticalCharacterRecognition.aipOcrIdCard(dir.getAbsolutePath()); 54 | String imageStatus = resp.getString("image_status"); 55 | if ("normal".equals(imageStatus)) { 56 | JSONObject temp = resp.getJSONObject("words_result"); 57 | String name = temp.getJSONObject("姓名").getString("words"); 58 | String identity = temp.getJSONObject("公民身份号码").getString("words"); 59 | List rooms = serviceCheckIn.select(name, identity); 60 | request.setAttribute("user", name); 61 | request.setAttribute("rooms", rooms); 62 | } else if ("reversed_side".equals(imageStatus)) { 63 | request.setAttribute("errorMsg", "未摆正身份证"); 64 | } else if ("non_idcard".equals(imageStatus)) { 65 | request.setAttribute("errorMsg", "上传的图片中不包含身份证"); 66 | } else if ("blurred".equals(imageStatus)) { 67 | request.setAttribute("errorMsg", "身份证模糊"); 68 | } else if ("over_exposure".equals(imageStatus)) { 69 | request.setAttribute("errorMsg", "身份证关键字段反光或过曝"); 70 | } else if ("unknown".equals(imageStatus)) { 71 | request.setAttribute("errorMsg", "该身份证无法识别,请重新上传。(未知状态)"); 72 | } 73 | } catch (Exception e) { 74 | // TODO: handle exception 75 | e.printStackTrace(); 76 | request.setAttribute("errorMsg", "该身份证无法识别,请重新上传。(异常状态)"); 77 | } 78 | return "jsp/checkin"; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/service/impl/ServiceRoom.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.service.impl; 5 | 6 | import java.util.List; 7 | 8 | import org.junit.Test; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.lzf.dao.IDaoFee; 13 | import com.lzf.dao.IDaoRoom; 14 | import com.lzf.entity.Room; 15 | import com.lzf.service.IServiceRoom; 16 | 17 | /** 18 | * @author MJCoder 19 | * 20 | */ 21 | @Service 22 | public class ServiceRoom implements IServiceRoom { 23 | 24 | @Autowired 25 | private IDaoRoom daoRoom; 26 | @Autowired 27 | private IDaoFee daoFee; 28 | 29 | /** 30 | * 31 | */ 32 | public ServiceRoom() { 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | @Override 37 | public int insert(Room room) { 38 | // TODO Auto-generated method stub 39 | int temp = -6003; 40 | try { 41 | temp = daoRoom.insert(room); 42 | } catch (Exception e) { 43 | // TODO: handle exception 44 | e.printStackTrace(); 45 | } 46 | return temp; 47 | } 48 | 49 | @Override 50 | public List select() { 51 | // TODO Auto-generated method stub 52 | List rooms = daoRoom.select(); 53 | for (Room room : rooms) { 54 | room.setUser(daoRoom.selectUser(room.getUserId())); 55 | } 56 | System.out.println(rooms); 57 | return rooms; 58 | } 59 | 60 | @Override 61 | public int update(Room room) { 62 | // TODO Auto-generated method stub 63 | int temp = -6003; 64 | try { 65 | if (room.getStatus() == 1) { 66 | daoFee.insert( 67 | room.getPrice() * (Integer 68 | .parseInt(room.getCheckoutTime().getYear() + "" + room.getCheckoutTime().getMonth() + "" 69 | + room.getCheckoutTime().getDay()) 70 | - Integer.parseInt(room.getCheckinTime().getYear() + "" 71 | + room.getCheckinTime().getMonth() + "" + room.getCheckinTime().getDay())), 72 | room.getType() + ":" + (room.getName() == null ? "" : room.getName())); 73 | } 74 | temp = daoRoom.update(room); 75 | } catch (Exception e) { 76 | // TODO: handle exception 77 | e.printStackTrace(); 78 | } 79 | return temp; 80 | } 81 | 82 | @Override 83 | public int delete(int id) { 84 | // TODO Auto-generated method stub 85 | int temp = -6003; 86 | try { 87 | temp = daoRoom.delete(id); 88 | } catch (Exception e) { 89 | // TODO: handle exception 90 | e.printStackTrace(); 91 | } 92 | return temp; 93 | } 94 | 95 | @Override 96 | public List selectVacantRoom() { 97 | // TODO Auto-generated method stub 98 | return daoRoom.selectVacantRoom(); 99 | } 100 | 101 | @Override 102 | public List selectUserRoom(int userId) { 103 | // TODO Auto-generated method stub 104 | System.out.println(daoRoom.selectUserRoom(userId)); 105 | return daoRoom.selectUserRoom(userId); 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/entity/User.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.entity; 5 | 6 | /** 7 | * @author MJCoder 8 | * 9 | */ 10 | public class User { 11 | private int id; 12 | private String name; 13 | private String identity; 14 | private String password; 15 | private int type; // 用户类型:(大于0是旅客)旅客类型:普通、会员。(小于0是管理员)管理员类型:超级管理员。 16 | private String memo; // 管理员、前台 17 | 18 | /** 19 | * 20 | */ 21 | public User() { 22 | // TODO Auto-generated constructor stub 23 | } 24 | 25 | /** 26 | * @param id 27 | * @param name 28 | * @param identity 29 | * @param password 30 | * @param type 31 | * @param memo 32 | */ 33 | public User(int id, String name, String identity, String password, int type, String memo) { 34 | this.id = id; 35 | this.name = name; 36 | this.identity = identity; 37 | this.password = password; 38 | this.type = type; 39 | this.memo = memo; 40 | } 41 | 42 | /** 43 | * @return the id 44 | */ 45 | public int getId() { 46 | return id; 47 | } 48 | 49 | /** 50 | * @param id 51 | * the id to set 52 | */ 53 | public void setId(int id) { 54 | this.id = id; 55 | } 56 | 57 | /** 58 | * @return the name 59 | */ 60 | public String getName() { 61 | return name; 62 | } 63 | 64 | /** 65 | * @param name 66 | * the name to set 67 | */ 68 | public void setName(String name) { 69 | this.name = name; 70 | } 71 | 72 | /** 73 | * @return the identity 74 | */ 75 | public String getIdentity() { 76 | return identity; 77 | } 78 | 79 | /** 80 | * @param identity 81 | * the identity to set 82 | */ 83 | public void setIdentity(String identity) { 84 | this.identity = identity; 85 | } 86 | 87 | /** 88 | * @return the password 89 | */ 90 | public String getPassword() { 91 | return password; 92 | } 93 | 94 | /** 95 | * @param password 96 | * the password to set 97 | */ 98 | public void setPassword(String password) { 99 | this.password = password; 100 | } 101 | 102 | /** 103 | * @return the type 104 | */ 105 | public int getType() { 106 | return type; 107 | } 108 | 109 | /** 110 | * @param type 111 | * the type to set 112 | */ 113 | public void setType(int type) { 114 | this.type = type; 115 | } 116 | 117 | /** 118 | * @return the memo 119 | */ 120 | public String getMemo() { 121 | return memo; 122 | } 123 | 124 | /** 125 | * @param memo 126 | * the memo to set 127 | */ 128 | public void setMemo(String memo) { 129 | this.memo = memo; 130 | } 131 | 132 | /* 133 | * (non-Javadoc) 134 | * 135 | * @see java.lang.Object#toString() 136 | */ 137 | @Override 138 | public String toString() { 139 | return "User [id=" + id + ", name=" + name + ", identity=" + identity + ", password=" + password + ", type=" 140 | + type + ", memo=" + memo + "]"; 141 | } 142 | 143 | } 144 | -------------------------------------------------------------------------------- /WebContent/jsp/staff.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | 9 | 11 | 员工管理 12 | 13 | 14 |
15 |
17 |
18 | 姓名: 20 |
21 |
22 | 身份证号: 24 |
25 |
26 | 岗位: 36 |
37 |
38 | 密码: 40 |
41 |
42 | 43 |
44 |

${errorMsg }

45 |
46 |
47 |
48 |

49 |

姓名

50 |

身份证号

51 |

岗位

52 |

密码

53 |

操作

54 |
55 | 56 |
57 | ${user.id } ${user.name } 58 | ${user.identity } 59 | 69 | 74 |
75 |
76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/mobile/ControlUserRoom.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web.mobile; 5 | 6 | import java.sql.Timestamp; 7 | import java.text.ParseException; 8 | import java.text.SimpleDateFormat; 9 | import java.util.List; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Controller; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RequestMethod; 17 | import org.springframework.web.bind.annotation.ResponseBody; 18 | 19 | import com.lzf.entity.Room; 20 | import com.lzf.service.IServiceRoom; 21 | 22 | /** 23 | * @author MJCoder 24 | * 25 | */ 26 | @Controller 27 | @RequestMapping("userRoom") 28 | public class ControlUserRoom { 29 | 30 | @Autowired 31 | private IServiceRoom serviceRoom; 32 | 33 | /** 34 | * 35 | */ 36 | public ControlUserRoom() { 37 | // TODO Auto-generated constructor stub 38 | } 39 | 40 | /** 41 | * 查询空房间和用户的房间 42 | * 43 | * @return 44 | */ 45 | @RequestMapping(value = "vacantOrUserRoom", method = RequestMethod.GET) 46 | @ResponseBody 47 | private Object selectVacantOrUserRoom(HttpServletRequest request) { 48 | String userId = request.getParameter("userId"); 49 | System.out.println(userId); 50 | List vacantRooms = serviceRoom.selectVacantRoom(); 51 | List userRooms = serviceRoom.selectUserRoom(Integer.parseInt(userId)); 52 | DtoPackaging dtoPackaging = null; 53 | if (vacantRooms != null || userRooms != null) { 54 | dtoPackaging = new DtoPackaging(true, "找到房间", new Object[] { vacantRooms, userRooms }); 55 | } else { 56 | dtoPackaging = new DtoPackaging(false, "未找到房间", null); 57 | } 58 | return dtoPackaging; 59 | } 60 | 61 | /** 62 | * 预订入住 63 | * 64 | * @return 65 | */ 66 | @RequestMapping(value = "userHandleRoom", method = RequestMethod.GET) 67 | @ResponseBody 68 | private Object userHandleRoom(HttpServletRequest request) { 69 | int temp = -6003; 70 | try { 71 | String price = request.getParameter("price"); 72 | String fewHuman = request.getParameter("fewHuman"); 73 | String status = request.getParameter("status"); 74 | String userId = request.getParameter("userId"); 75 | String type = request.getParameter("type"); 76 | String roomId = request.getParameter("roomId"); 77 | String checkinTime = request.getParameter("checkinTime"); 78 | String checkoutTime = request.getParameter("checkoutTime"); 79 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); 80 | temp = serviceRoom.update(new Room(Integer.parseInt(roomId), "", Float.parseFloat(price), 81 | Integer.parseInt(fewHuman), Integer.parseInt(status), Integer.parseInt(userId), null, 82 | new Timestamp(simpleDateFormat.parse(checkinTime).getTime()), type, 83 | new Timestamp(simpleDateFormat.parse(checkoutTime).getTime()))); 84 | } catch (NumberFormatException e) { 85 | // TODO Auto-generated catch block 86 | e.printStackTrace(); 87 | } catch (ParseException e) { 88 | // TODO Auto-generated catch block 89 | e.printStackTrace(); 90 | } 91 | DtoPackaging dtoPackaging = null; 92 | if (temp == -6003) { 93 | dtoPackaging = new DtoPackaging(false, "失败", null); 94 | } else { 95 | dtoPackaging = new DtoPackaging(true, "成功", null); 96 | } 97 | return dtoPackaging; 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/ControlRoom.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web; 5 | 6 | import java.util.List; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import com.lzf.entity.Room; 17 | import com.lzf.service.IServiceRoom; 18 | 19 | /** 20 | * 控制层 21 | * 22 | * @author MJCoder 23 | * 24 | */ 25 | 26 | @Controller 27 | @RequestMapping("room") // url:/模块/资源/{id}/细分 /seckill/list 28 | public class ControlRoom { 29 | // 注入Service 30 | @Autowired 31 | private IServiceRoom serviceRoom; 32 | 33 | /** 34 | * 35 | */ 36 | public ControlRoom() { 37 | // TODO Auto-generated constructor stub 38 | } 39 | 40 | // @RequestMapping(value = "sysConfigs") 41 | // @ResponseBody // 返回json 42 | @RequestMapping(value = "insert", method = RequestMethod.POST) 43 | private Object insert(HttpServletRequest request) { 44 | String room = request.getParameter("room"); 45 | String price = request.getParameter("price"); 46 | String fewHuman = request.getParameter("fewHuman"); 47 | String type = request.getParameter("type"); 48 | int result = serviceRoom.insert( 49 | new Room(0, room, Float.parseFloat(price), Integer.parseInt(fewHuman), 0, 0, null, null, type, null)); 50 | List rooms = serviceRoom.select(); 51 | request.setAttribute("room", room); 52 | request.setAttribute("price", price); 53 | request.setAttribute("fewHuman", fewHuman); 54 | request.setAttribute("type", type); 55 | request.setAttribute("rooms", rooms); 56 | if (result == -6003) { 57 | request.setAttribute("errorMsg", "系统中已有该房间,无需重复录入;如果需要可以在原有房间数据上进行修改。"); 58 | } else { 59 | request.setAttribute("errorMsg", "添加成功"); 60 | } 61 | return "jsp/room"; 62 | } 63 | 64 | @RequestMapping(value = "select", method = RequestMethod.GET) 65 | private Object select(HttpServletRequest request) { 66 | List rooms = serviceRoom.select(); 67 | request.setAttribute("rooms", rooms); 68 | return "jsp/room"; 69 | } 70 | 71 | @RequestMapping(value = "update", method = RequestMethod.POST) 72 | @ResponseBody 73 | private Object update(HttpServletRequest request) { 74 | String id = request.getParameter("id"); 75 | String price = request.getParameter("price"); 76 | String fewHuman = request.getParameter("fewHuman"); 77 | String status = request.getParameter("status"); 78 | String type = request.getParameter("type"); 79 | String errorMsg = ""; 80 | if (serviceRoom.update(new Room(Integer.parseInt(id), null, Float.parseFloat(price), Integer.parseInt(fewHuman), 81 | Integer.parseInt(status), 31, null, null, type, null)) == -6003) { 82 | errorMsg = "修改失败"; 83 | } else { 84 | errorMsg = "修改成功"; 85 | } 86 | return errorMsg; 87 | } 88 | 89 | // @RequestMapping(value = "sysConfigs") 90 | // @ResponseBody // 返回json 91 | @RequestMapping(value = "delete", method = RequestMethod.GET) 92 | @ResponseBody 93 | private Object delete(HttpServletRequest request) { 94 | String id = request.getParameter("id"); 95 | int result = serviceRoom.delete(Integer.parseInt(id)); 96 | String errorMsg = ""; 97 | if (result == -6003) { 98 | errorMsg = "删除失败"; 99 | } else { 100 | errorMsg = "删除成功"; 101 | } 102 | return errorMsg; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /WebContent/jsp/room.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | 9 | 11 | 房间管理 12 | 13 | 14 |
15 |

16 |

房间

17 |

价格

18 |

几人间

19 |

状态

20 |

用户

21 |

入住时间

22 |

退房时间

23 |

类型

24 |

操作

25 |
26 | 27 |
28 | 29 | ${room.id } ${room.name } 30 | 35 | 36 | 41 | 42 | 43 | 44 | 45 | 46 | 51 | ${room.user.name }:${room.user.identity } 52 | ${room.checkinTime } 53 | ${room.checkoutTime } 54 | 55 | 56 | 61 | 62 | 63 | 64 | 65 | 69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
78 |
79 | 房间: 81 |
82 |
83 | 价格: 85 |
86 |
87 | 几人间: 89 |
90 |
91 | 类型: 93 |
94 |
95 | 96 |
97 |

${errorMsg }

98 |
99 |
100 |
101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /bin/main/spring-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | text/html;charset=UTF-8 35 | text/json;charset=UTF-8 36 | application/json;charset=UTF-8 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 50 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 61 | 62 | 63 | 64 | 65 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | json=application/json 77 | xml=application/xml 78 | html=text/html 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /bin/default/spring-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | text/html;charset=UTF-8 35 | text/json;charset=UTF-8 36 | application/json;charset=UTF-8 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 50 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 61 | 62 | 63 | 64 | 65 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | json=application/json 77 | xml=application/xml 78 | html=text/html 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/main/resources/spring-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | text/html;charset=UTF-8 35 | text/json;charset=UTF-8 36 | application/json;charset=UTF-8 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 50 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 61 | 62 | 63 | 64 | 65 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | json=application/json 77 | xml=application/xml 78 | html=text/html 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/web/ControlIndex.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.web; 5 | 6 | import java.util.List; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import com.lzf.entity.User; 17 | import com.lzf.entity.UserType; 18 | import com.lzf.service.IServiceIndex; 19 | import com.lzf.service.IServiceUserType; 20 | 21 | /** 22 | * 控制层 23 | * 24 | * @author MJCoder 25 | * 26 | */ 27 | 28 | @Controller 29 | @RequestMapping("controller") // url:/模块/资源/{id}/细分 /seckill/list 30 | public class ControlIndex { 31 | // 注入Service 32 | @Autowired 33 | private IServiceIndex serviceIndex; 34 | @Autowired 35 | private IServiceUserType serviceUserType; 36 | 37 | /** 38 | * 39 | */ 40 | public ControlIndex() { 41 | // TODO Auto-generated constructor stub 42 | } 43 | 44 | // @RequestMapping(value = "sysConfigs") 45 | // @ResponseBody //返回json 46 | @RequestMapping(value = "login", method = RequestMethod.POST) 47 | private Object login(HttpServletRequest request) { 48 | String identity = request.getParameter("identity"); 49 | String password = request.getParameter("password"); 50 | User user = serviceIndex.login(identity, password, -1); 51 | System.out.println(user); 52 | if (user != null) { 53 | request.getSession().setAttribute("user", user); 54 | return "jsp/main"; 55 | } else { 56 | request.setAttribute("identity", identity); 57 | request.setAttribute("password", password); 58 | request.setAttribute("errorMsg", "身份证和密码不匹配(PC端只允许管理员登录哦)"); 59 | return "index"; 60 | } 61 | } 62 | 63 | @RequestMapping(value = "selectStaff", method = RequestMethod.GET) 64 | private Object selectStaff(HttpServletRequest request) { 65 | List users = serviceIndex.select(-1); 66 | request.setAttribute("users", users); 67 | List userTypes = serviceUserType.selectAdmin(); 68 | request.setAttribute("userTypes", userTypes); 69 | return "jsp/staff"; 70 | } 71 | 72 | @RequestMapping(value = "selectUser", method = RequestMethod.GET) 73 | private Object selectUser(HttpServletRequest request) { 74 | List users = serviceIndex.select(1); 75 | request.setAttribute("users", users); 76 | List userTypes = serviceUserType.selectUser(); 77 | request.setAttribute("userTypes", userTypes); 78 | return "jsp/user"; 79 | } 80 | 81 | @RequestMapping(value = "insert", method = RequestMethod.POST) 82 | private Object insert(HttpServletRequest request) { 83 | String name = request.getParameter("name"); 84 | String identity = request.getParameter("identity"); 85 | String type = request.getParameter("type"); 86 | String password = request.getParameter("password"); 87 | int result = serviceIndex.insert(new User(0, name, identity, password, Integer.parseInt(type), null)); 88 | if (result == -6003) { 89 | request.setAttribute("errorMsg", "添加失败"); 90 | } else { 91 | request.setAttribute("errorMsg", "添加成功"); 92 | } 93 | request.setAttribute("name", name); 94 | request.setAttribute("identity", identity); 95 | request.setAttribute("type", type); 96 | request.setAttribute("password", password); 97 | List users = serviceIndex.select(-1); 98 | request.setAttribute("users", users); 99 | List userTypes = serviceUserType.selectAdmin(); 100 | request.setAttribute("userTypes", userTypes); 101 | return "jsp/staff"; 102 | } 103 | 104 | @RequestMapping(value = "update", method = RequestMethod.POST) 105 | @ResponseBody 106 | private Object update(HttpServletRequest request) { 107 | String id = request.getParameter("id"); 108 | String type = request.getParameter("type"); 109 | String password = request.getParameter("password"); 110 | int result = serviceIndex 111 | .update(new User(Integer.parseInt(id), null, null, password, Integer.parseInt(type), null)); 112 | if (result == -6003) { 113 | return "修改失败"; 114 | } else { 115 | return "修改成功"; 116 | } 117 | } 118 | 119 | @RequestMapping(value = "delete", method = RequestMethod.GET) 120 | @ResponseBody 121 | private Object delete(HttpServletRequest request) { 122 | String id = request.getParameter("id"); 123 | int result = serviceIndex.delete(Integer.parseInt(id)); 124 | if (result == -6003) { 125 | return "修改失败"; 126 | } else { 127 | return "修改成功"; 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /WebContent/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | HotelCheck-inSystem 7 | 8 | index.html 9 | index.htm 10 | index.jsp 11 | default.html 12 | default.htm 13 | default.jsp 14 | 15 | 16 | 17 | 18 | 19 | org.springframework.web.context.ContextLoaderListener 20 | 21 | 22 | 23 | org.springframework.web.util.IntrospectorCleanupListener 24 | 25 | 26 | 27 | 28 | contextConfigLocation 29 | 30 | classpath:spring-*.xml 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 | DispatcherServlet 40 | org.springframework.web.servlet.DispatcherServlet 41 | 43 | 44 | contextConfigLocation 45 | 46 | classpath:spring-*.xml 47 | 48 | 1 49 | true 50 | 51 | 52 | 53 | DispatcherServlet 54 | 55 | / 56 | 57 | 58 | 59 | 60 | 61 | 62 | CharacterEncodingFilter 63 | org.springframework.web.filter.CharacterEncodingFilter 64 | true 65 | 66 | encoding 67 | UTF-8 68 | 69 | 70 | forceEncoding 71 | true 72 | 73 | 74 | 75 | CharacterEncodingFilter 76 | /* 77 | 78 | 79 | 80 | 81 | logbackConfigLocation 82 | classpath:logback.xml 83 | 84 | 86 | 87 | 88 | 89 | 90 | http://java.sun.com/jstl/fmt 91 | /WEB-INF/fmt.tld 92 | 93 | 94 | http://java.sun.com/jstl/fmt-rt 95 | /WEB-INF/fmt-rt.tld 96 | 97 | 98 | http://java.sun.com/jstl/core 99 | /WEB-INF/c.tld 100 | 101 | 102 | http://java.sun.com/jstl/core-rt 103 | /WEB-INF/c-rt.tld 104 | 105 | 106 | http://java.sun.com/jstl/sql 107 | /WEB-INF/sql.tld 108 | 109 | 110 | http://java.sun.com/jstl/sql-rt 111 | /WEB-INF/sql-rt.tld 112 | 113 | 114 | http://java.sun.com/jstl/x 115 | /WEB-INF/x.tld 116 | 117 | 118 | http://java.sun.com/jstl/x-rt 119 | /WEB-INF/x-rt.tld 120 | 121 | 122 | -------------------------------------------------------------------------------- /src/main/java/com/lzf/entity/Room.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.lzf.entity; 5 | 6 | import java.sql.Timestamp; 7 | 8 | /** 9 | * @author MJCoder 10 | * 11 | * 房间信息:名称、价格、几人间、状态(0为空、1预订入住、2暂停使用)。 12 | */ 13 | public class Room { 14 | private int id; 15 | private String name; 16 | private float price; 17 | private int fewHuman; // 几人间 18 | private int status; // 状态(0为空、1预订入住、2暂停使用)。 19 | private int userId; 20 | private User user; 21 | private Timestamp checkinTime; // 入住时间 22 | private String type; // 大床房、总统套房 23 | private Timestamp checkoutTime; // 退房时间 24 | 25 | /** 26 | * 27 | */ 28 | public Room() { 29 | } 30 | 31 | /** 32 | * @param id 33 | * @param name 34 | * @param price 35 | * @param fewHuman 36 | * @param status 37 | * @param userId 38 | * @param user 39 | * @param checkinTime 40 | * @param type 41 | * @param checkoutTime 42 | */ 43 | public Room(int id, String name, float price, int fewHuman, int status, int userId, User user, 44 | Timestamp checkinTime, String type, Timestamp checkoutTime) { 45 | this.id = id; 46 | this.name = name; 47 | this.price = price; 48 | this.fewHuman = fewHuman; 49 | this.status = status; 50 | this.userId = userId; 51 | this.user = user; 52 | this.checkinTime = checkinTime; 53 | this.type = type; 54 | this.checkoutTime = checkoutTime; 55 | } 56 | 57 | /** 58 | * @return the id 59 | */ 60 | public int getId() { 61 | return id; 62 | } 63 | 64 | /** 65 | * @param id 66 | * the id to set 67 | */ 68 | public void setId(int id) { 69 | this.id = id; 70 | } 71 | 72 | /** 73 | * @return the name 74 | */ 75 | public String getName() { 76 | return name; 77 | } 78 | 79 | /** 80 | * @param name 81 | * the name to set 82 | */ 83 | public void setName(String name) { 84 | this.name = name; 85 | } 86 | 87 | /** 88 | * @return the price 89 | */ 90 | public float getPrice() { 91 | return price; 92 | } 93 | 94 | /** 95 | * @param price 96 | * the price to set 97 | */ 98 | public void setPrice(float price) { 99 | this.price = price; 100 | } 101 | 102 | /** 103 | * @return the fewHuman 104 | */ 105 | public int getFewHuman() { 106 | return fewHuman; 107 | } 108 | 109 | /** 110 | * @param fewHuman 111 | * the fewHuman to set 112 | */ 113 | public void setFewHuman(int fewHuman) { 114 | this.fewHuman = fewHuman; 115 | } 116 | 117 | /** 118 | * @return the status 119 | */ 120 | public int getStatus() { 121 | return status; 122 | } 123 | 124 | /** 125 | * @param status 126 | * the status to set 127 | */ 128 | public void setStatus(int status) { 129 | this.status = status; 130 | } 131 | 132 | /** 133 | * @return the userId 134 | */ 135 | public int getUserId() { 136 | return userId; 137 | } 138 | 139 | /** 140 | * @param userId 141 | * the userId to set 142 | */ 143 | public void setUserId(int userId) { 144 | this.userId = userId; 145 | } 146 | 147 | /** 148 | * @return the user 149 | */ 150 | public User getUser() { 151 | return user; 152 | } 153 | 154 | /** 155 | * @param user 156 | * the user to set 157 | */ 158 | public void setUser(User user) { 159 | this.user = user; 160 | } 161 | 162 | /** 163 | * @return the checkinTime 164 | */ 165 | public Timestamp getCheckinTime() { 166 | return checkinTime; 167 | } 168 | 169 | /** 170 | * @param checkinTime 171 | * the checkinTime to set 172 | */ 173 | public void setCheckinTime(Timestamp checkinTime) { 174 | this.checkinTime = checkinTime; 175 | } 176 | 177 | /** 178 | * @return the type 179 | */ 180 | public String getType() { 181 | return type; 182 | } 183 | 184 | /** 185 | * @param type 186 | * the type to set 187 | */ 188 | public void setType(String type) { 189 | this.type = type; 190 | } 191 | 192 | /** 193 | * @return the checkoutTime 194 | */ 195 | public Timestamp getCheckoutTime() { 196 | return checkoutTime; 197 | } 198 | 199 | /** 200 | * @param checkoutTime 201 | * the checkoutTime to set 202 | */ 203 | public void setCheckoutTime(Timestamp checkoutTime) { 204 | this.checkoutTime = checkoutTime; 205 | } 206 | 207 | /* 208 | * (non-Javadoc) 209 | * 210 | * @see java.lang.Object#toString() 211 | */ 212 | @Override 213 | public String toString() { 214 | return "Room [id=" + id + ", name=" + name + ", price=" + price + ", fewHuman=" + fewHuman + ", status=" 215 | + status + ", userId=" + userId + ", user=" + user + ", checkinTime=" + checkinTime + ", type=" + type 216 | + ", checkoutTime=" + checkoutTime + "]"; 217 | } 218 | 219 | } 220 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /HotelCheck-inSystem.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS `hotel_check-in_system` /*!40100 DEFAULT CHARACTER SET utf8 */; 2 | USE `hotel_check-in_system`; 3 | -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) 4 | -- 5 | -- Host: localhost Database: hotel_check-in_system 6 | -- ------------------------------------------------------ 7 | -- Server version 5.7.21-log 8 | 9 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 10 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 11 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 12 | /*!40101 SET NAMES utf8 */; 13 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 14 | /*!40103 SET TIME_ZONE='+00:00' */; 15 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 16 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 17 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 18 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 19 | 20 | -- 21 | -- Table structure for table `fee` 22 | -- 23 | 24 | DROP TABLE IF EXISTS `fee`; 25 | /*!40101 SET @saved_cs_client = @@character_set_client */; 26 | /*!40101 SET character_set_client = utf8 */; 27 | CREATE TABLE `fee` ( 28 | `id` int(11) NOT NULL AUTO_INCREMENT, 29 | `fee` float NOT NULL, 30 | `memo` varchar(50) NOT NULL, 31 | `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 32 | PRIMARY KEY (`id`), 33 | UNIQUE KEY `id_UNIQUE` (`id`) 34 | ) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 COMMENT='收费信息管理???'; 35 | /*!40101 SET character_set_client = @saved_cs_client */; 36 | 37 | -- 38 | -- Dumping data for table `fee` 39 | -- 40 | 41 | LOCK TABLES `fee` WRITE; 42 | /*!40000 ALTER TABLE `fee` DISABLE KEYS */; 43 | INSERT INTO `fee` VALUES (34,400,'标间:','2018-05-24 13:13:13'),(35,210,'标间:','2018-05-24 13:13:26'),(36,0,'标间:','2018-05-24 13:21:27'),(37,0,'标间:','2018-05-24 13:21:30'),(38,0,'标间:','2018-05-24 13:21:42'),(39,109,'标间:','2018-05-24 13:23:03'); 44 | /*!40000 ALTER TABLE `fee` ENABLE KEYS */; 45 | UNLOCK TABLES; 46 | 47 | -- 48 | -- Table structure for table `goods` 49 | -- 50 | 51 | DROP TABLE IF EXISTS `goods`; 52 | /*!40101 SET @saved_cs_client = @@character_set_client */; 53 | /*!40101 SET character_set_client = utf8 */; 54 | CREATE TABLE `goods` ( 55 | `id` int(11) NOT NULL AUTO_INCREMENT, 56 | `name` varchar(20) NOT NULL, 57 | `price` float NOT NULL, 58 | PRIMARY KEY (`id`), 59 | UNIQUE KEY `id_UNIQUE` (`id`), 60 | UNIQUE KEY `name_UNIQUE` (`name`) 61 | ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='房间里的必须物品:食物、矿泉水、方便面(各项对应的价格)。'; 62 | /*!40101 SET character_set_client = @saved_cs_client */; 63 | 64 | -- 65 | -- Dumping data for table `goods` 66 | -- 67 | 68 | LOCK TABLES `goods` WRITE; 69 | /*!40000 ALTER TABLE `goods` DISABLE KEYS */; 70 | INSERT INTO `goods` VALUES (17,'SPA',520.99); 71 | /*!40000 ALTER TABLE `goods` ENABLE KEYS */; 72 | UNLOCK TABLES; 73 | 74 | -- 75 | -- Table structure for table `room` 76 | -- 77 | 78 | DROP TABLE IF EXISTS `room`; 79 | /*!40101 SET @saved_cs_client = @@character_set_client */; 80 | /*!40101 SET character_set_client = utf8 */; 81 | CREATE TABLE `room` ( 82 | `id` int(11) NOT NULL AUTO_INCREMENT, 83 | `name` varchar(6) NOT NULL, 84 | `price` float NOT NULL, 85 | `few_human` tinyint(2) NOT NULL, 86 | `status` tinyint(2) unsigned zerofill NOT NULL, 87 | `user` int(11) DEFAULT NULL, 88 | `checkin_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 89 | `type` varchar(8) NOT NULL, 90 | `checkout_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 91 | PRIMARY KEY (`id`), 92 | UNIQUE KEY `id_UNIQUE` (`id`), 93 | UNIQUE KEY `name_UNIQUE` (`name`), 94 | KEY `user_idx` (`user`), 95 | CONSTRAINT `user` FOREIGN KEY (`user`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION 96 | ) ENGINE=InnoDB AUTO_INCREMENT=105 DEFAULT CHARSET=utf8 COMMENT='房间信息:名称、价格、几人间、状态(0为空、预订、入住)。'; 97 | /*!40101 SET character_set_client = @saved_cs_client */; 98 | 99 | -- 100 | -- Dumping data for table `room` 101 | -- 102 | 103 | LOCK TABLES `room` WRITE; 104 | /*!40000 ALTER TABLE `room` DISABLE KEYS */; 105 | INSERT INTO `room` VALUES (102,'101',105,2,00,31,'1999-09-08 16:00:00','标间','1999-09-08 16:00:00'),(103,'102',100,2,00,31,'1999-09-08 16:00:00','标间','1999-09-08 16:00:00'),(104,'103',109,2,01,31,'2022-04-04 16:00:00','标间','2022-04-05 16:00:00'); 106 | /*!40000 ALTER TABLE `room` ENABLE KEYS */; 107 | UNLOCK TABLES; 108 | 109 | -- 110 | -- Table structure for table `user` 111 | -- 112 | 113 | DROP TABLE IF EXISTS `user`; 114 | /*!40101 SET @saved_cs_client = @@character_set_client */; 115 | /*!40101 SET character_set_client = utf8 */; 116 | CREATE TABLE `user` ( 117 | `id` int(11) NOT NULL AUTO_INCREMENT, 118 | `name` varchar(10) NOT NULL, 119 | `identity` varchar(40) NOT NULL, 120 | `type` int(11) NOT NULL, 121 | `password` varchar(20) NOT NULL, 122 | PRIMARY KEY (`id`), 123 | UNIQUE KEY `id_UNIQUE` (`id`), 124 | UNIQUE KEY `identity_UNIQUE` (`identity`), 125 | KEY `type_idx` (`type`), 126 | CONSTRAINT `type` FOREIGN KEY (`type`) REFERENCES `user_type` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION 127 | ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COMMENT='用户类型:(大于0是旅客)旅客类型:普通、会员。(小于0是管理员)管理员类型:超级管理员。'; 128 | /*!40101 SET character_set_client = @saved_cs_client */; 129 | 130 | -- 131 | -- Dumping data for table `user` 132 | -- 133 | 134 | LOCK TABLES `user` WRITE; 135 | /*!40000 ALTER TABLE `user` DISABLE KEYS */; 136 | INSERT INTO `user` VALUES (31,'MJCoder','6003',14,'6003'),(32,'测试','121213154',14,'3333'); 137 | /*!40000 ALTER TABLE `user` ENABLE KEYS */; 138 | UNLOCK TABLES; 139 | 140 | -- 141 | -- Table structure for table `user_type` 142 | -- 143 | 144 | DROP TABLE IF EXISTS `user_type`; 145 | /*!40101 SET @saved_cs_client = @@character_set_client */; 146 | /*!40101 SET character_set_client = utf8 */; 147 | CREATE TABLE `user_type` ( 148 | `id` int(11) NOT NULL AUTO_INCREMENT, 149 | `type` tinyint(6) NOT NULL, 150 | `memo` varchar(10) NOT NULL, 151 | PRIMARY KEY (`id`), 152 | UNIQUE KEY `id_UNIQUE` (`id`) 153 | ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='用户类型:(大于0是旅客)旅客类型:普通、会员。(小于0是管理员)管理员类型:超级管理员'; 154 | /*!40101 SET character_set_client = @saved_cs_client */; 155 | 156 | -- 157 | -- Dumping data for table `user_type` 158 | -- 159 | 160 | LOCK TABLES `user_type` WRITE; 161 | /*!40000 ALTER TABLE `user_type` DISABLE KEYS */; 162 | INSERT INTO `user_type` VALUES (14,-1,'超级管理员'),(15,1,'普通用户'); 163 | /*!40000 ALTER TABLE `user_type` ENABLE KEYS */; 164 | UNLOCK TABLES; 165 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 166 | 167 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 168 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 169 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 170 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 171 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 172 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 173 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 174 | 175 | -- Dump completed on 2018-05-24 21:25:53 176 | --------------------------------------------------------------------------------