@ -0,0 +1,25 @@
|
||||
/target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/build/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
@ -0,0 +1 @@
|
||||
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
|
||||
@ -0,0 +1,85 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : Mysql
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80026
|
||||
Source Host : localhost:3306
|
||||
Source Schema : jiudianmanage
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80026
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 20/10/2021 18:46:26
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for config
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config`;
|
||||
CREATE TABLE `config` (
|
||||
`id` int NOT NULL,
|
||||
`managesalary` double(10, 2) NULL DEFAULT NULL,
|
||||
`staffsalary` double(10, 2) NULL DEFAULT NULL,
|
||||
`cleanerssalary` double(10, 2) NULL DEFAULT NULL,
|
||||
`manage` double(10, 2) NULL DEFAULT NULL,
|
||||
`staff` double(10, 2) NULL DEFAULT NULL,
|
||||
`cleaner` double(10, 2) NULL DEFAULT NULL,
|
||||
`totalmoney` double(10, 2) NULL DEFAULT NULL,
|
||||
`totalroom` double(10, 2) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for order
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `order`;
|
||||
CREATE TABLE `order` (
|
||||
`orderid` int NOT NULL,
|
||||
`householdname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`ID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`starttime` datetime NULL DEFAULT NULL,
|
||||
`endtime` datetime NULL DEFAULT NULL,
|
||||
`money` double NULL DEFAULT NULL,
|
||||
`state` int NULL DEFAULT NULL,
|
||||
`roomid` int NULL DEFAULT NULL,
|
||||
`userid` int NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`orderid`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for room
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `room`;
|
||||
CREATE TABLE `room` (
|
||||
`roomid` int NOT NULL,
|
||||
`local` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`money` double NULL DEFAULT NULL,
|
||||
`state` int NULL DEFAULT NULL,
|
||||
`type` int NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`roomid`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `user`;
|
||||
CREATE TABLE `user` (
|
||||
`userid` int NOT NULL,
|
||||
`useraccount` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`age` int NULL DEFAULT NULL,
|
||||
`power` int NULL DEFAULT NULL,
|
||||
`IDnumber` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`money` double NULL DEFAULT NULL,
|
||||
`photoUrl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`phonenumber` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`userid`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@ -0,0 +1,225 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven2 Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Migwn, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
# TODO classpath?
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`which java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
@ -0,0 +1,143 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven2 Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||
|
||||
exit /B %ERROR_CODE%
|
||||
@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.jiudian</groupId>
|
||||
<artifactId>manage</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>manage</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot</artifactId>
|
||||
<version>2.0.4.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
<version>2.0.4.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 分页插件 -->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.2.7</version>
|
||||
</dependency>
|
||||
<!-- alibaba的druid数据库连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.1.10</version>
|
||||
</dependency>
|
||||
|
||||
<!--mysql连接-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.11</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!--<dependency>-->
|
||||
<!--<groupId>mysql</groupId>-->
|
||||
<!--<artifactId>mysql-connector-java</artifactId>-->
|
||||
<!--<version>5.1.32</version>-->
|
||||
<!--<scope>runtime</scope>-->
|
||||
<!--</dependency>-->
|
||||
|
||||
<!--mybatis-->
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter-test</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<!--数据库连接池-->
|
||||
<dependency>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>c3p0</artifactId>
|
||||
<version>0.9.5.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.5</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<defaultGoal>compile</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>com.jiudian.manage.ManageApplication</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- mybatis generator 自动生成代码插件 -->
|
||||
<plugin>
|
||||
<groupId>org.mybatis.generator</groupId>
|
||||
<artifactId>mybatis-generator-maven-plugin</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<configuration>
|
||||
<configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
|
||||
<overwrite>true</overwrite>
|
||||
<verbose>true</verbose>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,43 @@
|
||||
package com.jiudian.manage;
|
||||
|
||||
import com.jiudian.manage.config.CustomMVCConfiguration;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan(value = "com.jiudian.manage.mapper")
|
||||
public class ManageApplication extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ManageApplication.class, args);
|
||||
}
|
||||
|
||||
private CorsConfiguration buildConfig() {
|
||||
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
corsConfiguration.addAllowedOrigin("*");
|
||||
corsConfiguration.addAllowedHeader("*");
|
||||
corsConfiguration.addAllowedMethod("*");
|
||||
return corsConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨域过滤器
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", buildConfig()); // 4
|
||||
return new CorsFilter(source);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.jiudian.manage.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class CustomMVCConfiguration extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Bean
|
||||
public HttpMessageConverter<String> responseBodyConverter() {
|
||||
StringHttpMessageConverter converter = new StringHttpMessageConverter(
|
||||
Charset.forName("UTF-8"));
|
||||
return converter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureMessageConverters(
|
||||
List<HttpMessageConverter<?>> converters) {
|
||||
super.configureMessageConverters(converters);
|
||||
converters.add(responseBodyConverter());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureContentNegotiation(
|
||||
ContentNegotiationConfigurer configurer) {
|
||||
configurer.favorPathExtension(false);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.jiudian.manage.controller;
|
||||
|
||||
import com.jiudian.manage.model.Config;
|
||||
import com.jiudian.manage.service.ConfigService;
|
||||
import com.jiudian.manage.until.State;
|
||||
import com.jiudian.manage.until.StateSignal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/config")
|
||||
public class ConfigController {
|
||||
@Autowired
|
||||
ConfigService configService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getConfig.do")
|
||||
public Map getConfig(){
|
||||
Config config = configService.get();
|
||||
StateSignal signal = new StateSignal();
|
||||
if(config!=null){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
signal.put("config",config);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配置
|
||||
* @param managesalary 经理薪水百分比
|
||||
* @param staffsalary 员工薪水百分比
|
||||
* @param cleanerssalary 保洁员薪水百分比
|
||||
* @param manage 经理底薪
|
||||
* @param staff 员工底薪
|
||||
* @param cleaner 保洁员底薪
|
||||
* @param totalmoney 总营业额
|
||||
* @param totalroom 总卖出房数
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/updateConfig.do")
|
||||
public Map updateConfig(@RequestParam double managesalary,@RequestParam double staffsalary,@RequestParam double cleanerssalary,@RequestParam double manage,@RequestParam double staff,@RequestParam double cleaner,@RequestParam(required = false,defaultValue = "-1") double totalmoney,@RequestParam(required = false,defaultValue = "-1") double totalroom){
|
||||
boolean update = configService.update(managesalary, staffsalary, cleanerssalary, manage, staff, cleaner, totalmoney, totalroom);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(update){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.jiudian.manage.controller;
|
||||
|
||||
import com.jiudian.manage.service.UserService;
|
||||
import com.jiudian.manage.until.FileUtil;
|
||||
import com.jiudian.manage.until.State;
|
||||
import com.jiudian.manage.until.StateSignal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/upFile")
|
||||
public class FileController {
|
||||
@Autowired
|
||||
UserService userService;
|
||||
|
||||
@RequestMapping("/upFilePhoto.do")
|
||||
public Map upFilePhoto(@RequestParam MultipartFile file,@RequestParam int userid){
|
||||
String fileName = UUID.randomUUID().toString()+file.getOriginalFilename();
|
||||
|
||||
String filePath = ".\\src\\main\\resources\\static\\File\\";
|
||||
String RealfilePath = "File\\"+fileName;
|
||||
boolean photo = userService.photo(userid, RealfilePath);
|
||||
boolean b = false;
|
||||
try {
|
||||
b = FileUtil.uploadFile(file.getBytes(), filePath, fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StateSignal signal = new StateSignal();
|
||||
if(b&&photo){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package com.jiudian.manage.controller;
|
||||
|
||||
import com.jiudian.manage.model.Room;
|
||||
import com.jiudian.manage.service.RoomService;
|
||||
import com.jiudian.manage.until.State;
|
||||
import com.jiudian.manage.until.StateSignal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/room")
|
||||
public class RoomController {
|
||||
@Autowired
|
||||
RoomService roomService;
|
||||
@RequestMapping("/addRoom.do")
|
||||
public Map addRoom(@RequestParam String local,@RequestParam double money,@RequestParam int state,@RequestParam int type){
|
||||
boolean b = roomService.addRoom(local, money, state, type);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(b){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
@RequestMapping("/delRoom.do")
|
||||
public Map delRoom(@RequestParam int roomid){
|
||||
boolean b = roomService.delRoom(roomid);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(b){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
@RequestMapping("/getRoom.do")
|
||||
public Map selectRoom(@RequestParam int state,@RequestParam int type,@RequestParam int pageNum,@RequestParam int pageSize){
|
||||
List<Room> roomByState = roomService.getRoomByState(state, type,pageNum,pageSize);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(roomByState!=null){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
signal.put("List",roomByState);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
@RequestMapping("/updateRoom.do")
|
||||
public Map updateRoom(@RequestParam int roomid,@RequestParam(required = false,defaultValue = "null") String local,@RequestParam(required = false,defaultValue = "-1") double money,@RequestParam(required = false,defaultValue = "-1") int state,@RequestParam(required = false,defaultValue = "-1") int type){
|
||||
boolean b = roomService.updateRoom(roomid, local, money, state, type);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(b){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
@RequestMapping("/getRoomById.do")
|
||||
public Map getRoomById(@RequestParam int roomid){
|
||||
Room b = roomService.getRoomById(roomid);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(b!=null){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
signal.put("room",b);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,189 @@
|
||||
package com.jiudian.manage.controller;
|
||||
|
||||
import com.jiudian.manage.model.User;
|
||||
import com.jiudian.manage.service.impl.UserServiceImpl;
|
||||
import com.jiudian.manage.until.ImageCode;
|
||||
import com.jiudian.manage.until.State;
|
||||
import com.jiudian.manage.until.StateSignal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/user")
|
||||
public class UserController {
|
||||
@Autowired
|
||||
UserServiceImpl userService;
|
||||
|
||||
/**
|
||||
* 登录(已测试)
|
||||
* @param useraccount
|
||||
* @param password
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/login.do")
|
||||
public Map login(@RequestParam String useraccount, @RequestParam String password,@RequestParam String icode,HttpSession session){
|
||||
StateSignal signal = new StateSignal();
|
||||
String code = (String) session.getAttribute(ImageCode.CODENAME);
|
||||
System.out.println("session: "+code+" 实际"+icode);
|
||||
if(icode!=null&&code!=null&&icode.equals(code)){
|
||||
int[] login = userService.login(useraccount, password);
|
||||
if(login!=null){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
signal.put("userid",login[0]);
|
||||
signal.put("power",login[1]);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
}else{
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put("message","验证码输入错误");
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
@GetMapping("/createImage")
|
||||
public void createImage(@RequestParam String code, HttpServletResponse response, HttpSession session) throws IOException {
|
||||
ImageCode.createImage(response,session);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户(已测试)
|
||||
* @param useraccount 用户名
|
||||
* @param password 密码
|
||||
* @param power 权限
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/addUser.do")
|
||||
public Map addUser(@RequestParam String useraccount, @RequestParam String password, @RequestParam String power){
|
||||
boolean add = userService.addUser(useraccount,password,Integer.parseInt(power));
|
||||
StateSignal signal = new StateSignal();
|
||||
if(add){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户数据(已测试)
|
||||
* @param userid
|
||||
* @param password
|
||||
* @param username
|
||||
* @param age
|
||||
* @param power
|
||||
* @param IDnumber
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/updateUser.do")
|
||||
public Map updateUser(@RequestParam int userid,@RequestParam(required = false,defaultValue = "null") String password,@RequestParam(required = false,defaultValue = "null") String username,@RequestParam(required = false,defaultValue = "-1") int age,@RequestParam(required = false,defaultValue = "-1") int power,@RequestParam(required = false,defaultValue = "null") String IDnumber,@RequestParam(required = false,defaultValue = "null") String phonenumber){
|
||||
boolean upd = userService.alterUser(userid, password, username, age, power, IDnumber,phonenumber);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(upd){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户(已测试)
|
||||
* @param userid 用户id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delUser.do")
|
||||
public Map delUser(@RequestParam("userid")Integer userid){
|
||||
boolean del = userService.delUser(userid);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(del){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表(已测试)
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getAllUser.do")
|
||||
public Map getAllUser(@RequestParam int pageNum,@RequestParam int pageSize){
|
||||
List<User> allUser = userService.getAllUser(pageNum,pageSize);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(allUser!=null){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
signal.put("List",allUser);
|
||||
signal.put("pageNum",pageNum);
|
||||
signal.put("pageSize",pageSize);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应权限的用户列表
|
||||
* @param power
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getUserByPower.do")
|
||||
public Map getUserByPower(@RequestParam int power,@RequestParam int pageNum,@RequestParam int pageSize){
|
||||
List<User> Users = userService.getUserByPower(power,pageNum,pageSize);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(Users!=null){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
signal.put("List",Users);
|
||||
signal.put("pageNum",pageNum);
|
||||
signal.put("pageSize",pageSize);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过userid获取信息
|
||||
* @param userid 用户id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getUserById.do")
|
||||
public Map getUserById(@RequestParam int userid){
|
||||
User user = userService.selectUser(userid);
|
||||
StateSignal signal = new StateSignal();
|
||||
if(user!=null){
|
||||
signal.put(State.SuccessCode);
|
||||
signal.put(State.SuccessMessage);
|
||||
signal.put("user",user);
|
||||
}else {
|
||||
signal.put(State.ErrorCode);
|
||||
signal.put(State.ErrorMessage);
|
||||
}
|
||||
return signal.getResult();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.jiudian.manage.mapper;
|
||||
|
||||
import com.jiudian.manage.model.Config;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface ConfigMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Config record);
|
||||
|
||||
int insertSelective(Config record);
|
||||
|
||||
Config selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(Config record);
|
||||
|
||||
int updateByPrimaryKey(Config record);
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.jiudian.manage.mapper;
|
||||
|
||||
import com.jiudian.manage.model.Order;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface OrderMapper {
|
||||
int deleteByPrimaryKey(Integer orderid);
|
||||
|
||||
int insert(Order record);
|
||||
|
||||
int insertSelective(Order record);
|
||||
|
||||
Order selectByPrimaryKey(Integer orderid);
|
||||
|
||||
int updateByPrimaryKeySelective(Order record);
|
||||
|
||||
int updateByPrimaryKey(Order record);
|
||||
|
||||
List<Order> getAllUser();
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.jiudian.manage.mapper;
|
||||
|
||||
import com.jiudian.manage.model.Room;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface RoomMapper {
|
||||
int deleteByPrimaryKey(Integer roomid);
|
||||
|
||||
int insert(Room record);
|
||||
|
||||
int insertSelective(Room record);
|
||||
|
||||
Room selectByPrimaryKey(Integer roomid);
|
||||
|
||||
int updateByPrimaryKeySelective(Room record);
|
||||
|
||||
int updateByPrimaryKey(Room record);
|
||||
|
||||
List<Room> selectRoomByStateType(Room stateType);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.jiudian.manage.mapper;
|
||||
|
||||
import com.jiudian.manage.model.User;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@Repository
|
||||
public interface UserMapper {
|
||||
int deleteByPrimaryKey(Integer userid);
|
||||
|
||||
int insert(User record);
|
||||
|
||||
int insertSelective(User record);
|
||||
|
||||
User selectByPrimaryKey(Integer userid);
|
||||
|
||||
int updateByPrimaryKeySelective(User record);
|
||||
|
||||
int updateByPrimaryKey(User record);
|
||||
|
||||
List<User> getAllUser();
|
||||
|
||||
List<User> selectByPower(Integer power);
|
||||
|
||||
User selectByAccount(String useraccount);
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.jiudian.manage.model;
|
||||
|
||||
public class Config {
|
||||
private Integer id;
|
||||
|
||||
private Double managesalary;
|
||||
|
||||
private Double staffsalary;
|
||||
|
||||
private Double cleanerssalary;
|
||||
|
||||
private Double manage;
|
||||
|
||||
private Double staff;
|
||||
|
||||
private Double cleaner;
|
||||
|
||||
private Double totalmoney;
|
||||
|
||||
private Double totalroom;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Double getManagesalary() {
|
||||
return managesalary;
|
||||
}
|
||||
|
||||
public void setManagesalary(Double managesalary) {
|
||||
this.managesalary = managesalary;
|
||||
}
|
||||
|
||||
public Double getStaffsalary() {
|
||||
return staffsalary;
|
||||
}
|
||||
|
||||
public void setStaffsalary(Double staffsalary) {
|
||||
this.staffsalary = staffsalary;
|
||||
}
|
||||
|
||||
public Double getCleanerssalary() {
|
||||
return cleanerssalary;
|
||||
}
|
||||
|
||||
public void setCleanerssalary(Double cleanerssalary) {
|
||||
this.cleanerssalary = cleanerssalary;
|
||||
}
|
||||
|
||||
public Double getManage() {
|
||||
return manage;
|
||||
}
|
||||
|
||||
public void setManage(Double manage) {
|
||||
this.manage = manage;
|
||||
}
|
||||
|
||||
public Double getStaff() {
|
||||
return staff;
|
||||
}
|
||||
|
||||
public void setStaff(Double staff) {
|
||||
this.staff = staff;
|
||||
}
|
||||
|
||||
public Double getCleaner() {
|
||||
return cleaner;
|
||||
}
|
||||
|
||||
public void setCleaner(Double cleaner) {
|
||||
this.cleaner = cleaner;
|
||||
}
|
||||
|
||||
public Double getTotalmoney() {
|
||||
return totalmoney;
|
||||
}
|
||||
|
||||
public void setTotalmoney(Double totalmoney) {
|
||||
this.totalmoney = totalmoney;
|
||||
}
|
||||
|
||||
public Double getTotalroom() {
|
||||
return totalroom;
|
||||
}
|
||||
|
||||
public void setTotalroom(Double totalroom) {
|
||||
this.totalroom = totalroom;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package com.jiudian.manage.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Order {
|
||||
private Integer orderid;
|
||||
|
||||
private String householdname;
|
||||
|
||||
private String id;
|
||||
|
||||
private Date starttime;
|
||||
|
||||
private Date endtime;
|
||||
|
||||
private Double money;
|
||||
|
||||
private Integer state;
|
||||
|
||||
private Integer roomid;
|
||||
|
||||
private Integer userid;
|
||||
|
||||
public Integer getOrderid() {
|
||||
return orderid;
|
||||
}
|
||||
|
||||
public void setOrderid(Integer orderid) {
|
||||
this.orderid = orderid;
|
||||
}
|
||||
|
||||
public String getHouseholdname() {
|
||||
return householdname;
|
||||
}
|
||||
|
||||
public void setHouseholdname(String householdname) {
|
||||
this.householdname = householdname == null ? null : householdname.trim();
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id == null ? null : id.trim();
|
||||
}
|
||||
|
||||
public Date getStarttime() {
|
||||
return starttime;
|
||||
}
|
||||
|
||||
public void setStarttime(Date starttime) {
|
||||
this.starttime = starttime;
|
||||
}
|
||||
|
||||
public Date getEndtime() {
|
||||
return endtime;
|
||||
}
|
||||
|
||||
public void setEndtime(Date endtime) {
|
||||
this.endtime = endtime;
|
||||
}
|
||||
|
||||
public Double getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(Double money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Integer getRoomid() {
|
||||
return roomid;
|
||||
}
|
||||
|
||||
public void setRoomid(Integer roomid) {
|
||||
this.roomid = roomid;
|
||||
}
|
||||
|
||||
public Integer getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(Integer userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.jiudian.manage.model;
|
||||
|
||||
public class Room {
|
||||
private Integer roomid;
|
||||
|
||||
private String local;
|
||||
|
||||
private Double money;
|
||||
|
||||
private Integer state;
|
||||
|
||||
private Integer type;
|
||||
|
||||
public Integer getRoomid() {
|
||||
return roomid;
|
||||
}
|
||||
|
||||
public void setRoomid(Integer roomid) {
|
||||
this.roomid = roomid;
|
||||
}
|
||||
|
||||
public String getLocal() {
|
||||
return local;
|
||||
}
|
||||
|
||||
public void setLocal(String local) {
|
||||
this.local = local == null ? null : local.trim();
|
||||
}
|
||||
|
||||
public Double getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(Double money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package com.jiudian.manage.model;
|
||||
|
||||
public class User {
|
||||
private Integer userid;
|
||||
|
||||
private String useraccount;
|
||||
|
||||
private String password;
|
||||
|
||||
private String username;
|
||||
|
||||
private Integer age;
|
||||
|
||||
private Integer power;
|
||||
|
||||
private String idnumber;
|
||||
|
||||
private Double money;
|
||||
|
||||
private String photourl;
|
||||
|
||||
private String phonenumber;
|
||||
|
||||
public Integer getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(Integer userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getUseraccount() {
|
||||
return useraccount;
|
||||
}
|
||||
|
||||
public void setUseraccount(String useraccount) {
|
||||
this.useraccount = useraccount == null ? null : useraccount.trim();
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password == null ? null : password.trim();
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username == null ? null : username.trim();
|
||||
}
|
||||
|
||||
public Integer getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(Integer age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public Integer getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
public void setPower(Integer power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public String getIdnumber() {
|
||||
return idnumber;
|
||||
}
|
||||
|
||||
public void setIdnumber(String idnumber) {
|
||||
this.idnumber = idnumber == null ? null : idnumber.trim();
|
||||
}
|
||||
|
||||
public Double getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(Double money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public String getPhotourl() {
|
||||
return photourl;
|
||||
}
|
||||
|
||||
public void setPhotourl(String photourl) {
|
||||
this.photourl = photourl == null ? null : photourl.trim();
|
||||
}
|
||||
|
||||
public String getPhonenumber() {
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber) {
|
||||
this.phonenumber = phonenumber == null ? null : phonenumber.trim();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.jiudian.manage.service;
|
||||
|
||||
import com.jiudian.manage.model.Config;
|
||||
|
||||
public interface ConfigService {
|
||||
public Config get();
|
||||
public boolean update(double managesalary,double staffsalary, double cleanerssalary, double manage, double staff, double cleaner, double totalmoney, double totalroom);
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.jiudian.manage.service;
|
||||
|
||||
import com.jiudian.manage.model.Order;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface OrderService {
|
||||
/**
|
||||
* 增加订单
|
||||
* @param householdname
|
||||
* @param id
|
||||
* @param starttime
|
||||
* @param endtime
|
||||
* @param roomid
|
||||
* @param userid
|
||||
* @return
|
||||
*/
|
||||
public boolean addOrder(String householdname, String id, String starttime, String endtime, int roomid, int userid);
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
* @param orderid
|
||||
* @return
|
||||
*/
|
||||
public boolean delOrder(int orderid);
|
||||
|
||||
/**
|
||||
* 修改订单状态
|
||||
* @param orderid
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public boolean updateOrderState(int orderid,int state);
|
||||
|
||||
/**
|
||||
*获取所有订单
|
||||
* @return
|
||||
*/
|
||||
public List<Order> getAllOrder(int pageNum, int pageSize);
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.jiudian.manage.service;
|
||||
|
||||
import com.jiudian.manage.model.Room;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RoomService {
|
||||
/**
|
||||
* 添加一个新房间
|
||||
* @param local 位置
|
||||
* @param money 价格
|
||||
* @param state 状态
|
||||
* @param type 类型
|
||||
* @return
|
||||
*/
|
||||
public boolean addRoom(String local,double money,int state,int type);
|
||||
|
||||
/**
|
||||
* 删除一个房间
|
||||
* @param roomid 房间id
|
||||
* @return
|
||||
*/
|
||||
public boolean delRoom(int roomid);
|
||||
|
||||
/**
|
||||
* 修改房间信息
|
||||
* @param roomid 房间id
|
||||
* @param local 房间位置
|
||||
* @param money 房间价格
|
||||
* @param state 房间状态
|
||||
* @param type 房间类型
|
||||
* @return
|
||||
*/
|
||||
public boolean updateRoom(int roomid,String local,double money,int state,int type);
|
||||
|
||||
/**
|
||||
* 修改房间状态
|
||||
* @param roomid 房间id
|
||||
* @param state 房间状态
|
||||
* @return
|
||||
*/
|
||||
public boolean updateRoomState(int roomid,int state);
|
||||
|
||||
/**
|
||||
* 获取某一状态或者类型的房间
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public List<Room> getRoomByState(int state,int type,int pageNum,int pageSize);
|
||||
|
||||
/**
|
||||
* 通过房间id获取房间信息
|
||||
* @param roomid 房间id
|
||||
* @return
|
||||
*/
|
||||
public Room getRoomById(int roomid);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package com.jiudian.manage.service;
|
||||
|
||||
import com.jiudian.manage.model.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserService {
|
||||
|
||||
public User selectUser(int userid);
|
||||
/**
|
||||
* 添加用户
|
||||
* @param account 用户名
|
||||
* @param password 密码
|
||||
* @param power 权限
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
public boolean addUser(String account,String password,int power);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param userid 账户名
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
public boolean delUser(int userid);
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
* @param userid 用户id
|
||||
* @param password 用户面
|
||||
* @param username 用户真实姓名
|
||||
* @param age 用户年龄
|
||||
* @param power 用户权限
|
||||
* @param IDnumber 工号
|
||||
* @param phonenumber 手机号
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
public boolean alterUser(int userid,String password,String username,int age,int power,String IDnumber,String phonenumber);
|
||||
|
||||
/**
|
||||
* 修改用户的业绩(服务器内部调用)
|
||||
* @param userid 用户id
|
||||
* @param money 增加的业绩额
|
||||
* @return 是否成功
|
||||
*/
|
||||
public boolean addSlary(int userid,double money);
|
||||
|
||||
/**
|
||||
* 获得所有的用户
|
||||
* @return 返回List集合
|
||||
*/
|
||||
public List<User> getAllUser(int pageNum,int pageSize);
|
||||
|
||||
/**
|
||||
* 获取相应权限的用户
|
||||
* @param power
|
||||
* @return
|
||||
*/
|
||||
public List<User> getUserByPower(int power,int pageNum,int pageSize);
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
* @param username 用户名
|
||||
* @param password 密码
|
||||
* @return 用户id和用户权限等级
|
||||
*/
|
||||
public int[] login(String username,String password);
|
||||
|
||||
|
||||
/**
|
||||
* 修改头像
|
||||
*/
|
||||
public boolean photo(int userid,String url);
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.jiudian.manage.service.impl;
|
||||
|
||||
import com.jiudian.manage.mapper.ConfigMapper;
|
||||
import com.jiudian.manage.model.Config;
|
||||
import com.jiudian.manage.service.ConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ConfigServiceImpl implements ConfigService {
|
||||
@Autowired
|
||||
ConfigMapper configMapper;
|
||||
|
||||
@Override
|
||||
public Config get() {
|
||||
return configMapper.selectByPrimaryKey(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(double managesalary, double staffsalary, double cleanerssalary, double manage, double staff, double cleaner, double totalmoney, double totalroom) {
|
||||
Config config = new Config();
|
||||
config.setId(1);
|
||||
config.setManagesalary(managesalary);
|
||||
config.setStaffsalary(staffsalary);
|
||||
config.setCleanerssalary(cleanerssalary);
|
||||
config.setManage(manage);
|
||||
config.setStaff(staff);
|
||||
config.setCleaner(cleaner);
|
||||
if(totalmoney!=-1){
|
||||
config.setTotalmoney(totalmoney);
|
||||
}
|
||||
if(totalroom!=-1){
|
||||
config.setTotalroom(totalroom);
|
||||
}
|
||||
int i = configMapper.updateByPrimaryKeySelective(config);
|
||||
return i>0?true:false;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
package com.jiudian.manage.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.jiudian.manage.mapper.ConfigMapper;
|
||||
import com.jiudian.manage.mapper.OrderMapper;
|
||||
import com.jiudian.manage.mapper.RoomMapper;
|
||||
import com.jiudian.manage.model.Config;
|
||||
import com.jiudian.manage.model.Order;
|
||||
import com.jiudian.manage.model.Room;
|
||||
import com.jiudian.manage.service.OrderService;
|
||||
import com.jiudian.manage.until.TimeUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class OrderServiceImpl implements OrderService {
|
||||
@Autowired
|
||||
OrderMapper orderMapper;
|
||||
@Autowired
|
||||
RoomMapper roomMapper;
|
||||
@Autowired
|
||||
ConfigMapper configMapper;
|
||||
|
||||
@Override
|
||||
public boolean addOrder(String householdname, String id, String starttime, String endtime, int roomid, int userid) {
|
||||
Room room = roomMapper.selectByPrimaryKey(roomid);
|
||||
if(room.getState()!=1){
|
||||
return false;
|
||||
}
|
||||
Order order = new Order();
|
||||
order.setHouseholdname(householdname);
|
||||
order.setId(id);
|
||||
order.setStarttime(TimeUtil.formatterTime(starttime));
|
||||
order.setEndtime(TimeUtil.formatterTime(endtime));
|
||||
order.setRoomid(roomid);
|
||||
order.setUserid(userid);
|
||||
order.setState(0);
|
||||
double money = TimeUtil.getBetweenDay(starttime,endtime)*room.getMoney();
|
||||
order.setMoney(money);
|
||||
|
||||
Config config = configMapper.selectByPrimaryKey(1);
|
||||
config.setTotalroom(config.getTotalroom()+1);
|
||||
config.setTotalmoney(config.getTotalmoney()+money);
|
||||
configMapper.updateByPrimaryKeySelective(config);
|
||||
|
||||
int insert = orderMapper.insertSelective(order);
|
||||
if(insert>0){
|
||||
Room room1 = new Room();
|
||||
room1.setRoomid(roomid);
|
||||
room1.setState(2);
|
||||
int i = roomMapper.updateByPrimaryKeySelective(room1);
|
||||
if(i>0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delOrder(int orderid) {
|
||||
Order order = orderMapper.selectByPrimaryKey(orderid);
|
||||
Integer roomid = order.getRoomid();
|
||||
Room room = new Room();
|
||||
room.setRoomid(roomid);
|
||||
room.setState(1);
|
||||
int i = roomMapper.updateByPrimaryKeySelective(room);
|
||||
if(i>0){
|
||||
int i1 = orderMapper.deleteByPrimaryKey(orderid);
|
||||
if(i1>0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateOrderState(int orderid, int state) {
|
||||
Order order = orderMapper.selectByPrimaryKey(orderid);
|
||||
if(order==null){
|
||||
return false;
|
||||
}
|
||||
Integer roomid = order.getRoomid();
|
||||
Room room = new Room();
|
||||
room.setRoomid(roomid);
|
||||
int i = 1;
|
||||
if(state==2){
|
||||
room.setState(3);
|
||||
i = roomMapper.updateByPrimaryKeySelective(room);
|
||||
}
|
||||
if(state==3){
|
||||
room.setState(1);
|
||||
i = roomMapper.updateByPrimaryKeySelective(room);
|
||||
}
|
||||
order.setState(state);
|
||||
if(i>0){
|
||||
int i1 = orderMapper.updateByPrimaryKeySelective(order);
|
||||
if(i1>0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Order> getAllOrder(int pageNum, int pageSize) {
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
return orderMapper.getAllUser();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.jiudian.manage.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.jiudian.manage.mapper.RoomMapper;
|
||||
import com.jiudian.manage.model.Room;
|
||||
import com.jiudian.manage.service.RoomService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class RoomServiceImpl implements RoomService {
|
||||
@Autowired
|
||||
RoomMapper roomMapper;
|
||||
|
||||
@Override
|
||||
public boolean addRoom(String local, double money, int state, int type) {
|
||||
Room room = new Room();
|
||||
room.setLocal(local);
|
||||
room.setMoney(money);
|
||||
room.setState(state);
|
||||
room.setType(type);
|
||||
int i = roomMapper.insertSelective(room);
|
||||
return i>0?true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delRoom(int roomid) {
|
||||
int i = roomMapper.deleteByPrimaryKey(roomid);
|
||||
return i>0?true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateRoom(int roomid, String local, double money, int state, int type) {
|
||||
Room room = new Room();
|
||||
room.setRoomid(roomid);
|
||||
if(!local.equals("null")){
|
||||
room.setLocal(local);
|
||||
}
|
||||
if(money!=-1){
|
||||
room.setMoney(money);
|
||||
}
|
||||
if(state!=-1){
|
||||
room.setState(state);
|
||||
}
|
||||
if(type!=-1){
|
||||
room.setType(type);
|
||||
}
|
||||
int i = roomMapper.updateByPrimaryKeySelective(room);
|
||||
return i>0?true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateRoomState(int roomid, int state) {
|
||||
Room room = new Room();
|
||||
room.setRoomid(roomid);
|
||||
room.setState(state);
|
||||
int i = roomMapper.updateByPrimaryKeySelective(room);
|
||||
return i>0?true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Room> getRoomByState(int state, int type,int pageNum,int pageSize) {
|
||||
Room room = new Room();
|
||||
if(state!=-1){
|
||||
room.setState(state);
|
||||
}
|
||||
if(type!=-1){
|
||||
room.setType(type);
|
||||
}
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
return roomMapper.selectRoomByStateType(room);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Room getRoomById(int roomid) {
|
||||
return roomMapper.selectByPrimaryKey(roomid);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.jiudian.manage.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.jiudian.manage.mapper.UserMapper;
|
||||
import com.jiudian.manage.model.User;
|
||||
import com.jiudian.manage.service.UserService;
|
||||
import com.jiudian.manage.until.UUIDUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserServiceImpl implements UserService {
|
||||
@Autowired
|
||||
UserMapper userMapper;
|
||||
|
||||
@Override
|
||||
public User selectUser(int userid) {
|
||||
return userMapper.selectByPrimaryKey(userid);
|
||||
}
|
||||
|
||||
public boolean addUser(String account, String password, int power){
|
||||
User user = new User();
|
||||
user.setUseraccount(account);
|
||||
user.setPassword(password);
|
||||
user.setPower(power);
|
||||
user.setIdnumber(UUIDUtil.generateShortUuid());
|
||||
int insert = userMapper.insertSelective(user);
|
||||
return insert>0?true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delUser(int userid) {
|
||||
int i = userMapper.deleteByPrimaryKey(userid);
|
||||
return i>0?true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alterUser(int userid, String password, String username, int age, int power, String IDnumber,String phonenumber) {
|
||||
User user = new User();
|
||||
user.setUserid(userid);
|
||||
if(!password.equals("null")){
|
||||
user.setPassword(password);
|
||||
}
|
||||
if(!username.equals("null")){
|
||||
user.setUsername(username);
|
||||
}
|
||||
if(age!=-1){
|
||||
user.setAge(age);
|
||||
}
|
||||
if(power!=-1){
|
||||
user.setPower(power);
|
||||
}
|
||||
if(!IDnumber.equals("null")){
|
||||
user.setIdnumber(IDnumber);
|
||||
}
|
||||
if(!phonenumber.equals("null")){
|
||||
user.setPhonenumber(phonenumber);
|
||||
}
|
||||
int i = userMapper.updateByPrimaryKeySelective(user);
|
||||
return i>0?true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addSlary(int userid, double money) {
|
||||
User user = userMapper.selectByPrimaryKey(userid);
|
||||
Double money1 = user.getMoney();
|
||||
user.setMoney(money+money1);
|
||||
int i = userMapper.updateByPrimaryKey(user);
|
||||
return i>0?true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getAllUser(int pageNum,int pageSize) {
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
return userMapper.getAllUser();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getUserByPower(int power,int pageNum,int pageSize) {
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
return userMapper.selectByPower(power);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] login(String username, String password) {
|
||||
User user = userMapper.selectByAccount(username);
|
||||
if(user!=null&&user.getPassword().equals(password)){
|
||||
return new int[]{user.getUserid(),user.getPower()};
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean photo(int userid, String url) {
|
||||
User user = new User();
|
||||
user.setUserid(userid);
|
||||
user.setPhotourl(url);
|
||||
int i = userMapper.updateByPrimaryKeySelective(user);
|
||||
return i>0?true:false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jiudian.manage.until;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
public class FileUtil {
|
||||
public static boolean uploadFile(byte[] file, String filePath, String fileName) throws Exception {
|
||||
File targetFile = new File(filePath);
|
||||
if(!targetFile.exists()){
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
FileOutputStream out = new FileOutputStream(filePath+fileName);
|
||||
out.write(file);
|
||||
out.flush();
|
||||
out.close();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.jiudian.manage.until;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
public class ImageCode {
|
||||
public static final String CODENAME="ImageCode";
|
||||
public static void createImage(HttpServletResponse response, HttpSession session) throws IOException {
|
||||
BufferedImage image = new BufferedImage(80, 30, BufferedImage.TYPE_INT_RGB);
|
||||
Graphics g = image.getGraphics();
|
||||
Random r = new Random();
|
||||
g.setColor(new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255)));
|
||||
g.fillRect(0, 0, 80, 20);
|
||||
//获取生成的验证码
|
||||
String code = getNumber();
|
||||
//绑定验证码
|
||||
session.setAttribute(CODENAME, code);
|
||||
g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 25));
|
||||
g.setColor(new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255)));
|
||||
g.drawString(code, 5, 25);
|
||||
//设置消息头
|
||||
response.setContentType("image/jpeg");
|
||||
OutputStream os = response.getOutputStream();
|
||||
ImageIO.write(image, "jpeg", os);
|
||||
}
|
||||
public static String getNumber(){
|
||||
String str = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
String code = "";
|
||||
for(int i= 0;i<4;i++){
|
||||
int index = (int)(Math.random()*str.length());
|
||||
code+=str.charAt(index);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.jiudian.manage.until;
|
||||
|
||||
public enum State {
|
||||
SuccessCode("code","0"),SuccessMessage("message","成功"),
|
||||
ErrorCode("code","-1"),ErrorMessage("message","失败")
|
||||
;
|
||||
|
||||
|
||||
public String name;
|
||||
public String message;
|
||||
State(String name,String message) {
|
||||
this.name = name;
|
||||
this.message = message;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.jiudian.manage.until;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class StateSignal {
|
||||
HashMap<String,Object> result = new HashMap<String,Object>();
|
||||
|
||||
public void put(State state){
|
||||
result.put(state.name,state.message);
|
||||
}
|
||||
public void put(String name,Object val){
|
||||
result.put(name,val);
|
||||
}
|
||||
public HashMap<String, Object> getResult() {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.jiudian.manage.until;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
public class TimeUtil {
|
||||
/**
|
||||
* 获取两个时间段的天数从date2-date1
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static int getBetweenDay(String date1, String date2) {
|
||||
Calendar d1 = new GregorianCalendar();
|
||||
d1.setTime(formatterTime(date1));
|
||||
Calendar d2 = new GregorianCalendar();
|
||||
d2.setTime(formatterTime(date2));
|
||||
int days = d2.get(Calendar.DAY_OF_YEAR) - d1.get(Calendar.DAY_OF_YEAR);
|
||||
int y2 = d2.get(Calendar.YEAR);
|
||||
if (d1.get(Calendar.YEAR) != y2) {
|
||||
do {
|
||||
days += d1.getActualMaximum(Calendar.DAY_OF_YEAR);
|
||||
d1.add(Calendar.YEAR, 1);
|
||||
} while (d1.get(Calendar.YEAR) != y2);
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
||||
public static Date formatterTime(String date){
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date newDate=null;
|
||||
try {
|
||||
newDate= formatter.parse(date);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return newDate;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.jiudian.manage.until;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class UUIDUtil {
|
||||
public static String[] chars = new String[] { "a", "b", "c", "d", "e", "f",
|
||||
"g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
|
||||
"t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5",
|
||||
"6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I",
|
||||
"J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
|
||||
"W", "X", "Y", "Z" };
|
||||
|
||||
/**
|
||||
* 生成8位UUID
|
||||
* @return 8位UUID
|
||||
*/
|
||||
public static String generateShortUuid() {
|
||||
StringBuffer shortBuffer = new StringBuffer();
|
||||
String uuid = UUID.randomUUID().toString().replace("-", "");
|
||||
for (int i = 0; i < 8; i++) {
|
||||
String str = uuid.substring(i * 4, i * 4 + 4);
|
||||
int x = Integer.parseInt(str, 16);
|
||||
shortBuffer.append(chars[x % 0x3E]);
|
||||
}
|
||||
return shortBuffer.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
#设置端口号
|
||||
server:
|
||||
port: 8080
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
#设置访问路径
|
||||
context-path: /
|
||||
spring:
|
||||
datasource:
|
||||
name: mysql
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
filters: stat
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/jiudianmanage?useSSL=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
|
||||
username: root
|
||||
password: 123456
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
# url: jdbc:mysql://127.0.0.1:3306/jiudianmanage?useSSL=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
|
||||
# username: root
|
||||
# password: jiaoYAN585269..
|
||||
initial-size: 1
|
||||
min-idle: 1
|
||||
max-active: 20
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
validation-query: SELECT 1
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
pool-prepared-statements: false
|
||||
max-pool-prepared-statement-per-connection-size: 20
|
||||
thymeleaf:
|
||||
cache: false
|
||||
resources:
|
||||
static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/
|
||||
http:
|
||||
encoding:
|
||||
charset: UTF-8
|
||||
force: true
|
||||
enabled: true
|
||||
#配置mybatis的mapper路径和实体类路径
|
||||
mybatis:
|
||||
mapper-locations: classpath:mappers/*.xml
|
||||
type-aliases-package: com.jiudian.manage.model
|
||||
#pagehelper分页
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
reasonable: false
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
returnPageInfo: check
|
||||
@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.jiudian.manage.mapper.ConfigMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.jiudian.manage.model.Config" >
|
||||
<id column="id" property="id" jdbcType="INTEGER" />
|
||||
<result column="managesalary" property="managesalary" jdbcType="DOUBLE" />
|
||||
<result column="staffsalary" property="staffsalary" jdbcType="DOUBLE" />
|
||||
<result column="cleanerssalary" property="cleanerssalary" jdbcType="DOUBLE" />
|
||||
<result column="manage" property="manage" jdbcType="DOUBLE" />
|
||||
<result column="staff" property="staff" jdbcType="DOUBLE" />
|
||||
<result column="cleaner" property="cleaner" jdbcType="DOUBLE" />
|
||||
<result column="totalmoney" property="totalmoney" jdbcType="DOUBLE" />
|
||||
<result column="totalroom" property="totalroom" jdbcType="DOUBLE" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
id, managesalary, staffsalary, cleanerssalary, manage, staff, cleaner, totalmoney,
|
||||
totalroom
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from config
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
||||
delete from config
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jiudian.manage.model.Config" >
|
||||
insert into config (id, managesalary, staffsalary,
|
||||
cleanerssalary, manage, staff,
|
||||
cleaner, totalmoney, totalroom
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{managesalary,jdbcType=DOUBLE}, #{staffsalary,jdbcType=DOUBLE},
|
||||
#{cleanerssalary,jdbcType=DOUBLE}, #{manage,jdbcType=DOUBLE}, #{staff,jdbcType=DOUBLE},
|
||||
#{cleaner,jdbcType=DOUBLE}, #{totalmoney,jdbcType=DOUBLE}, #{totalroom,jdbcType=DOUBLE}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jiudian.manage.model.Config" >
|
||||
insert into config
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="managesalary != null" >
|
||||
managesalary,
|
||||
</if>
|
||||
<if test="staffsalary != null" >
|
||||
staffsalary,
|
||||
</if>
|
||||
<if test="cleanerssalary != null" >
|
||||
cleanerssalary,
|
||||
</if>
|
||||
<if test="manage != null" >
|
||||
manage,
|
||||
</if>
|
||||
<if test="staff != null" >
|
||||
staff,
|
||||
</if>
|
||||
<if test="cleaner != null" >
|
||||
cleaner,
|
||||
</if>
|
||||
<if test="totalmoney != null" >
|
||||
totalmoney,
|
||||
</if>
|
||||
<if test="totalroom != null" >
|
||||
totalroom,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="managesalary != null" >
|
||||
#{managesalary,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="staffsalary != null" >
|
||||
#{staffsalary,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="cleanerssalary != null" >
|
||||
#{cleanerssalary,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="manage != null" >
|
||||
#{manage,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="staff != null" >
|
||||
#{staff,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="cleaner != null" >
|
||||
#{cleaner,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="totalmoney != null" >
|
||||
#{totalmoney,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="totalroom != null" >
|
||||
#{totalroom,jdbcType=DOUBLE},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jiudian.manage.model.Config" >
|
||||
update config
|
||||
<set >
|
||||
<if test="managesalary != null" >
|
||||
managesalary = #{managesalary,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="staffsalary != null" >
|
||||
staffsalary = #{staffsalary,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="cleanerssalary != null" >
|
||||
cleanerssalary = #{cleanerssalary,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="manage != null" >
|
||||
manage = #{manage,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="staff != null" >
|
||||
staff = #{staff,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="cleaner != null" >
|
||||
cleaner = #{cleaner,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="totalmoney != null" >
|
||||
totalmoney = #{totalmoney,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="totalroom != null" >
|
||||
totalroom = #{totalroom,jdbcType=DOUBLE},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jiudian.manage.model.Config" >
|
||||
update config
|
||||
set managesalary = #{managesalary,jdbcType=DOUBLE},
|
||||
staffsalary = #{staffsalary,jdbcType=DOUBLE},
|
||||
cleanerssalary = #{cleanerssalary,jdbcType=DOUBLE},
|
||||
manage = #{manage,jdbcType=DOUBLE},
|
||||
staff = #{staff,jdbcType=DOUBLE},
|
||||
cleaner = #{cleaner,jdbcType=DOUBLE},
|
||||
totalmoney = #{totalmoney,jdbcType=DOUBLE},
|
||||
totalroom = #{totalroom,jdbcType=DOUBLE}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.jiudian.manage.mapper.OrderMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.jiudian.manage.model.Order" >
|
||||
<id column="orderid" property="orderid" jdbcType="INTEGER" />
|
||||
<result column="householdname" property="householdname" jdbcType="VARCHAR" />
|
||||
<result column="ID" property="id" jdbcType="VARCHAR" />
|
||||
<result column="starttime" property="starttime" jdbcType="DATE" />
|
||||
<result column="endtime" property="endtime" jdbcType="DATE" />
|
||||
<result column="money" property="money" jdbcType="DOUBLE" />
|
||||
<result column="state" property="state" jdbcType="INTEGER" />
|
||||
<result column="roomid" property="roomid" jdbcType="INTEGER" />
|
||||
<result column="userid" property="userid" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
orderid, householdname, ID, starttime, endtime, money, state, roomid, userid
|
||||
</sql>
|
||||
<select id="getAllUser" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from orderlist
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from orderlist
|
||||
where orderid = #{orderid,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
||||
delete from orderlist
|
||||
where orderid = #{orderid,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jiudian.manage.model.Order" >
|
||||
insert into orderlist (orderid, householdname, ID,
|
||||
starttime, endtime, money,
|
||||
state, roomid, userid
|
||||
)
|
||||
values (#{orderid,jdbcType=INTEGER}, #{householdname,jdbcType=VARCHAR}, #{id,jdbcType=VARCHAR},
|
||||
#{starttime,jdbcType=DATE}, #{endtime,jdbcType=DATE}, #{money,jdbcType=DOUBLE},
|
||||
#{state,jdbcType=INTEGER}, #{roomid,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jiudian.manage.model.Order" >
|
||||
insert into orderlist
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="orderid != null" >
|
||||
orderid,
|
||||
</if>
|
||||
<if test="householdname != null" >
|
||||
householdname,
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
ID,
|
||||
</if>
|
||||
<if test="starttime != null" >
|
||||
starttime,
|
||||
</if>
|
||||
<if test="endtime != null" >
|
||||
endtime,
|
||||
</if>
|
||||
<if test="money != null" >
|
||||
money,
|
||||
</if>
|
||||
<if test="state != null" >
|
||||
state,
|
||||
</if>
|
||||
<if test="roomid != null" >
|
||||
roomid,
|
||||
</if>
|
||||
<if test="userid != null" >
|
||||
userid,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="orderid != null" >
|
||||
#{orderid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="householdname != null" >
|
||||
#{householdname,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="starttime != null" >
|
||||
#{starttime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="endtime != null" >
|
||||
#{endtime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="money != null" >
|
||||
#{money,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="state != null" >
|
||||
#{state,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomid != null" >
|
||||
#{roomid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userid != null" >
|
||||
#{userid,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jiudian.manage.model.Order" >
|
||||
update orderlist
|
||||
<set >
|
||||
<if test="householdname != null" >
|
||||
householdname = #{householdname,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
ID = #{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="starttime != null" >
|
||||
starttime = #{starttime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="endtime != null" >
|
||||
endtime = #{endtime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="money != null" >
|
||||
money = #{money,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="state != null" >
|
||||
state = #{state,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomid != null" >
|
||||
roomid = #{roomid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userid != null" >
|
||||
userid = #{userid,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where orderid = #{orderid,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jiudian.manage.model.Order" >
|
||||
update orderlist
|
||||
set householdname = #{householdname,jdbcType=VARCHAR},
|
||||
ID = #{id,jdbcType=VARCHAR},
|
||||
starttime = #{starttime,jdbcType=DATE},
|
||||
endtime = #{endtime,jdbcType=DATE},
|
||||
money = #{money,jdbcType=DOUBLE},
|
||||
state = #{state,jdbcType=INTEGER},
|
||||
roomid = #{roomid,jdbcType=INTEGER},
|
||||
userid = #{userid,jdbcType=INTEGER}
|
||||
where orderid = #{orderid,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jiudian.manage.mapper.RoomMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jiudian.manage.model.Room">
|
||||
<id column="roomid" jdbcType="INTEGER" property="roomid" />
|
||||
<result column="local" jdbcType="VARCHAR" property="local" />
|
||||
<result column="money" jdbcType="DOUBLE" property="money" />
|
||||
<result column="state" jdbcType="INTEGER" property="state" />
|
||||
<result column="type" jdbcType="INTEGER" property="type" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
roomid, local, money, state, type
|
||||
</sql>
|
||||
|
||||
<select id="selectRoomByStateType" parameterType="com.jiudian.manage.model.Room" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room
|
||||
<where>
|
||||
<trim suffixOverrides="and">
|
||||
<if test="state !=null">
|
||||
state = #{state,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="type !=null">
|
||||
and type =#{type,jdbcType=INTEGER}
|
||||
</if>
|
||||
</trim>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room
|
||||
where roomid = #{roomid,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from room
|
||||
where roomid = #{roomid,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jiudian.manage.model.Room">
|
||||
insert into room (roomid, local, money,
|
||||
state, type)
|
||||
values (#{roomid,jdbcType=INTEGER}, #{local,jdbcType=VARCHAR}, #{money,jdbcType=DOUBLE},
|
||||
#{state,jdbcType=INTEGER}, #{type,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jiudian.manage.model.Room">
|
||||
insert into room
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="roomid != null">
|
||||
roomid,
|
||||
</if>
|
||||
<if test="local != null">
|
||||
local,
|
||||
</if>
|
||||
<if test="money != null">
|
||||
money,
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="roomid != null">
|
||||
#{roomid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="local != null">
|
||||
#{local,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="money != null">
|
||||
#{money,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
#{state,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jiudian.manage.model.Room">
|
||||
update room
|
||||
<set>
|
||||
<if test="local != null">
|
||||
local = #{local,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="money != null">
|
||||
money = #{money,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state = #{state,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where roomid = #{roomid,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jiudian.manage.model.Room">
|
||||
update room
|
||||
set local = #{local,jdbcType=VARCHAR},
|
||||
money = #{money,jdbcType=DOUBLE},
|
||||
state = #{state,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=INTEGER}
|
||||
where roomid = #{roomid,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jiudian.manage.mapper.UserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jiudian.manage.model.User">
|
||||
<id column="userid" jdbcType="INTEGER" property="userid" />
|
||||
<result column="useraccount" jdbcType="VARCHAR" property="useraccount" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||
<result column="age" jdbcType="INTEGER" property="age" />
|
||||
<result column="power" jdbcType="INTEGER" property="power" />
|
||||
<result column="IDnumber" jdbcType="VARCHAR" property="idnumber" />
|
||||
<result column="money" jdbcType="DOUBLE" property="money" />
|
||||
<result column="photoUrl" jdbcType="VARCHAR" property="photourl" />
|
||||
<result column="phonenumber" jdbcType="VARCHAR" property="phonenumber" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
userid, useraccount, password, username, age, power, IDnumber, money, photoUrl, phonenumber
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="getAllUser" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
</select>
|
||||
|
||||
<select id="selectByPower" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
where power = #{power,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<select id="selectByAccount" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
where useraccount = #{useraccount,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
where userid = #{userid,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from user
|
||||
where userid = #{userid,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jiudian.manage.model.User">
|
||||
insert into user (userid, useraccount, password,
|
||||
username, age, power,
|
||||
IDnumber, money, photoUrl,
|
||||
phonenumber)
|
||||
values (#{userid,jdbcType=INTEGER}, #{useraccount,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
||||
#{username,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{power,jdbcType=INTEGER},
|
||||
#{idnumber,jdbcType=VARCHAR}, #{money,jdbcType=DOUBLE}, #{photourl,jdbcType=VARCHAR},
|
||||
#{phonenumber,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jiudian.manage.model.User">
|
||||
insert into user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userid != null">
|
||||
userid,
|
||||
</if>
|
||||
<if test="useraccount != null">
|
||||
useraccount,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username,
|
||||
</if>
|
||||
<if test="age != null">
|
||||
age,
|
||||
</if>
|
||||
<if test="power != null">
|
||||
power,
|
||||
</if>
|
||||
<if test="idnumber != null">
|
||||
IDnumber,
|
||||
</if>
|
||||
<if test="money != null">
|
||||
money,
|
||||
</if>
|
||||
<if test="photourl != null">
|
||||
photoUrl,
|
||||
</if>
|
||||
<if test="phonenumber != null">
|
||||
phonenumber,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userid != null">
|
||||
#{userid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="useraccount != null">
|
||||
#{useraccount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
#{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="age != null">
|
||||
#{age,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="power != null">
|
||||
#{power,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="idnumber != null">
|
||||
#{idnumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="money != null">
|
||||
#{money,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="photourl != null">
|
||||
#{photourl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phonenumber != null">
|
||||
#{phonenumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jiudian.manage.model.User">
|
||||
update user
|
||||
<set>
|
||||
<if test="useraccount != null">
|
||||
useraccount = #{useraccount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="age != null">
|
||||
age = #{age,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="power != null">
|
||||
power = #{power,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="idnumber != null">
|
||||
IDnumber = #{idnumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="money != null">
|
||||
money = #{money,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="photourl != null">
|
||||
photoUrl = #{photourl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phonenumber != null">
|
||||
phonenumber = #{phonenumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where userid = #{userid,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jiudian.manage.model.User">
|
||||
update user
|
||||
set useraccount = #{useraccount,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
age = #{age,jdbcType=INTEGER},
|
||||
power = #{power,jdbcType=INTEGER},
|
||||
IDnumber = #{idnumber,jdbcType=VARCHAR},
|
||||
money = #{money,jdbcType=DOUBLE},
|
||||
photoUrl = #{photourl,jdbcType=VARCHAR},
|
||||
phonenumber = #{phonenumber,jdbcType=VARCHAR}
|
||||
where userid = #{userid,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 538 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 585 KiB |
|
After Width: | Height: | Size: 375 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 272 KiB |
@ -0,0 +1,26 @@
|
||||
|
||||
.bs-docs-footer {
|
||||
padding-top: 25px;
|
||||
padding-bottom: 50px;
|
||||
height: 12rem;
|
||||
color: #99979c;
|
||||
text-align: center;
|
||||
background-color: rgba(0,0,0,.8);
|
||||
}
|
||||
|
||||
.bs-docs-footer-links {
|
||||
padding-left: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.bs-docs-footer-links li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.bs-docs-footer a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.bs-docs-footer p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
.navbar-default{
|
||||
transition: all 0.6s;
|
||||
background-color: rgba(0,0,0,.7);
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
.header{
|
||||
text-align: center;
|
||||
letter-spacing: 1rem;
|
||||
}
|
||||
|
||||
.navbar{
|
||||
min-height: 5.4rem !important;
|
||||
}
|
||||
|
||||
|
||||
@media screen and (min-width:1000px){
|
||||
|
||||
.nav-con{
|
||||
padding: 0 12rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
label{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.logindiv{
|
||||
border: 1px solid white;
|
||||
padding: 0rem 3.5rem;
|
||||
height: 32rem;
|
||||
background: rgba(255,255,255,.9);
|
||||
position: relative;
|
||||
margin-top: 5rem;
|
||||
}
|
||||
|
||||
.login-h{
|
||||
border-bottom: 2px solid #337AB7;
|
||||
text-align: center;
|
||||
letter-spacing: 2.5px;
|
||||
}
|
||||
|
||||
.login-f{
|
||||
padding-top: 2rem !important;
|
||||
}
|
||||
|
||||
.forminput{
|
||||
height: 4rem;
|
||||
}
|
||||
|
||||
.main{
|
||||
background: url('../img/pexels-photo-545049.jpg') no-repeat;
|
||||
background-repeat:no-repeat;
|
||||
background-size: cover;
|
||||
min-height: 40rem;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"]{
|
||||
text-indent:2.3rem;
|
||||
font-weight:normal;
|
||||
color:black;
|
||||
background:url('../img/login-sprite.png') no-repeat white;
|
||||
background-position:3% 10%;
|
||||
}
|
||||
|
||||
input[type="password"]{
|
||||
background-position:3% 90%;
|
||||
}
|
||||
|
||||
.inputcode{
|
||||
background-position:3% 90% !important;
|
||||
}
|
||||
|
||||
.code{
|
||||
height: 4rem;
|
||||
width: 100%;
|
||||
border:1px solid #3D86ED;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.loginbtn{
|
||||
background: #419FD8;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.loginbtn:hover{
|
||||
background: #5D89FA;
|
||||
color: white;
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
.navbar-default{
|
||||
transition: all 0.6s;
|
||||
background-color: #219ED8;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
.header{
|
||||
text-align: center;
|
||||
letter-spacing: 1rem;
|
||||
}
|
||||
|
||||
.navbar{
|
||||
min-height: 5.4rem !important;
|
||||
}
|
||||
|
||||
|
||||
@media screen and (min-width:1000px){
|
||||
|
||||
.nav-con{
|
||||
padding: 0 12rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
label{
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
.navbar-default .navbar-nav>li>a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
li.navli{
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-toggle {
|
||||
border-color: white;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-toggle .icon-bar {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:focus, .navbar-default .navbar-nav>.open>a:hover{
|
||||
background: transparent;
|
||||
color: white;
|
||||
transition: all 0.6s;
|
||||
transform: scale(1.0,1.2);
|
||||
}
|
||||
|
||||
|
||||
.navbar-nav>li>a{
|
||||
padding-top: 1.7rem;
|
||||
}
|
||||
|
||||
|
||||
.navbar-default .navbar-nav>li>a:hover{
|
||||
color: white;
|
||||
transition: all 0.6s;
|
||||
}
|
||||
|
||||
.main{
|
||||
margin-top: -20px;
|
||||
}
|
||||
|
||||
.nopadding{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.navlist{
|
||||
min-height: 58rem;
|
||||
background: #254552;
|
||||
}
|
||||
|
||||
a.list-group-item{
|
||||
color: #C2D2CB;
|
||||
padding-left: 3rem;
|
||||
|
||||
}
|
||||
|
||||
.list-group-item{
|
||||
background-color:transparent;
|
||||
color: #C2D2CB;
|
||||
border:0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.list-group-item:hover,.list-group-item:focus{
|
||||
background-color:transparent !important;
|
||||
color: #C2D2CB !important;
|
||||
|
||||
}
|
||||
|
||||
.list-group-item.active,.list-group-item.active:hover{
|
||||
background: #20343D !important;
|
||||
color:white !important;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.glyphicon{
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.mainFrame{
|
||||
width: 100%;
|
||||
min-height: 60rem;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
|
||||
.nopadding{
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.userpic{
|
||||
width: 50%;
|
||||
border-radius: 50%;
|
||||
border: 1px solid black;
|
||||
margin-left:25%;
|
||||
}
|
||||
|
||||
.username{
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
font-size: 1.7rem;
|
||||
}
|
||||
|
||||
.glyphicon{
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.fdata {
|
||||
padding-left: 2%;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
line-height: 3.2;
|
||||
border-bottom: 2px solid #e6e6e6;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.alterinfo{
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 633 B |
|
After Width: | Height: | Size: 159 KiB |
@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>酒店管理系统</title>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/index.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/footer.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid main" id="main" style="padding: 0">
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid nav-con">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="#" style="padding-top: 2rem;color: #EDEDED">
|
||||
<span style="font-size: 2.3rem;padding-right: 2rem;letter-spacing: 2px">酒店管理系统</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="col-md-7 col-xs-1"></div>
|
||||
<div class="col-md-3 col-xs-10 logindiv">
|
||||
<div class="login-h">
|
||||
<h3 class="loginh">
|
||||
登录
|
||||
</h3>
|
||||
</div>
|
||||
<form class="form-horizontal login-f">
|
||||
<div class="form-group">
|
||||
<label for="inputName" class="col-sm-2 control-label">Username</label>
|
||||
<div class="col-md-12 col-xs-12">
|
||||
<input type="text" class="form-control forminput" id="inputName" placeholder="账号 Account">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="inputPassword" class="col-sm-2 control-label">Password</label>
|
||||
<div class="col-md-12 col-xs-12">
|
||||
<input type="password" class="form-control forminput" id="inputPassword" placeholder="密码 Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="inputCode" class="col-sm-2 control-label">Code</label>
|
||||
<div class="col-md-8 col-xs-7">
|
||||
<input type="text" class="form-control forminput inputcode" id="inputCode" placeholder="验证码 code">
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-5" style="padding-left:0">
|
||||
<img class="code" id="code" src=" ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-6 col-xs-12">
|
||||
<button type="button" id="loginBtn" class="form-control btn loginbtn" style="transition: all 0.6s;" >登 录</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="bs-docs-footer">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
<a href="#">关于本站</a>
|
||||
<a href="#">廉正举报</a>
|
||||
<a href="#">开放平台</a>
|
||||
<a href="#">诚征英才</a>
|
||||
<a href="#">联系我们</a>
|
||||
<a href="#">网站地图</a><br/><br/>
|
||||
<em>2025 合肥师范学院 软件工程</em>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="js/index.js"></script>
|
||||
|
||||
@ -0,0 +1,220 @@
|
||||
var pageNum=1;
|
||||
var pageSize=8;
|
||||
var l;
|
||||
|
||||
$(document).ready(function(){
|
||||
getStaffList();
|
||||
$("#pre").on('click',function(){
|
||||
getPre();
|
||||
});
|
||||
$("#next").on('click',function(){
|
||||
getNext();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var list;
|
||||
function getStaffList(){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"../user/getAllUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"pageNum":pageNum,
|
||||
"pageSize":pageSize
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code=="0"){
|
||||
if(isEmptyObject(data.List)&&pageNum>0){
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
else{
|
||||
var power=" ";
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
list=data.List;
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#staffList").empty();
|
||||
$("#staffList").append("<tr><th>账号</th><th>员工号</th><th>姓名</th><th>年龄</th><th>职位</th><th>联系方式</th><th>操作</th></tr>")
|
||||
for(i in list){
|
||||
if(list[i].power=="0") {
|
||||
power="管理员";
|
||||
btnStr=" ";
|
||||
}
|
||||
else if(list[i].power=="1") {
|
||||
power="经理";
|
||||
btnStr="<input type=\"button\" id=\"setStaff\" data-userid=\""+list[i].userid+"\" class=\"btn btn-success\" value=\"设置为员工\"/> <input type=\"button\" id=\"delUser\" data-userid=\""+list[i].userid+"\" class=\"btn btn-danger\" value=\"删除\"/>"
|
||||
}
|
||||
else if(list[i].power=="2") {
|
||||
power="员工";
|
||||
btnStr="<input type=\"button\" id=\"setManage\" data-userid=\""+list[i].userid+"\" class=\"btn btn-success\" value=\"设置为经理\"/> <input type=\"button\" id=\"setPwd\" data-userid=\""+list[i].userid+"\" class=\"btn btn-info\" value=\"重置密码\"/> <input type=\"button\" id=\"delUser\" data-userid=\""+list[i].userid+"\" class=\"btn btn-danger\" value=\"删除\"/>"
|
||||
}
|
||||
else {
|
||||
power="清洁工";
|
||||
btnStr="<input type=\"button\" id=\"setPwd\" data-userid=\""+list[i].userid+"\" class=\"btn btn-info\" value=\"重置密码\"/> <input type=\"button\" id=\"delUser\" data-userid=\""+list[i].userid+"\" class=\"btn btn-danger\" value=\"删除\"/> "
|
||||
}
|
||||
|
||||
htmlStr="<tr data-userid=\""+list[i].userid+"\"><td>"+list[i].useraccount+"</td><td>"+list[i].idnumber+"</td><td>"+list[i].username+"</td><td>"+list[i].age+"</td><td>"+power+"</td><td>"+list[i].phonenumber+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#staffList").append(htmlStr);
|
||||
l++;
|
||||
//console.log(htmlStr)
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
alert("获取员工列表失败")
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取员工列表发生错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function btnOn(){
|
||||
$("input").filter("#setStaff").on('click',function(event){
|
||||
setPosition(event,"2");
|
||||
});
|
||||
$("input").filter("#setManage").on('click',function(event){
|
||||
setPosition(event,"1");
|
||||
});
|
||||
$("input").filter("#setPwd").on('click',function(event){
|
||||
setPwd(event);
|
||||
});
|
||||
$("input").filter("#delUser").on('click',function(event){
|
||||
delUser(event);
|
||||
});
|
||||
$("input").filter("#setPageBtn").on('click',function( ){
|
||||
setPage( );
|
||||
})
|
||||
}
|
||||
|
||||
function getPre(){
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
pageNum=pageNum+1;
|
||||
getStaffList();
|
||||
|
||||
}
|
||||
|
||||
function setPage(){
|
||||
|
||||
if($("#inputPage").val()<0 || $("#inputPage").val()==0)
|
||||
alert("请输入正确页码");
|
||||
else{
|
||||
pageNum=$("#inputPage").val();
|
||||
getStaffList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setPosition(event,alter){
|
||||
var userid=$(event.target).data("userid");
|
||||
var info;
|
||||
for(i in list){
|
||||
if(list[i].userid==userid){
|
||||
info=list[i];
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/updateUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":info.userid,
|
||||
"power":alter
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("修改成功");
|
||||
getStaffList();
|
||||
}
|
||||
else
|
||||
alert("修改失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("修改信息出现错误");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function setPwd(event){
|
||||
var userid=$(event.target).data("userid");
|
||||
var info;
|
||||
for(i in list){
|
||||
if(list[i].userid==userid){
|
||||
info=list[i];
|
||||
}
|
||||
}
|
||||
info.password="111111";
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/updateUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":info.userid,
|
||||
"password":info.password
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("修改成功");
|
||||
getStaffList();
|
||||
}
|
||||
else
|
||||
alert("修改失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("修改信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function delUser(event){
|
||||
var userid=$(event.target).data("userid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/delUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":userid
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("删除成功");
|
||||
if(l==1)
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
else
|
||||
alert("删除失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("删除出现错误");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@ -0,0 +1,215 @@
|
||||
var pageNum=1;
|
||||
var pageSize=8;
|
||||
var l;
|
||||
|
||||
$(document).ready(function(){
|
||||
getorderList();
|
||||
getConfig();
|
||||
$("#pre").on('click',function(){
|
||||
getPre();
|
||||
});
|
||||
$("#next").on('click',function(){
|
||||
getNext();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
var list;
|
||||
function getorderList(){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"../order/getAllOrder.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"pageNum":pageNum,
|
||||
"pageSize":pageSize
|
||||
},
|
||||
success:function(data){
|
||||
if(isEmptyObject(data.List)&&pageNum>0){
|
||||
pageNum=pageNum-1;
|
||||
getorderList();
|
||||
}
|
||||
else{
|
||||
list=data.List;
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
var state=" ";
|
||||
var sdate;
|
||||
var edate;
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#orderList").empty();
|
||||
$("#orderList").append("<tr><th>入住人</th><th>身份证号</th><th>开始时间</th><th>结束时间</th><th>总金额</th><th>状态</th><th>操作</th></tr>")
|
||||
|
||||
for(i in list){
|
||||
sdate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(list[i].starttime);
|
||||
edate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(list[i].endtime);
|
||||
if(list[i].state=="0"){
|
||||
state="未付款";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"showRoom\" data-toggle=\"modal\" data-target=\"#showRoomT\" value=\"查看房间\">";
|
||||
}
|
||||
else if(list[i].state=="1"){
|
||||
state="已付款";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"showRoom\" data-toggle=\"modal\" data-target=\"#showRoomT\" value=\"查看房间\"> ";
|
||||
}
|
||||
else if(list[i].state=="2"){
|
||||
state="已完成";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"showRoom\" data-toggle=\"modal\" data-target=\"#showRoomT\" value=\"查看房间\"> <input type=\"button\" class=\"btn btn-success\" data-orderid=\""+list[i].orderid+"\" id=\"delOrder\" value=\"删除\">";
|
||||
}
|
||||
else{
|
||||
state="已取消";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"showRoom\" data-toggle=\"modal\" data-target=\"#showRoomT\" value=\"查看房间\"> <input type=\"button\" class=\"btn btn-success\" data-orderid=\""+list[i].orderid+"\" id=\"delOrder\" value=\"删除\">";
|
||||
}
|
||||
htmlStr="<tr data-orderid=\""+list[i].orderid+"\"><td>"+list[i].householdname+"</td><td>"+list[i].id+"</td><td>"+sdate+"</td><td>"+edate+"</td><td>"+list[i].money+"</td><td>"+state+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#orderList").append(htmlStr);
|
||||
l++;
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
}
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取订单列表发生错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function btnOn(){
|
||||
|
||||
$("input").filter("#setPageBtn").on('click',function( ){
|
||||
setPage( );
|
||||
});
|
||||
$("input").filter("#showRoom").on('click',function(event){
|
||||
showRoom(event);
|
||||
})
|
||||
$("input").filter("#delOrder").on('click',function(event){
|
||||
delOrder(event);
|
||||
});
|
||||
}
|
||||
|
||||
function getPre(){
|
||||
pageNum=pageNum-1;
|
||||
getorderList();
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
pageNum=pageNum+1;
|
||||
getorderList();
|
||||
}
|
||||
|
||||
function setPage(){
|
||||
|
||||
if($("#inputPage").val()<0 || $("#inputPage").val()==0)
|
||||
alert("请输入正确页码");
|
||||
else{
|
||||
pageNum=$("#inputPage").val();
|
||||
getorderList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function delOrder(event){
|
||||
var orderid=$(event.target).data("orderid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../order/delOrder.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"orderid":orderid
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("删除成功");
|
||||
if(l==1)
|
||||
pageNum=pageNum-1;
|
||||
getorderList();
|
||||
}
|
||||
else
|
||||
alert("删除失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("删除出现错误");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showRoom(event){
|
||||
var roomid=$(event.target).data("roomid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../room/getRoomById.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"roomid":roomid
|
||||
},
|
||||
success:function(data){
|
||||
var room=data.room;
|
||||
if(data.code==0){
|
||||
var htmlStr=" ";
|
||||
var state=" ";
|
||||
var type=" ";
|
||||
$("#roomTable").empty();
|
||||
if(room.state=="0")
|
||||
state="停用";
|
||||
else if(room.state=="1")
|
||||
state="未预定";
|
||||
else if(room.state=="2")
|
||||
state="已预定(入住)";
|
||||
else
|
||||
state="待清扫";
|
||||
if(room.type=="1")
|
||||
type="单人间";
|
||||
else if(room.type=="2")
|
||||
type="双人间";
|
||||
else if(room.type=="3")
|
||||
type="大床房";
|
||||
else
|
||||
type="套房";
|
||||
htmlStr="<tr><th>位置</th><td>"+room.local+"</td></tr><tr><th>价格</th><td>"+room.money+"</td></tr><tr><th>类型</th><td>"+type+"</td></tr><tr><th>状态</th><td>"+state+"</td></tr>"
|
||||
$("#roomTable").append(htmlStr);
|
||||
}
|
||||
else
|
||||
alert("获取失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("获取信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getConfig(){
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../config/getConfig.do",
|
||||
dataType:"JSON",
|
||||
data:{},
|
||||
success:function(data){
|
||||
if(data.code=="0"){
|
||||
var config=data.config;
|
||||
$("#totalMoney").text(config.totalmoney);
|
||||
$("#totalRoom").text(config.totalroom);
|
||||
}
|
||||
else{
|
||||
alert("获取配置错误");
|
||||
}
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取配置发生错误")
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
$(document).ready(function(){
|
||||
getConfig();
|
||||
$("#showConfig").click(function(){
|
||||
changeTab();
|
||||
});
|
||||
$("#alterConfig").click(function(){
|
||||
changeTab();
|
||||
});
|
||||
$("#alterConfigBtn").click(function(){
|
||||
alterConfig();
|
||||
})
|
||||
})
|
||||
|
||||
var config;
|
||||
|
||||
//判断字符串是否为空 空返回1 非空返回0
|
||||
function isEmptyString(str){
|
||||
if(str=='null'||str=='')
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
function getConfig(){
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../config/getConfig.do",
|
||||
dataType:"JSON",
|
||||
data:{},
|
||||
success:function(data){
|
||||
if(data.code=="0"){
|
||||
config=data.config;
|
||||
var htmlStr="<tr><td>经理</td><td>"+config.manage+"</td><td>"+config.managesalary+"%</td></tr>"+
|
||||
"<tr><td>员工</td><td>"+config.staff+"</td><td>"+config.staffsalary+"%</td></tr>"+
|
||||
"<tr><td>清洁工</td><td>"+config.cleaner+"</td><td>"+config.cleanerssalary+"%</td></tr>";
|
||||
$("#configList").append(htmlStr);
|
||||
$("#inputMS").val(config.manage);
|
||||
$("#inputSS").val(config.staff);
|
||||
$("#inputCS").val(config.cleaner);
|
||||
$("#inputM").val(config.managesalary);
|
||||
$("#inputS").val(config.staffsalary);
|
||||
$("#inputC").val(config.cleanerssalary);
|
||||
}
|
||||
else{
|
||||
alert("获取配置错误");
|
||||
}
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取配置发生错误")
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function changeTab(){
|
||||
var info=$("#showConfigDiv").css("display");
|
||||
var alter=$("#alterConfigDiv").css("display");
|
||||
if(info=="block"){
|
||||
$("#showConfigDiv").css("display","none");
|
||||
$("#alterConfigDiv").fadeIn();
|
||||
}
|
||||
else{
|
||||
$("#alterConfigDiv").css("display","none")
|
||||
$("#showConfigDiv").fadeIn();
|
||||
}
|
||||
}
|
||||
|
||||
function alterConfig(){
|
||||
if(isEmptyString($("#inputMS").val())||isEmptyString($("#inputM").val())||isEmptyString($("#inputSS").val())||isEmptyString($("#inputS").val())||isEmptyString($("#inputCS").val())||isEmptyString($("#inputC").val()))
|
||||
alert("请填写全内容");
|
||||
else{
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../config/updateConfig.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"managesalary":$("#inputM").val(),
|
||||
"staffsalary":$("#inputS").val(),
|
||||
"cleanerssalary":$("#inputC").val(),
|
||||
"manage":$("#inputMS").val(),
|
||||
"staff":$("#inputSS").val(),
|
||||
"cleaner":$("#inputCS").val()
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code=="0"){
|
||||
alert("修改成功");
|
||||
|
||||
}
|
||||
else{
|
||||
alert("修改配置错误");
|
||||
}
|
||||
window.location.reload();
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("修改配置发生错误")
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,208 @@
|
||||
(function($){
|
||||
$.getData=function(name){
|
||||
var reg=new RegExp("(^|&)"+name+"=([^&]+)(&|$)?");
|
||||
var result = window.location.search.substr(1).match(reg);
|
||||
if (result!= null) return result[2]; return null;
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
|
||||
var userid=$.getData('userid');
|
||||
var power=$.getData('power');
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
var w=$("#userpic").width();
|
||||
$("#userpic").height(w);
|
||||
$("#inputNone").attr("value",userid);
|
||||
$("#showInfo").click(function(){
|
||||
changeTab();
|
||||
});
|
||||
$("#showAlter").click(function(){
|
||||
changeTab();
|
||||
});
|
||||
getInfo();
|
||||
getSalary();
|
||||
$("#alterInfoBtn").click(function(){
|
||||
alterInfo();
|
||||
});
|
||||
$("#alterPwdBtn").click(function(){
|
||||
alterPwd();
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//判断字符串是否为空 空返回1 非空返回0
|
||||
function isEmptyString(str){
|
||||
if(str=='null'||str=='')
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
function changeTab(){
|
||||
var info=$("#showInfodiv").css("display");
|
||||
var alter=$("#showAlterdiv").css("display");
|
||||
if(info=="block"){
|
||||
$("#showInfodiv").css("display","none");
|
||||
$("#showAlterdiv").fadeIn();
|
||||
}
|
||||
else{
|
||||
$("#showAlterdiv").css("display","none")
|
||||
$("#showInfodiv").fadeIn();
|
||||
}
|
||||
}
|
||||
|
||||
var info;
|
||||
|
||||
function getInfo(){
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/getUserById.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":userid
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
info=data.user;
|
||||
var span=$("span");
|
||||
$("#userpic").attr("src",'../'+info.photourl)
|
||||
span.filter("#account").text(info.useraccount);
|
||||
span.filter("#idnum").text(info.idnumber);
|
||||
span.filter("#name").text(info.username);
|
||||
$("#inputName").val(info.username);
|
||||
span.filter("#age").text(info.age);
|
||||
$("#inputAge").val(info.age)
|
||||
span.filter("#phone").text(info.phonenumber);
|
||||
$("#inputPhone").val(info.phonenumber)
|
||||
}
|
||||
else{
|
||||
alert("获取信息失败");
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("获取信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function alterInfo(){
|
||||
var name=$("#inputName").val();
|
||||
var age=$("#inputAge").val();
|
||||
var phone=$("#inputPhone").val();
|
||||
if(isEmptyString(name) || isEmptyString(age) || isEmptyString(phone)){
|
||||
alert("请填写全信息");
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/updateUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":userid,
|
||||
"password":info.password,
|
||||
"username":name,
|
||||
"age":age,
|
||||
"power":power,
|
||||
"IDnumber":info.idnumber,
|
||||
"phonenumber":phone
|
||||
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("修改成功");
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
alert("修改失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("修改信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function alterPwd(){
|
||||
var oldPwd=$("#inputoldPwd").val();
|
||||
var newPwd=$("#inputnewPwd").val();
|
||||
var renewPwd=$("#inputrenewPwd").val();
|
||||
if(isEmptyString(oldPwd) || isEmptyString(newPwd) || isEmptyString(renewPwd)){
|
||||
alert("请填写全信息");
|
||||
}
|
||||
else if(oldPwd!=info.password)
|
||||
alert("原密码不正确");
|
||||
else if(newPwd!=renewPwd)
|
||||
alert("新密码输入错误")
|
||||
else{
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/updateUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":userid,
|
||||
"password":newPwd
|
||||
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("修改成功");
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
alert("修改失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("修改密码出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function getSalary(){
|
||||
if(power!="0"){
|
||||
$("#showS").css("display","block");
|
||||
$("#showC").css("display","block");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../config/getConfig.do",
|
||||
dataType:"JSON",
|
||||
data:{},
|
||||
success:function(data){
|
||||
if(data.code=="0"){
|
||||
var config=data.config;
|
||||
if(power=="1"){
|
||||
$("#salary").text(config.manage);
|
||||
$("#commission").text(config.managesalary+"%");
|
||||
}
|
||||
else if(power=="2"){
|
||||
$("#salary").text(config.staff);
|
||||
$("#commission").text(config.staffsalary+"%");
|
||||
}
|
||||
else{
|
||||
$("#salary").text(config.cleaner);
|
||||
$("#commission").text(config.cleanerssalary+"%");
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
alert("获取配置错误");
|
||||
}
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取配置发生错误")
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
!function(a){a.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],daysShort:["周日","周一","周二","周三","周四","周五","周六"],daysMin:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",clear:"清除",format:"yyyy年mm月dd日",titleFormat:"yyyy年mm月",weekStart:1}}(jQuery);
|
||||
@ -0,0 +1,135 @@
|
||||
var pageNum=1;
|
||||
var pageSize=8;
|
||||
var l;
|
||||
|
||||
$(document).ready(function(){
|
||||
getroomList();
|
||||
$("#pre").on('click',function(){
|
||||
getPre();
|
||||
});
|
||||
$("#next").on('click',function(){
|
||||
getNext();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
var list;
|
||||
function getroomList(){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"../room/getRoom.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"state":"3",
|
||||
"type":"-1",
|
||||
"pageNum":pageNum,
|
||||
"pageSize":pageSize
|
||||
},
|
||||
success:function(data){
|
||||
if(isEmptyObject(data.List)&&pageNum>0){
|
||||
pageNum=pageNum-1;
|
||||
getroomList();
|
||||
}
|
||||
else{
|
||||
list=data.List;
|
||||
var power=" ";
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
var state=" ";
|
||||
var type=" ";
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#roomList").empty();
|
||||
$("#roomList").append("<tr><th>位置</th><th>价格</th><th>状态</th><th>类型</th><th>操作</th></tr>");
|
||||
state="未清扫";
|
||||
for(i in list){
|
||||
if(list[i].type=="1")
|
||||
type="单人间";
|
||||
else if(list[i].type=="2")
|
||||
type="双人间";
|
||||
else if(list[i].type=="3")
|
||||
type="大床房";
|
||||
else
|
||||
type="套房"
|
||||
btnStr="<input type=\"button\" class=\"btn btn-success\" data-roomid=\""+list[i].roomid+"\" id=\"setRoom\" value=\"已清扫\">";
|
||||
htmlStr="<tr data-roomid=\""+list[i].roomid+"\"><td>"+list[i].local+"</td><td>"+list[i].money+"</td><td>"+state+"</td><td>"+type+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#roomList").append(htmlStr);
|
||||
l++;
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
}
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取房间列表发生错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function btnOn(){;
|
||||
$("input").filter("#setPageBtn").on('click',function( ){
|
||||
setPage( );
|
||||
});
|
||||
$("input").filter("#setRoom").on('click',function(event ){
|
||||
setRoom(event);
|
||||
});
|
||||
}
|
||||
|
||||
function setRoom(event){
|
||||
var roomid=$(event.target).data("roomid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../room/updateRoom.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"roomid":roomid,
|
||||
"state":"1"
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("修改成功");
|
||||
getroomList();
|
||||
}
|
||||
else{
|
||||
alert("修改失败");
|
||||
getroomList();
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("修改信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getPre(){
|
||||
pageNum=pageNum-1;
|
||||
getroomList();
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
pageNum=pageNum+1;
|
||||
getroomList();
|
||||
}
|
||||
|
||||
function setPage(){
|
||||
if($("#inputPage").val()<0 || $("#inputPage").val()==0)
|
||||
alert("请输入正确页码");
|
||||
else{
|
||||
pageNum=$("#inputPage").val();
|
||||
getroomList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
$(document).ready(function(){
|
||||
getCode();
|
||||
var h=$(window).height();
|
||||
$("#main").css("height",h);
|
||||
$("#loginBtn").click(function(){
|
||||
login();
|
||||
})
|
||||
$("#code").click(function(){
|
||||
getCode();
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
//获取验证码
|
||||
function getCode(){
|
||||
$("#code").attr("src","./user/createImage?code="+Math.random());
|
||||
}
|
||||
|
||||
//登录
|
||||
function login(){
|
||||
var user=$("#inputName").val();
|
||||
var pwd=$("#inputPassword").val();
|
||||
var code=$("#inputCode").val();
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"./user/login.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"useraccount":user,
|
||||
"password":pwd,
|
||||
"icode":code
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data)
|
||||
if(data.code=="0"){
|
||||
var urlString="pages/myCenter.html?power="+data.power+"&userid="+data.userid;
|
||||
window.location.href=urlString;
|
||||
}
|
||||
else if(data.code=="-1"){
|
||||
alert("验证码或密码错误")
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("登录 发生错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,284 @@
|
||||
var pageNum=1;
|
||||
var pageSize=8;
|
||||
var l;
|
||||
|
||||
$(document).ready(function(){
|
||||
getroomList();
|
||||
$("#pre").on('click',function(){
|
||||
getPre();
|
||||
});
|
||||
$("#next").on('click',function(){
|
||||
getNext();
|
||||
});
|
||||
$("input").filter("#setRoomBtn").on('click',function( ){
|
||||
setRoomajax( );
|
||||
});
|
||||
|
||||
$("input").filter("#addRoomBtn").on('click',function(){
|
||||
addRoom();
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//判断字符串是否为空 空返回1 非空返回0
|
||||
function isEmptyString(str){
|
||||
if(str=='null'||str=='')
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var list;
|
||||
function getroomList(){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"../room/getRoom.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"state":"-1",
|
||||
"type":"-1",
|
||||
"pageNum":pageNum,
|
||||
"pageSize":pageSize
|
||||
},
|
||||
success:function(data){
|
||||
if(isEmptyObject(data.List)&&pageNum>0){
|
||||
pageNum=pageNum-1;
|
||||
getroomList();
|
||||
}
|
||||
else{
|
||||
list=data.List;
|
||||
var power=" ";
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
var state=" ";
|
||||
var type=" ";
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#roomList").empty();
|
||||
$("#roomList").append("<tr><th>位置</th><th>价格</th><th>状态</th><th>类型</th><th>操作</th></tr>")
|
||||
for(i in list){
|
||||
if(list[i].state=="0"){
|
||||
state="停用";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"setStart\" value=\"开始使用\"> <input type=\"button\" class=\"btn btn-success\" data-toggle=\"modal\" data-target=\"#alterRoom\" data-roomid=\""+list[i].roomid+"\" id=\"setRoom\" value=\"修改信息\"> <input type=\"button\" class=\"btn btn-danger\" data-roomid=\""+list[i].roomid+"\" value=\"删除\" id=\"delRoom\">";
|
||||
}
|
||||
else if(list[i].state=="1"){
|
||||
state="未预定";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"setStop\" value=\"改为停用\"> <input type=\"button\" class=\"btn btn-success\" data-toggle=\"modal\" data-target=\"#alterRoom\" data-roomid=\""+list[i].roomid+"\" id=\"setRoom\" value=\"修改信息\"> <input type=\"button\" class=\"btn btn-danger\" data-roomid=\""+list[i].roomid+"\" value=\"删除\" id=\"delRoom\">";
|
||||
}
|
||||
else if(list[i].state=="2"){
|
||||
state="已预定(入住)";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-success\" data-toggle=\"modal\" data-target=\"#alterRoom\" data-roomid=\""+list[i].roomid+"\" id=\"setRoom\" value=\"修改信息\">";
|
||||
}
|
||||
else{
|
||||
state="待清扫";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"setStop\" value=\"改为停用\"> <input type=\"button\" class=\"btn btn-success\" data-toggle=\"modal\" data-target=\"#alterRoom\" data-roomid=\""+list[i].roomid+"\" id=\"setRoom\" value=\"修改信息\"> <input type=\"button\" class=\"btn btn-danger\" data-roomid=\""+list[i].roomid+"\" value=\"删除\" id=\"delRoom\">";
|
||||
}
|
||||
|
||||
if(list[i].type=="1")
|
||||
type="单人间";
|
||||
else if(list[i].type=="2")
|
||||
type="双人间";
|
||||
else if(list[i].type=="3")
|
||||
type="大床房";
|
||||
else
|
||||
type="套房"
|
||||
|
||||
htmlStr="<tr data-roomid=\""+list[i].roomid+"\"><td>"+list[i].local+"</td><td>"+list[i].money+"</td><td>"+state+"</td><td>"+type+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#roomList").append(htmlStr);
|
||||
l++;
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
}
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取房间列表发生错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function btnOn(){
|
||||
$("input").filter("#delRoom").on('click',function(event){
|
||||
delRoom(event);
|
||||
});
|
||||
$("input").filter("#setPageBtn").on('click',function( ){
|
||||
setPage( );
|
||||
})
|
||||
$("input").filter("#setStop").on('click',function(event){
|
||||
setState(event,"0");
|
||||
});
|
||||
$("input").filter("#setStart").on('click',function(event){
|
||||
setState(event,"1");
|
||||
});
|
||||
$("input").filter("#setRoom").on('click',function(event){
|
||||
setRoom(event);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getPre(){
|
||||
pageNum=pageNum-1;
|
||||
getroomList();
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
pageNum=pageNum+1;
|
||||
getroomList();
|
||||
}
|
||||
|
||||
function setRoom(event){
|
||||
var roomid=$(event.target).data("roomid");
|
||||
var info;
|
||||
for(i in list){
|
||||
if(list[i].roomid==roomid){
|
||||
info=list[i];
|
||||
}
|
||||
}
|
||||
$("#reinputLocal").val(info.local);
|
||||
$("#reinputPrice").val(info.money);
|
||||
$("#reinputType").val(info.type);
|
||||
$("#reinputid").val(roomid);
|
||||
}
|
||||
|
||||
function setRoomajax( ){
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../room/updateRoom.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"roomid":$("#reinputid").val(),
|
||||
"money":$("#reinputPrice").val(),
|
||||
"type":$("#reinputType").val(),
|
||||
"local":$("#reinputLocal").val()
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("修改成功");
|
||||
$("#reinputLocal").val("");
|
||||
$("#reinputPrice").val("");
|
||||
$("#reinputType").val("");
|
||||
$("#reinputid").val("");
|
||||
$('#alterRoom').modal('toggle');
|
||||
getroomList();
|
||||
}
|
||||
else{
|
||||
alert("修改失败");
|
||||
getroomList();
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("修改信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function setState(event,alter){
|
||||
var roomid=$(event.target).data("roomid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../room/updateRoom.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"roomid":roomid,
|
||||
"state":alter
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("修改成功");
|
||||
getroomList();
|
||||
}
|
||||
else
|
||||
alert("修改失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("修改信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function setPage(){
|
||||
|
||||
if($("#inputPage").val()<0 || $("#inputPage").val()==0)
|
||||
alert("请输入正确页码");
|
||||
else{
|
||||
pageNum=$("#inputPage").val();
|
||||
getroomList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function delRoom(event){
|
||||
var roomid=$(event.target).data("roomid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../room/delRoom.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"roomid":roomid
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("删除成功");
|
||||
if(l==1)
|
||||
pageNum=pageNum-1;
|
||||
getroomList();
|
||||
}
|
||||
else
|
||||
alert("删除失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("删除出现错误");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function addRoom(){
|
||||
if(isEmptyString($("#inputLocal").val())||isEmptyString($("#inputLocal").val())||isEmptyString($("#inputType").val()))
|
||||
alert("请填写全内容");
|
||||
else{
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../room/addRoom.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"local":$("#inputLocal").val(),
|
||||
"money":$("#inputPrice").val(),
|
||||
"state":"1",
|
||||
"type":$("#inputType").val()
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("添加成功");
|
||||
$('#addRoom').modal('toggle');
|
||||
$("#inputLocal").val(" ");
|
||||
$("#inputPrice").val(" ");
|
||||
$("#inputType").val(" ");
|
||||
getroomList();
|
||||
}
|
||||
else{
|
||||
alert("添加失败");
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("添加出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,175 @@
|
||||
var pageNum=1;
|
||||
var pageSize=8;
|
||||
var l;
|
||||
|
||||
$(document).ready(function(){
|
||||
getStaffList();
|
||||
$("#pre").on('click',function(){
|
||||
getPre();
|
||||
});
|
||||
$("#next").on('click',function(){
|
||||
getNext();
|
||||
});
|
||||
$("#addUserBtn").on('click',function(){
|
||||
addUser();
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//判断字符串是否为空 空返回1 非空返回0
|
||||
function isEmptyString(str){
|
||||
if(str=='null'||str=='')
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var list;
|
||||
function getStaffList(){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"../user/getUserByPower.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"pageNum":pageNum,
|
||||
"pageSize":pageSize,
|
||||
"power":"2"
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code=="0"){
|
||||
if(isEmptyObject(data.List)&&pageNum>0){
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
else{
|
||||
var power=" ";
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
list=data.List;
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#staffList").empty();
|
||||
$("#staffList").append("<tr><th>账号</th><th>员工号</th><th>姓名</th><th>年龄</th><th>职位</th><th>联系方式</th><th>操作</th></tr>")
|
||||
for(i in list){
|
||||
btnStr="<input type=\"button\" id=\"delUser\" data-userid=\""+list[i].userid+"\" class=\"btn btn-danger\" value=\"删除\"/>"
|
||||
htmlStr="<tr data-userid=\""+list[i].userid+"\"><td>"+list[i].useraccount+"</td><td>"+list[i].idnumber+"</td><td>"+list[i].username+"</td><td>"+list[i].age+"</td><td>"+"员工"+"</td><td>"+list[i].phonenumber+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#staffList").append(htmlStr);
|
||||
//console.log(htmlStr);
|
||||
l++;
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
}
|
||||
}
|
||||
else{
|
||||
alert("获取员工列表失败");
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取员工列表发生错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function btnOn(){
|
||||
$("input").filter("#delUser").on('click',function(event){
|
||||
delUser(event);
|
||||
});
|
||||
$("input").filter("#setPageBtn").on('click',function( ){
|
||||
setPage( );
|
||||
})
|
||||
}
|
||||
|
||||
function getPre(){
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
pageNum=pageNum+1;
|
||||
getStaffList();
|
||||
}
|
||||
|
||||
|
||||
function setPage(){
|
||||
|
||||
if($("#inputPage").val()<0 || $("#inputPage").val()==0)
|
||||
alert("请输入正确页码");
|
||||
else{
|
||||
pageNum=$("#inputPage").val();
|
||||
getStaffList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function delUser(event){
|
||||
var userid=$(event.target).data("userid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/delUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":userid
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("删除成功");
|
||||
if(l==1)
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
else
|
||||
alert("删除失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("删除出现错误");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function addUser(){
|
||||
if(isEmptyString($("#inputAccount").val())||isEmptyString($("#inputPwd").val()))
|
||||
alert("请填写全内容");
|
||||
else{
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/addUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"useraccount":$("#inputAccount").val(),
|
||||
"password":$("#inputPwd").val(),
|
||||
"power":"2"
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("添加成功");
|
||||
$('#addUser').modal('toggle');
|
||||
$("#inputAccount").val("");
|
||||
$("#inputPwd").val("")
|
||||
getStaffList();
|
||||
}
|
||||
else
|
||||
alert("添加失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("添加用户出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
(function($){
|
||||
$.getData=function(name){
|
||||
var reg=new RegExp("(^|&)"+name+"=([^&]+)(&|$)?");
|
||||
var result = window.location.search.substr(1).match(reg);
|
||||
if (result!= null) return result[2]; return null;
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
var power=$.getData('power');
|
||||
var userid=$.getData('userid');
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#mainFrame").attr("src","all_infor.html?userid="+userid+"&power="+power);
|
||||
$("inputNone").attr("value",userid);
|
||||
var h=$(window).height();
|
||||
$("#tagList").css("height",h);
|
||||
$("#mainFrame").css("height",h);
|
||||
setList();
|
||||
})
|
||||
|
||||
function setList(){
|
||||
var tagList=" ";
|
||||
if(power=="0"){
|
||||
tagList="<a href=\"all_infor.html?userid="+userid+"&power="+power+"\" target=\"mainFrame\" class=\"list-group-item active\"><span class=\"glyphicon glyphicon-user\" aria-hidden=\"true\"></span>个人信息</a><a href=\"ad_manage.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-list\" aria-hidden=\"true\"></span>人员管理</a> <a href=\"ad_order.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-shopping-cart\" aria-hidden=\"true\"></span> 订单管理</a> <a href=\"ad_salary.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-usd\" aria-hidden=\"true\"></span>工资管理</a>"
|
||||
}
|
||||
else if(power=="1"){
|
||||
tagList="<a href=\"all_infor.html?userid="+userid+"&power="+power+"\" target=\"mainFrame\" class=\"list-group-item active\"><span class=\"glyphicon glyphicon-user\" aria-hidden=\"true\"></span>个人信息</a><a href=\"manage_staff.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-list\" aria-hidden=\"true\"></span>员工管理</a><a href=\"manage_room.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-home\" aria-hidden=\"true\"></span>房间管理</a><a href=\"ad_order.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-shopping-cart\" aria-hidden=\"true\"></span> 订单管理</a>"
|
||||
}
|
||||
else if(power=="2"){
|
||||
tagList="<a href=\"all_infor.html?userid="+userid+"&power="+power+"\" target=\"mainFrame\" class=\"list-group-item active\"><span class=\"glyphicon glyphicon-user\" aria-hidden=\"true\"></span>个人信息</a><a href=\"staff_room.html?userid="+userid+"\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-home\" aria-hidden=\"true\"></span>订房</a><a href=\"staff_order.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-shopping-cart\" aria-hidden=\"true\"></span> 订单管理</a><a href=\"staff_cleaner.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-list\" aria-hidden=\"true\"></span>清洁工管理</a>"
|
||||
}
|
||||
else if(power=="3"){
|
||||
tagList="<a href=\"all_infor.html?userid="+userid+"&power="+power+"\" target=\"mainFrame\" class=\"list-group-item active\"><span class=\"glyphicon glyphicon-user\" aria-hidden=\"true\"></span>个人信息</a><a href=\"cleaner_room.html\" target=\"mainFrame\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-home\" aria-hidden=\"true\"></span>房间管理</a>"
|
||||
}
|
||||
$("#tagList").append(tagList);
|
||||
tagList=$("#tagList").children("a");
|
||||
tagList.on('click',function(event){
|
||||
changeColor(event)
|
||||
});
|
||||
}
|
||||
|
||||
function changeColor(event){
|
||||
var obj=event.target;
|
||||
var objSi=$(obj).siblings();
|
||||
$(obj).attr("class","list-group-item active");
|
||||
$(objSi).attr("class","list-group-item ");
|
||||
}
|
||||
@ -0,0 +1,193 @@
|
||||
var pageNum=1;
|
||||
var pageSize=8;
|
||||
var l;
|
||||
|
||||
$(document).ready(function(){
|
||||
getStaffList();
|
||||
$("#pre").on('click',function(){
|
||||
getPre();
|
||||
});
|
||||
$("#next").on('click',function(){
|
||||
getNext();
|
||||
});
|
||||
$("#addUserBtn").on('click',function(){
|
||||
addUser();
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//判断字符串是否为空 空返回1 非空返回0
|
||||
function isEmptyString(str){
|
||||
if(str=='null'||str=='')
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
var list;
|
||||
function getStaffList(){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"../user/getUserByPower.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"pageNum":pageNum,
|
||||
"pageSize":pageSize,
|
||||
"power":"3"
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code){
|
||||
if(isEmptyObject(data.List)&&pageNum>0){
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
else{
|
||||
var power=" ";
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
list=data.List;
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#staffList").empty();
|
||||
$("#staffList").append("<tr><th>账号</th><th>员工号</th><th>姓名</th><th>年龄</th><th>职位</th><th>联系方式</th><th>操作</th></tr>")
|
||||
for(i in list){
|
||||
btnStr="<input type=\"button\" id=\"delUser\" data-userid=\""+list[i].userid+"\" class=\"btn btn-danger\" value=\"删除\"/>"
|
||||
htmlStr="<tr data-userid=\""+list[i].userid+"\"><td>"+list[i].useraccount+"</td><td>"+list[i].idnumber+"</td><td>"+list[i].username+"</td><td>"+list[i].age+"</td><td>"+"清洁工"+"</td><td>"+list[i].phonenumber+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#staffList").append(htmlStr);
|
||||
//console.log(htmlStr);
|
||||
l++;
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
}
|
||||
}
|
||||
else{
|
||||
alert("获取员工列表失败");
|
||||
var power=" ";
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
list=data.List;
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#staffList").empty();
|
||||
$("#staffList").append("<tr><th>账号</th><th>员工号</th><th>姓名</th><th>年龄</th><th>职位</th><th>联系方式</th><th>操作</th></tr>")
|
||||
for(i in list){
|
||||
btnStr="<input type=\"button\" id=\"delUser\" data-userid=\""+list[i].userid+"\" class=\"btn btn-danger\" value=\"删除\"/>"
|
||||
htmlStr="<tr data-userid=\""+list[i].userid+"\"><td>"+list[i].useraccount+"</td><td>"+list[i].idnumber+"</td><td>"+list[i].username+"</td><td>"+list[i].age+"</td><td>"+"清洁工"+"</td><td>"+list[i].phonenumber+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#staffList").append(htmlStr);
|
||||
//console.log(htmlStr);
|
||||
l++;
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取员工列表发生错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function btnOn(){
|
||||
$("input").filter("#delUser").on('click',function(event){
|
||||
delUser(event);
|
||||
});
|
||||
$("input").filter("#setPageBtn").on('click',function( ){
|
||||
setPage( );
|
||||
})
|
||||
}
|
||||
|
||||
function getPre(){
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
pageNum=pageNum+1;
|
||||
getStaffList();
|
||||
}
|
||||
|
||||
|
||||
function setPage(){
|
||||
|
||||
if($("#inputPage").val()<0 || $("#inputPage").val()==0)
|
||||
alert("请输入正确页码");
|
||||
else{
|
||||
pageNum=$("#inputPage").val();
|
||||
getStaffList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function delUser(event){
|
||||
var userid=$(event.target).data("userid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/delUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":userid
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("删除成功");
|
||||
if(l==1)
|
||||
pageNum=pageNum-1;
|
||||
getStaffList();
|
||||
}
|
||||
else
|
||||
alert("删除失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("删除出现错误");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function addUser(){
|
||||
if(isEmptyString($("#inputAccount").val())||isEmptyString($("#inputPwd").val()))
|
||||
alert("请填写全内容");
|
||||
else{
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../user/addUser.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"useraccount":$("#inputAccount").val(),
|
||||
"password":$("#inputPwd").val(),
|
||||
"power":"3"
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("添加成功");
|
||||
$('#addUser').modal('toggle');
|
||||
$("#inputAccount").val("");
|
||||
$("#inputPwd").val("")
|
||||
getStaffList();
|
||||
}
|
||||
else
|
||||
alert("添加失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("添加用户出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,195 @@
|
||||
var pageNum=1;
|
||||
var pageSize=8;
|
||||
var l;
|
||||
|
||||
$(document).ready(function(){
|
||||
getorderList();
|
||||
$("#pre").on('click',function(){
|
||||
getPre();
|
||||
});
|
||||
$("#next").on('click',function(){
|
||||
getNext();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var list;
|
||||
function getorderList(){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"../order/getAllOrder.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"pageNum":pageNum,
|
||||
"pageSize":pageSize
|
||||
},
|
||||
success:function(data){
|
||||
if(isEmptyObject(data.List)&&pageNum>0){
|
||||
pageNum=pageNum-1;
|
||||
getorderList();
|
||||
}
|
||||
else{
|
||||
list=data.List;
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
var state=" ";
|
||||
var sdate;
|
||||
var edate;
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#orderList").empty();
|
||||
$("#orderList").append("<tr><th>入住人</th><th>身份证号</th><th>开始时间</th><th>结束时间</th><th>总金额</th><th>状态</th><th>操作</th></tr>")
|
||||
for(i in list){
|
||||
sdate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(list[i].starttime);
|
||||
edate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(list[i].endtime);
|
||||
if(list[i].state=="0"){
|
||||
state="未付款";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"showRoom\" data-toggle=\"modal\" data-target=\"#showRoomT\" value=\"查看房间\"> <input type=\"button\" class=\"btn btn-success\" data-orderid=\""+list[i].orderid+"\" id=\"setPaied\" value=\"已收款\"> <input type=\"button\" class=\"btn btn-danger\" data-orderid=\""+list[i].orderid+"\" id=\"setNone\" value=\"取消\">";
|
||||
}
|
||||
else if(list[i].state=="1"){
|
||||
state="已付款";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"showRoom\" data-toggle=\"modal\" data-target=\"#showRoomT\" value=\"查看房间\"> <input type=\"button\" class=\"btn btn-success\" data-orderid=\""+list[i].orderid+"\" id=\"setFinish\" value=\"退房\">";
|
||||
}
|
||||
else if(list[i].state=="2"){
|
||||
state="已完成";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"showRoom\" data-toggle=\"modal\" data-target=\"#showRoomT\" value=\"查看房间\">";
|
||||
}
|
||||
else{
|
||||
state="已取消";
|
||||
btnStr="<input type=\"button\" class=\"btn btn-info\" data-roomid=\""+list[i].roomid+"\" id=\"showRoom\" data-toggle=\"modal\" data-target=\"#showRoomT\" value=\"查看房间\">";
|
||||
}
|
||||
htmlStr="<tr data-orderid=\""+list[i].orderid+"\"><td>"+list[i].householdname+"</td><td>"+list[i].id+"</td><td>"+sdate+"</td><td>"+edate+"</td><td>"+list[i].money+"</td><td>"+state+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#orderList").append(htmlStr);
|
||||
l++;
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
}
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取订单列表发生错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function btnOn(){
|
||||
|
||||
$("input").filter("#setPageBtn").on('click',function( ){
|
||||
setPage( );
|
||||
});
|
||||
$("input").filter("#showRoom").on('click',function(event){
|
||||
showRoom(event);
|
||||
})
|
||||
$("input").filter("#setPaied").on('click',function(event){
|
||||
setState(event,"1");
|
||||
});
|
||||
$("input").filter("#setFinish").on('click',function(event){
|
||||
setState(event,"2");
|
||||
});
|
||||
$("input").filter("#setNone").on('click',function(event){
|
||||
setState(event,"3");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getPre(){
|
||||
pageNum=pageNum-1;
|
||||
getorderList();
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
pageNum=pageNum+1;
|
||||
getorderList();
|
||||
}
|
||||
|
||||
function setState(event,alter){
|
||||
var orderid=$(event.target).data("orderid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../order/updateOrderState.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"orderid":orderid,
|
||||
"state":alter
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("修改成功");
|
||||
getorderList();
|
||||
}
|
||||
else
|
||||
alert("修改失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("修改信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function setPage(){
|
||||
|
||||
if($("#inputPage").val()<0 || $("#inputPage").val()==0)
|
||||
alert("请输入正确页码");
|
||||
else{
|
||||
pageNum=$("#inputPage").val();
|
||||
getorderList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function showRoom(event){
|
||||
var roomid=$(event.target).data("roomid");
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../room/getRoomById.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"roomid":roomid
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
var htmlStr=" ";
|
||||
var state=" ";
|
||||
var type=" ";
|
||||
var room=data.room;
|
||||
$("#roomTable").empty();
|
||||
if(room.state=="0")
|
||||
state="停用";
|
||||
else if(room.state=="1")
|
||||
state="未预定";
|
||||
else if(room.state=="2")
|
||||
state="已预定(入住)";
|
||||
else
|
||||
state="待清扫";
|
||||
if(room.type=="1")
|
||||
type="单人间";
|
||||
else if(room.type=="2")
|
||||
type="双人间";
|
||||
else if(room.type=="3")
|
||||
type="大床房";
|
||||
else
|
||||
type="套房";
|
||||
htmlStr="<tr><th>位置</th><td>"+room.local+"</td></tr><tr><th>价格</th><td>"+room.money+"</td></tr><tr><th>类型</th><td>"+type+"</td></tr><tr><th>状态</th><td>"+state+"</td></tr>"
|
||||
$("#roomTable").append(htmlStr);
|
||||
}
|
||||
else
|
||||
alert("获取失败")
|
||||
},
|
||||
error:function(){
|
||||
alert("获取信息出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,198 @@
|
||||
(function($){
|
||||
$.getData=function(name){
|
||||
var reg=new RegExp("(^|&)"+name+"=([^&]+)(&|$)?");
|
||||
var result = window.location.search.substr(1).match(reg);
|
||||
if (result!= null) return result[2]; return null;
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
var staffid=$.getData("userid");
|
||||
var pageNum=1;
|
||||
var pageSize=8;
|
||||
var choose;
|
||||
var l;
|
||||
|
||||
$(document).ready(function(){
|
||||
getroomList();
|
||||
|
||||
$('#dateStart').datepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
autoclose: true
|
||||
}).on('changeDate',function(e){
|
||||
var startTime = e.date;
|
||||
$('#dateEnd').datepicker('setStartDate',startTime);
|
||||
});
|
||||
|
||||
$('#dateEnd').datepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
autoclose: true
|
||||
}).on('changeDate',function(e){
|
||||
var endTime = e.date;
|
||||
$('#dateStart').datepicker('setEndDate',endTime);
|
||||
});
|
||||
|
||||
|
||||
$("#pre").on('click',function(){
|
||||
getPre();
|
||||
});
|
||||
$("#next").on('click',function(){
|
||||
getNext();
|
||||
});
|
||||
$("#addOrder").on('click',function(){
|
||||
addOrder();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
//判断对象/JSON是否为空 空返回1 非空返回0
|
||||
function isEmptyObject(e) {
|
||||
var t;
|
||||
for (t in e)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//判断字符串是否为空 空返回1 非空返回0
|
||||
function isEmptyString(str){
|
||||
if(str=='null'||str=='')
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
var list;
|
||||
function getroomList(){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"../room/getRoom.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"state":"1",
|
||||
"type":"-1",
|
||||
"pageNum":pageNum,
|
||||
"pageSize":pageSize
|
||||
},
|
||||
success:function(data){
|
||||
if(isEmptyObject(data.List)&&pageNum>0){
|
||||
pageNum=pageNum-1;
|
||||
getroomList();
|
||||
}
|
||||
else{
|
||||
list=data.List;
|
||||
var power=" ";
|
||||
var htmlStr=" ";
|
||||
var btnStr=" ";
|
||||
var state=" ";
|
||||
var type=" ";
|
||||
l=0;
|
||||
$("#pre").css("display","block");
|
||||
$("#next").css("display","block");
|
||||
$("#roomList").empty();
|
||||
$("#roomList").append("<tr><th>位置</th><th>价格</th><th>状态</th><th>类型</th><th>操作</th></tr>");
|
||||
state="未预定";
|
||||
for(i in list){
|
||||
if(list[i].type=="1")
|
||||
type="单人间";
|
||||
else if(list[i].type=="2")
|
||||
type="双人间";
|
||||
else if(list[i].type=="3")
|
||||
type="大床房";
|
||||
else
|
||||
type="套房"
|
||||
btnStr="<input type=\"button\" class=\"btn btn-success\" data-roomid=\""+list[i].roomid+"\" id=\"chooseRoomBtn\" data-toggle=\"modal\" data-target=\"#chooseRoom\" value=\"生成订单\">";
|
||||
htmlStr="<tr data-roomid=\""+list[i].roomid+"\"><td>"+list[i].local+"</td><td>"+list[i].money+"</td><td>"+state+"</td><td>"+type+"</td><td>"+btnStr+"</td></tr>";
|
||||
$("#roomList").append(htmlStr);
|
||||
l++;
|
||||
}
|
||||
if(pageNum=="1") $("#pre").css("display","none");
|
||||
if(pageSize>l) $("#next").css("display","none");
|
||||
btnOn();
|
||||
}
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert("获取房间列表发生错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function btnOn(){;
|
||||
$("input").filter("#setPageBtn").on('click',function( ){
|
||||
setPage( );
|
||||
});
|
||||
$("input").filter("#chooseRoomBtn").on('click',function(event){
|
||||
chooseRoomBtn(event);
|
||||
});
|
||||
}
|
||||
|
||||
function getPre(){
|
||||
pageNum=pageNum-1;
|
||||
getroomList();
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
pageNum=pageNum+1;
|
||||
getroomList();
|
||||
}
|
||||
|
||||
function setPage(){
|
||||
if($("#inputPage").val()<0 || $("#inputPage").val()==0)
|
||||
alert("请输入正确页码");
|
||||
else{
|
||||
pageNum=$("#inputPage").val();
|
||||
getroomList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function chooseRoomBtn(event){
|
||||
var roomid=$(event.target).data("roomid");
|
||||
choose=roomid;
|
||||
for(i in list){
|
||||
if(list[i].roomid=roomid){
|
||||
$("span").filter("#inputLocal").text(list[i].local);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addOrder(){
|
||||
if(isEmptyString($("#inputName").val())||isEmptyString($("#inputId").val())||isEmptyString($("#dateStart").val())||isEmptyString($("#dateEnd").val()))
|
||||
alert("请填写全内容");
|
||||
else{
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"../order/addOrder.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"userid":staffid,
|
||||
"roomid":choose,
|
||||
"householdname":$("#inputName").val(),
|
||||
"id":$("#inputId").val(),
|
||||
"starttime":$("#dateStart").val(),
|
||||
"endtime":$("#dateEnd").val()
|
||||
},
|
||||
success:function(data){
|
||||
if(data.code==0){
|
||||
alert("添加成功");
|
||||
$("#inputRoom").val("");
|
||||
$("#inputName").val("");
|
||||
$("#inputId").val("");
|
||||
$("#dateStart").val("");
|
||||
$("#dateEnd").val("");
|
||||
$('#chooseRoom').modal('toggle');
|
||||
window.location.href="staff_order.html";
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("添加订单出现错误");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-11 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="staffList">
|
||||
<tr><th>账号</th><th>员工号</th><th>姓名</th><th>年龄</th><th>职位</th><th>联系方式</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/ad_manage.js"></script>
|
||||
@ -0,0 +1,78 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="col-md-9 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 2rem">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="orderList">
|
||||
<tr><th>入住人</th><th>身份证号</th><th>开始时间</th><th>结束时间</th><th>总金额</th><th>状态</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 20px">
|
||||
<div class="col-md-8 col-xs-6 nopadding">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item" style="color:black !important;border: 0.5px solid #C8C8BF">
|
||||
<span class="badge" id="totalMoney"> </span>
|
||||
总交易额
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-8 col-xs-6 nopadding">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item" style="color:black !important;border: 0.5px solid #C8C8BF">
|
||||
<span class="badge" id="totalRoom"> </span>
|
||||
总订房数
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<div class="modal fade" id="showRoomT" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">房间详情</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table class="table table-bordered table-hover" style="margin-top:10px" id="roomTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/ad_order.js"></script>
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-6 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive" id="showConfigDiv">
|
||||
<a href="#" id="showConfig" style="font-size:1.7rem">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<span>更改配置</span>
|
||||
</a>
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="configList">
|
||||
<tr><th style="width: 100px">职位</th><th>底薪</th><th>提成</th></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="table-responsive" id="alterConfigDiv" style="display: none">
|
||||
<a href="#" id="alterConfig" style="font-size:1.7rem">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<span>返回</span>
|
||||
</a>
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px">
|
||||
<tr><th style="width: 100px">职位</th><th>底薪</th><th>提成</th></tr>
|
||||
<tr>
|
||||
<th>经理</th>
|
||||
<th>
|
||||
<input type="text" class="form-control" id="inputMS">
|
||||
</th>
|
||||
<th>
|
||||
<input type="text" class="form-control" id="inputM">
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>员工</th>
|
||||
<th>
|
||||
<input type="text" class="form-control" id="inputSS">
|
||||
</th>
|
||||
<th>
|
||||
<input type="text" class="form-control" id="inputS">
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>清洁工</th>
|
||||
<th>
|
||||
<input type="text" class="form-control" id="inputCS">
|
||||
</th>
|
||||
<th>
|
||||
<input type="text" class="form-control" id="inputC">
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
<input style="float: right" type="button" id="alterConfigBtn" class="btn btn-success" value="确定"/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/ad_salary.js"></script>
|
||||
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-8 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="roomList">
|
||||
<tr><th>位置</th><th>价格</th><th>状态</th><th>类型</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/cleaner_room.js"></script>
|
||||
|
||||
@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-10 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive">
|
||||
<a href="#" style="font-size:1.7rem" data-toggle="modal" data-target="#addRoom" >
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<span>添加房间</span>
|
||||
</a>
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="roomList">
|
||||
<tr><th style="width:100px">位置</th><th style="width:100px">价格</th><th style="width:100px">状态</th><th style="width:100px">类型</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<div class="modal fade" id="addRoom" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加房间</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width: 80%;padding-left:20%">
|
||||
<div class="form-group alterinfo">请输入位置:
|
||||
<label for="inputLocal">inputPrice</label>
|
||||
<input type="text" name="inputLocal" class="form-control" id="inputLocal">
|
||||
</div>
|
||||
<div class="form-group alterinfo">请输入价格:
|
||||
<label for="inputPrice">inputPrice</label>
|
||||
<input type="text" name="inputPrice" class="form-control" id="inputPrice">
|
||||
</div>
|
||||
<div class="form-group alterinfo">请选择类型:
|
||||
<select class="form-control" id="inputType">
|
||||
<option value="1">单人间</option>
|
||||
<option value="2">双人间</option>
|
||||
<option value="3">大床房</option>
|
||||
<option value="4">套房</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group alterinfo">
|
||||
<input type="button" id="addRoomBtn" class="btn btn-success" value="确定"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="alterRoom" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">修改房间</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width: 80%;padding-left:20%">
|
||||
<div class="form-group alterinfo" style="display:none">
|
||||
<input type="text" class="form-control" id="reinputid">
|
||||
</div>
|
||||
<div class="form-group alterinfo">请输入位置:
|
||||
<label for="reinputLocal">inputPrice</label>
|
||||
<input type="text" name="reinputLocal" class="form-control" id="reinputLocal">
|
||||
</div>
|
||||
<div class="form-group alterinfo">请输入价格:
|
||||
<label for="reinputPrice">inputPrice</label>
|
||||
<input type="text" name="reinputPrice" class="form-control" id="reinputPrice">
|
||||
</div>
|
||||
<div class="form-group alterinfo">请选择类型:
|
||||
<select class="form-control" id="reinputType">
|
||||
<option value="1">单人间</option>
|
||||
<option value="2">双人间</option>
|
||||
<option value="3">大床房</option>
|
||||
<option value="4">套房</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group alterinfo">
|
||||
<input type="button" id="setRoomBtn" class="btn btn-success" value="确定"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/manage_room.js"></script>
|
||||
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-11 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive">
|
||||
<a href="#" style="font-size:1.7rem" data-toggle="modal" data-target="#addUser" >
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<span>添加员工</span>
|
||||
</a>
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="staffList">
|
||||
<tr><th>账号</th><th>员工号</th><th>姓名</th><th>年龄</th><th>职位</th><th>联系方式</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<div class="modal fade" id="addUser" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加员工</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width: 80%;padding-left:20%">
|
||||
<div class="form-group alterinfo">请输入账号:
|
||||
<label for="newAcc">newAcc</label>
|
||||
<input type="text" name="newAcc" class="form-control" id="inputAccount">
|
||||
</div>
|
||||
<div class="form-group alterinfo">请输入密码:
|
||||
<label for="newPwd">newPwd</label>
|
||||
<input type="text" name="newPwd" class="form-control" id="inputPwd">
|
||||
</div>
|
||||
<div class="form-group alterinfo">
|
||||
<input type="button" id="addUserBtn" class="btn btn-success" value="确定"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/manage_staff.js"></script>
|
||||
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>酒店管理系统</title>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/footer.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid nav-con">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#" style="padding-top: 2rem;color: white">
|
||||
<span style="font-size: 2.3rem;padding-right: 2rem;letter-spacing: 2px">酒店管理系统</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="navli"><a href="#">欢迎!</a></li>
|
||||
<li class="navli"><a href="../index.html">退出</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="col-md-12 main nopadding">
|
||||
<div class="col-md-2 navlist nopadding">
|
||||
<div class="list-group" id="tagList">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-10 nopadding">
|
||||
<iframe frameborder="0" id="mainFrame" class="mainFrame" name="mainFrame" src=""></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--
|
||||
<footer class="col-md-12 bs-docs-footer">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
<a href="#">关于本站</a>
|
||||
<a href="#">廉正举报</a>
|
||||
<a href="#">开放平台</a>
|
||||
<a href="#">诚征英才</a>
|
||||
<a href="#">联系我们</a>
|
||||
<a href="#">网站地图</a><br/><br/>
|
||||
<em>Copyright © 2017 西安工业大学 All Rights Reserved</em>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</footer>-->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/myCenter.js"></script>
|
||||
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-11 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive">
|
||||
<a href="#" style="font-size:1.7rem" data-toggle="modal" data-target="#addUser" >
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<span>添加清洁工</span>
|
||||
</a>
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="staffList">
|
||||
<tr><th>账号</th><th>员工号</th><th>姓名</th><th>年龄</th><th>职位</th><th>联系方式</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<div class="modal fade" id="addUser" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加清洁工</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width: 80%;padding-left:20%">
|
||||
<div class="form-group alterinfo">请输入账号:
|
||||
<label for="newAcc">newAcc</label>
|
||||
<input type="text" name="newAcc" class="form-control" id="inputAccount">
|
||||
</div>
|
||||
<div class="form-group alterinfo">请输入密码:
|
||||
<label for="newPwd">newPwd</label>
|
||||
<input type="text" name="newPwd" class="form-control" id="inputPwd">
|
||||
</div>
|
||||
<div class="form-group alterinfo">
|
||||
<input type="button" id="addUserBtn" class="btn btn-success" value="确定"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/staff_cleaner.js"></script>
|
||||
@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-8 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="orderList">
|
||||
<tr><th>入住人</th><th>身份证号</th><th>开始时间</th><th>结束时间</th><th>总金额</th><th>状态</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<div class="modal fade" id="showRoomT" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">房间详情</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="roomTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/staff_order.js"></script>
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-8 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="roomList">
|
||||
<tr><th>位置</th><th>价格</th><th>状态</th><th>类型</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<div class="modal fade" id="chooseRoom" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">生成订单</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width: 80%;padding-left:20%">
|
||||
<div class="form-group alterinfo">位置:
|
||||
<span id="inputLocal"></span>
|
||||
</div>
|
||||
<div class="form-group alterinfo">入住人姓名:
|
||||
<label for="inputName">inputName</label>
|
||||
<input type="text" name="inputName" class="form-control" id="inputName">
|
||||
</div>
|
||||
<div class="form-group alterinfo">身份证号:
|
||||
<label for="inputId">inputId</label>
|
||||
<input type="text" name="inputId" class="form-control" id="inputId">
|
||||
</div>
|
||||
<div class="form-group alterinfo">开始日期:
|
||||
<label for="inputStart">inputId</label>
|
||||
<input type="text" name="inputStart" class="form-control" data-provide="datepicker" id="dateStart">
|
||||
</div>
|
||||
<div class="form-group alterinfo">结束日期:
|
||||
<label for="inputEnd">inputId</label>
|
||||
<input type="text" name="inputEnd" class="form-control" data-provide="datepicker" id="dateEnd">
|
||||
</div>
|
||||
<div class="form-group alterinfo">
|
||||
<input type="button" id="addOrder" class="btn btn-success" value="确定"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</html>
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap-datepicker.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap-datepicker.zh-CN.min.js"></script>
|
||||
<script type="text/javascript" src="../js/staff_room.js"></script>
|
||||
|
||||
|
||||
|
||||